fix some checklist issues

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7417 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
ywu21 2009-02-03 07:56:54 +00:00
parent 5c998646f3
commit 6e4bac4dac
9 changed files with 626 additions and 626 deletions

View File

@ -1,11 +1,11 @@
/** @file
UEFI Component Name(2) protocol implementation for MnpDxe driver.
UEFI Component Name(2) protocol implementation for MnpDxe driver.
Copyright (c) 2005 - 2007, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
Copyright (c) 2005 - 2007, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials are licensed
and made available under the terms and conditions of the BSD License which
accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@ -15,135 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "MnpDriver.h"
//
// EFI Component Name Functions
//
/**
Retrieves a Unicode string that is the user readable name of the driver.
This function retrieves the user readable name of a driver in the form of a
Unicode string. If the driver specified by This has a user readable name in
the language specified by Language, then a pointer to the driver name is
returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
by This does not support the language specified by Language,
then EFI_UNSUPPORTED is returned.
@param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param[in] Language A pointer to a Null-terminated ASCII string
array indicating the language. This is the
language of the driver name that the caller is
requesting, and it must match one of the
languages specified in SupportedLanguages. The
number of languages supported by a driver is up
to the driver writer. Language is specified
in RFC 3066 or ISO 639-2 language code format.
@param[out] DriverName A pointer to the Unicode string to return.
This Unicode string is the name of the
driver specified by This in the language
specified by Language.
@retval EFI_SUCCESS The Unicode string for the Driver specified by
This and the language specified by Language was
returned in DriverName.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER DriverName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
EFIAPI
MnpComponentNameGetDriverName (
IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN CHAR8 *Language,
OUT CHAR16 **DriverName
);
/**
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by a driver.
This function retrieves the user readable name of the controller specified by
ControllerHandle and ChildHandle in the form of a Unicode string. If the
driver specified by This has a user readable name in the language specified by
Language, then a pointer to the controller name is returned in ControllerName,
and EFI_SUCCESS is returned. If the driver specified by This is not currently
managing the controller specified by ControllerHandle and ChildHandle,
then EFI_UNSUPPORTED is returned. If the driver specified by This does not
support the language specified by Language, then EFI_UNSUPPORTED is returned.
@param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param[in] ControllerHandle The handle of a controller that the driver
specified by This is managing. This handle
specifies the controller whose name is to be
returned.
@param[in] ChildHandle The handle of the child controller to retrieve
the name of. This is an optional parameter that
may be NULL. It will be NULL for device
drivers. It will also be NULL for a bus drivers
that wish to retrieve the name of the bus
controller. It will not be NULL for a bus
driver that wishes to retrieve the name of a
child controller.
@param[in] Language A pointer to a Null-terminated ASCII string
array indicating the language. This is the
language of the driver name that the caller is
requesting, and it must match one of the
languages specified in SupportedLanguages. The
number of languages supported by a driver is up
to the driver writer. Language is specified in
RFC 3066 or ISO 639-2 language code format.
@param[out] ControllerName A pointer to the Unicode string to return.
This Unicode string is the name of the
controller specified by ControllerHandle and
ChildHandle in the language specified by
Language from the point of view of the driver
specified by This.
@retval EFI_SUCCESS The Unicode string for the user readable name in
the language specified by Language for the
driver specified by This was returned in
DriverName.
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
EFI_HANDLE.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER ControllerName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This is not currently
managing the controller specified by
ControllerHandle and ChildHandle.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
EFIAPI
MnpComponentNameGetControllerName (
IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL,
IN CHAR8 *Language,
OUT CHAR16 **ControllerName
);
//
// EFI Component Name Protocol
@ -185,10 +56,10 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mMnpDriverNameTable[] = {
by This does not support the language specified by Language,
then EFI_UNSUPPORTED is returned.
@param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
@param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param[in] Language A pointer to a Null-terminated ASCII string
@param[in] Language A pointer to a Null-terminated ASCII string
array indicating the language. This is the
language of the driver name that the caller is
requesting, and it must match one of the
@ -243,16 +114,17 @@ MnpComponentNameGetDriverName (
managing the controller specified by ControllerHandle and ChildHandle,
then EFI_UNSUPPORTED is returned. If the driver specified by This does not
support the language specified by Language, then EFI_UNSUPPORTED is returned.
Currently not implemented.
@param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
@param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param[in] ControllerHandle The handle of a controller that the driver
@param[in] ControllerHandle The handle of a controller that the driver
specified by This is managing. This handle
specifies the controller whose name is to be
returned.
@param[in] ChildHandle The handle of the child controller to retrieve
@param[in] ChildHandle The handle of the child controller to retrieve
the name of. This is an optional parameter that
may be NULL. It will be NULL for device
drivers. It will also be NULL for a bus drivers
@ -261,7 +133,7 @@ MnpComponentNameGetDriverName (
driver that wishes to retrieve the name of a
child controller.
@param[in] Language A pointer to a Null-terminated ASCII string
@param[in] Language A pointer to a Null-terminated ASCII string
array indicating the language. This is the
language of the driver name that the caller is
requesting, and it must match one of the
@ -277,10 +149,9 @@ MnpComponentNameGetDriverName (
Language from the point of view of the driver
specified by This.
@retval EFI_SUCCESS The Unicode string for the user readable name in
the language specified by Language for the
driver specified by This was returned in
DriverName.
@retval EFI_SUCCESS The Unicode string for the user readable name
specified by This, ControllerHandle, ChildHandle,
and Language was returned in ControllerName.
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.

View File

@ -0,0 +1,150 @@
/** @file
The header file of UEFI Component Name(2) protocol.
Copyright (c) 2004 - 2007, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _COMPONENT_NAME_H_
#define _COMPONENT_NAME_H_
#include <Protocol/ComponentName.h>
#include <Protocol/ComponentName2.h>
extern EFI_COMPONENT_NAME2_PROTOCOL gMnpComponentName2;
extern EFI_COMPONENT_NAME_PROTOCOL gMnpComponentName;
/**
Retrieves a Unicode string that is the user readable name of the driver.
This function retrieves the user readable name of a driver in the form of a
Unicode string. If the driver specified by This has a user readable name in
the language specified by Language, then a pointer to the driver name is
returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
by This does not support the language specified by Language,
then EFI_UNSUPPORTED is returned.
@param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param[in] Language A pointer to a Null-terminated ASCII string
array indicating the language. This is the
language of the driver name that the caller is
requesting, and it must match one of the
languages specified in SupportedLanguages. The
number of languages supported by a driver is up
to the driver writer. Language is specified
in RFC 3066 or ISO 639-2 language code format.
@param[out] DriverName A pointer to the Unicode string to return.
This Unicode string is the name of the
driver specified by This in the language
specified by Language.
@retval EFI_SUCCESS The Unicode string for the Driver specified by
This and the language specified by Language was
returned in DriverName.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER DriverName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
EFIAPI
MnpComponentNameGetDriverName (
IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN CHAR8 *Language,
OUT CHAR16 **DriverName
);
/**
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by a driver.
This function retrieves the user readable name of the controller specified by
ControllerHandle and ChildHandle in the form of a Unicode string. If the
driver specified by This has a user readable name in the language specified by
Language, then a pointer to the controller name is returned in ControllerName,
and EFI_SUCCESS is returned. If the driver specified by This is not currently
managing the controller specified by ControllerHandle and ChildHandle,
then EFI_UNSUPPORTED is returned. If the driver specified by This does not
support the language specified by Language, then EFI_UNSUPPORTED is returned.
Currently not implemented.
@param[in] This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
EFI_COMPONENT_NAME_PROTOCOL instance.
@param[in] ControllerHandle The handle of a controller that the driver
specified by This is managing. This handle
specifies the controller whose name is to be
returned.
@param[in] ChildHandle The handle of the child controller to retrieve
the name of. This is an optional parameter that
may be NULL. It will be NULL for device
drivers. It will also be NULL for a bus drivers
that wish to retrieve the name of the bus
controller. It will not be NULL for a bus
driver that wishes to retrieve the name of a
child controller.
@param[in] Language A pointer to a Null-terminated ASCII string
array indicating the language. This is the
language of the driver name that the caller is
requesting, and it must match one of the
languages specified in SupportedLanguages. The
number of languages supported by a driver is up
to the driver writer. Language is specified in
RFC 3066 or ISO 639-2 language code format.
@param[out] ControllerName A pointer to the Unicode string to return.
This Unicode string is the name of the
controller specified by ControllerHandle and
ChildHandle in the language specified by
Language from the point of view of the driver
specified by This.
@retval EFI_SUCCESS The Unicode string for the user readable name
specified by This, ControllerHandle, ChildHandle,
and Language was returned in ControllerName.
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
EFI_HANDLE.
@retval EFI_INVALID_PARAMETER Language is NULL.
@retval EFI_INVALID_PARAMETER ControllerName is NULL.
@retval EFI_UNSUPPORTED The driver specified by This is not currently
managing the controller specified by
ControllerHandle and ChildHandle.
@retval EFI_UNSUPPORTED The driver specified by This does not support
the language specified by Language.
**/
EFI_STATUS
EFIAPI
MnpComponentNameGetControllerName (
IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL,
IN CHAR8 *Language,
OUT CHAR16 **ControllerName
);
#endif

View File

@ -1,11 +1,11 @@
/** @file
Implementation of Managed Network Protocol private services.
Copyright (c) 2005 - 2008, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
Copyright (c) 2005 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials are licensed
and made available under the terms and conditions of the BSD License which
accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@ -48,11 +48,11 @@ EFI_MANAGED_NETWORK_CONFIG_DATA mMnpDefaultConfigData = {
Configure the Snp receive filters according to the instances' receive filter
settings.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in] MnpServiceData Pointer to the mnp service context data.
@retval EFI_SUCCESS The receive filters is configured.
@retval EFI_OUT_OF_RESOURCES The receive filters can't be configured due to
lack of memory resource.
@retval EFI_SUCCESS The receive filters is configured.
@retval EFI_OUT_OF_RESOURCES The receive filters can't be configured due
to lack of memory resource.
**/
EFI_STATUS
@ -144,7 +144,7 @@ MnpConfigReceiveFilters (
// multicast.
//
if (Snp->Mode->ReceiveFilterMask & EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST) {
if ((Snp->Mode->ReceiveFilterMask & EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST) != 0) {
EnableFilterBits |= EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST;
} else {
//
@ -205,8 +205,8 @@ MnpConfigReceiveFilters (
Add Count of net buffers to MnpServiceData->FreeNbufQue. The length of the net
buffer is specified by MnpServiceData->BufferLength.
@param[in] MnpServiceData Pointer to the MNP_SERVICE_DATA.
@param[in] Count Number of NET_BUFFERs to add.
@param[in, out] MnpServiceData Pointer to the MNP_SERVICE_DATA.
@param[in] Count Number of NET_BUFFERs to add.
@retval EFI_SUCCESS The specified amount of NET_BUFs are allocated
and added to MnpServiceData->FreeNbufQue.
@ -215,8 +215,8 @@ MnpConfigReceiveFilters (
**/
EFI_STATUS
MnpAddFreeNbuf (
IN MNP_SERVICE_DATA *MnpServiceData,
IN UINTN Count
IN OUT MNP_SERVICE_DATA *MnpServiceData,
IN UINTN Count
)
{
EFI_STATUS Status;
@ -260,7 +260,7 @@ MnpAddFreeNbuf (
in the queue, first try to allocate some and add them into the queue, then
fetch the NET_BUF from the updated FreeNbufQue.
@param[in] MnpServiceData Pointer to the MNP_SERVICE_DATA.
@param[in, out] MnpServiceData Pointer to the MNP_SERVICE_DATA.
@return Pointer to the allocated free NET_BUF structure, if NULL the
operation is failed.
@ -268,7 +268,7 @@ MnpAddFreeNbuf (
**/
NET_BUF *
MnpAllocNbuf (
IN MNP_SERVICE_DATA *MnpServiceData
IN OUT MNP_SERVICE_DATA *MnpServiceData
)
{
EFI_STATUS Status;
@ -333,14 +333,14 @@ ON_EXIT:
/**
Try to reclaim the Nbuf into the buffer pool.
@param MnpServiceData Pointer to the mnp service context data.
@param Nbuf Pointer to the NET_BUF to free.
@param[in,out] MnpServiceData Pointer to the mnp service context data.
@param[in,out] Nbuf Pointer to the NET_BUF to free.
**/
VOID
MnpFreeNbuf (
IN MNP_SERVICE_DATA *MnpServiceData,
IN NET_BUF *Nbuf
IN OUT MNP_SERVICE_DATA *MnpServiceData,
IN OUT NET_BUF *Nbuf
)
{
EFI_TPL OldTpl;
@ -367,19 +367,20 @@ MnpFreeNbuf (
/**
Initialize the mnp service context data.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in] ImageHandle The driver image handle.
@param[in] ControllerHandle Handle of device to bind driver to.
@param[in, out] MnpServiceData Pointer to the mnp service context data.
@param[in] ImageHandle The driver image handle.
@param[in] ControllerHandle Handle of device to bind driver to.
@retval EFI_SUCCESS The mnp service context is initialized.
@retval Other Some error occurs.
@retval EFI_UNSUPPORTED ControllerHandle does not support Simple Network Protocol.
@retval Others Other errors as indicated.
**/
EFI_STATUS
MnpInitializeServiceData (
IN MNP_SERVICE_DATA *MnpServiceData,
IN EFI_HANDLE ImageHandle,
IN EFI_HANDLE ControllerHandle
IN OUT MNP_SERVICE_DATA *MnpServiceData,
IN EFI_HANDLE ImageHandle,
IN EFI_HANDLE ControllerHandle
)
{
EFI_STATUS Status;
@ -553,14 +554,14 @@ ERROR:
/**
Flush the mnp service context data.
@param MnpServiceData Pointer to the mnp service context data.
@param ImageHandle The driver image handle.
@param[in, out] MnpServiceData Pointer to the mnp service context data.
@param[in] ImageHandle The driver image handle.
**/
VOID
MnpFlushServiceData (
IN MNP_SERVICE_DATA *MnpServiceData,
IN EFI_HANDLE ImageHandle
IN OUT MNP_SERVICE_DATA *MnpServiceData,
IN EFI_HANDLE ImageHandle
)
{
NET_CHECK_SIGNATURE (MnpServiceData, MNP_SERVICE_DATA_SIGNATURE);
@ -616,15 +617,15 @@ MnpFlushServiceData (
/**
Initialize the mnp instance context data.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in] Instance Pointer to the mnp instance context data to
initialize.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in, out] Instance Pointer to the mnp instance context data
to initialize.
**/
VOID
MnpInitializeInstanceData (
IN MNP_SERVICE_DATA *MnpServiceData,
IN MNP_INSTANCE_DATA *Instance
IN MNP_SERVICE_DATA *MnpServiceData,
IN OUT MNP_INSTANCE_DATA *Instance
)
{
NET_CHECK_SIGNATURE (MnpServiceData, MNP_SERVICE_DATA_SIGNATURE);
@ -665,10 +666,10 @@ MnpInitializeInstanceData (
/**
Check whether the token specified by Arg maches the token in Item.
Check whether the token specified by Arg matches the token in Item.
@param[in] Map Pointer to the NET_MAP.
@param[in] Item Pointer to the NET_MAP_ITEM
@param[in] Item Pointer to the NET_MAP_ITEM.
@param[in] Arg Pointer to the Arg, it's a pointer to the token to
check.
@ -705,10 +706,10 @@ MnpTokenExist (
/**
Cancel the token specified by Arg if it matches the token in Item.
@param[in, out] Map Pointer to the NET_MAP.
@param[in] Item Pointer to the NET_MAP_ITEM
@param[in] Arg Pointer to the Arg, it's a pointer to the token to
cancel.
@param[in, out] Map Pointer to the NET_MAP.
@param[in, out] Item Pointer to the NET_MAP_ITEM.
@param[in] Arg Pointer to the Arg, it's a pointer to the
token to cancel.
@retval EFI_SUCCESS The Arg is NULL, and the token in Item is cancelled,
or the Arg isn't NULL, and the token in Item is
@ -719,9 +720,9 @@ MnpTokenExist (
**/
EFI_STATUS
MnpCancelTokens (
IN OUT NET_MAP *Map,
IN NET_MAP_ITEM *Item,
IN VOID *Arg
IN OUT NET_MAP *Map,
IN OUT NET_MAP_ITEM *Item,
IN VOID *Arg
)
{
EFI_MANAGED_NETWORK_COMPLETION_TOKEN *TokenToCancel;
@ -763,7 +764,7 @@ MnpCancelTokens (
@param[in] Snp Pointer to the simple network protocol.
@retval EFI_SUCCESS The simple network protocol is started.
@retval Other Some error occurs.
@retval Others Other errors as indicated.
**/
EFI_STATUS
@ -797,7 +798,7 @@ MnpStartSnp (
@param[in] Snp Pointer to the simple network protocol.
@retval EFI_SUCCESS The simple network is stopped.
@retval Other Some error occurs.
@retval Others Other errors as indicated.
**/
EFI_STATUS
@ -829,21 +830,21 @@ MnpStopSnp (
Start the managed network, this function is called when one instance is configured
or reconfigured.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in] IsConfigUpdate The instance is reconfigured or it's the first time
the instanced is configured.
@param[in] EnableSystemPoll Enable the system polling or not.
@param[in, out] MnpServiceData Pointer to the mnp service context data.
@param[in] IsConfigUpdate The instance is reconfigured or it's the first
time the instanced is configured.
@param[in] EnableSystemPoll Enable the system polling or not.
@retval EFI_SUCCESS The managed network is started and some
configuration is updated.
@retval Other Some error occurs.
@retval EFI_SUCCESS The managed network is started and some
configuration is updated.
@retval Others Other errors as indicated.
**/
EFI_STATUS
MnpStart (
IN MNP_SERVICE_DATA *MnpServiceData,
IN BOOLEAN IsConfigUpdate,
IN BOOLEAN EnableSystemPoll
IN OUT MNP_SERVICE_DATA *MnpServiceData,
IN BOOLEAN IsConfigUpdate,
IN BOOLEAN EnableSystemPoll
)
{
EFI_STATUS Status;
@ -921,15 +922,15 @@ ErrorExit:
/**
Stop the managed network.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in, out] MnpServiceData Pointer to the mnp service context data.
@retval EFI_SUCCESS The managed network is stopped.
@retval Other Some error occurs.
@retval EFI_SUCCESS The managed network is stopped.
@retval Others Other errors as indicated.
**/
EFI_STATUS
MnpStop (
IN MNP_SERVICE_DATA *MnpServiceData
IN OUT MNP_SERVICE_DATA *MnpServiceData
)
{
EFI_STATUS Status;
@ -984,12 +985,12 @@ MnpStop (
/**
Flush the instance's received data.
@param Instance Pointer to the mnp instance context data.
@param[in, out] Instance Pointer to the mnp instance context data.
**/
VOID
MnpFlushRcvdDataQueue (
IN MNP_INSTANCE_DATA *Instance
IN OUT MNP_INSTANCE_DATA *Instance
)
{
EFI_TPL OldTpl;
@ -1021,20 +1022,20 @@ MnpFlushRcvdDataQueue (
/**
Configure the Instance using ConfigData.
@param[in] Instance Pointer to the mnp instance context data.
@param[in] ConfigData Pointer to the configuration data used to configure
@param[in, out] Instance Pointer to the mnp instance context data.
@param[in] ConfigData Pointer to the configuration data used to configure
the isntance.
@retval EFI_SUCCESS The Instance is configured.
@retval EFI_UNSUPPORTED EnableReceiveTimestamps is on and the
implementation doesn't support it.
@retval Other Some error occurs.
@retval Others Other errors as indicated.
**/
EFI_STATUS
MnpConfigureInstance (
IN MNP_INSTANCE_DATA *Instance,
IN EFI_MANAGED_NETWORK_CONFIG_DATA *ConfigData OPTIONAL
IN OUT MNP_INSTANCE_DATA *Instance,
IN EFI_MANAGED_NETWORK_CONFIG_DATA *ConfigData OPTIONAL
)
{
EFI_STATUS Status;
@ -1162,23 +1163,23 @@ MnpConfigureInstance (
Add a group address control block which controls the MacAddress for
this instance.
@param[in] Instance Pointer to the mnp instance context data.
@param[in] CtrlBlk Pointer to the group address control block.
@param[in] GroupAddress Pointer to the group adress.
@param[in] MacAddress Pointer to the mac address.
@param[in] HwAddressSize The hardware address size.
@param[in, out] Instance Pointer to the mnp instance context data.
@param[in, out] CtrlBlk Pointer to the group address control block.
@param[in, out] GroupAddress Pointer to the group adress.
@param[in] MacAddress Pointer to the mac address.
@param[in] HwAddressSize The hardware address size.
@retval EFI_SUCCESS The group address control block is added.
@retval EFI_OUT_OF_RESOURCE Failed due to lack of memory resources.
@retval EFI_SUCCESS The group address control block is added.
@retval EFI_OUT_OF_RESOURCES Failed due to lack of memory resources.
**/
EFI_STATUS
MnpGroupOpAddCtrlBlk (
IN MNP_INSTANCE_DATA *Instance,
IN MNP_GROUP_CONTROL_BLOCK *CtrlBlk,
IN MNP_GROUP_ADDRESS *GroupAddress OPTIONAL,
IN EFI_MAC_ADDRESS *MacAddress,
IN UINT32 HwAddressSize
IN OUT MNP_INSTANCE_DATA *Instance,
IN OUT MNP_GROUP_CONTROL_BLOCK *CtrlBlk,
IN OUT MNP_GROUP_ADDRESS *GroupAddress OPTIONAL,
IN EFI_MAC_ADDRESS *MacAddress,
IN UINT32 HwAddressSize
)
{
MNP_SERVICE_DATA *MnpServiceData;
@ -1283,20 +1284,21 @@ MnpGroupOpDelCtrlBlk (
/**
Do the group operations for this instance.
@param[in] Instance Pointer to the instance context data.
@param[in] JoinFlag Set to TRUE to join a group. Set to TRUE to leave a
group/groups.
@param[in] MacAddress Pointer to the group address to join or leave.
@param[in] CtrlBlk Pointer to the group control block if JoinFlag if
FALSE.
@param[in, out] Instance Pointer to the instance context data.
@param[in] JoinFlag Set to TRUE to join a group. Set to TRUE to
leave a group/groups.
@param[in] MacAddress Pointer to the group address to join or leave.
@param[in] CtrlBlk Pointer to the group control block if JoinFlag
is FALSE.
@retval EFI_SUCCESS The group operation finished.
@retval Other Some error occurs.
@retval EFI_SUCCESS The group operation finished.
@retval EFI_OUT_OF_RESOURCES Failed due to lack of memory resources.
@retval Others Other errors as indicated.
**/
EFI_STATUS
MnpGroupOp (
IN MNP_INSTANCE_DATA *Instance,
IN OUT MNP_INSTANCE_DATA *Instance,
IN BOOLEAN JoinFlag,
IN EFI_MAC_ADDRESS *MacAddress OPTIONAL,
IN MNP_GROUP_CONTROL_BLOCK *CtrlBlk OPTIONAL

View File

@ -1,11 +1,11 @@
/** @file
Implementation of driver entry point and driver binding protocol.
Implementation of driver entry point and driver binding protocol.
Copyright (c) 2005 - 2008, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
Copyright (c) 2005 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials are licensed
and made available under the terms and conditions of the BSD License which
accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@ -33,14 +33,14 @@ EFI_DRIVER_BINDING_PROTOCOL gMnpDriverBinding = {
follow these calling restrictions. If any other agent wishes to call
Supported() it must also follow these calling restrictions.
@param[in] This Protocol instance pointer.
@param[in] ControllerHandle Handle of device to test
@param[in] RemainingDevicePath Optional parameter use to pick a specific child
device to start.
@param[in] This Protocol instance pointer.
@param[in] ControllerHandle Handle of device to test.
@param[in] RemainingDevicePath Optional parameter use to pick a specific
child device to start.
@retval EFI_SUCCESS This driver supports this device
@retval EFI_ALREADY_STARTED This driver is already running on this device
@retval other This driver does not support this device
@retval EFI_SUCCESS This driver supports this device.
@retval EFI_ALREADY_STARTED This driver is already running on this device.
@retval Others This driver does not support this device.
**/
EFI_STATUS
@ -101,21 +101,21 @@ MnpDriverBindingSupported (
/**
Start this driver on ControllerHandle. This service is called by the
EFI boot service ConnectController(). In order to make
drivers as small as possible, there are a few calling restrictions for
this service. ConnectController() must follow these
calling restrictions. If any other agent wishes to call Start() it
must also follow these calling restrictions.
EFI boot service ConnectController(). In order to make drivers as small
as possible, there are a few calling restrictions for this service.
ConnectController() must follow these calling restrictions. If any other
agent wishes to call Start() it must also follow these calling restrictions.
@param[in] This Protocol instance pointer.
@param[in] ControllerHandle Handle of device to bind driver to.
@param[in] RemainingDevicePath Optional parameter use to pick a specific child
device to start.
@retval EFI_SUCCESS This driver is added to ControllerHandle
@retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
@retval other This driver does not support this device
@param[in] This Protocol instance pointer.
@param[in] ControllerHandle Handle of device to bind driver to.
@param[in] RemainingDevicePath Optional parameter use to pick a specific
child device to start.
@retval EFI_SUCCESS This driver is added to ControllerHandle.
@retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory for Mnp Service Data.
@retval Others This driver does not support this device.
**/
EFI_STATUS
EFIAPI
@ -179,20 +179,20 @@ ErrorExit:
/**
Stop this driver on ControllerHandle. This service is called by the
EFI boot service DisconnectController(). In order to
make drivers as small as possible, there are a few calling
restrictions for this service. DisconnectController()
must follow these calling restrictions. If any other agent wishes
to call Stop() it must also follow these calling restrictions.
EFI boot service DisconnectController(). In order to make drivers as
small as possible, there are a few calling restrictions for this service.
DisconnectController() must follow these calling restrictions. If any other
agent wishes to call Stop() it must also follow these calling restrictions.
@param[in] This Protocol instance pointer.
@param[in] ControllerHandle Handle of device to stop driver on
@param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
children is zero stop the entire bus driver.
@param[in] ChildHandleBuffer List of Child Handles to Stop.
@param[in] This Protocol instance pointer.
@param[in] ControllerHandle Handle of device to stop driver on.
@param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If
number of children is zero stop the entire
bus driver.
@param[in] ChildHandleBuffer List of Child Handles to Stop.
@retval EFI_SUCCESS This driver is removed ControllerHandle
@retval other This driver was not removed from this device
@retval EFI_SUCCESS This driver is removed ControllerHandle.
@retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
**/
EFI_STATUS
@ -201,7 +201,7 @@ MnpDriverBindingStop (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle,
IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer
IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
)
{
EFI_STATUS Status;
@ -270,22 +270,19 @@ MnpDriverBindingStop (
/**
Creates a child handle and installs a protocol.
The CreateChild() function installs a protocol on ChildHandle.
If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
Creates a child handle with a set of I/O services.
@param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@param ChildHandle Pointer to the handle of the child to create. If it is NULL,
then a new handle is created. If it is a pointer to an existing UEFI handle,
then the protocol is added to the existing UEFI handle.
@param[in] This Protocol instance pointer.
@param[in, out] ChildHandle Pointer to the handle of the child to create. If
it is NULL, then a new handle is created. If
it is not NULL, then the I/O services are added
to the existing child handle.
@retval EFI_SUCCES The protocol was added to ChildHandle.
@retval EFI_INVALID_PARAMETER ChildHandle is NULL.
@retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create
the child
@retval other The child handle was not created
@retval EFI_SUCCES The protocol was added to ChildHandle.
@retval EFI_INVALID_PARAMETER ChildHandle is NULL.
@retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to
create the child.
@retval Others The child handle was not created.
**/
EFI_STATUS
@ -387,21 +384,24 @@ ErrorExit:
/**
Destroys a child handle with a protocol installed on it.
The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
that was installed by CreateChild() from ChildHandle. If the removed protocol is the
last protocol on ChildHandle, then ChildHandle is destroyed.
Destroys a child handle with a set of I/O services.
The DestroyChild() function does the opposite of CreateChild(). It removes a
protocol that was installed by CreateChild() from ChildHandle. If the removed
protocol is the last protocol on ChildHandle, then ChildHandle is destroyed.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL
instance.
@param[in] ChildHandle Handle of the child to destroy.
@param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@param ChildHandle Handle of the child to destroy
@retval EFI_SUCCES The protocol was removed from ChildHandle.
@retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
@retval EFI_INVALID_PARAMETER Child handle is not a valid UEFI Handle.
@retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
because its services are being used.
@retval other The child handle was not destroyed
@retval EFI_SUCCES The protocol was removed from ChildHandle.
@retval EFI_UNSUPPORTED ChildHandle does not support the protocol that
is being removed.
@retval EFI_INVALID_PARAMETER ChildHandle is not a valid UEFI handle.
@retval EFI_ACCESS_DENIED The protocol could not be removed from the
ChildHandle because its services are being
used.
@retval Others The child handle was not destroyed.
**/
EFI_STATUS
@ -520,12 +520,12 @@ MnpServiceBindingDestroyChild (
The entry point for Mnp driver which installs the driver binding and component
name protocol on its ImageHandle.
@param[in] ImageHandle The image handle of the driver.
@param[in] SystemTable The system table.
@param[in] ImageHandle The image handle of the driver.
@param[in] SystemTable The system table.
@retval EFI_SUCCES The driver binding and component name protocols are
successfully installed.
@retval other failed.
@retval Others Other errors as indicated.
**/
EFI_STATUS

View File

@ -1,11 +1,11 @@
/** @file
Declaration of strctures and functions for MnpDxe driver.
Declaration of strctures and functions for MnpDxe driver.
Copyright (c) 2005 - 2007, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
Copyright (c) 2005 - 2007, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials are licensed
and made available under the terms and conditions of the BSD License which
accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@ -21,24 +21,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Protocol/ServiceBinding.h>
#include <Library/DebugLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/NetLib.h>
#include <Library/BaseLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/BaseMemoryLib.h>
//
// Required Global Variables
//
extern EFI_DRIVER_BINDING_PROTOCOL gMnpDriverBinding;
extern EFI_COMPONENT_NAME_PROTOCOL gMnpComponentName;
extern EFI_COMPONENT_NAME2_PROTOCOL gMnpComponentName2;
#include "ComponentName.h"
#define MNP_SERVICE_DATA_SIGNATURE SIGNATURE_32 ('M', 'n', 'p', 'S')
typedef struct _MNP_SERVICE_DATA {
typedef struct {
UINT32 Signature;
EFI_HANDLE ControllerHandle;
@ -96,14 +87,14 @@ typedef struct _MNP_SERVICE_DATA {
follow these calling restrictions. If any other agent wishes to call
Supported() it must also follow these calling restrictions.
@param[in] This Protocol instance pointer.
@param[in] ControllerHandle Handle of device to test
@param[in] RemainingDevicePath Optional parameter use to pick a specific child
device to start.
@param[in] This Protocol instance pointer.
@param[in] ControllerHandle Handle of device to test.
@param[in] RemainingDevicePath Optional parameter use to pick a specific
child device to start.
@retval EFI_SUCCESS This driver supports this device
@retval EFI_ALREADY_STARTED This driver is already running on this device
@retval other This driver does not support this device
@retval EFI_SUCCESS This driver supports this device.
@retval EFI_ALREADY_STARTED This driver is already running on this device.
@retval Others This driver does not support this device.
**/
EFI_STATUS
@ -116,21 +107,21 @@ MnpDriverBindingSupported (
/**
Start this driver on ControllerHandle. This service is called by the
EFI boot service ConnectController(). In order to make
drivers as small as possible, there are a few calling restrictions for
this service. ConnectController() must follow these
calling restrictions. If any other agent wishes to call Start() it
must also follow these calling restrictions.
EFI boot service ConnectController(). In order to make drivers as small
as possible, there are a few calling restrictions for this service.
ConnectController() must follow these calling restrictions. If any other
agent wishes to call Start() it must also follow these calling restrictions.
@param[in] This Protocol instance pointer.
@param[in] ControllerHandle Handle of device to bind driver to.
@param[in] RemainingDevicePath Optional parameter use to pick a specific child
device to start.
@retval EFI_SUCCESS This driver is added to ControllerHandle
@retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
@retval other This driver does not support this device
@param[in] This Protocol instance pointer.
@param[in] ControllerHandle Handle of device to bind driver to.
@param[in] RemainingDevicePath Optional parameter use to pick a specific
child device to start.
@retval EFI_SUCCESS This driver is added to ControllerHandle.
@retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory for Mnp Service Data.
@retval Others This driver does not support this device.
**/
EFI_STATUS
EFIAPI
@ -143,20 +134,20 @@ MnpDriverBindingStart (
/**
Stop this driver on ControllerHandle. This service is called by the
EFI boot service DisconnectController(). In order to
make drivers as small as possible, there are a few calling
restrictions for this service. DisconnectController()
must follow these calling restrictions. If any other agent wishes
to call Stop() it must also follow these calling restrictions.
EFI boot service DisconnectController(). In order to make drivers as
small as possible, there are a few calling restrictions for this service.
DisconnectController() must follow these calling restrictions. If any other
agent wishes to call Stop() it must also follow these calling restrictions.
@param[in] This Protocol instance pointer.
@param[in] ControllerHandle Handle of device to stop driver on
@param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
children is zero stop the entire bus driver.
@param[in] ChildHandleBuffer List of Child Handles to Stop.
@param[in] This Protocol instance pointer.
@param[in] ControllerHandle Handle of device to stop driver on.
@param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. If
number of children is zero stop the entire
bus driver.
@param[in] ChildHandleBuffer List of Child Handles to Stop.
@retval EFI_SUCCESS This driver is removed ControllerHandle
@retval other This driver was not removed from this device
@retval EFI_SUCCESS This driver is removed ControllerHandle.
@retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
**/
EFI_STATUS
@ -165,26 +156,23 @@ MnpDriverBindingStop (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle,
IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer
IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
);
/**
Creates a child handle and installs a protocol.
The CreateChild() function installs a protocol on ChildHandle.
If ChildHandle is a pointer to NULL, then a new handle is created and returned in ChildHandle.
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing ChildHandle.
Creates a child handle with a set of I/O services.
@param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@param ChildHandle Pointer to the handle of the child to create. If it is NULL,
then a new handle is created. If it is a pointer to an existing UEFI handle,
then the protocol is added to the existing UEFI handle.
@param[in] This Protocol instance pointer.
@param[in, out] ChildHandle Pointer to the handle of the child to create. If
it is NULL, then a new handle is created. If
it is not NULL, then the I/O services are added
to the existing child handle.
@retval EFI_SUCCES The protocol was added to ChildHandle.
@retval EFI_INVALID_PARAMETER ChildHandle is NULL.
@retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create
the child
@retval other The child handle was not created
@retval EFI_SUCCES The protocol was added to ChildHandle.
@retval EFI_INVALID_PARAMETER ChildHandle is NULL.
@retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to
create the child.
@retval Others The child handle was not created.
**/
EFI_STATUS
@ -195,21 +183,24 @@ MnpServiceBindingCreateChild (
);
/**
Destroys a child handle with a protocol installed on it.
The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
that was installed by CreateChild() from ChildHandle. If the removed protocol is the
last protocol on ChildHandle, then ChildHandle is destroyed.
Destroys a child handle with a set of I/O services.
The DestroyChild() function does the opposite of CreateChild(). It removes a
protocol that was installed by CreateChild() from ChildHandle. If the removed
protocol is the last protocol on ChildHandle, then ChildHandle is destroyed.
@param[in] This Pointer to the EFI_SERVICE_BINDING_PROTOCOL
instance.
@param[in] ChildHandle Handle of the child to destroy.
@param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@param ChildHandle Handle of the child to destroy
@retval EFI_SUCCES The protocol was removed from ChildHandle.
@retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is being removed.
@retval EFI_INVALID_PARAMETER Child handle is not a valid UEFI Handle.
@retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
because its services are being used.
@retval other The child handle was not destroyed
@retval EFI_SUCCES The protocol was removed from ChildHandle.
@retval EFI_UNSUPPORTED ChildHandle does not support the protocol that
is being removed.
@retval EFI_INVALID_PARAMETER ChildHandle is not a valid UEFI handle.
@retval EFI_ACCESS_DENIED The protocol could not be removed from the
ChildHandle because its services are being
used.
@retval Others The child handle was not destroyed.
**/
EFI_STATUS

View File

@ -1,20 +1,16 @@
#/** @file
# Component name for module Mnp
#
# FIX ME!
# Copyright (c) 2006, Intel Corporation
#
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
#
#**/
/** @file
Component description file for Mnp module.
Copyright (c) 2006, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = MnpDxe
@ -36,6 +32,7 @@
[Sources.common]
MnpMain.c
MnpIo.c
ComponentName.h
MnpDriver.h
ComponentName.c
MnpDriver.c

View File

@ -1,7 +1,7 @@
/** @file
Declaration of structures and functions of MnpDxe driver.
Declaration of structures and functions of MnpDxe driver.
Copyright (c) 2005 - 2008, Intel Corporation.<BR>
Copyright (c) 2005 - 2008, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -44,7 +44,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
MNP_INSTANCE_DATA_SIGNATURE \
)
typedef struct _MNP_INSTANCE_DATA {
typedef struct {
UINT32 Signature;
MNP_SERVICE_DATA *MnpServiceData;
@ -71,18 +71,18 @@ typedef struct _MNP_INSTANCE_DATA {
UINT8 ReceiveFilter;
} MNP_INSTANCE_DATA;
typedef struct _MNP_GROUP_ADDRESS {
typedef struct {
LIST_ENTRY AddrEntry;
EFI_MAC_ADDRESS Address;
INTN RefCnt;
} MNP_GROUP_ADDRESS;
typedef struct _MNP_GROUP_CONTROL_BLOCK {
typedef struct {
LIST_ENTRY CtrlBlkEntry;
MNP_GROUP_ADDRESS *GroupAddress;
} MNP_GROUP_CONTROL_BLOCK;
typedef struct _MNP_RXDATA_WRAP {
typedef struct {
LIST_ENTRY WrapEntry;
MNP_INSTANCE_DATA *Instance;
EFI_MANAGED_NETWORK_RECEIVE_DATA RxData;
@ -93,53 +93,54 @@ typedef struct _MNP_RXDATA_WRAP {
/**
Initialize the mnp service context data.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in] ImageHandle The driver image handle.
@param[in] ControllerHandle Handle of device to bind driver to.
@param[in, out] MnpServiceData Pointer to the mnp service context data.
@param[in] ImageHandle The driver image handle.
@param[in] ControllerHandle Handle of device to bind driver to.
@retval EFI_SUCCESS The mnp service context is initialized.
@retval Other Some error occurs.
@retval EFI_UNSUPPORTED ControllerHandle does not support Simple Network Protocol.
@retval Others Other errors as indicated.
**/
EFI_STATUS
MnpInitializeServiceData (
IN MNP_SERVICE_DATA *MnpServiceData,
IN EFI_HANDLE ImageHandle,
IN EFI_HANDLE ControllerHandle
IN OUT MNP_SERVICE_DATA *MnpServiceData,
IN EFI_HANDLE ImageHandle,
IN EFI_HANDLE ControllerHandle
);
/**
Flush the mnp service context data.
@param MnpServiceData Pointer to the mnp service context data.
@param ImageHandle The driver image handle.
@param[in, out] MnpServiceData Pointer to the mnp service context data.
@param[in] ImageHandle The driver image handle.
**/
VOID
MnpFlushServiceData (
IN MNP_SERVICE_DATA *MnpServiceData,
IN EFI_HANDLE ImageHandle
IN OUT MNP_SERVICE_DATA *MnpServiceData,
IN EFI_HANDLE ImageHandle
);
/**
Initialize the mnp instance context data.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in] Instance Pointer to the mnp instance context data to
initialize.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in, out] Instance Pointer to the mnp instance context data
to initialize.
**/
VOID
MnpInitializeInstanceData (
IN MNP_SERVICE_DATA *MnpServiceData,
IN MNP_INSTANCE_DATA *Instance
IN MNP_SERVICE_DATA *MnpServiceData,
IN OUT MNP_INSTANCE_DATA *Instance
);
/**
Check whether the token specified by Arg maches the token in Item.
Check whether the token specified by Arg matches the token in Item.
@param[in] Map Pointer to the NET_MAP.
@param[in] Item Pointer to the NET_MAP_ITEM
@param[in] Item Pointer to the NET_MAP_ITEM.
@param[in] Arg Pointer to the Arg, it's a pointer to the token to
check.
@ -159,10 +160,10 @@ MnpTokenExist (
/**
Cancel the token specified by Arg if it matches the token in Item.
@param[in, out] Map Pointer to the NET_MAP.
@param[in] Item Pointer to the NET_MAP_ITEM
@param[in] Arg Pointer to the Arg, it's a pointer to the token to
cancel.
@param[in, out] Map Pointer to the NET_MAP.
@param[in, out] Item Pointer to the NET_MAP_ITEM.
@param[in] Arg Pointer to the Arg, it's a pointer to the
token to cancel.
@retval EFI_SUCCESS The Arg is NULL, and the token in Item is cancelled,
or the Arg isn't NULL, and the token in Item is
@ -173,58 +174,59 @@ MnpTokenExist (
**/
EFI_STATUS
MnpCancelTokens (
IN OUT NET_MAP *Map,
IN NET_MAP_ITEM *Item,
IN VOID *Arg
IN OUT NET_MAP *Map,
IN OUT NET_MAP_ITEM *Item,
IN VOID *Arg
);
/**
Flush the instance's received data.
@param Instance Pointer to the mnp instance context data.
@param[in, out] Instance Pointer to the mnp instance context data.
**/
VOID
MnpFlushRcvdDataQueue (
IN MNP_INSTANCE_DATA *Instance
IN OUT MNP_INSTANCE_DATA *Instance
);
/**
Configure the Instance using ConfigData.
@param[in] Instance Pointer to the mnp instance context data.
@param[in] ConfigData Pointer to the configuration data used to configure
@param[in, out] Instance Pointer to the mnp instance context data.
@param[in] ConfigData Pointer to the configuration data used to configure
the isntance.
@retval EFI_SUCCESS The Instance is configured.
@retval EFI_UNSUPPORTED EnableReceiveTimestamps is on and the
implementation doesn't support it.
@retval Other Some error occurs.
@retval Others Other errors as indicated.
**/
EFI_STATUS
MnpConfigureInstance (
IN MNP_INSTANCE_DATA *Instance,
IN EFI_MANAGED_NETWORK_CONFIG_DATA *ConfigData OPTIONAL
IN OUT MNP_INSTANCE_DATA *Instance,
IN EFI_MANAGED_NETWORK_CONFIG_DATA *ConfigData OPTIONAL
);
/**
Do the group operations for this instance.
@param[in] Instance Pointer to the instance context data.
@param[in] JoinFlag Set to TRUE to join a group. Set to TRUE to leave a
group/groups.
@param[in] MacAddress Pointer to the group address to join or leave.
@param[in] CtrlBlk Pointer to the group control block if JoinFlag if
FALSE.
@param[in, out] Instance Pointer to the instance context data.
@param[in] JoinFlag Set to TRUE to join a group. Set to TRUE to
leave a group/groups.
@param[in] MacAddress Pointer to the group address to join or leave.
@param[in] CtrlBlk Pointer to the group control block if JoinFlag
is FALSE.
@retval EFI_SUCCESS The group operation finished.
@retval Other Some error occurs.
@retval EFI_SUCCESS The group operation finished.
@retval EFI_OUT_OF_RESOURCES Failed due to lack of memory resources.
@retval Others Other errors as indicated.
**/
EFI_STATUS
MnpGroupOp (
IN MNP_INSTANCE_DATA *Instance,
IN OUT MNP_INSTANCE_DATA *Instance,
IN BOOLEAN JoinFlag,
IN EFI_MAC_ADDRESS *MacAddress OPTIONAL,
IN MNP_GROUP_CONTROL_BLOCK *CtrlBlk OPTIONAL
@ -233,8 +235,8 @@ MnpGroupOp (
/**
Validates the Mnp transmit token.
@param[in] Instance Pointer to the Mnp instance context data.
@param[in] Token Pointer to the transmit token to check.
@param[in] Instance Pointer to the Mnp instance context data.
@param[in] Token Pointer to the transmit token to check.
@return The Token is valid or not.
@ -248,13 +250,13 @@ MnpIsValidTxToken (
/**
Build the packet to transmit from the TxData passed in.
@param MnpServiceData Pointer to the mnp service context data.
@param TxData Pointer to the transmit data containing the
information to build the packet.
@param PktBuf Pointer to record the address of the packet.
@param PktLen Pointer to a UINT32 variable used to record the
packet's length.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in] TxData Pointer to the transmit data containing the information
to build the packet.
@param[out] PktBuf Pointer to record the address of the packet.
@param[out] PktLen Pointer to a UINT32 variable used to record the packet's
length.
**/
VOID
MnpBuildTxPacket (
@ -267,28 +269,28 @@ MnpBuildTxPacket (
/**
Synchronously send out the packet.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in] Packet Pointer to the pakcet buffer.
@param[in] Length The length of the packet.
@param[in] Token Pointer to the token the packet generated from.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in] Packet Pointer to the pakcet buffer.
@param[in] Length The length of the packet.
@param[in, out] Token Pointer to the token the packet generated from.
@retval EFI_SUCCESS The packet is sent out.
@retval EFI_TIMEOUT Time out occurs, the packet isn't sent.
@retval EFI_DEVICE_ERROR An unexpected network error occurs.
@retval EFI_SUCCESS The packet is sent out.
@retval EFI_TIMEOUT Time out occurs, the packet isn't sent.
@retval EFI_DEVICE_ERROR An unexpected network error occurs.
**/
EFI_STATUS
MnpSyncSendPacket (
IN MNP_SERVICE_DATA *MnpServiceData,
IN UINT8 *Packet,
IN UINT32 Length,
IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token
IN MNP_SERVICE_DATA *MnpServiceData,
IN UINT8 *Packet,
IN UINT32 Length,
IN OUT EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token
);
/**
Try to deliver the received packet to the instance.
@param[in] Instance Pointer to the mnp instance context data.
@param[in, out] Instance Pointer to the mnp instance context data.
@retval EFI_SUCCESS The received packet is delivered, or there is no
packet to deliver, or there is no available receive
@ -298,16 +300,16 @@ MnpSyncSendPacket (
**/
EFI_STATUS
MnpInstanceDeliverPacket (
IN MNP_INSTANCE_DATA *Instance
IN OUT MNP_INSTANCE_DATA *Instance
);
/**
Recycle the RxData and other resources used to hold and deliver the received
packet.
@param Event The event this notify function registered to.
@param Context Pointer to the context data registerd to the Event.
@param[in] Event The event this notify function registered to.
@param[in] Context Pointer to the context data registerd to the Event.
**/
VOID
EFIAPI
@ -319,7 +321,7 @@ MnpRecycleRxData (
/**
Try to receive a packet and deliver it.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in, out] MnpServiceData Pointer to the mnp service context data.
@retval EFI_SUCCESS add return value to function comment
@retval EFI_NOT_STARTED The simple network protocol is not started.
@ -329,7 +331,7 @@ MnpRecycleRxData (
**/
EFI_STATUS
MnpReceivePacket (
IN MNP_SERVICE_DATA *MnpServiceData
IN OUT MNP_SERVICE_DATA *MnpServiceData
);
/**
@ -337,7 +339,7 @@ MnpReceivePacket (
in the queue, first try to allocate some and add them into the queue, then
fetch the NET_BUF from the updated FreeNbufQue.
@param[in] MnpServiceData Pointer to the MNP_SERVICE_DATA.
@param[in, out] MnpServiceData Pointer to the MNP_SERVICE_DATA.
@return Pointer to the allocated free NET_BUF structure, if NULL the
operation is failed.
@ -345,29 +347,29 @@ MnpReceivePacket (
**/
NET_BUF *
MnpAllocNbuf (
IN MNP_SERVICE_DATA *MnpServiceData
IN OUT MNP_SERVICE_DATA *MnpServiceData
);
/**
Try to reclaim the Nbuf into the buffer pool.
@param MnpServiceData Pointer to the mnp service context data.
@param Nbuf Pointer to the NET_BUF to free.
@param[in,out] MnpServiceData Pointer to the mnp service context data.
@param[in,out] Nbuf Pointer to the NET_BUF to free.
**/
VOID
MnpFreeNbuf (
IN MNP_SERVICE_DATA *MnpServiceData,
IN NET_BUF *Nbuf
IN OUT MNP_SERVICE_DATA *MnpServiceData,
IN OUT NET_BUF *Nbuf
);
/**
Remove the received packets if timeout occurs.
@param Event The event this notify function registered to.
@param Context Pointer to the context data registered to the
event.
@param[in] Event The event this notify function registered to.
@param[in] Context Pointer to the context data registered to the
event.
**/
VOID
EFIAPI
@ -380,16 +382,15 @@ MnpCheckPacketTimeout (
Poll to receive the packets from Snp. This function is either called by upperlayer
protocols/applications or the system poll timer notify mechanism.
@param Event The event this notify function registered to.
@param Context Pointer to the context data registered to the
event.
@param[in] Event The event this notify function registered to.
@param[in, out] Context Pointer to the context data registered to the event.
**/
VOID
EFIAPI
MnpSystemPoll (
IN EFI_EVENT Event,
IN VOID *Context
IN OUT VOID *Context
);
/**
@ -414,14 +415,14 @@ MnpSystemPoll (
@retval EFI_NOT_STARTED This MNP child driver instance has not been
configured. The default values are returned in
MnpConfigData if it is not NULL.
@retval Other The mode data could not be read.
@retval Others The mode data could not be read.
**/
EFI_STATUS
EFIAPI
MnpGetModeData (
IN EFI_MANAGED_NETWORK_PROTOCOL *This,
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData, OPTIONAL
OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
);
@ -447,13 +448,13 @@ MnpGetModeData (
Note: Warning: Receive filter settings that overlap will consume extra
processor and/or DMA resources and degrade system and network performance.
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] MnpConfigData Pointer to configuration data that will be assigned
to the MNP child driver instance. If NULL, the MNP
child driver instance is reset to startup defaults
and all pending transmit and receive requests are
flushed. Type EFI_MANAGED_NETWORK_CONFIG_DATA is
defined in EFI_MANAGED_NETWORK_PROTOCOL.GetModeData().
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] MnpConfigData Pointer to configuration data that will be assigned
to the MNP child driver instance. If NULL, the MNP
child driver instance is reset to startup defaults
and all pending transmit and receive requests are
flushed. Type EFI_MANAGED_NETWORK_CONFIG_DATA is
defined in EFI_MANAGED_NETWORK_PROTOCOL.GetModeData().
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is
@ -473,7 +474,7 @@ MnpGetModeData (
@retval EFI_DEVICE_ERROR An unexpected network or system error
occurred. The MNP child driver instance has
been reset to startup defaults.
@retval Other The MNP child driver instance has been reset to
@retval Others The MNP child driver instance has been reset to
startup defaults.
**/
@ -490,15 +491,15 @@ MnpConfigure (
The McastIpToMac() function translates an IP multicast address to a hardware
(MAC) multicast address. This function may be implemented by calling the
underlying EFI_SIMPLE_NETWORK.MCastIpToMac() function, which may also be
underlying EFI_SIMPLE_NETWORK. MCastIpToMac() function, which may also be
unsupported in some MNP implementations.
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address.
Set to FALSE if IpAddress is an IPv4 multicast address.
@param[in] IpAddress Pointer to the multicast IP address (in network byte order)
to convert.
@param[out] MacAddress Pointer to the resulting multicast MAC address.
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address.
Set to FALSE if IpAddress is an IPv4 multicast address.
@param[in] IpAddress Pointer to the multicast IP address (in network byte
order) to convert.
@param[out] MacAddress Pointer to the resulting multicast MAC address.
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_INVALID_PARAMETER One of the following conditions is TRUE:
@ -512,7 +513,7 @@ MnpConfigure (
@retval EFI_UNSUPPORTED The requested feature is unsupported in this
MNP implementation.
@retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
@retval Other The address could not be converted.
@retval Others The address could not be converted.
**/
EFI_STATUS
EFIAPI
@ -555,7 +556,7 @@ MnpMcastIpToMac (
startup defaults.
@retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP
implementation.
@retval Other The requested operation could not be completed.
@retval Others The requested operation could not be completed.
The MNP multicast group settings are unchanged.
**/
@ -584,8 +585,8 @@ MnpGroups (
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] Token Pointer to a token associated with the transmit data
descriptor. Type EFI_MANAGED_NETWORK_COMPLETION_TOKEN is
defined in "Related Definitions" below.
descriptor. Type EFI_MANAGED_NETWORK_COMPLETION_TOKEN
is defined in "Related Definitions" below.
@retval EFI_SUCCESS The transmit completion token was cached.
@retval EFI_NOT_STARTED This MNP child driver instance has not been
@ -642,8 +643,8 @@ MnpTransmit (
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] Token Pointer to a token that has been issued by
EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or
EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If NULL, all pending
tokens are aborted.
EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If NULL, all
pending tokens are aborted.
@retval EFI_SUCCESS The asynchronous I/O request was aborted and
Token.Event was signaled. When Token is NULL,
@ -675,11 +676,11 @@ MnpCancel (
updates the Token.Status and Token.RxData fields and the Token.Event is
signaled.
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] Token Pointer to a token associated with the receive
data descriptor. Type
EFI_MANAGED_NETWORK_COMPLETION_TOKEN is defined in
EFI_MANAGED_NETWORK_PROTOCOL.Transmit().
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] Token Pointer to a token associated with the receive
data descriptor. Type
EFI_MANAGED_NETWORK_COMPLETION_TOKEN is defined in
EFI_MANAGED_NETWORK_PROTOCOL.Transmit().
@retval EFI_SUCCESS The receive completion token was cached.
@retval EFI_NOT_STARTED This MNP child driver instance has not been
@ -719,7 +720,7 @@ MnpReceive (
applications that are experiencing packet loss should try calling the Poll()
function more often.
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@retval EFI_SUCCESS Incoming or outgoing data was processed.
@retval EFI_NOT_STARTED This MNP child driver instance has not been

View File

@ -1,8 +1,7 @@
/** @file
Implementation of Managed Network Protocol I/O functions.
Copyright (c) 2005 - 2007, Intel Corporation.<BR>
Copyright (c) 2005 - 2007, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -14,17 +13,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "MnpImpl.h"
#include <Library/NetLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/BaseLib.h>
#include <Library/MemoryAllocationLib.h>
/**
Validates the Mnp transmit token.
@param[in] Instance Pointer to the Mnp instance context data.
@param[in] Token Pointer to the transmit token to check.
@param[in] Instance Pointer to the Mnp instance context data.
@param[in] Token Pointer to the transmit token to check.
@return The Token is valid or not.
@ -110,13 +104,13 @@ MnpIsValidTxToken (
/**
Build the packet to transmit from the TxData passed in.
@param MnpServiceData Pointer to the mnp service context data.
@param TxData Pointer to the transmit data containing the
information to build the packet.
@param PktBuf Pointer to record the address of the packet.
@param PktLen Pointer to a UINT32 variable used to record the
packet's length.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in] TxData Pointer to the transmit data containing the information
to build the packet.
@param[out] PktBuf Pointer to record the address of the packet.
@param[out] PktLen Pointer to a UINT32 variable used to record the packet's
length.
**/
VOID
MnpBuildTxPacket (
@ -180,22 +174,22 @@ MnpBuildTxPacket (
/**
Synchronously send out the packet.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in] Packet Pointer to the pakcet buffer.
@param[in] Length The length of the packet.
@param[in] Token Pointer to the token the packet generated from.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in] Packet Pointer to the pakcet buffer.
@param[in] Length The length of the packet.
@param[in, out] Token Pointer to the token the packet generated from.
@retval EFI_SUCCESS The packet is sent out.
@retval EFI_TIMEOUT Time out occurs, the packet isn't sent.
@retval EFI_DEVICE_ERROR An unexpected network error occurs.
@retval EFI_SUCCESS The packet is sent out.
@retval EFI_TIMEOUT Time out occurs, the packet isn't sent.
@retval EFI_DEVICE_ERROR An unexpected network error occurs.
**/
EFI_STATUS
MnpSyncSendPacket (
IN MNP_SERVICE_DATA *MnpServiceData,
IN UINT8 *Packet,
IN UINT32 Length,
IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token
IN MNP_SERVICE_DATA *MnpServiceData,
IN UINT8 *Packet,
IN UINT32 Length,
IN OUT EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token
)
{
EFI_STATUS Status;
@ -297,7 +291,7 @@ SIGNAL_TOKEN:
/**
Try to deliver the received packet to the instance.
@param[in] Instance Pointer to the mnp instance context data.
@param[in, out] Instance Pointer to the mnp instance context data.
@retval EFI_SUCCESS The received packet is delivered, or there is no
packet to deliver, or there is no available receive
@ -307,7 +301,7 @@ SIGNAL_TOKEN:
**/
EFI_STATUS
MnpInstanceDeliverPacket (
IN MNP_INSTANCE_DATA *Instance
IN OUT MNP_INSTANCE_DATA *Instance
)
{
MNP_SERVICE_DATA *MnpServiceData;
@ -391,7 +385,7 @@ MnpInstanceDeliverPacket (
/**
Deliver the received packet for the instances belonging to the MnpServiceData.
@param MnpServiceData Pointer to the mnp service context data.
@param[in] MnpServiceData Pointer to the mnp service context data.
**/
VOID
@ -420,9 +414,9 @@ MnpDeliverPacket (
Recycle the RxData and other resources used to hold and deliver the received
packet.
@param Event The event this notify function registered to.
@param Context Pointer to the context data registerd to the Event.
@param[in] Event The event this notify function registered to.
@param[in] Context Pointer to the context data registerd to the Event.
**/
VOID
EFIAPI
@ -467,15 +461,14 @@ MnpRecycleRxData (
/**
Queue the received packet into instance's receive queue.
@param Instance Pointer to the mnp instance context data.
@param RxDataWrap Pointer to the Wrap structure containing the
received data and other information.
@param[in, out] Instance Pointer to the mnp instance context data.
@param[in, out] RxDataWrap Pointer to the Wrap structure containing the
received data and other information.
**/
VOID
MnpQueueRcvdPacket (
IN MNP_INSTANCE_DATA *Instance,
IN MNP_RXDATA_WRAP *RxDataWrap
IN OUT MNP_INSTANCE_DATA *Instance,
IN OUT MNP_RXDATA_WRAP *RxDataWrap
)
{
MNP_RXDATA_WRAP *OldRxDataWrap;
@ -600,25 +593,25 @@ MnpMatchPacket (
/**
Analyse the received packets.
@param MnpServiceData Pointer to the mnp service context data.
@param Nbuf Pointer to the net buffer holding the received
packet.
@param RxData Pointer to the buffer used to save the analysed
result in EFI_MANAGED_NETWORK_RECEIVE_DATA.
@param GroupAddress Pointer to pointer to a MNP_GROUP_ADDRESS used to
pass out the address of the multicast address the
received packet destinated to.
@param PktAttr Pointer to the buffer used to save the analysed
packet attribute.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in] Nbuf Pointer to the net buffer holding the received
packet.
@param[in, out] RxData Pointer to the buffer used to save the analysed
result in EFI_MANAGED_NETWORK_RECEIVE_DATA.
@param[out] GroupAddress Pointer to pointer to a MNP_GROUP_ADDRESS used to
pass out the address of the multicast address the
received packet destinated to.
@param[out] PktAttr Pointer to the buffer used to save the analysed
packet attribute.
**/
VOID
MnpAnalysePacket (
IN MNP_SERVICE_DATA *MnpServiceData,
IN NET_BUF *Nbuf,
IN EFI_MANAGED_NETWORK_RECEIVE_DATA *RxData,
OUT MNP_GROUP_ADDRESS **GroupAddress,
OUT UINT8 *PktAttr
IN MNP_SERVICE_DATA *MnpServiceData,
IN NET_BUF *Nbuf,
IN OUT EFI_MANAGED_NETWORK_RECEIVE_DATA *RxData,
OUT MNP_GROUP_ADDRESS **GroupAddress,
OUT UINT8 *PktAttr
)
{
EFI_SIMPLE_NETWORK_MODE *SnpMode;
@ -702,8 +695,8 @@ MnpAnalysePacket (
/**
Wrap the RxData.
@param[in] Instance Pointer to the mnp instance context data.
@param[in] RxData Pointer to the receive data to wrap.
@param[in] Instance Pointer to the mnp instance context data.
@param[in] RxData Pointer to the receive data to wrap.
@return Pointer to a MNP_RXDATA_WRAP which wraps the RxData.
@ -758,9 +751,9 @@ MnpWrapRxData (
Enqueue the received the packets to the instances belonging to the
MnpServiceData.
@param MnpServiceData Pointer to the mnp service context data.
@param Nbuf Pointer to the net buffer representing the received
packet.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in] Nbuf Pointer to the net buffer representing the received
packet.
**/
VOID
@ -833,7 +826,7 @@ MnpEnqueuePacket (
/**
Try to receive a packet and deliver it.
@param[in] MnpServiceData Pointer to the mnp service context data.
@param[in, out] MnpServiceData Pointer to the mnp service context data.
@retval EFI_SUCCESS add return value to function comment
@retval EFI_NOT_STARTED The simple network protocol is not started.
@ -843,7 +836,7 @@ MnpEnqueuePacket (
**/
EFI_STATUS
MnpReceivePacket (
IN MNP_SERVICE_DATA *MnpServiceData
IN OUT MNP_SERVICE_DATA *MnpServiceData
)
{
EFI_STATUS Status;
@ -985,10 +978,10 @@ EXIT:
/**
Remove the received packets if timeout occurs.
@param Event The event this notify function registered to.
@param Context Pointer to the context data registered to the
event.
@param[in] Event The event this notify function registered to.
@param[in] Context Pointer to the context data registered to the
event.
**/
VOID
EFIAPI
@ -1052,16 +1045,15 @@ MnpCheckPacketTimeout (
Poll to receive the packets from Snp. This function is either called by upperlayer
protocols/applications or the system poll timer notify mechanism.
@param Event The event this notify function registered to.
@param Context Pointer to the context data registered to the
event.
@param[in] Event The event this notify function registered to.
@param[in, out] Context Pointer to the context data registered to the event.
**/
VOID
EFIAPI
MnpSystemPoll (
IN EFI_EVENT Event,
IN VOID *Context
IN OUT VOID *Context
)
{
MNP_SERVICE_DATA *MnpServiceData;

View File

@ -1,8 +1,7 @@
/** @file
Implementation of Managed Network Protocol public services.
Copyright (c) 2005 - 2007, Intel Corporation.<BR>
Copyright (c) 2005 - 2007, Intel Corporation. <BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -12,11 +11,8 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "MnpImpl.h"
#include <Library/BaseMemoryLib.h>
#include <Library/BaseLib.h>
/**
Returns the operational parameters for the current MNP child driver. May also
@ -40,14 +36,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@retval EFI_NOT_STARTED This MNP child driver instance has not been
configured. The default values are returned in
MnpConfigData if it is not NULL.
@retval Other The mode data could not be read.
@retval Others The mode data could not be read.
**/
EFI_STATUS
EFIAPI
MnpGetModeData (
IN EFI_MANAGED_NETWORK_PROTOCOL *This,
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL,
OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData, OPTIONAL
OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
)
{
@ -76,7 +72,7 @@ MnpGetModeData (
//
// Copy the underlayer Snp mode data.
//
Snp = Instance->MnpServiceData->Snp;
Snp = Instance->MnpServiceData->Snp;
CopyMem (SnpModeData, Snp->Mode, sizeof (*SnpModeData));
}
@ -114,13 +110,13 @@ MnpGetModeData (
Note: Warning: Receive filter settings that overlap will consume extra
processor and/or DMA resources and degrade system and network performance.
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] MnpConfigData Pointer to configuration data that will be assigned
to the MNP child driver instance. If NULL, the MNP
child driver instance is reset to startup defaults
and all pending transmit and receive requests are
flushed. Type EFI_MANAGED_NETWORK_CONFIG_DATA is
defined in EFI_MANAGED_NETWORK_PROTOCOL.GetModeData().
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] MnpConfigData Pointer to configuration data that will be assigned
to the MNP child driver instance. If NULL, the MNP
child driver instance is reset to startup defaults
and all pending transmit and receive requests are
flushed. Type EFI_MANAGED_NETWORK_CONFIG_DATA is
defined in EFI_MANAGED_NETWORK_PROTOCOL.GetModeData().
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_INVALID_PARAMETER One or more of the following conditions is
@ -140,7 +136,7 @@ MnpGetModeData (
@retval EFI_DEVICE_ERROR An unexpected network or system error
occurred. The MNP child driver instance has
been reset to startup defaults.
@retval Other The MNP child driver instance has been reset to
@retval Others The MNP child driver instance has been reset to
startup defaults.
**/
@ -193,15 +189,15 @@ ON_EXIT:
The McastIpToMac() function translates an IP multicast address to a hardware
(MAC) multicast address. This function may be implemented by calling the
underlying EFI_SIMPLE_NETWORK.MCastIpToMac() function, which may also be
underlying EFI_SIMPLE_NETWORK. MCastIpToMac() function, which may also be
unsupported in some MNP implementations.
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address.
Set to FALSE if IpAddress is an IPv4 multicast address.
@param[in] IpAddress Pointer to the multicast IP address (in network byte order)
to convert.
@param[out] MacAddress Pointer to the resulting multicast MAC address.
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address.
Set to FALSE if IpAddress is an IPv4 multicast address.
@param[in] IpAddress Pointer to the multicast IP address (in network byte
order) to convert.
@param[out] MacAddress Pointer to the resulting multicast MAC address.
@retval EFI_SUCCESS The operation completed successfully.
@retval EFI_INVALID_PARAMETER One of the following conditions is TRUE:
@ -215,7 +211,7 @@ ON_EXIT:
@retval EFI_UNSUPPORTED The requested feature is unsupported in this
MNP implementation.
@retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
@retval Other The address could not be converted.
@retval Others The address could not be converted.
**/
EFI_STATUS
EFIAPI
@ -326,7 +322,7 @@ ON_EXIT:
startup defaults.
@retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP
implementation.
@retval Other The requested operation could not be completed.
@retval Others The requested operation could not be completed.
The MNP multicast group settings are unchanged.
**/
@ -457,8 +453,8 @@ ON_EXIT:
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] Token Pointer to a token associated with the transmit data
descriptor. Type EFI_MANAGED_NETWORK_COMPLETION_TOKEN is
defined in "Related Definitions" below.
descriptor. Type EFI_MANAGED_NETWORK_COMPLETION_TOKEN
is defined in "Related Definitions" below.
@retval EFI_SUCCESS The transmit completion token was cached.
@retval EFI_NOT_STARTED This MNP child driver instance has not been
@ -562,11 +558,11 @@ ON_EXIT:
updates the Token.Status and Token.RxData fields and the Token.Event is
signaled.
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] Token Pointer to a token associated with the receive
data descriptor. Type
EFI_MANAGED_NETWORK_COMPLETION_TOKEN is defined in
EFI_MANAGED_NETWORK_PROTOCOL.Transmit().
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] Token Pointer to a token associated with the receive
data descriptor. Type
EFI_MANAGED_NETWORK_COMPLETION_TOKEN is defined in
EFI_MANAGED_NETWORK_PROTOCOL.Transmit().
@retval EFI_SUCCESS The receive completion token was cached.
@retval EFI_NOT_STARTED This MNP child driver instance has not been
@ -658,8 +654,8 @@ ON_EXIT:
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] Token Pointer to a token that has been issued by
EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or
EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If NULL, all pending
tokens are aborted.
EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If NULL, all
pending tokens are aborted.
@retval EFI_SUCCESS The asynchronous I/O request was aborted and
Token.Event was signaled. When Token is NULL,
@ -733,7 +729,7 @@ ON_EXIT:
applications that are experiencing packet loss should try calling the Poll()
function more often.
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@retval EFI_SUCCESS Incoming or outgoing data was processed.
@retval EFI_NOT_STARTED This MNP child driver instance has not been