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

View File

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

View File

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

View File

@ -1,20 +1,16 @@
#/** @file /** @file
# Component name for module Mnp Component description file for Mnp module.
#
# 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.
#
#
#**/
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] [Defines]
INF_VERSION = 0x00010005 INF_VERSION = 0x00010005
BASE_NAME = MnpDxe BASE_NAME = MnpDxe
@ -36,6 +32,7 @@
[Sources.common] [Sources.common]
MnpMain.c MnpMain.c
MnpIo.c MnpIo.c
ComponentName.h
MnpDriver.h MnpDriver.h
ComponentName.c ComponentName.c
MnpDriver.c MnpDriver.c

View File

@ -1,7 +1,7 @@
/** @file /** @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 All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 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 \ MNP_INSTANCE_DATA_SIGNATURE \
) )
typedef struct _MNP_INSTANCE_DATA { typedef struct {
UINT32 Signature; UINT32 Signature;
MNP_SERVICE_DATA *MnpServiceData; MNP_SERVICE_DATA *MnpServiceData;
@ -71,18 +71,18 @@ typedef struct _MNP_INSTANCE_DATA {
UINT8 ReceiveFilter; UINT8 ReceiveFilter;
} MNP_INSTANCE_DATA; } MNP_INSTANCE_DATA;
typedef struct _MNP_GROUP_ADDRESS { typedef struct {
LIST_ENTRY AddrEntry; LIST_ENTRY AddrEntry;
EFI_MAC_ADDRESS Address; EFI_MAC_ADDRESS Address;
INTN RefCnt; INTN RefCnt;
} MNP_GROUP_ADDRESS; } MNP_GROUP_ADDRESS;
typedef struct _MNP_GROUP_CONTROL_BLOCK { typedef struct {
LIST_ENTRY CtrlBlkEntry; LIST_ENTRY CtrlBlkEntry;
MNP_GROUP_ADDRESS *GroupAddress; MNP_GROUP_ADDRESS *GroupAddress;
} MNP_GROUP_CONTROL_BLOCK; } MNP_GROUP_CONTROL_BLOCK;
typedef struct _MNP_RXDATA_WRAP { typedef struct {
LIST_ENTRY WrapEntry; LIST_ENTRY WrapEntry;
MNP_INSTANCE_DATA *Instance; MNP_INSTANCE_DATA *Instance;
EFI_MANAGED_NETWORK_RECEIVE_DATA RxData; EFI_MANAGED_NETWORK_RECEIVE_DATA RxData;
@ -93,17 +93,18 @@ typedef struct _MNP_RXDATA_WRAP {
/** /**
Initialize the mnp service context data. Initialize the mnp service context data.
@param[in] MnpServiceData Pointer to the mnp service context data. @param[in, out] MnpServiceData Pointer to the mnp service context data.
@param[in] ImageHandle The driver image handle. @param[in] ImageHandle The driver image handle.
@param[in] ControllerHandle Handle of device to bind driver to. @param[in] ControllerHandle Handle of device to bind driver to.
@retval EFI_SUCCESS The mnp service context is initialized. @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 EFI_STATUS
MnpInitializeServiceData ( MnpInitializeServiceData (
IN MNP_SERVICE_DATA *MnpServiceData, IN OUT MNP_SERVICE_DATA *MnpServiceData,
IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ImageHandle,
IN EFI_HANDLE ControllerHandle IN EFI_HANDLE ControllerHandle
); );
@ -111,13 +112,13 @@ MnpInitializeServiceData (
/** /**
Flush the mnp service context data. Flush the mnp service context data.
@param MnpServiceData Pointer to the mnp service context data. @param[in, out] MnpServiceData Pointer to the mnp service context data.
@param ImageHandle The driver image handle. @param[in] ImageHandle The driver image handle.
**/ **/
VOID VOID
MnpFlushServiceData ( MnpFlushServiceData (
IN MNP_SERVICE_DATA *MnpServiceData, IN OUT MNP_SERVICE_DATA *MnpServiceData,
IN EFI_HANDLE ImageHandle IN EFI_HANDLE ImageHandle
); );
@ -125,21 +126,21 @@ MnpFlushServiceData (
Initialize the mnp instance context data. Initialize the mnp instance context data.
@param[in] MnpServiceData Pointer to the mnp service context data. @param[in] MnpServiceData Pointer to the mnp service context data.
@param[in] Instance Pointer to the mnp instance context data to @param[in, out] Instance Pointer to the mnp instance context data
initialize. to initialize.
**/ **/
VOID VOID
MnpInitializeInstanceData ( MnpInitializeInstanceData (
IN MNP_SERVICE_DATA *MnpServiceData, IN MNP_SERVICE_DATA *MnpServiceData,
IN MNP_INSTANCE_DATA *Instance 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] 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 @param[in] Arg Pointer to the Arg, it's a pointer to the token to
check. check.
@ -160,9 +161,9 @@ MnpTokenExist (
Cancel the token specified by Arg if it matches the token in Item. Cancel the token specified by Arg if it matches the token in Item.
@param[in, out] Map Pointer to the NET_MAP. @param[in, out] Map Pointer to the NET_MAP.
@param[in] Item Pointer to the NET_MAP_ITEM @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 @param[in] Arg Pointer to the Arg, it's a pointer to the
cancel. token to cancel.
@retval EFI_SUCCESS The Arg is NULL, and the token in Item is cancelled, @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 or the Arg isn't NULL, and the token in Item is
@ -174,57 +175,58 @@ MnpTokenExist (
EFI_STATUS EFI_STATUS
MnpCancelTokens ( MnpCancelTokens (
IN OUT NET_MAP *Map, IN OUT NET_MAP *Map,
IN NET_MAP_ITEM *Item, IN OUT NET_MAP_ITEM *Item,
IN VOID *Arg IN VOID *Arg
); );
/** /**
Flush the instance's received data. 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 VOID
MnpFlushRcvdDataQueue ( MnpFlushRcvdDataQueue (
IN MNP_INSTANCE_DATA *Instance IN OUT MNP_INSTANCE_DATA *Instance
); );
/** /**
Configure the Instance using ConfigData. Configure the Instance using ConfigData.
@param[in] Instance Pointer to the mnp instance context data. @param[in, out] Instance Pointer to the mnp instance context data.
@param[in] ConfigData Pointer to the configuration data used to configure @param[in] ConfigData Pointer to the configuration data used to configure
the isntance. the isntance.
@retval EFI_SUCCESS The Instance is configured. @retval EFI_SUCCESS The Instance is configured.
@retval EFI_UNSUPPORTED EnableReceiveTimestamps is on and the @retval EFI_UNSUPPORTED EnableReceiveTimestamps is on and the
implementation doesn't support it. implementation doesn't support it.
@retval Other Some error occurs. @retval Others Other errors as indicated.
**/ **/
EFI_STATUS EFI_STATUS
MnpConfigureInstance ( MnpConfigureInstance (
IN MNP_INSTANCE_DATA *Instance, IN OUT MNP_INSTANCE_DATA *Instance,
IN EFI_MANAGED_NETWORK_CONFIG_DATA *ConfigData OPTIONAL IN EFI_MANAGED_NETWORK_CONFIG_DATA *ConfigData OPTIONAL
); );
/** /**
Do the group operations for this instance. Do the group operations for this instance.
@param[in] Instance Pointer to the instance context data. @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 @param[in] JoinFlag Set to TRUE to join a group. Set to TRUE to
group/groups. leave a group/groups.
@param[in] MacAddress Pointer to the group address to join or leave. @param[in] MacAddress Pointer to the group address to join or leave.
@param[in] CtrlBlk Pointer to the group control block if JoinFlag if @param[in] CtrlBlk Pointer to the group control block if JoinFlag
FALSE. is FALSE.
@retval EFI_SUCCESS The group operation finished. @retval EFI_SUCCESS The group operation finished.
@retval Other Some error occurs. @retval EFI_OUT_OF_RESOURCES Failed due to lack of memory resources.
@retval Others Other errors as indicated.
**/ **/
EFI_STATUS EFI_STATUS
MnpGroupOp ( MnpGroupOp (
IN MNP_INSTANCE_DATA *Instance, IN OUT MNP_INSTANCE_DATA *Instance,
IN BOOLEAN JoinFlag, IN BOOLEAN JoinFlag,
IN EFI_MAC_ADDRESS *MacAddress OPTIONAL, IN EFI_MAC_ADDRESS *MacAddress OPTIONAL,
IN MNP_GROUP_CONTROL_BLOCK *CtrlBlk OPTIONAL IN MNP_GROUP_CONTROL_BLOCK *CtrlBlk OPTIONAL
@ -248,12 +250,12 @@ MnpIsValidTxToken (
/** /**
Build the packet to transmit from the TxData passed in. Build the packet to transmit from the TxData passed in.
@param MnpServiceData Pointer to the mnp service context data. @param[in] MnpServiceData Pointer to the mnp service context data.
@param TxData Pointer to the transmit data containing the @param[in] TxData Pointer to the transmit data containing the information
information to build the packet. to build the packet.
@param PktBuf Pointer to record the address of the packet. @param[out] PktBuf Pointer to record the address of the packet.
@param PktLen Pointer to a UINT32 variable used to record the @param[out] PktLen Pointer to a UINT32 variable used to record the packet's
packet's length. length.
**/ **/
VOID VOID
@ -270,7 +272,7 @@ MnpBuildTxPacket (
@param[in] MnpServiceData Pointer to the mnp service context data. @param[in] MnpServiceData Pointer to the mnp service context data.
@param[in] Packet Pointer to the pakcet buffer. @param[in] Packet Pointer to the pakcet buffer.
@param[in] Length The length of the packet. @param[in] Length The length of the packet.
@param[in] Token Pointer to the token the packet generated from. @param[in, out] Token Pointer to the token the packet generated from.
@retval EFI_SUCCESS The packet is sent out. @retval EFI_SUCCESS The packet is sent out.
@retval EFI_TIMEOUT Time out occurs, the packet isn't sent. @retval EFI_TIMEOUT Time out occurs, the packet isn't sent.
@ -282,13 +284,13 @@ MnpSyncSendPacket (
IN MNP_SERVICE_DATA *MnpServiceData, IN MNP_SERVICE_DATA *MnpServiceData,
IN UINT8 *Packet, IN UINT8 *Packet,
IN UINT32 Length, IN UINT32 Length,
IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token IN OUT EFI_MANAGED_NETWORK_COMPLETION_TOKEN *Token
); );
/** /**
Try to deliver the received packet to the instance. 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 @retval EFI_SUCCESS The received packet is delivered, or there is no
packet to deliver, or there is no available receive packet to deliver, or there is no available receive
@ -298,15 +300,15 @@ MnpSyncSendPacket (
**/ **/
EFI_STATUS EFI_STATUS
MnpInstanceDeliverPacket ( 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 Recycle the RxData and other resources used to hold and deliver the received
packet. packet.
@param Event The event this notify function registered to. @param[in] Event The event this notify function registered to.
@param Context Pointer to the context data registerd to the Event. @param[in] Context Pointer to the context data registerd to the Event.
**/ **/
VOID VOID
@ -319,7 +321,7 @@ MnpRecycleRxData (
/** /**
Try to receive a packet and deliver it. 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_SUCCESS add return value to function comment
@retval EFI_NOT_STARTED The simple network protocol is not started. @retval EFI_NOT_STARTED The simple network protocol is not started.
@ -329,7 +331,7 @@ MnpRecycleRxData (
**/ **/
EFI_STATUS EFI_STATUS
MnpReceivePacket ( 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 in the queue, first try to allocate some and add them into the queue, then
fetch the NET_BUF from the updated FreeNbufQue. 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 @return Pointer to the allocated free NET_BUF structure, if NULL the
operation is failed. operation is failed.
@ -345,27 +347,27 @@ MnpReceivePacket (
**/ **/
NET_BUF * NET_BUF *
MnpAllocNbuf ( MnpAllocNbuf (
IN MNP_SERVICE_DATA *MnpServiceData IN OUT MNP_SERVICE_DATA *MnpServiceData
); );
/** /**
Try to reclaim the Nbuf into the buffer pool. Try to reclaim the Nbuf into the buffer pool.
@param MnpServiceData Pointer to the mnp service context data. @param[in,out] MnpServiceData Pointer to the mnp service context data.
@param Nbuf Pointer to the NET_BUF to free. @param[in,out] Nbuf Pointer to the NET_BUF to free.
**/ **/
VOID VOID
MnpFreeNbuf ( MnpFreeNbuf (
IN MNP_SERVICE_DATA *MnpServiceData, IN OUT MNP_SERVICE_DATA *MnpServiceData,
IN NET_BUF *Nbuf IN OUT NET_BUF *Nbuf
); );
/** /**
Remove the received packets if timeout occurs. Remove the received packets if timeout occurs.
@param Event The event this notify function registered to. @param[in] Event The event this notify function registered to.
@param Context Pointer to the context data registered to the @param[in] Context Pointer to the context data registered to the
event. event.
**/ **/
@ -380,16 +382,15 @@ MnpCheckPacketTimeout (
Poll to receive the packets from Snp. This function is either called by upperlayer Poll to receive the packets from Snp. This function is either called by upperlayer
protocols/applications or the system poll timer notify mechanism. protocols/applications or the system poll timer notify mechanism.
@param Event The event this notify function registered to. @param[in] Event The event this notify function registered to.
@param Context Pointer to the context data registered to the @param[in, out] Context Pointer to the context data registered to the event.
event.
**/ **/
VOID VOID
EFIAPI EFIAPI
MnpSystemPoll ( MnpSystemPoll (
IN EFI_EVENT Event, 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 @retval EFI_NOT_STARTED This MNP child driver instance has not been
configured. The default values are returned in configured. The default values are returned in
MnpConfigData if it is not NULL. 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 EFI_STATUS
EFIAPI EFIAPI
MnpGetModeData ( MnpGetModeData (
IN EFI_MANAGED_NETWORK_PROTOCOL *This, 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 OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
); );
@ -473,7 +474,7 @@ MnpGetModeData (
@retval EFI_DEVICE_ERROR An unexpected network or system error @retval EFI_DEVICE_ERROR An unexpected network or system error
occurred. The MNP child driver instance has occurred. The MNP child driver instance has
been reset to startup defaults. 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. startup defaults.
**/ **/
@ -490,14 +491,14 @@ MnpConfigure (
The McastIpToMac() function translates an IP multicast address to a hardware The McastIpToMac() function translates an IP multicast address to a hardware
(MAC) multicast address. This function may be implemented by calling the (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. unsupported in some MNP implementations.
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance. @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. @param[in] Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address.
Set to FALSE if IpAddress is an IPv4 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) @param[in] IpAddress Pointer to the multicast IP address (in network byte
to convert. order) to convert.
@param[out] MacAddress Pointer to the resulting multicast MAC address. @param[out] MacAddress Pointer to the resulting multicast MAC address.
@retval EFI_SUCCESS The operation completed successfully. @retval EFI_SUCCESS The operation completed successfully.
@ -512,7 +513,7 @@ MnpConfigure (
@retval EFI_UNSUPPORTED The requested feature is unsupported in this @retval EFI_UNSUPPORTED The requested feature is unsupported in this
MNP implementation. MNP implementation.
@retval EFI_DEVICE_ERROR An unexpected network or system error occurred. @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 EFI_STATUS
EFIAPI EFIAPI
@ -555,7 +556,7 @@ MnpMcastIpToMac (
startup defaults. startup defaults.
@retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP
implementation. 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. 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] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] Token Pointer to a token associated with the transmit data @param[in] Token Pointer to a token associated with the transmit data
descriptor. Type EFI_MANAGED_NETWORK_COMPLETION_TOKEN is descriptor. Type EFI_MANAGED_NETWORK_COMPLETION_TOKEN
defined in "Related Definitions" below. is defined in "Related Definitions" below.
@retval EFI_SUCCESS The transmit completion token was cached. @retval EFI_SUCCESS The transmit completion token was cached.
@retval EFI_NOT_STARTED This MNP child driver instance has not been @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] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] Token Pointer to a token that has been issued by @param[in] Token Pointer to a token that has been issued by
EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or
EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If NULL, all pending EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If NULL, all
tokens are aborted. pending tokens are aborted.
@retval EFI_SUCCESS The asynchronous I/O request was aborted and @retval EFI_SUCCESS The asynchronous I/O request was aborted and
Token.Event was signaled. When Token is NULL, Token.Event was signaled. When Token is NULL,

View File

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

View File

@ -1,8 +1,7 @@
/** @file /** @file
Implementation of Managed Network Protocol public services. 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 All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 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. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/ **/
#include "MnpImpl.h" #include "MnpImpl.h"
#include <Library/BaseMemoryLib.h>
#include <Library/BaseLib.h>
/** /**
Returns the operational parameters for the current MNP child driver. May also 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 @retval EFI_NOT_STARTED This MNP child driver instance has not been
configured. The default values are returned in configured. The default values are returned in
MnpConfigData if it is not NULL. 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 EFI_STATUS
EFIAPI EFIAPI
MnpGetModeData ( MnpGetModeData (
IN EFI_MANAGED_NETWORK_PROTOCOL *This, 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 OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL
) )
{ {
@ -140,7 +136,7 @@ MnpGetModeData (
@retval EFI_DEVICE_ERROR An unexpected network or system error @retval EFI_DEVICE_ERROR An unexpected network or system error
occurred. The MNP child driver instance has occurred. The MNP child driver instance has
been reset to startup defaults. 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. startup defaults.
**/ **/
@ -193,14 +189,14 @@ ON_EXIT:
The McastIpToMac() function translates an IP multicast address to a hardware The McastIpToMac() function translates an IP multicast address to a hardware
(MAC) multicast address. This function may be implemented by calling the (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. unsupported in some MNP implementations.
@param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance. @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. @param[in] Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address.
Set to FALSE if IpAddress is an IPv4 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) @param[in] IpAddress Pointer to the multicast IP address (in network byte
to convert. order) to convert.
@param[out] MacAddress Pointer to the resulting multicast MAC address. @param[out] MacAddress Pointer to the resulting multicast MAC address.
@retval EFI_SUCCESS The operation completed successfully. @retval EFI_SUCCESS The operation completed successfully.
@ -215,7 +211,7 @@ ON_EXIT:
@retval EFI_UNSUPPORTED The requested feature is unsupported in this @retval EFI_UNSUPPORTED The requested feature is unsupported in this
MNP implementation. MNP implementation.
@retval EFI_DEVICE_ERROR An unexpected network or system error occurred. @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 EFI_STATUS
EFIAPI EFIAPI
@ -326,7 +322,7 @@ ON_EXIT:
startup defaults. startup defaults.
@retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP
implementation. 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. 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] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] Token Pointer to a token associated with the transmit data @param[in] Token Pointer to a token associated with the transmit data
descriptor. Type EFI_MANAGED_NETWORK_COMPLETION_TOKEN is descriptor. Type EFI_MANAGED_NETWORK_COMPLETION_TOKEN
defined in "Related Definitions" below. is defined in "Related Definitions" below.
@retval EFI_SUCCESS The transmit completion token was cached. @retval EFI_SUCCESS The transmit completion token was cached.
@retval EFI_NOT_STARTED This MNP child driver instance has not been @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] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
@param[in] Token Pointer to a token that has been issued by @param[in] Token Pointer to a token that has been issued by
EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or
EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If NULL, all pending EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If NULL, all
tokens are aborted. pending tokens are aborted.
@retval EFI_SUCCESS The asynchronous I/O request was aborted and @retval EFI_SUCCESS The asynchronous I/O request was aborted and
Token.Event was signaled. When Token is NULL, Token.Event was signaled. When Token is NULL,