From c6d0ee4b41589bcf5806b457bb3de596d455d4a1 Mon Sep 17 00:00:00 2001 From: jgong5 Date: Mon, 8 Dec 2008 05:09:57 +0000 Subject: [PATCH] Code scrubbing. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6916 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/Network/ArpDxe/ArpDriver.c | 150 +++++------ .../Universal/Network/ArpDxe/ArpDriver.h | 145 ++++++----- .../Universal/Network/ArpDxe/ArpImpl.c | 147 ++++++----- .../Universal/Network/ArpDxe/ArpImpl.h | 235 ++++++++++-------- .../Universal/Network/ArpDxe/ArpMain.c | 52 ++-- .../Universal/Network/ArpDxe/ComponentName.c | 28 +-- 6 files changed, 411 insertions(+), 346 deletions(-) diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c index 49352c0bb1..e946549278 100644 --- a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c +++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c @@ -1,24 +1,17 @@ /** @file - -Copyright (c) 2006 - 2008, Intel Corporation + Abstract: + +Copyright (c) 2006 - 2008, 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 +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. -Module Name: - - ArpDriver.c - -Abstract: - - **/ - #include "ArpDriver.h" #include "ArpImpl.h" @@ -35,14 +28,14 @@ EFI_DRIVER_BINDING_PROTOCOL gArpDriverBinding = { /** Create and initialize the arp service context data. - @param ImageHandle The image handle representing the loaded driver - image. - @param ControllerHandle The controller handle the driver binds to. - @param ArpService Pointer to the buffer containing the arp service - context data. + @param[in] ImageHandle The image handle representing the loaded driver + image. + @param[in] ControllerHandle The controller handle the driver binds to. + @param[in] ArpService Pointer to the buffer containing the arp service + context data. - @retval EFI_SUCCESS The arp service context is initialized. - @retval other Failed to initialize the arp service context. + @retval EFI_SUCCESS The arp service context is initialized. + @retval other Failed to initialize the arp service context. **/ EFI_STATUS @@ -193,8 +186,8 @@ ERROR_EXIT: /** Clean the arp service context data. - @param ArpService Pointer to the buffer containing the arp service - context data. + @param[in] ArpService Pointer to the buffer containing the arp service + context data. @return None. @@ -248,18 +241,23 @@ ArpCleanService ( } } - /** Test to see if this driver supports ControllerHandle. - - @param This Protocol instance pointer. - @param ControllerHandle Handle of device to test. - @param RemainingDevicePath Optional parameter use to pick a specific child - device to start. - - @retval EFI_SUCCES 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. + + 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 + 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. + + @retval EFI_SUCCES 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. **/ EFI_STATUS @@ -305,15 +303,21 @@ ArpDriverBindingSupported ( /** Start this driver on ControllerHandle. - - @param This Protocol instance pointer. - @param ControllerHandle Handle of device to bind driver to - @param RemainingDevicePath Optional parameter use to pick a specific child - device to start. - - @retval EFI_SUCCES 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 + + 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. + + @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_SUCCES 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. **/ EFI_STATUS @@ -380,15 +384,21 @@ ERROR: /** Stop this driver on ControllerHandle. - - @param This Protocol instance pointer. - @param ControllerHandle Handle of device to stop driver on - @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number - of children is zero stop the entire bus driver. - @param ChildHandleBuffer List of Child Handles to Stop. - - @retval EFI_SUCCES This driver is removed ControllerHandle - @retval other This driver was not removed from this device + + 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. + + @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_SUCCES This driver is removed ControllerHandle + @retval other This driver was not removed from this device **/ EFI_STATUS @@ -468,17 +478,17 @@ ArpDriverBindingStop ( /** Creates a child handle with a set of I/O services. - @param This Protocol instance pointer. - @param 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. + @param[in] This Protocol instance pointer. + @param[in] 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 child handle was created with the I/O - services. - @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 child handle was created with the I/O + services. + @retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create + the child. + @retval other The child handle was not created. **/ EFI_STATUS @@ -592,17 +602,17 @@ ERROR: /** Destroys a child handle with a set of I/O services. - @param This Protocol instance pointer. - @param ChildHandle Handle of the child to destroy. + @param[in] This Protocol instance pointer. + @param[in] ChildHandle Handle of the child to destroy. - @retval EFI_SUCCES The I/O services were removed from the child - handle. - @retval EFI_UNSUPPORTED The child handle does not support the I/O services - that are being removed. - @retval EFI_INVALID_PARAMETER Child handle is not a valid EFI Handle. - @retval EFI_ACCESS_DENIED The child handle could not be destroyed because - its I/O services are being used. - @retval other The child handle was not destroyed. + @retval EFI_SUCCES The I/O services were removed from the child + handle. + @retval EFI_UNSUPPORTED The child handle does not support the I/O services + that are being removed. + @retval EFI_INVALID_PARAMETER Child handle is not a valid EFI Handle. + @retval EFI_ACCESS_DENIED The child handle could not be destroyed because + its I/O services are being used. + @retval other The child handle was not destroyed. **/ EFI_STATUS @@ -708,8 +718,8 @@ ArpServiceBindingDestroyChild ( The entry point for Arp driver which installs the driver binding and component name protocol on its ImageHandle. - @param ImageHandle The image handle of the driver. - @param SystemTable The system table. + @param[in] ImageHandle The image handle of the driver. + @param[in] SystemTable The system table. @retval EFI_SUCCES if the driver binding and component name protocols are successfully @retval Others Failed to install the protocols. diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.h b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.h index 73b7f08042..cace02ee90 100644 --- a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.h +++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.h @@ -1,21 +1,15 @@ /** @file - -Copyright (c) 2006 - 2008, Intel Corporation + Abstract: + +Copyright (c) 2006 - 2008, 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 +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. -Module Name: - - ArpDriver.c - -Abstract: - - **/ #ifndef _ARP_DRIVER_H_ @@ -41,17 +35,26 @@ extern EFI_DRIVER_BINDING_PROTOCOL gArpDriverBinding; extern EFI_COMPONENT_NAME_PROTOCOL gArpComponentName; extern EFI_COMPONENT_NAME2_PROTOCOL gArpComponentName2; +// +// Function prototypes for the Drivr Binding Protocol +// /** Test to see if this driver supports ControllerHandle. - - @param This Protocol instance pointer. - @param ControllerHandle Handle of device to test. - @param RemainingDevicePath Optional parameter use to pick a specific child - device to start. - - @retval EFI_SUCCES 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. + + 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 + 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. + + @retval EFI_SUCCES 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. **/ EFI_STATUS @@ -64,15 +67,21 @@ ArpDriverBindingSupported ( /** Start this driver on ControllerHandle. - - @param This Protocol instance pointer. - @param ControllerHandle Handle of device to bind driver to - @param RemainingDevicePath Optional parameter use to pick a specific child - device to start. - - @retval EFI_SUCCES 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 + + 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. + + @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_SUCCES 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. **/ EFI_STATUS @@ -85,15 +94,21 @@ ArpDriverBindingStart ( /** Stop this driver on ControllerHandle. - - @param This Protocol instance pointer. - @param ControllerHandle Handle of device to stop driver on - @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number - of children is zero stop the entire bus driver. - @param ChildHandleBuffer List of Child Handles to Stop. - - @retval EFI_SUCCES This driver is removed ControllerHandle - @retval other This driver was not removed from this device + + 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. + + @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_SUCCES This driver is removed ControllerHandle + @retval other This driver was not removed from this device **/ EFI_STATUS @@ -108,17 +123,17 @@ ArpDriverBindingStop ( /** Creates a child handle with a set of I/O services. - @param This Protocol instance pointer. - @param 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. + @param[in] This Protocol instance pointer. + @param[in] 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 child handle was created with the I/O - services. - @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 child handle was created with the I/O + services. + @retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create + the child. + @retval other The child handle was not created. **/ EFI_STATUS @@ -131,17 +146,17 @@ ArpServiceBindingCreateChild ( /** Destroys a child handle with a set of I/O services. - @param This Protocol instance pointer. - @param ChildHandle Handle of the child to destroy. + @param[in] This Protocol instance pointer. + @param[in] ChildHandle Handle of the child to destroy. - @retval EFI_SUCCES The I/O services were removed from the child - handle. - @retval EFI_UNSUPPORTED The child handle does not support the I/O services - that are being removed. - @retval EFI_INVALID_PARAMETER Child handle is not a valid EFI Handle. - @retval EFI_ACCESS_DENIED The child handle could not be destroyed because - its I/O services are being used. - @retval other The child handle was not destroyed. + @retval EFI_SUCCES The I/O services were removed from the child + handle. + @retval EFI_UNSUPPORTED The child handle does not support the I/O services + that are being removed. + @retval EFI_INVALID_PARAMETER Child handle is not a valid EFI Handle. + @retval EFI_ACCESS_DENIED The child handle could not be destroyed because + its I/O services are being used. + @retval other The child handle was not destroyed. **/ EFI_STATUS @@ -165,10 +180,10 @@ ArpServiceBindingDestroyChild ( by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned. - @param This[in] 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 Language[in] 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 @@ -177,7 +192,7 @@ ArpServiceBindingDestroyChild ( to the driver writer. Language is specified in RFC 3066 or ISO 639-2 language code format. - @param DriverName[out] A pointer to the Unicode string to return. + @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. @@ -216,15 +231,15 @@ ArpComponentNameGetDriverName ( 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 This[in] 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 ControllerHandle[in] 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 ChildHandle[in] 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 @@ -233,7 +248,7 @@ ArpComponentNameGetDriverName ( driver that wishes to retrieve the name of a child controller. - @param Language[in] 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 @@ -242,7 +257,7 @@ ArpComponentNameGetDriverName ( to the driver writer. Language is specified in RFC 3066 or ISO 639-2 language code format. - @param ControllerName[out] A pointer to the Unicode string to return. + @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 diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c b/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c index e29fbf872c..79346db178 100644 --- a/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c +++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c @@ -1,24 +1,17 @@ /** @file - -Copyright (c) 2006 - 2008, Intel Corporation + Abstract: + +Copyright (c) 2006 - 2008, 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 +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. -Module Name: - - ArpImpl.c - -Abstract: - - **/ - #include "ArpImpl.h" EFI_ARP_PROTOCOL mEfiArpProtocolTemplate = { @@ -35,9 +28,9 @@ EFI_ARP_PROTOCOL mEfiArpProtocolTemplate = { /** Initialize the instance context data. - @param ArpService Pointer to the arp service context data this - instance belongs to. - @param Instance Pointer to the instance context data. + @param[in] ArpService Pointer to the arp service context data this + instance belongs to. + @param[in] Instance Pointer to the instance context data. @return None. @@ -65,7 +58,7 @@ ArpInitInstance ( /** Process the Arp packets received from Mnp, the procedure conforms to RFC826. - @param Context Pointer to the context data registerd to the + @param[in] Context Pointer to the context data registerd to the Event. @return None. @@ -312,9 +305,9 @@ RESTART_RECEIVE: /** Queue ArpOnFrameRcvdDpc as a DPC at TPL_CALLBACK. - @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. @return None. @@ -334,9 +327,9 @@ ArpOnFrameRcvd ( /** Process the already sent arp packets. - - @param Context Pointer to the context data registerd to the - Event. + + @param[in] Context Pointer to the context data registerd to the + Event. @return None. @@ -373,9 +366,9 @@ ArpOnFrameSentDpc ( /** Request ArpOnFrameSentDpc as a DPC at TPL_CALLBACK. - @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. @return None. @@ -397,9 +390,9 @@ ArpOnFrameSent ( /** Process the arp cache olding and drive the retrying arp requests. - @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. @return None. @@ -525,8 +518,8 @@ ArpTimerHandler ( /** Match the two NET_ARP_ADDRESSes. - @param AddressOne Pointer to the first address to match. - @param AddressTwo Pointer to the second address to match. + @param[in] AddressOne Pointer to the first address to match. + @param[in] AddressTwo Pointer to the second address to match. @return The two addresses match or not. @@ -564,12 +557,12 @@ ArpMatchAddress ( /** Find the CacheEntry which matches the requirements in the specified CacheTable. - @param CacheTable Pointer to the arp cache table. - @param StartEntry Pointer to the start entry this search begins with - in the cache table. - @param FindOpType The search type. - @param ProtocolAddress Pointer to the protocol address to match. - @param HardwareAddress Pointer to the hardware address to match. + @param[in] CacheTable Pointer to the arp cache table. + @param[in] StartEntry Pointer to the start entry this search begins with + in the cache table. + @param[in] FindOpType The search type. + @param[in] ProtocolAddress Pointer to the protocol address to match. + @param[in] HardwareAddress Pointer to the hardware address to match. @return Pointer to the matched arp cache entry, if NULL, no match is found. @@ -637,9 +630,9 @@ ArpFindNextCacheEntryInTable ( Find the CacheEntry, using ProtocolAddress or HardwareAddress or both, as the keyword, in the DeniedCacheTable. - @param ArpService Pointer to the arp service context data. - @param ProtocolAddress Pointer to the protocol address. - @param HardwareAddress Pointer to the hardware address. + @param[in] ArpService Pointer to the arp service context data. + @param[in] ProtocolAddress Pointer to the protocol address. + @param[in] HardwareAddress Pointer to the hardware address. @return Pointer to the matched cache entry, if NULL no match is found. @@ -697,7 +690,7 @@ ArpFindDeniedCacheEntry ( /** Allocate a cache entry and initialize it. - @param Instance Pointer to the instance context data. + @param[in] Instance Pointer to the instance context data. @return Pointer to the new created cache entry. @@ -764,9 +757,9 @@ ArpAllocCacheEntry ( /** Turn the CacheEntry into the resolved status. - @param CacheEntry Pointer to the resolved cache entry. - @param Instance Pointer to the instance context data. - @param UserEvent Pointer to the UserEvent to notify. + @param[in] CacheEntry Pointer to the resolved cache entry. + @param[in] Instance Pointer to the instance context data. + @param[in] UserEvent Pointer to the UserEvent to notify. @return The count of notifications sent to the instance. @@ -826,9 +819,9 @@ ArpAddressResolved ( Fill the addresses in the CacheEntry using the information passed in by HwAddr and SwAddr. - @param CacheEntry Pointer to the cache entry. - @param HwAddr Pointer to the software address. - @param SwAddr Pointer to the hardware address. + @param[in] CacheEntry Pointer to the cache entry. + @param[in] HwAddr Pointer to the software address. + @param[in] SwAddr Pointer to the hardware address. @return None. @@ -880,9 +873,9 @@ ArpFillAddressInCacheEntry ( /** Configure the instance using the ConfigData. ConfigData is already validated. - @param Instance Pointer to the instance context data to be + @param[in] Instance Pointer to the instance context data to be configured. - @param ConfigData Pointer to the configuration data used to + @param[in] ConfigData Pointer to the configuration data used to configure the instance. @retval EFI_SUCCESS The instance is configured with the ConfigData. @@ -1005,11 +998,11 @@ ArpConfigureInstance ( /** Send out an arp frame using the CachEntry and the ArpOpCode. - @param Instance Pointer to the instance context data. - @param CacheEntry Pointer to the configuration data used to - configure the instance. - @param ArpOpCode The opcode used to send out this Arp frame, either - request or reply. + @param[in] Instance Pointer to the instance context data. + @param[in] CacheEntry Pointer to the configuration data used to + configure the instance. + @param[in] ArpOpCode The opcode used to send out this Arp frame, either + request or reply. @return None. @@ -1212,13 +1205,13 @@ CLEAN_EXIT: SwAddressType, AddressBuffer combination as the matching key, if Force is TRUE, the cache is deleted event it's a static entry. - @param CacheTable Pointer to the cache table to do the deletion. - @param BySwAddress Delete the cache entry by software address or by - hardware address. - @param SwAddressType The software address used to do the deletion. - @param AddressBuffer Pointer to the buffer containing the address to - match for the deletion. - @param Force This deletion is forced or not. + @param[in] CacheTable Pointer to the cache table to do the deletion. + @param[in] BySwAddress Delete the cache entry by software address or by + hardware address. + @param[in] SwAddressType The software address used to do the deletion. + @param[in] AddressBuffer Pointer to the buffer containing the address to + match for the deletion. + @param[in] Force This deletion is forced or not. @return The count of the deleted cache entries. @@ -1301,12 +1294,12 @@ MATCHED: /** Delete cache entries in all the cache tables. - @param Instance Pointer to the instance context data. - @param BySwAddress Delete the cache entry by software address or by - hardware address. - @param AddressBuffer Pointer to the buffer containing the address to - match for the deletion. - @param Force This deletion is forced or not. + @param[in] Instance Pointer to the instance context data. + @param[in] BySwAddress Delete the cache entry by software address or by + hardware address. + @param[in] AddressBuffer Pointer to the buffer containing the address to + match for the deletion. + @param[in] Force This deletion is forced or not. @return The count of the deleted cache entries. @@ -1355,11 +1348,11 @@ ArpDeleteCacheEntry ( /** Cancel the arp request. - @param Instance Pointer to the instance context data. - @param TargetSwAddress Pointer to the buffer containing the target - software address to match the arp request. - @param UserEvent The user event used to notify this request - cancellation. + @param[in] Instance Pointer to the instance context data. + @param[in] TargetSwAddress Pointer to the buffer containing the target + software address to match the arp request. + @param[in] UserEvent The user event used to notify this request + cancellation. @return The count of the cancelled requests. @@ -1414,18 +1407,18 @@ ArpCancelRequest ( /** Find the cache entry in the cache table. - @param Instance Pointer to the instance context data. - @param BySwAddress Set to TRUE to look for matching software protocol + @param[in] Instance Pointer to the instance context data. + @param[in] BySwAddress Set to TRUE to look for matching software protocol addresses. Set to FALSE to look for matching hardware protocol addresses. - @param AddressBuffer Pointer to address buffer. Set to NULL to match + @param[in] AddressBuffer Pointer to address buffer. Set to NULL to match all addresses. - @param EntryLength The size of an entry in the entries buffer. - @param EntryCount The number of ARP cache entries that are found by + @param[out] EntryLength The size of an entry in the entries buffer. + @param[out] EntryCount The number of ARP cache entries that are found by the specified criteria. - @param Entries Pointer to the buffer that will receive the ARP + @param[out] Entries Pointer to the buffer that will receive the ARP cache entries. - @param Refresh Set to TRUE to refresh the timeout value of the + @param[in] Refresh Set to TRUE to refresh the timeout value of the matching ARP cache entry. @retval EFI_SUCCESS The requested ARP cache entries are copied into diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.h b/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.h index 935d788280..db889d4672 100644 --- a/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.h +++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.h @@ -1,21 +1,15 @@ /** @file + Abstract: -Copyright (c) 2006 - 2008, Intel Corporation +Copyright (c) 2006 - 2008, 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 +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. -Module Name: - - ArpImpl.h - -Abstract: - - **/ #ifndef _ARP_IMPL_H_ @@ -51,7 +45,7 @@ Abstract: #define ARP_PERIODIC_TIMER_INTERVAL (500 * TICKS_PER_MS) #pragma pack(1) -typedef struct _ARP_HEAD { +typedef struct { UINT16 HwType; UINT16 ProtoType; UINT8 HwAddrLen; @@ -60,7 +54,7 @@ typedef struct _ARP_HEAD { } ARP_HEAD; #pragma pack() -typedef struct _ARP_ADDRESS { +typedef struct { UINT8 *SenderHwAddr; UINT8 *SenderProtoAddr; UINT8 *TargetHwAddr; @@ -79,6 +73,9 @@ typedef enum { #define ARP_INSTANCE_DATA_SIGNATURE EFI_SIGNATURE_32('A', 'R', 'P', 'I') +// +//comment for macro +// #define ARP_INSTANCE_DATA_FROM_THIS(a) \ CR ( \ (a), \ @@ -89,7 +86,7 @@ typedef enum { typedef struct _ARP_SERVICE_DATA ARP_SERVICE_DATA; -typedef struct _ARP_INSTANCE_DATA { +typedef struct { UINT32 Signature; ARP_SERVICE_DATA *ArpService; EFI_HANDLE Handle; @@ -102,6 +99,9 @@ typedef struct _ARP_INSTANCE_DATA { #define ARP_SERVICE_DATA_SIGNATURE EFI_SIGNATURE_32('A', 'R', 'P', 'S') +// +//comment for macro +// #define ARP_SERVICE_DATA_FROM_THIS(a) \ CR ( \ (a), \ @@ -134,7 +134,7 @@ struct _ARP_SERVICE_DATA { EFI_EVENT PeriodicTimer; }; -typedef struct _USER_REQUEST_CONTEXT { +typedef struct { LIST_ENTRY List; ARP_INSTANCE_DATA *Instance; EFI_EVENT UserRequestEvent; @@ -144,7 +144,7 @@ typedef struct _USER_REQUEST_CONTEXT { #define ARP_MAX_PROTOCOL_ADDRESS_LEN sizeof(EFI_IP_ADDRESS) #define ARP_MAX_HARDWARE_ADDRESS_LEN sizeof(EFI_MAC_ADDRESS) -typedef struct _NET_ARP_ADDRESS { +typedef struct { UINT16 Type; UINT8 Length; UINT8 *AddressPtr; @@ -159,7 +159,7 @@ typedef enum { Protocol } ARP_ADDRESS_TYPE; -typedef struct _ARP_CACHE_ENTRY { +typedef struct { LIST_ENTRY List; UINT32 RetryCount; @@ -174,11 +174,17 @@ typedef struct _ARP_CACHE_ENTRY { /** This function is used to assign a station address to the ARP cache for this instance - of the ARP driver. A call to this function with the ConfigData field set to NULL - will reset this ARP instance. - - @param This Pointer to the EFI_ARP_PROTOCOL instance. - @param ConfigData Pointer to the EFI_ARP_CONFIG_DATA structure. + of the ARP driver. Each ARP instance has one station address. The EFI_ARP_PROTOCOL + driver will respond to ARP requests that match this registered station address. + A call to this function with the ConfigData field set to NULL will reset this + ARP instance. + + Once a protocol type and station address have been assigned to this ARP instance, + all the following ARP functions will use this information. Attempting to change + the protocol type or station address to a configured ARP instance will result in errors. + + @param[in] This Pointer to the EFI_ARP_PROTOCOL instance. + @param[in] ConfigData Pointer to the EFI_ARP_CONFIG_DATA structure. @retval EFI_SUCCESS The new station address was successfully registered. @@ -203,19 +209,30 @@ ArpConfigure ( /** This function is used to insert entries into the ARP cache. - @param This Pointer to the EFI_ARP_PROTOCOL instance. - @param DenyFlag Set to TRUE if this entry is a deny entry. Set to + ARP cache entries are typically inserted and updated by network protocol drivers + as network traffic is processed. Most ARP cache entries will time out and be + deleted if the network traffic stops. ARP cache entries that were inserted + by the Add() function may be static (will not time out) or dynamic (will time out). + Default ARP cache timeout values are not covered in most network protocol + specifications (although RFC 1122 comes pretty close) and will only be + discussed in general in this specification. The timeout values that are + used in the EFI Sample Implementation should be used only as a guideline. + Final product implementations of the EFI network stack should be tuned for + their expected network environments. + + @param[in] This Pointer to the EFI_ARP_PROTOCOL instance. + @param[in] DenyFlag Set to TRUE if this entry is a deny entry. Set to FALSE if this entry is a normal entry. - @param TargetSwAddress Pointer to a protocol address to add (or deny). + @param[in] TargetSwAddress Pointer to a protocol address to add (or deny). May be set to NULL if DenyFlag is TRUE. - @param TargetHwAddress Pointer to a hardware address to add (or deny). + @param[in] TargetHwAddress Pointer to a hardware address to add (or deny). May be set to NULL if DenyFlag is TRUE. - @param TimeoutValue Time in 100-ns units that this entry will remain + @param[in] TimeoutValue Time in 100-ns units that this entry will remain in the ARP cache. A value of zero means that the entry is permanent. A nonzero value will override the one given by Configure() if the entry to be added is a dynamic entry. - @param Overwrite If TRUE, the matching cache entry will be + @param[in] Overwrite If TRUE, the matching cache entry will be overwritten with the supplied parameters. If FALSE, EFI_ACCESS_DENIED is returned if the corresponding cache entry already exists. @@ -248,19 +265,26 @@ ArpAdd ( /** This function searches the ARP cache for matching entries and allocates a buffer into which those entries are copied. - - @param This Pointer to the EFI_ARP_PROTOCOL instance. - @param BySwAddress Set to TRUE to look for matching software protocol + + The first part of the allocated buffer is EFI_ARP_FIND_DATA, following which + are protocol address pairs and hardware address pairs. + When finding a specific protocol address (BySwAddress is TRUE and AddressBuffer + is not NULL), the ARP cache timeout for the found entry is reset if Refresh is + set to TRUE. If the found ARP cache entry is a permanent entry, it is not + affected by Refresh. + + @param[in] This Pointer to the EFI_ARP_PROTOCOL instance. + @param[in] BySwAddress Set to TRUE to look for matching software protocol addresses. Set to FALSE to look for matching hardware protocol addresses. - @param AddressBuffer Pointer to address buffer. Set to NULL to match + @param[in] AddressBuffer Pointer to address buffer. Set to NULL to match all addresses. - @param EntryLength The size of an entry in the entries buffer. - @param EntryCount The number of ARP cache entries that are found by + @param[out] EntryLength The size of an entry in the entries buffer. + @param[out] EntryCount The number of ARP cache entries that are found by the specified criteria. - @param Entries Pointer to the buffer that will receive the ARP + @param[out] Entries Pointer to the buffer that will receive the ARP cache entries. - @param Refresh Set to TRUE to refresh the timeout value of the + @param[in] Refresh Set to TRUE to refresh the timeout value of the matching ARP cache entry. @retval EFI_SUCCESS The requested ARP cache entries were copied into @@ -287,11 +311,11 @@ ArpFind ( /** This function removes specified ARP cache entries. - @param This Pointer to the EFI_ARP_PROTOCOL instance. - @param BySwAddress Set to TRUE to delete matching protocol addresses. + @param[in] This Pointer to the EFI_ARP_PROTOCOL instance. + @param[in] BySwAddress Set to TRUE to delete matching protocol addresses. Set to FALSE to delete matching hardware addresses. - @param AddressBuffer Pointer to the address buffer that is used as a + @param[in] AddressBuffer Pointer to the address buffer that is used as a key to look for the cache entry. Set to NULL to delete all entries. @@ -313,7 +337,7 @@ ArpDelete ( This function delete all dynamic entries from the ARP cache that match the specified software protocol type. - @param This Pointer to the EFI_ARP_PROTOCOL instance. + @param[in] This Pointer to the EFI_ARP_PROTOCOL instance. @retval EFI_SUCCESS The cache has been flushed. @retval EFI_INVALID_PARAMETER This is NULL. @@ -331,11 +355,11 @@ ArpFlush ( This function tries to resolve the TargetSwAddress and optionally returns a TargetHwAddress if it already exists in the ARP cache. - @param This Pointer to the EFI_ARP_PROTOCOL instance. - @param TargetSwAddress Pointer to the protocol address to resolve. - @param ResolvedEvent Pointer to the event that will be signaled when + @param[in] This Pointer to the EFI_ARP_PROTOCOL instance. + @param[in] TargetSwAddress Pointer to the protocol address to resolve. + @param[in] ResolvedEvent Pointer to the event that will be signaled when the address is resolved or some error occurs. - @param TargetHwAddress Pointer to the buffer for the resolved hardware + @param[out] TargetHwAddress Pointer to the buffer for the resolved hardware address in network byte order. @retval EFI_SUCCESS The data is copied from the ARP cache into the @@ -361,11 +385,17 @@ ArpRequest ( /** This function aborts the previous ARP request (identified by This, TargetSwAddress and ResolvedEvent) that is issued by EFI_ARP_PROTOCOL.Request(). - - @param This Pointer to the EFI_ARP_PROTOCOL instance. - @param TargetSwAddress Pointer to the protocol address in previous + + If the request is in the internal ARP request queue, the request is aborted + immediately and its ResolvedEvent is signaled. Only an asynchronous address + request needs to be canceled. If TargeSwAddress and ResolveEvent are both + NULL, all the pending asynchronous requests that have been issued by This + instance will be cancelled and their corresponding events will be signaled. + + @param[in] This Pointer to the EFI_ARP_PROTOCOL instance. + @param[in] TargetSwAddress Pointer to the protocol address in previous request session. - @param ResolvedEvent Pointer to the event that is used as the + @param[in] ResolvedEvent Pointer to the event that is used as the notification event in previous request session. @retval EFI_SUCCESS The pending request session(s) is/are aborted and @@ -390,9 +420,9 @@ ArpCancel ( /** Configure the instance using the ConfigData. ConfigData is already validated. - @param Instance Pointer to the instance context data to be + @param[in] Instance Pointer to the instance context data to be configured. - @param ConfigData Pointer to the configuration data used to + @param[in] ConfigData Pointer to the configuration data used to configure the instance. @retval EFI_SUCCESS The instance is configured with the ConfigData. @@ -415,9 +445,9 @@ ArpConfigureInstance ( Find the CacheEntry, using ProtocolAddress or HardwareAddress or both, as the keyword, in the DeniedCacheTable. - @param ArpService Pointer to the arp service context data. - @param ProtocolAddress Pointer to the protocol address. - @param HardwareAddress Pointer to the hardware address. + @param[in] ArpService Pointer to the arp service context data. + @param[in] ProtocolAddress Pointer to the protocol address. + @param[in] HardwareAddress Pointer to the hardware address. @return Pointer to the matched cache entry, if NULL no match is found. @@ -432,12 +462,12 @@ ArpFindDeniedCacheEntry ( /** Find the CacheEntry which matches the requirements in the specified CacheTable. - @param CacheTable Pointer to the arp cache table. - @param StartEntry Pointer to the start entry this search begins with - in the cache table. - @param FindOpType The search type. - @param ProtocolAddress Pointer to the protocol address to match. - @param HardwareAddress Pointer to the hardware address to match. + @param[in] CacheTable Pointer to the arp cache table. + @param[in] StartEntry Pointer to the start entry this search begins with + in the cache table. + @param[in] FindOpType The search type. + @param[in] ProtocolAddress Pointer to the protocol address to match. + @param[in] HardwareAddress Pointer to the hardware address to match. @return Pointer to the matched arp cache entry, if NULL, no match is found. @@ -454,7 +484,7 @@ ArpFindNextCacheEntryInTable ( /** Allocate a cache entry and initialize it. - @param Instance Pointer to the instance context data. + @param[in] Instance Pointer to the instance context data. @return Pointer to the new created cache entry. @@ -468,9 +498,9 @@ ArpAllocCacheEntry ( Fill the addresses in the CacheEntry using the information passed in by HwAddr and SwAddr. - @param CacheEntry Pointer to the cache entry. - @param HwAddr Pointer to the software address. - @param SwAddr Pointer to the hardware address. + @param[in] CacheEntry Pointer to the cache entry. + @param[in] HwAddr Pointer to the software address. + @param[in] SwAddr Pointer to the hardware address. @return None. @@ -485,9 +515,9 @@ ArpFillAddressInCacheEntry ( /** Turn the CacheEntry into the resolved status. - @param CacheEntry Pointer to the resolved cache entry. - @param Instance Pointer to the instance context data. - @param UserEvent Pointer to the UserEvent to notify. + @param[in] CacheEntry Pointer to the resolved cache entry. + @param[in] Instance Pointer to the instance context data. + @param[in] UserEvent Pointer to the UserEvent to notify. @return The count of notifications sent to the instance. @@ -502,12 +532,12 @@ ArpAddressResolved ( /** Delete cache entries in all the cache tables. - @param Instance Pointer to the instance context data. - @param BySwAddress Delete the cache entry by software address or by - hardware address. - @param AddressBuffer Pointer to the buffer containing the address to - match for the deletion. - @param Force This deletion is forced or not. + @param[in] Instance Pointer to the instance context data. + @param[in] BySwAddress Delete the cache entry by software address or by + hardware address. + @param[in] AddressBuffer Pointer to the buffer containing the address to + match for the deletion. + @param[in] Force This deletion is forced or not. @return The count of the deleted cache entries. @@ -523,11 +553,11 @@ ArpDeleteCacheEntry ( /** Send out an arp frame using the CachEntry and the ArpOpCode. - @param Instance Pointer to the instance context data. - @param CacheEntry Pointer to the configuration data used to - configure the instance. - @param ArpOpCode The opcode used to send out this Arp frame, either - request or reply. + @param[in] Instance Pointer to the instance context data. + @param[in] CacheEntry Pointer to the configuration data used to + configure the instance. + @param[in] ArpOpCode The opcode used to send out this Arp frame, either + request or reply. @return None. @@ -542,9 +572,9 @@ ArpSendFrame ( /** Initialize the instance context data. - @param ArpService Pointer to the arp service context data this - instance belongs to. - @param Instance Pointer to the instance context data. + @param[in] ArpService Pointer to the arp service context data this + instance belongs to. + @param[in] Instance Pointer to the instance context data. @return None. @@ -558,7 +588,7 @@ ArpInitInstance ( /** Process the Arp packets received from Mnp, the procedure conforms to RFC826. - @param Context Pointer to the context data registerd to the + @param[in] Context Pointer to the context data registerd to the Event. @return None. @@ -573,9 +603,9 @@ ArpOnFrameRcvdDpc ( /** Queue ArpOnFrameRcvdDpc as a DPC at TPL_CALLBACK. - @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. @return None. @@ -590,8 +620,8 @@ ArpOnFrameRcvd ( /** Process the already sent arp packets. - @param Context Pointer to the context data registerd to the - Event. + @param[in] Context Pointer to the context data registerd to the + Event. @return None. @@ -605,9 +635,9 @@ ArpOnFrameSentDpc ( /** Queue ArpOnFrameRcvdDpc as a DPC at TPL_CALLBACK. - @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. @return None. @@ -622,9 +652,9 @@ ArpOnFrameSent ( /** Process the arp cache olding and drive the retrying arp requests. - @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. @return None. @@ -639,11 +669,11 @@ ArpTimerHandler ( /** Cancel the arp request. - @param Instance Pointer to the instance context data. - @param TargetSwAddress Pointer to the buffer containing the target - software address to match the arp request. - @param UserEvent The user event used to notify this request - cancellation. + @param[in] Instance Pointer to the instance context data. + @param[in] TargetSwAddress Pointer to the buffer containing the target + software address to match the arp request. + @param[in] UserEvent The user event used to notify this request + cancellation. @return The count of the cancelled requests. @@ -658,18 +688,18 @@ ArpCancelRequest ( /** Find the cache entry in the cache table. - @param Instance Pointer to the instance context data. - @param BySwAddress Set to TRUE to look for matching software protocol + @param[in] Instance Pointer to the instance context data. + @param[in] BySwAddress Set to TRUE to look for matching software protocol addresses. Set to FALSE to look for matching hardware protocol addresses. - @param AddressBuffer Pointer to address buffer. Set to NULL to match + @param[in] AddressBuffer Pointer to address buffer. Set to NULL to match all addresses. - @param EntryLength The size of an entry in the entries buffer. - @param EntryCount The number of ARP cache entries that are found by + @param[out] EntryLength The size of an entry in the entries buffer. + @param[out] EntryCount The number of ARP cache entries that are found by the specified criteria. - @param Entries Pointer to the buffer that will receive the ARP + @param[out] Entries Pointer to the buffer that will receive the ARP cache entries. - @param Refresh Set to TRUE to refresh the timeout value of the + @param[in] Refresh Set to TRUE to refresh the timeout value of the matching ARP cache entry. @retval EFI_SUCCESS The requested ARP cache entries are copied into @@ -690,4 +720,3 @@ ArpFindCacheEntry ( ); #endif - diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpMain.c b/MdeModulePkg/Universal/Network/ArpDxe/ArpMain.c index 2d607fbf02..02fdf0be24 100644 --- a/MdeModulePkg/Universal/Network/ArpDxe/ArpMain.c +++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpMain.c @@ -1,21 +1,15 @@ /** @file - -Copyright (c) 2006, Intel Corporation + Abstract: + +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 +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. -Module Name: - - ArpMain.c - -Abstract: - - **/ #include "ArpImpl.h" @@ -23,8 +17,14 @@ Abstract: /** This function is used to assign a station address to the ARP cache for this instance - of the ARP driver. A call to this function with the ConfigData field set to NULL - will reset this ARP instance. + of the ARP driver. Each ARP instance has one station address. The EFI_ARP_PROTOCOL + driver will respond to ARP requests that match this registered station address. + A call to this function with the ConfigData field set to NULL will reset this + ARP instance. + + Once a protocol type and station address have been assigned to this ARP instance, + all the following ARP functions will use this information. Attempting to change + the protocol type or station address to a configured ARP instance will result in errors. @param This Pointer to the EFI_ARP_PROTOCOL instance. @param ConfigData Pointer to the EFI_ARP_CONFIG_DATA structure. @@ -82,6 +82,17 @@ ArpConfigure ( /** This function is used to insert entries into the ARP cache. + ARP cache entries are typically inserted and updated by network protocol drivers + as network traffic is processed. Most ARP cache entries will time out and be + deleted if the network traffic stops. ARP cache entries that were inserted + by the Add() function may be static (will not time out) or dynamic (will time out). + Default ARP cache timeout values are not covered in most network protocol + specifications (although RFC 1122 comes pretty close) and will only be + discussed in general in this specification. The timeout values that are + used in the EFI Sample Implementation should be used only as a guideline. + Final product implementations of the EFI network stack should be tuned for + their expected network environments. + @param This Pointer to the EFI_ARP_PROTOCOL instance. @param DenyFlag Set to TRUE if this entry is a deny entry. Set to FALSE if this entry is a normal entry. @@ -269,7 +280,14 @@ UNLOCK_EXIT: /** This function searches the ARP cache for matching entries and allocates a buffer into which those entries are copied. - + + The first part of the allocated buffer is EFI_ARP_FIND_DATA, following which + are protocol address pairs and hardware address pairs. + When finding a specific protocol address (BySwAddress is TRUE and AddressBuffer + is not NULL), the ARP cache timeout for the found entry is reset if Refresh is + set to TRUE. If the found ARP cache entry is a permanent entry, it is not + affected by Refresh. + @param This Pointer to the EFI_ARP_PROTOCOL instance. @param BySwAddress Set to TRUE to look for matching software protocol addresses. Set to FALSE to look for matching @@ -659,7 +677,13 @@ SIGNAL_USER: /** This function aborts the previous ARP request (identified by This, TargetSwAddress and ResolvedEvent) that is issued by EFI_ARP_PROTOCOL.Request(). - + + If the request is in the internal ARP request queue, the request is aborted + immediately and its ResolvedEvent is signaled. Only an asynchronous address + request needs to be canceled. If TargeSwAddress and ResolveEvent are both + NULL, all the pending asynchronous requests that have been issued by This + instance will be cancelled and their corresponding events will be signaled. + @param This Pointer to the EFI_ARP_PROTOCOL instance. @param TargetSwAddress Pointer to the protocol address in previous request session. diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ComponentName.c b/MdeModulePkg/Universal/Network/ArpDxe/ComponentName.c index 97bab4ed8b..90ab11a1df 100644 --- a/MdeModulePkg/Universal/Network/ArpDxe/ComponentName.c +++ b/MdeModulePkg/Universal/Network/ArpDxe/ComponentName.c @@ -1,21 +1,15 @@ /** @file + UEFI Component Name(2) protocol implementation for ArpDxe driver. -Copyright (c) 2006 - 2007, Intel Corporation +Copyright (c) 2006 - 2007, 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 +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. -Module Name: - - ComponentName.c - -Abstract: - - **/ #include "ArpDriver.h" @@ -55,10 +49,10 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mArpDriverNameTable[] = { by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned. - @param This[in] 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 Language[in] 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 @@ -67,7 +61,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mArpDriverNameTable[] = { to the driver writer. Language is specified in RFC 3066 or ISO 639-2 language code format. - @param DriverName[out] A pointer to the Unicode string to return. + @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. @@ -114,15 +108,15 @@ ArpComponentNameGetDriverName ( 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 This[in] 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 ControllerHandle[in] 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 ChildHandle[in] 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 @@ -131,7 +125,7 @@ ArpComponentNameGetDriverName ( driver that wishes to retrieve the name of a child controller. - @param Language[in] 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 @@ -140,7 +134,7 @@ ArpComponentNameGetDriverName ( to the driver writer. Language is specified in RFC 3066 or ISO 639-2 language code format. - @param ControllerName[out] A pointer to the Unicode string to return. + @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 -- 2.39.2