]> git.proxmox.com Git - mirror_edk2.git/commitdiff
code scrub ArpDxe
authorjgong5 <jgong5@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 24 Dec 2008 05:26:57 +0000 (05:26 +0000)
committerjgong5 <jgong5@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 24 Dec 2008 05:26:57 +0000 (05:26 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7113 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c
MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.h
MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.c
MdeModulePkg/Universal/Network/ArpDxe/ArpImpl.h
MdeModulePkg/Universal/Network/ArpDxe/ArpMain.c
MdePkg/Include/Protocol/Arp.h

index e946549278051a58871859412fc9cacb27f3b9f8..63c7639adadb0fc22995175dd0833e4b6884df3b 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  Abstract:\r
+  ARP driver functions.\r
   \r
 Copyright (c) 2006 - 2008, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
@@ -28,13 +28,16 @@ EFI_DRIVER_BINDING_PROTOCOL gArpDriverBinding = {
 /**\r
   Create and initialize the arp service context data.\r
 \r
-  @param[in]  ImageHandle            The image handle representing the loaded driver\r
+  @param[in]       ImageHandle       The image handle representing the loaded driver\r
                                      image.\r
-  @param[in]  ControllerHandle       The controller handle the driver binds to.\r
-  @param[in]  ArpService             Pointer to the buffer containing the arp service\r
+  @param[in]       ControllerHandle  The controller handle the driver binds to.\r
+  @param[in, out]  ArpService        Pointer to the buffer containing the arp service\r
                                      context data.\r
 \r
   @retval EFI_SUCCESS                The arp service context is initialized.\r
+  \r
+  @retval EFI_UNSUPPORTED            The underlayer Snp mode type is not ethernet.\r
+                                     Failed to initialize the service context.\r
   @retval other                      Failed to initialize the arp service context.\r
 \r
 **/\r
@@ -42,7 +45,7 @@ EFI_STATUS
 ArpCreateService (\r
   IN EFI_HANDLE        ImageHandle,\r
   IN EFI_HANDLE        ControllerHandle,\r
-  IN ARP_SERVICE_DATA  *ArpService\r
+  IN OUT ARP_SERVICE_DATA  *ArpService\r
   )\r
 {\r
   EFI_STATUS  Status;\r
@@ -186,7 +189,7 @@ ERROR_EXIT:
 /**\r
   Clean the arp service context data.\r
 \r
-  @param[in]  ArpService             Pointer to the buffer containing the arp service\r
+  @param[in, out]  ArpService        Pointer to the buffer containing the arp service\r
                                      context data.\r
 \r
   @return None.\r
@@ -194,7 +197,7 @@ ERROR_EXIT:
 **/\r
 VOID\r
 ArpCleanService (\r
-  IN ARP_SERVICE_DATA  *ArpService\r
+  IN OUT ARP_SERVICE_DATA  *ArpService\r
   )\r
 {\r
   NET_CHECK_SIGNATURE (ArpService, ARP_SERVICE_DATA_SIGNATURE);\r
@@ -242,22 +245,32 @@ ArpCleanService (
 }\r
 \r
 /**\r
-  Test to see if this driver supports ControllerHandle.\r
-  \r
-  This service is called by the EFI boot service ConnectController(). In\r
-  order to make drivers as small as possible, there are a few calling\r
-  restrictions for this service. ConnectController() must\r
-  follow these calling restrictions. If any other agent wishes to call\r
-  Supported() it must also follow these calling restrictions.\r
+  Tests to see if this driver supports a given controller. \r
   \r
-  @param[in]  This                   Protocol instance pointer.\r
-  @param[in]  ControllerHandle       Handle of device to test.\r
-  @param[in]  RemainingDevicePath    Optional parameter use to pick a specific child\r
-                                     device to start.\r
-\r
-  @retval EFI_SUCCES                 This driver supports this device\r
-  @retval EFI_ALREADY_STARTED        This driver is already running on this device.\r
-  @retval other                      This driver does not support this device.\r
+  If a child device is provided, it further tests to see if this driver supports \r
+  creating a handle for the specified child device.\r
+\r
+  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param[in]  ControllerHandle     The handle of the controller to test. This handle \r
+                                   must support a protocol interface that supplies \r
+                                   an I/O abstraction to the driver.\r
+  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path. \r
+                                   This parameter is ignored by device drivers, \r
+                                   and is optional for bus drivers.\r
+\r
+  @retval EFI_SUCCESS              The device specified by ControllerHandle and\r
+                                   RemainingDevicePath is supported by the driver \r
+                                   specified by This.\r
+  @retval EFI_ALREADY_STARTED      The device specified by ControllerHandle and\r
+                                   RemainingDevicePath is already being managed \r
+                                   by the driver specified by This.\r
+  @retval EFI_ACCESS_DENIED        The device specified by ControllerHandle and\r
+                                   RemainingDevicePath is already being managed by \r
+                                   a different driver or an application that \r
+                                   requires exclusive acces. Currently not implemented.\r
+  @retval EFI_UNSUPPORTED          The device specified by ControllerHandle and\r
+                                   RemainingDevicePath is not supported by the \r
+                                   driver specified by This.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -302,22 +315,34 @@ ArpDriverBindingSupported (
 \r
 \r
 /**\r
-  Start this driver on ControllerHandle.\r
+  Start this driver on ControllerHandle. \r
   \r
-  This service is called by the EFI boot service ConnectController(). In order to make\r
-  drivers as small as possible, there are a few calling restrictions for\r
-  this service. ConnectController() must follow these\r
-  calling restrictions. If any other agent wishes to call Start() it\r
-  must also follow these calling restrictions.\r
-\r
-  @param[in]  This                   Protocol instance pointer.\r
-  @param[in]  ControllerHandle       Handle of device to bind driver to.\r
-  @param[in]  RemainingDevicePath    Optional parameter use to pick a specific child\r
-                                     device to start.\r
-\r
-  @retval EFI_SUCCES                 This driver is added to ControllerHandle.\r
-  @retval EFI_ALREADY_STARTED        This driver is already running on ControllerHandle.\r
-  @retval other                      This driver does not support this device.\r
+  The Start() function is designed to be invoked from the EFI boot service ConnectController(). \r
+  As a result, much of the error checking on the parameters to Start() has been \r
+  moved into this common boot service. It is legal to call Start() from other locations, \r
+  but the following calling restrictions must be followed or the system behavior \r
+  will not be deterministic.\r
+  1. ControllerHandle must be a valid EFI_HANDLE.\r
+  2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally \r
+     aligned EFI_DEVICE_PATH_PROTOCOL.\r
+  3. Prior to calling Start(), the Supported() function for the driver specified \r
+     by This must have been called with the same calling parameters, and Supported() \r
+     must have returned EFI_SUCCESS.  \r
+\r
+  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param[in]  ControllerHandle     The handle of the controller to start. This handle \r
+                                   must support a protocol interface that supplies \r
+                                   an I/O abstraction to the driver.\r
+  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path. \r
+                                   This parameter is ignored by device drivers, \r
+                                   and is optional for bus drivers.\r
+\r
+  @retval EFI_SUCCESS              The device was started.\r
+  @retval EFI_DEVICE_ERROR         The device could not be started due to a device error.\r
+                                   Currently not implemented.\r
+  @retval EFI_OUT_OF_RESOURCES     The request could not be completed due to a lack of \r
+                                   resources.\r
+  @retval Others                   The driver failded to start the device.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -383,22 +408,32 @@ ERROR:
 \r
 \r
 /**\r
-  Stop this driver on ControllerHandle.\r
+  Stop this driver on ControllerHandle. \r
   \r
-  This service is called by the EFI boot service DisconnectController(). In order to\r
-  make drivers as small as possible, there are a few calling\r
-  restrictions for this service. DisconnectController()\r
-  must follow these calling restrictions. If any other agent wishes\r
-  to call Stop() it must also follow these calling restrictions.\r
+  Release the control of this controller and remove the IScsi functions. The Stop()\r
+  function is designed to be invoked from the EFI boot service DisconnectController(). \r
+  As a result, much of the error checking on the parameters to Stop() has been moved \r
+  into this common boot service. It is legal to call Stop() from other locations, \r
+  but the following calling restrictions must be followed or the system behavior \r
+  will not be deterministic.\r
+  1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
+     same driver's Start() function.\r
+  2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid\r
+     EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
+     Start() function, and the Start() function must have called OpenProtocol() on\r
+     ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
   \r
-  @param[in]  This                   Protocol instance pointer.\r
-  @param[in]  ControllerHandle       Handle of device to stop driver on\r
-  @param[in]  NumberOfChildren       Number of Handles in ChildHandleBuffer. If number\r
-                                     of children is zero stop the entire bus driver.\r
-  @param[in]  ChildHandleBuffer      List of Child Handles to Stop.\r
-\r
-  @retval EFI_SUCCES                 This driver is removed ControllerHandle\r
-  @retval other                      This driver was not removed from this device\r
+  @param[in]  This              A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param[in]  ControllerHandle  A handle to the device being stopped. The handle must \r
+                                support a bus specific I/O protocol for the driver \r
+                                to use to stop the device.\r
+  @param[in]  NumberOfChildren  The number of child device handles in ChildHandleBuffer.\r
+                                Not used.\r
+  @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL \r
+                                if NumberOfChildren is 0.Not used.\r
+\r
+  @retval EFI_SUCCESS           The device was stopped.\r
+  @retval EFI_DEVICE_ERROR      The device could not be stopped due to a device error.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -476,19 +511,23 @@ ArpDriverBindingStop (
 }\r
 \r
 /**\r
-  Creates a child handle with a set of I/O services.\r
-\r
-  @param[in]  This                   Protocol instance pointer.\r
-  @param[in]  ChildHandle            Pointer to the handle of the child to create. If\r
-                                     it is NULL, then a new handle is created. If it is\r
-                                     not NULL, then the I/O services are  added to the\r
-                                     existing child handle.\r
-\r
-  @retval EFI_SUCCES                 The child handle was created with the I/O\r
-                                     services.\r
-  @retval EFI_OUT_OF_RESOURCES       There are not enough resources availabe to create\r
-                                     the child.\r
-  @retval other                      The child handle was not created.\r
+  Creates a child handle and installs a protocol.\r
+  \r
+  The CreateChild() function installs a protocol on ChildHandle. \r
+  If ChildHandle is a pointer to NULL, then a new handle is created and returned \r
+  in ChildHandle. If ChildHandle is not a pointer to NULL, then the protocol \r
+  installs on the existing ChildHandle.\r
+\r
+  @param  This        Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
+  @param  ChildHandle Pointer to the handle of the child to create. If it is NULL,\r
+                      then a new handle is created. If it is a pointer to an existing \r
+                      UEFI handle, then the protocol is added to the existing UEFI handle.\r
+\r
+  @retval EFI_SUCCES            The protocol was added to ChildHandle.\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources availabe to create\r
+                                the child\r
+  @retval other                 The child handle was not created\r
 \r
 **/\r
 EFI_STATUS\r
@@ -600,19 +639,22 @@ ERROR:
 \r
 \r
 /**\r
-  Destroys a child handle with a set of I/O services.\r
+  Destroys a child handle with a protocol installed on it.\r
+  \r
+  The DestroyChild() function does the opposite of CreateChild(). It removes a protocol \r
+  that was installed by CreateChild() from ChildHandle. If the removed protocol is the \r
+  last protocol on ChildHandle, then ChildHandle is destroyed.\r
 \r
-  @param[in]  This                   Protocol instance pointer.\r
-  @param[in]  ChildHandle            Handle of the child to destroy.\r
+  @param  This        Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
+  @param  ChildHandle Handle of the child to destroy\r
 \r
-  @retval EFI_SUCCES                 The I/O services were removed from the child\r
-                                     handle.\r
-  @retval EFI_UNSUPPORTED            The child handle does not support the I/O services\r
-                                     that are being removed.\r
-  @retval EFI_INVALID_PARAMETER      Child handle is not a valid EFI Handle.\r
-  @retval EFI_ACCESS_DENIED          The child handle could not be destroyed because\r
-                                     its  I/O services are being used.\r
-  @retval other                      The child handle was not destroyed.\r
+  @retval EFI_SUCCES            The protocol was removed from ChildHandle.\r
+  @retval EFI_UNSUPPORTED       ChildHandle does not support the protocol that is \r
+                                being removed.\r
+  @retval EFI_INVALID_PARAMETER Child handle is not a valid UEFI Handle.\r
+  @retval EFI_ACCESS_DENIED     The protocol could not be removed from the ChildHandle\r
+                                because its services are being used.\r
+  @retval other                 The child handle was not destroyed\r
 \r
 **/\r
 EFI_STATUS\r
@@ -721,7 +763,8 @@ ArpServiceBindingDestroyChild (
   @param[in]  ImageHandle        The image handle of the driver.\r
   @param[in]  SystemTable        The system table.\r
 \r
-  @retval EFI_SUCCES             if the driver binding and component name protocols are successfully\r
+  @retval EFI_SUCCESS            if the driver binding and component name protocols \r
+                                 are successfully\r
   @retval Others                 Failed to install the protocols.\r
 \r
 **/\r
index cace02ee90baa8b29aacea834c748b4ae59325c8..6f6fc5d8914e3887bf2a906a36e4885e2fbff9d7 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  Abstract:\r
+  ARP driver header file.\r
   \r
 Copyright (c) 2006 - 2008, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
@@ -39,22 +39,32 @@ extern EFI_COMPONENT_NAME2_PROTOCOL   gArpComponentName2;
 // Function prototypes for the Drivr Binding Protocol\r
 //\r
 /**\r
-  Test to see if this driver supports ControllerHandle.\r
+  Tests to see if this driver supports a given controller. \r
   \r
-  This service is called by the EFI boot service ConnectController(). In\r
-  order to make drivers as small as possible, there are a few calling\r
-  restrictions for this service. ConnectController() must\r
-  follow these calling restrictions. If any other agent wishes to call\r
-  Supported() it must also follow these calling restrictions.\r
-  \r
-  @param[in]  This                   Protocol instance pointer.\r
-  @param[in]  ControllerHandle       Handle of device to test.\r
-  @param[in]  RemainingDevicePath    Optional parameter use to pick a specific child\r
-                                     device to start.\r
-\r
-  @retval EFI_SUCCES                 This driver supports this device\r
-  @retval EFI_ALREADY_STARTED        This driver is already running on this device.\r
-  @retval other                      This driver does not support this device.\r
+  If a child device is provided, it further tests to see if this driver supports \r
+  creating a handle for the specified child device.\r
+\r
+  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param[in]  ControllerHandle     The handle of the controller to test. This handle \r
+                                   must support a protocol interface that supplies \r
+                                   an I/O abstraction to the driver.\r
+  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path. \r
+                                   This parameter is ignored by device drivers, \r
+                                   and is optional for bus drivers.\r
+\r
+  @retval EFI_SUCCESS              The device specified by ControllerHandle and\r
+                                   RemainingDevicePath is supported by the driver \r
+                                   specified by This.\r
+  @retval EFI_ALREADY_STARTED      The device specified by ControllerHandle and\r
+                                   RemainingDevicePath is already being managed \r
+                                   by the driver specified by This.\r
+  @retval EFI_ACCESS_DENIED        The device specified by ControllerHandle and\r
+                                   RemainingDevicePath is already being managed by \r
+                                   a different driver or an application that \r
+                                   requires exclusive acces. Currently not implemented.\r
+  @retval EFI_UNSUPPORTED          The device specified by ControllerHandle and\r
+                                   RemainingDevicePath is not supported by the \r
+                                   driver specified by This.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -66,22 +76,34 @@ ArpDriverBindingSupported (
   );\r
 \r
 /**\r
-  Start this driver on ControllerHandle.\r
+  Start this driver on ControllerHandle. \r
   \r
-  This service is called by the EFI boot service ConnectController(). In order to make\r
-  drivers as small as possible, there are a few calling restrictions for\r
-  this service. ConnectController() must follow these\r
-  calling restrictions. If any other agent wishes to call Start() it\r
-  must also follow these calling restrictions.\r
-\r
-  @param[in]  This                   Protocol instance pointer.\r
-  @param[in]  ControllerHandle       Handle of device to bind driver to.\r
-  @param[in]  RemainingDevicePath    Optional parameter use to pick a specific child\r
-                                     device to start.\r
-\r
-  @retval EFI_SUCCES                 This driver is added to ControllerHandle.\r
-  @retval EFI_ALREADY_STARTED        This driver is already running on ControllerHandle.\r
-  @retval other                      This driver does not support this device.\r
+  The Start() function is designed to be invoked from the EFI boot service ConnectController(). \r
+  As a result, much of the error checking on the parameters to Start() has been \r
+  moved into this common boot service. It is legal to call Start() from other locations, \r
+  but the following calling restrictions must be followed or the system behavior \r
+  will not be deterministic.\r
+  1. ControllerHandle must be a valid EFI_HANDLE.\r
+  2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally \r
+     aligned EFI_DEVICE_PATH_PROTOCOL.\r
+  3. Prior to calling Start(), the Supported() function for the driver specified \r
+     by This must have been called with the same calling parameters, and Supported() \r
+     must have returned EFI_SUCCESS.  \r
+\r
+  @param[in]  This                 A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param[in]  ControllerHandle     The handle of the controller to start. This handle \r
+                                   must support a protocol interface that supplies \r
+                                   an I/O abstraction to the driver.\r
+  @param[in]  RemainingDevicePath  A pointer to the remaining portion of a device path. \r
+                                   This parameter is ignored by device drivers, \r
+                                   and is optional for bus drivers.\r
+\r
+  @retval EFI_SUCCESS              The device was started.\r
+  @retval EFI_DEVICE_ERROR         The device could not be started due to a device error.\r
+                                   Currently not implemented.\r
+  @retval EFI_OUT_OF_RESOURCES     The request could not be completed due to a lack of \r
+                                   resources.\r
+  @retval Others                   The driver failded to start the device.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -93,22 +115,32 @@ ArpDriverBindingStart (
   );\r
 \r
 /**\r
-  Stop this driver on ControllerHandle.\r
+  Stop this driver on ControllerHandle. \r
   \r
-  This service is called by the EFI boot service DisconnectController(). In order to\r
-  make drivers as small as possible, there are a few calling\r
-  restrictions for this service. DisconnectController()\r
-  must follow these calling restrictions. If any other agent wishes\r
-  to call Stop() it must also follow these calling restrictions.\r
+  Release the control of this controller and remove the IScsi functions. The Stop()\r
+  function is designed to be invoked from the EFI boot service DisconnectController(). \r
+  As a result, much of the error checking on the parameters to Stop() has been moved \r
+  into this common boot service. It is legal to call Stop() from other locations, \r
+  but the following calling restrictions must be followed or the system behavior \r
+  will not be deterministic.\r
+  1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
+     same driver's Start() function.\r
+  2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid\r
+     EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
+     Start() function, and the Start() function must have called OpenProtocol() on\r
+     ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
   \r
-  @param[in]  This                   Protocol instance pointer.\r
-  @param[in]  ControllerHandle       Handle of device to stop driver on\r
-  @param[in]  NumberOfChildren       Number of Handles in ChildHandleBuffer. If number\r
-                                     of children is zero stop the entire bus driver.\r
-  @param[in]  ChildHandleBuffer      List of Child Handles to Stop.\r
-\r
-  @retval EFI_SUCCES                 This driver is removed ControllerHandle\r
-  @retval other                      This driver was not removed from this device\r
+  @param[in]  This              A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
+  @param[in]  ControllerHandle  A handle to the device being stopped. The handle must \r
+                                support a bus specific I/O protocol for the driver \r
+                                to use to stop the device.\r
+  @param[in]  NumberOfChildren  The number of child device handles in ChildHandleBuffer.\r
+                                Not used.\r
+  @param[in]  ChildHandleBuffer An array of child handles to be freed. May be NULL \r
+                                if NumberOfChildren is 0.Not used.\r
+\r
+  @retval EFI_SUCCESS           The device was stopped.\r
+  @retval EFI_DEVICE_ERROR      The device could not be stopped due to a device error.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -121,19 +153,23 @@ ArpDriverBindingStop (
   );\r
 \r
 /**\r
-  Creates a child handle with a set of I/O services.\r
-\r
-  @param[in]  This                   Protocol instance pointer.\r
-  @param[in]  ChildHandle            Pointer to the handle of the child to create. If\r
-                                     it is NULL, then a new handle is created. If it is\r
-                                     not NULL, then the I/O services are  added to the\r
-                                     existing child handle.\r
-\r
-  @retval EFI_SUCCES                 The child handle was created with the I/O\r
-                                     services.\r
-  @retval EFI_OUT_OF_RESOURCES       There are not enough resources availabe to create\r
-                                     the child.\r
-  @retval other                      The child handle was not created.\r
+  Creates a child handle and installs a protocol.\r
+  \r
+  The CreateChild() function installs a protocol on ChildHandle. \r
+  If ChildHandle is a pointer to NULL, then a new handle is created and returned \r
+  in ChildHandle. If ChildHandle is not a pointer to NULL, then the protocol \r
+  installs on the existing ChildHandle.\r
+\r
+  @param  This        Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
+  @param  ChildHandle Pointer to the handle of the child to create. If it is NULL,\r
+                      then a new handle is created. If it is a pointer to an existing \r
+                      UEFI handle, then the protocol is added to the existing UEFI handle.\r
+\r
+  @retval EFI_SUCCES            The protocol was added to ChildHandle.\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is NULL.\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources availabe to create\r
+                                the child\r
+  @retval other                 The child handle was not created\r
 \r
 **/\r
 EFI_STATUS\r
@@ -144,19 +180,22 @@ ArpServiceBindingCreateChild (
   );\r
 \r
 /**\r
-  Destroys a child handle with a set of I/O services.\r
-\r
-  @param[in]  This                   Protocol instance pointer.\r
-  @param[in]  ChildHandle            Handle of the child to destroy.\r
-\r
-  @retval EFI_SUCCES                 The I/O services were removed from the child\r
-                                     handle.\r
-  @retval EFI_UNSUPPORTED            The child handle does not support the I/O services\r
-                                     that are being removed.\r
-  @retval EFI_INVALID_PARAMETER      Child handle is not a valid EFI Handle.\r
-  @retval EFI_ACCESS_DENIED          The child handle could not be destroyed because\r
-                                     its  I/O services are being used.\r
-  @retval other                      The child handle was not destroyed.\r
+  Destroys a child handle with a protocol installed on it.\r
+  \r
+  The DestroyChild() function does the opposite of CreateChild(). It removes a protocol \r
+  that was installed by CreateChild() from ChildHandle. If the removed protocol is the \r
+  last protocol on ChildHandle, then ChildHandle is destroyed.\r
+\r
+  @param  This        Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.\r
+  @param  ChildHandle Handle of the child to destroy\r
+\r
+  @retval EFI_SUCCES            The protocol was removed from ChildHandle.\r
+  @retval EFI_UNSUPPORTED       ChildHandle does not support the protocol that is \r
+                                being removed.\r
+  @retval EFI_INVALID_PARAMETER Child handle is not a valid UEFI Handle.\r
+  @retval EFI_ACCESS_DENIED     The protocol could not be removed from the ChildHandle\r
+                                because its services are being used.\r
+  @retval other                 The child handle was not destroyed\r
 \r
 **/\r
 EFI_STATUS\r
index 79346db1780ab9113b5fbe731f6b972d698960cb..d42937ef347de3c8a480d7d6c1560775b0853d27 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  Abstract:\r
+  The implementation of the ARP protocol.\r
   \r
 Copyright (c) 2006 - 2008, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
@@ -14,6 +14,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "ArpImpl.h"\r
 \r
+//\r
+// Global variable of EFI ARP Protocol Interface.\r
+//\r
 EFI_ARP_PROTOCOL  mEfiArpProtocolTemplate = {\r
   ArpConfigure,\r
   ArpAdd,\r
@@ -28,17 +31,17 @@ EFI_ARP_PROTOCOL  mEfiArpProtocolTemplate = {
 /**\r
   Initialize the instance context data.\r
 \r
-  @param[in]  ArpService             Pointer to the arp service context data this\r
-                                     instance belongs to.\r
-  @param[in]  Instance               Pointer to the instance context data.\r
+  @param[in]   ArpService        Pointer to the arp service context data this\r
+                                 instance belongs to.\r
+  @param[out]  Instance          Pointer to the instance context data.\r
 \r
   @return None.\r
 \r
 **/\r
 VOID\r
 ArpInitInstance (\r
-  IN ARP_SERVICE_DATA   *ArpService,\r
-  IN ARP_INSTANCE_DATA  *Instance\r
+  IN  ARP_SERVICE_DATA   *ArpService,\r
+  OUT ARP_INSTANCE_DATA  *Instance\r
   )\r
 {\r
   NET_CHECK_SIGNATURE (ArpService, ARP_SERVICE_DATA_SIGNATURE);\r
index 7fd5e1bf31a5674e06f1f4ef91daeb7c00695fac..77873dc6744b30109b4dcb831cb52bd69135d50f 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  Abstract:\r
+  EFI Address Resolution Protocol (ARP) Protocol interface header file.\r
 \r
 Copyright (c) 2006 - 2008, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
@@ -16,7 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #define _ARP_IMPL_H_\r
 \r
 \r
-#include <PiDxe.h>\r
+#include <Uefi.h>\r
 \r
 #include <Protocol/Arp.h>\r
 #include <Protocol/ManagedNetwork.h>\r
@@ -31,19 +31,30 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 \r
-\r
+//\r
+// Ethernet protocol type definitions.\r
+//\r
 #define ARP_ETHER_PROTO_TYPE         0x0806\r
 #define IPV4_ETHER_PROTO_TYPE        0x0800\r
 #define IPV6_ETHER_PROTO_TYPE        0x86DD\r
 \r
+//\r
+// ARP opcode definitions.\r
+//\r
 #define ARP_OPCODE_REQUEST           0x0001\r
 #define ARP_OPCODE_REPLY             0x0002\r
 \r
+//\r
+// ARP timeout, retry count and interval definitions.\r
+//\r
 #define ARP_DEFAULT_TIMEOUT_VALUE    (400 * TICKS_PER_SECOND)\r
 #define ARP_DEFAULT_RETRY_COUNT      2\r
 #define ARP_DEFAULT_RETRY_INTERVAL   (5   * TICKS_PER_MS)\r
 #define ARP_PERIODIC_TIMER_INTERVAL  (500 * TICKS_PER_MS)\r
 \r
+//\r
+// ARP packet head definition.\r
+//\r
 #pragma pack(1)\r
 typedef struct {\r
   UINT16  HwType;\r
@@ -54,6 +65,9 @@ typedef struct {
 } ARP_HEAD;\r
 #pragma pack()\r
 \r
+//\r
+// ARP Address definition for internal use.\r
+//\r
 typedef struct {\r
   UINT8  *SenderHwAddr;\r
   UINT8  *SenderProtoAddr;\r
@@ -64,6 +78,10 @@ typedef struct {
 #define MATCH_SW_ADDRESS  0x1\r
 #define MATCH_HW_ADDRESS  0x2\r
 \r
+//\r
+// Enumeration for the search type. A search type is specified as the keyword to find\r
+// a cache entry in the cache table.\r
+//\r
 typedef enum {\r
   ByNone         = 0,\r
   ByProtoAddress = MATCH_SW_ADDRESS,\r
@@ -73,9 +91,16 @@ typedef enum {
 \r
 #define ARP_INSTANCE_DATA_SIGNATURE  SIGNATURE_32('A', 'R', 'P', 'I')\r
 \r
-//\r
-//comment for macro\r
-//\r
+/**\r
+  Returns a pointer to the ARP_INSTANCE_DATA structure from the input a.\r
+  \r
+  If the signatures matches, then a pointer to the data structure that contains \r
+  a specified field of that data structure is returned.\r
+   \r
+  @param  a              Pointer to the field specified by ArpProto within a data \r
+                         structure of type ARP_INSTANCE_DATA.\r
\r
+**/\r
 #define ARP_INSTANCE_DATA_FROM_THIS(a) \\r
   CR ( \\r
   (a), \\r
@@ -86,6 +111,9 @@ typedef enum {
 \r
 typedef struct _ARP_SERVICE_DATA  ARP_SERVICE_DATA;\r
 \r
+//\r
+// ARP instance context data structure.\r
+//\r
 typedef struct {\r
   UINT32               Signature;\r
   ARP_SERVICE_DATA     *ArpService;\r
@@ -99,9 +127,16 @@ typedef struct {
 \r
 #define ARP_SERVICE_DATA_SIGNATURE  SIGNATURE_32('A', 'R', 'P', 'S')\r
 \r
-//\r
-//comment for macro\r
-//\r
+/**\r
+  Returns a pointer to the ARP_SERVICE_DATA structure from the input a.\r
+  \r
+  If the signatures matches, then a pointer to the data structure that contains \r
+  a specified field of that data structure is returned.\r
+   \r
+  @param  a              Pointer to the field specified by ServiceBinding within \r
+                         a data structure of type ARP_SERVICE_DATA.\r
\r
+**/\r
 #define ARP_SERVICE_DATA_FROM_THIS(a) \\r
   CR ( \\r
   (a), \\r
@@ -110,6 +145,9 @@ typedef struct {
   ARP_SERVICE_DATA_SIGNATURE \\r
   )\r
 \r
+//\r
+// ARP service data structure.\r
+//\r
 struct _ARP_SERVICE_DATA {\r
   UINT32                           Signature;\r
   EFI_SERVICE_BINDING_PROTOCOL     ServiceBinding;\r
@@ -134,6 +172,9 @@ struct _ARP_SERVICE_DATA {
   EFI_EVENT                        PeriodicTimer;\r
 };\r
 \r
+//\r
+// User request context structure.\r
+//\r
 typedef struct {\r
   LIST_ENTRY         List;\r
   ARP_INSTANCE_DATA  *Instance;\r
@@ -144,6 +185,9 @@ typedef struct {
 #define ARP_MAX_PROTOCOL_ADDRESS_LEN  sizeof(EFI_IP_ADDRESS)\r
 #define ARP_MAX_HARDWARE_ADDRESS_LEN  sizeof(EFI_MAC_ADDRESS)\r
 \r
+//\r
+// ARP address structure in an ARP packet.\r
+//\r
 typedef struct {\r
   UINT16  Type;\r
   UINT8   Length;\r
@@ -154,11 +198,17 @@ typedef struct {
   } Buffer;\r
 } NET_ARP_ADDRESS;\r
 \r
+//\r
+// Enumeration for ARP address type.\r
+//\r
 typedef enum {\r
   Hardware,\r
   Protocol\r
 } ARP_ADDRESS_TYPE;\r
 \r
+//\r
+// ARP cache entry definition.\r
+//\r
 typedef struct {\r
   LIST_ENTRY      List;\r
 \r
@@ -174,17 +224,18 @@ typedef struct {
 \r
 /**\r
   This function is used to assign a station address to the ARP cache for this instance\r
-  of the ARP driver. Each ARP instance has one station address. The EFI_ARP_PROTOCOL \r
-  driver will respond to ARP requests that match this registered station address. \r
-  A call to this function with the ConfigData field set to NULL will reset this \r
-  ARP instance.\r
+  of the ARP driver.\r
+  \r
+  Each ARP instance has one station address. The EFI_ARP_PROTOCOL driver will \r
+  respond to ARP requests that match this registered station address. A call to \r
+  this function with the ConfigData field set to NULL will reset this ARP instance.\r
   \r
   Once a protocol type and station address have been assigned to this ARP instance, \r
   all the following ARP functions will use this information. Attempting to change \r
   the protocol type or station address to a configured ARP instance will result in errors.\r
 \r
-  @param[in]  This               Pointer to the EFI_ARP_PROTOCOL instance.\r
-  @param[in]  ConfigData         Pointer to the EFI_ARP_CONFIG_DATA structure.\r
+  @param  This                   Pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  ConfigData             Pointer to the EFI_ARP_CONFIG_DATA structure.\r
 \r
   @retval EFI_SUCCESS            The new station address was successfully\r
                                  registered.\r
@@ -220,19 +271,19 @@ ArpConfigure (
   Final product implementations of the EFI network stack should be tuned for \r
   their expected network environments.\r
   \r
-  @param[in]  This               Pointer to the EFI_ARP_PROTOCOL instance.\r
-  @param[in]  DenyFlag           Set to TRUE if this entry is a deny entry. Set to\r
+  @param  This                   Pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  DenyFlag               Set to TRUE if this entry is a deny entry. Set to\r
                                  FALSE if this  entry is a normal entry.\r
-  @param[in]  TargetSwAddress    Pointer to a protocol address to add (or deny).\r
+  @param  TargetSwAddress        Pointer to a protocol address to add (or deny).\r
                                  May be set to NULL if DenyFlag is TRUE.\r
-  @param[in]  TargetHwAddress    Pointer to a hardware address to add (or deny).\r
+  @param  TargetHwAddress        Pointer to a hardware address to add (or deny).\r
                                  May be set to NULL if DenyFlag is TRUE.\r
-  @param[in]  TimeoutValue       Time in 100-ns units that this entry will remain\r
+  @param  TimeoutValue           Time in 100-ns units that this entry will remain\r
                                  in the ARP cache. A value of zero means that the\r
                                  entry is permanent. A nonzero value will override\r
                                  the one given by Configure() if the entry to be\r
                                  added is a dynamic entry.\r
-  @param[in]  Overwrite          If TRUE, the matching cache entry will be\r
+  @param  Overwrite              If TRUE, the matching cache entry will be\r
                                  overwritten with the supplied parameters. If\r
                                  FALSE, EFI_ACCESS_DENIED is returned if the\r
                                  corresponding cache entry already exists.\r
@@ -273,18 +324,18 @@ ArpAdd (
   set to TRUE. If the found ARP cache entry is a permanent entry, it is not \r
   affected by Refresh.\r
   \r
-  @param[in]  This               Pointer to the EFI_ARP_PROTOCOL instance.\r
-  @param[in]  BySwAddress        Set to TRUE to look for matching software protocol\r
+  @param  This                   Pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  BySwAddress            Set to TRUE to look for matching software protocol\r
                                  addresses. Set to FALSE to look for matching\r
                                  hardware protocol addresses.\r
-  @param[in]  AddressBuffer      Pointer to address buffer. Set to NULL to match\r
+  @param  AddressBuffer          Pointer to address buffer. Set to NULL to match\r
                                  all addresses.\r
-  @param[out]  EntryLength       The size of an entry in the entries buffer.\r
-  @param[out]  EntryCount        The number of ARP cache entries that are found by\r
+  @param  EntryLength            The size of an entry in the entries buffer.\r
+  @param  EntryCount             The number of ARP cache entries that are found by\r
                                  the specified criteria.\r
-  @param[out]  Entries           Pointer to the buffer that will receive the ARP\r
+  @param  Entries                Pointer to the buffer that will receive the ARP\r
                                  cache entries.\r
-  @param[in]  Refresh            Set to TRUE to refresh the timeout value of the\r
+  @param  Refresh                Set to TRUE to refresh the timeout value of the\r
                                  matching ARP cache entry.\r
 \r
   @retval EFI_SUCCESS            The requested ARP cache entries were copied into\r
@@ -311,11 +362,11 @@ ArpFind (
 /**\r
   This function removes specified ARP cache entries.\r
 \r
-  @param[in]  This               Pointer to the EFI_ARP_PROTOCOL instance.\r
-  @param[in]  BySwAddress        Set to TRUE to delete matching protocol addresses.\r
+  @param  This                   Pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  BySwAddress            Set to TRUE to delete matching protocol addresses.\r
                                  Set to FALSE to delete matching hardware\r
                                  addresses.\r
-  @param[in]  AddressBuffer      Pointer to the address buffer that is used as a\r
+  @param  AddressBuffer          Pointer to the address buffer that is used as a\r
                                  key to look for the cache entry. Set to NULL to\r
                                  delete all entries.\r
 \r
@@ -337,7 +388,7 @@ ArpDelete (
   This function delete all dynamic entries from the ARP cache that match the specified\r
   software protocol type.\r
 \r
-  @param[in]  This               Pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  This                   Pointer to the EFI_ARP_PROTOCOL instance.\r
 \r
   @retval EFI_SUCCESS            The cache has been flushed.\r
   @retval EFI_INVALID_PARAMETER  This is NULL.\r
@@ -355,11 +406,11 @@ ArpFlush (
   This function tries to resolve the TargetSwAddress and optionally returns a\r
   TargetHwAddress if it already exists in the ARP cache.\r
 \r
-  @param[in]  This               Pointer to the EFI_ARP_PROTOCOL instance.\r
-  @param[in]  TargetSwAddress    Pointer to the protocol address to resolve.\r
-  @param[in]  ResolvedEvent      Pointer to the event that will be signaled when\r
+  @param  This                   Pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  TargetSwAddress        Pointer to the protocol address to resolve.\r
+  @param  ResolvedEvent          Pointer to the event that will be signaled when\r
                                  the address is resolved or some error occurs.\r
-  @param[out]  TargetHwAddress   Pointer to the buffer for the resolved hardware\r
+  @param  TargetHwAddress        Pointer to the buffer for the resolved hardware\r
                                  address in network byte order.\r
 \r
   @retval EFI_SUCCESS            The data is copied from the ARP cache into the\r
@@ -392,10 +443,10 @@ ArpRequest (
   NULL, all the pending asynchronous requests that have been issued by This \r
   instance will be cancelled and their corresponding events will be signaled.\r
   \r
-  @param[in]  This               Pointer to the EFI_ARP_PROTOCOL instance.\r
-  @param[in]  TargetSwAddress    Pointer to the protocol address in previous\r
+  @param  This                   Pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  TargetSwAddress        Pointer to the protocol address in previous\r
                                  request session.\r
-  @param[in]  ResolvedEvent      Pointer to the event that is used as the\r
+  @param  ResolvedEvent          Pointer to the event that is used as the\r
                                  notification event in previous request session.\r
 \r
   @retval EFI_SUCCESS            The pending request session(s) is/are aborted and\r
@@ -572,17 +623,17 @@ ArpSendFrame (
 /**\r
   Initialize the instance context data.\r
 \r
-  @param[in]  ArpService             Pointer to the arp service context data this\r
-                                     instance belongs to.\r
-  @param[in]  Instance               Pointer to the instance context data.\r
+  @param[in]   ArpService        Pointer to the arp service context data this\r
+                                 instance belongs to.\r
+  @param[out]  Instance          Pointer to the instance context data.\r
 \r
   @return None.\r
 \r
 **/\r
 VOID\r
 ArpInitInstance (\r
-  IN ARP_SERVICE_DATA   *ArpService,\r
-  IN ARP_INSTANCE_DATA  *Instance\r
+  IN  ARP_SERVICE_DATA   *ArpService,\r
+  OUT ARP_INSTANCE_DATA  *Instance\r
   );\r
 \r
 /**\r
@@ -619,7 +670,7 @@ ArpOnFrameRcvd (
 \r
 /**\r
   Process the already sent arp packets.\r
-\r
+  \r
   @param[in]  Context                Pointer to the context data registerd to the\r
                                      Event.\r
 \r
@@ -633,7 +684,7 @@ ArpOnFrameSentDpc (
   );\r
 \r
 /**\r
-  Queue ArpOnFrameRcvdDpc as a DPC at TPL_CALLBACK.\r
+  Request ArpOnFrameSentDpc as a DPC at TPL_CALLBACK.\r
 \r
   @param[in]  Event                  The Event this notify function registered to.\r
   @param[in]  Context                Pointer to the context data registerd to the\r
index 02fdf0be24b578db89629e5332c1a6a8f74bc7e7..ac76fcd6324917747c2778b8ad80a39e4f754e59 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  Abstract:\r
+  Implementation of EFI Address Resolution Protocol (ARP) Protocol interface functions.\r
   \r
 Copyright (c) 2006, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
@@ -17,10 +17,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 /**\r
   This function is used to assign a station address to the ARP cache for this instance\r
-  of the ARP driver. Each ARP instance has one station address. The EFI_ARP_PROTOCOL \r
-  driver will respond to ARP requests that match this registered station address. \r
-  A call to this function with the ConfigData field set to NULL will reset this \r
-  ARP instance.\r
+  of the ARP driver.\r
+  \r
+  Each ARP instance has one station address. The EFI_ARP_PROTOCOL driver will \r
+  respond to ARP requests that match this registered station address. A call to \r
+  this function with the ConfigData field set to NULL will reset this ARP instance.\r
   \r
   Once a protocol type and station address have been assigned to this ARP instance, \r
   all the following ARP functions will use this information. Attempting to change \r
index f4fe49e6be523ce8bdca508279f600f3a35c21a0..bd7f7d2a5fc9fbc2a252e453814e64a2c5ffbfbe 100644 (file)
@@ -1,22 +1,20 @@
-/** @file\r
-  \r
+/** @file  \r
   EFI ARP Protocol Definition\r
   \r
   The EFI ARP Service Binding Protocol is used to locate EFI\r
   ARP Protocol drivers to create and destroy child of the\r
   driver to communicate with other host using ARP protocol.\r
-  \r
   The EFI ARP Protocol provides services to map IP network\r
   address to hardware address used by a data link protocol.\r
   \r
-  Copyright (c) 2006 - 2008, Intel Corporation                                                         \r
-  All rights reserved. This program and the accompanying materials                          \r
-  are licensed and made available under the terms and conditions of the BSD License         \r
-  which accompanies this distribution.  The full text of the license may be found at        \r
-  http://opensource.org/licenses/bsd-license.php                                            \r
+Copyright (c) 2006 - 2008, Intel Corporation.<BR>                                                         \r
+All rights reserved. This program and the accompanying materials                          \r
+are licensed and made available under the terms and conditions of the BSD License         \r
+which accompanies this distribution.  The full text of the license may be found at<BR>        \r
+http://opensource.org/licenses/bsd-license.php                                            \r
   \r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
   \r
 **/\r
 \r
@@ -116,20 +114,31 @@ typedef struct {
 \r
 \r
 /**\r
-  Assigns a station address (protocol type and network address) to this instance of the ARP cache.\r
-\r
-  @param  This                  A pointer to the EFI_ARP_PROTOCOL instance.\r
-  @param  ConfigData            A pointer to the EFI_ARP_CONFIG_DATA structure.Buffer\r
-\r
-  @retval EFI_SUCCESS           The new station address was successfully registered.\r
-  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
-                                This is NULL.\r
-                                SwAddressLength is zero when ConfigData is not NULL.\r
-                                StationAddress is NULL when ConfigData is not NULL.\r
-  @retval EFI_ACCESS_DENIED     The SwAddressType, SwAddressLength, or\r
-                                StationAddress is different from the one that is already\r
-                                registered.\r
-  @retval EFI_OUT_OF_RESOURCES  Storage for the new StationAddress could not be allocated.\r
+  This function is used to assign a station address to the ARP cache for this instance\r
+  of the ARP driver.\r
+  \r
+  Each ARP instance has one station address. The EFI_ARP_PROTOCOL driver will \r
+  respond to ARP requests that match this registered station address. A call to \r
+  this function with the ConfigData field set to NULL will reset this ARP instance.\r
+  \r
+  Once a protocol type and station address have been assigned to this ARP instance, \r
+  all the following ARP functions will use this information. Attempting to change \r
+  the protocol type or station address to a configured ARP instance will result in errors.\r
+\r
+  @param  This                   Pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  ConfigData             Pointer to the EFI_ARP_CONFIG_DATA structure.\r
+\r
+  @retval EFI_SUCCESS            The new station address was successfully\r
+                                 registered.\r
+  @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:\r
+                                 This is NULL. SwAddressLength is zero when\r
+                                 ConfigData is not NULL. StationAddress is NULL\r
+                                 when ConfigData is not NULL.\r
+  @retval EFI_ACCESS_DENIED      The SwAddressType, SwAddressLength, or\r
+                                 StationAddress is different from the one that is\r
+                                 already registered.\r
+  @retval EFI_OUT_OF_RESOURCES   Storage for the new StationAddress could not be\r
+                                 allocated.\r
 \r
 **/\r
 typedef \r
@@ -140,31 +149,48 @@ EFI_STATUS
   );  \r
 \r
 /**\r
-  Inserts an entry to the ARP cache.\r
-\r
-  @param  This            A pointer to the EFI_ARP_PROTOCOL instance.  \r
-  @param  DenyFlag        Set to TRUE if this entry is a "deny" entry. Set to FALSE if this\r
-                          entry is a "normal" entry.\r
-  @param  TargetSwAddress Pointer to a protocol address to add (or deny). May be set to\r
-                          NULL if DenyFlag is TRUE.\r
-  @param  TargetHwAddress Pointer to a hardware address to add (or deny). May be set to\r
-                          NULL if DenyFlag is TRUE.\r
-  @param  TimeoutValue    Time in 100-ns units that this entry will remain in the ARP\r
-                          cache. A value of zero means that the entry is permanent. A\r
-                          nonzero value will override the one given by Configure() if\r
-                          the entry to be added is dynamic entry.\r
-  @param  Overwrite       If TRUE, the matching cache entry will be overwritten with the\r
-                          supplied parameters. If FALSE, EFI_ACCESS_DENIED is returned \r
-                          if the corresponding cache entry already exists.\r
-\r
-  @retval EFI_SUCCESS           The entry has been added or updated.\r
-  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
-                                This is NULL. DenyFlag is FALSE and TargetHwAddress is NULL.\r
-                                DenyFlag is FALSE and TargetSwAddress is NULL. TargetHwAddress is NULL and TargetSwAddress is NULL. \r
-                                Both TargetSwAddress and TargetHwAddress are not NULL when DenyFlag is TRUE.\r
-  @retval EFI_OUT_OF_RESOURCES  The new ARP cache entry could not be allocated.\r
-  @retval EFI_ACCESS_DENIED     The ARP cache entry already exists and Overwrite is not true.\r
-  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
+  This function is used to insert entries into the ARP cache.\r
+\r
+  ARP cache entries are typically inserted and updated by network protocol drivers \r
+  as network traffic is processed. Most ARP cache entries will time out and be \r
+  deleted if the network traffic stops. ARP cache entries that were inserted \r
+  by the Add() function may be static (will not time out) or dynamic (will time out).\r
+  Default ARP cache timeout values are not covered in most network protocol \r
+  specifications (although RFC 1122 comes pretty close) and will only be \r
+  discussed in general in this specification. The timeout values that are \r
+  used in the EFI Sample Implementation should be used only as a guideline. \r
+  Final product implementations of the EFI network stack should be tuned for \r
+  their expected network environments.\r
+  \r
+  @param  This                   Pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  DenyFlag               Set to TRUE if this entry is a deny entry. Set to\r
+                                 FALSE if this  entry is a normal entry.\r
+  @param  TargetSwAddress        Pointer to a protocol address to add (or deny).\r
+                                 May be set to NULL if DenyFlag is TRUE.\r
+  @param  TargetHwAddress        Pointer to a hardware address to add (or deny).\r
+                                 May be set to NULL if DenyFlag is TRUE.\r
+  @param  TimeoutValue           Time in 100-ns units that this entry will remain\r
+                                 in the ARP cache. A value of zero means that the\r
+                                 entry is permanent. A nonzero value will override\r
+                                 the one given by Configure() if the entry to be\r
+                                 added is a dynamic entry.\r
+  @param  Overwrite              If TRUE, the matching cache entry will be\r
+                                 overwritten with the supplied parameters. If\r
+                                 FALSE, EFI_ACCESS_DENIED is returned if the\r
+                                 corresponding cache entry already exists.\r
+\r
+  @retval EFI_SUCCESS            The entry has been added or updated.\r
+  @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:\r
+                                 This is NULL. DenyFlag is FALSE and\r
+                                 TargetHwAddress is NULL. DenyFlag is FALSE and\r
+                                 TargetSwAddress is NULL. TargetHwAddress is NULL\r
+                                 and TargetSwAddress is NULL. Both TargetSwAddress\r
+                                 and TargetHwAddress are not NULL when DenyFlag is\r
+                                 TRUE.\r
+  @retval EFI_OUT_OF_RESOURCES   The new ARP cache entry could not be allocated.\r
+  @retval EFI_ACCESS_DENIED      The ARP cache entry already exists and Overwrite\r
+                                 is not true.\r
+  @retval EFI_NOT_STARTED        The ARP driver instance has not been configured.\r
 \r
 **/\r
 typedef\r
@@ -179,27 +205,37 @@ EFI_STATUS
   );  \r
 \r
 /**\r
-  Locates one or more entries in the ARP cache.\r
-\r
-  @param  This            A pointer to the EFI_ARP_PROTOCOL instance.\r
-  @param  BySwAddress     Set to TRUE to look for matching software protocol addresses.\r
-                          Set to FALSE to look for matching hardware protocol addresses.\r
-  @param  AddressBuffer   Pointer to address buffer. Set to NULL to match all addresses.\r
-  @param  EntryLength     The size of an entry in the entries buffer. To keep the\r
-                          EFI_ARP_FIND_DATA structure properly aligned, this field\r
-                          may be longer than sizeof(EFI_ARP_FIND_DATA) plus\r
-                          the length of the software and hardware addresses.\r
-  @param  EntryCount      The number of ARP cache entries that are found by the specified criteria.\r
-  @param  Entries         Pointer to the buffer that will receive the ARP cache entries.\r
-  @param  Refresh         Set to TRUE to refresh the timeout value of the matching ARP\r
-                          cache entry.\r
-\r
-  @retval EFI_SUCCESS           The requested ARP cache entries were copied into the buffer.\r
-  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
-                                This is NULL. Both EntryCount and EntryLength are NULL, \r
-                                when Refresh is FALSE.\r
-  @retval EFI_NOT_FOUND         No matching entries were found.\r
-  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
+  This function searches the ARP cache for matching entries and allocates a buffer into\r
+  which those entries are copied.\r
+  \r
+  The first part of the allocated buffer is EFI_ARP_FIND_DATA, following which \r
+  are protocol address pairs and hardware address pairs.\r
+  When finding a specific protocol address (BySwAddress is TRUE and AddressBuffer \r
+  is not NULL), the ARP cache timeout for the found entry is reset if Refresh is \r
+  set to TRUE. If the found ARP cache entry is a permanent entry, it is not \r
+  affected by Refresh.\r
+  \r
+  @param  This                   Pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  BySwAddress            Set to TRUE to look for matching software protocol\r
+                                 addresses. Set to FALSE to look for matching\r
+                                 hardware protocol addresses.\r
+  @param  AddressBuffer          Pointer to address buffer. Set to NULL to match\r
+                                 all addresses.\r
+  @param  EntryLength            The size of an entry in the entries buffer.\r
+  @param  EntryCount             The number of ARP cache entries that are found by\r
+                                 the specified criteria.\r
+  @param  Entries                Pointer to the buffer that will receive the ARP\r
+                                 cache entries.\r
+  @param  Refresh                Set to TRUE to refresh the timeout value of the\r
+                                 matching ARP cache entry.\r
+\r
+  @retval EFI_SUCCESS            The requested ARP cache entries were copied into\r
+                                 the buffer.\r
+  @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:\r
+                                 This is NULL. Both EntryCount and EntryLength are\r
+                                 NULL, when Refresh is FALSE.\r
+  @retval EFI_NOT_FOUND          No matching entries were found.\r
+  @retval EFI_NOT_STARTED        The ARP driver instance has not been configured.\r
 \r
 **/\r
 typedef \r
@@ -216,18 +252,20 @@ EFI_STATUS
 \r
 \r
 /**\r
-  Removes entries from the ARP cache.\r
+  This function removes specified ARP cache entries.\r
 \r
-  @param  This          A pointer to the EFI_ARP_PROTOCOL instance.\r
-  @param  BySwAddress   Set to TRUE to delete matching protocol addresses.\r
-                        Set to FALSE to delete matching hardware addresses.\r
-  @param  AddressBuffer Pointer to the address buffer that is used as a key to look for the\r
-                        cache entry. Set to NULL to delete all entries.\r
+  @param  This                   Pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  BySwAddress            Set to TRUE to delete matching protocol addresses.\r
+                                 Set to FALSE to delete matching hardware\r
+                                 addresses.\r
+  @param  AddressBuffer          Pointer to the address buffer that is used as a\r
+                                 key to look for the cache entry. Set to NULL to\r
+                                 delete all entries.\r
 \r
-  @retval EFI_SUCCESS           The entry was removed from the ARP cache.\r
-  @retval EFI_INVALID_PARAMETER This is NULL.\r
-  @retval EFI_NOT_FOUND         The specified deletion key was not found.\r
-  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
+  @retval EFI_SUCCESS            The entry was removed from the ARP cache.\r
+  @retval EFI_INVALID_PARAMETER  This is NULL.\r
+  @retval EFI_NOT_FOUND          The specified deletion key was not found.\r
+  @retval EFI_NOT_STARTED        The ARP driver instance has not been configured.\r
 \r
 **/\r
 typedef\r
@@ -239,14 +277,15 @@ EFI_STATUS
   );  \r
 \r
 /**\r
-  Removes all dynamic ARP cache entries that were added by this interface.\r
+  This function delete all dynamic entries from the ARP cache that match the specified\r
+  software protocol type.\r
+\r
+  @param  This                   Pointer to the EFI_ARP_PROTOCOL instance.\r
 \r
-  @param  This                  A pointer to the EFI_ARP_PROTOCOL instance.\r
-                                 \r
-  @retval EFI_SUCCESS           The cache has been flushed.\r
-  @retval EFI_INVALID_PARAMETER This is NULL.\r
-  @retval EFI_NOT_FOUND         There are no matching dynamic cache entries.\r
-  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
+  @retval EFI_SUCCESS            The cache has been flushed.\r
+  @retval EFI_INVALID_PARAMETER  This is NULL.\r
+  @retval EFI_NOT_FOUND          There are no matching dynamic cache entries.\r
+  @retval EFI_NOT_STARTED        The ARP driver instance has not been configured.\r
 \r
 **/\r
 typedef\r
@@ -256,27 +295,25 @@ EFI_STATUS
   );  \r
 \r
 /**\r
-  Starts an ARP request session.\r
-\r
-  @param  This            A pointer to the EFI_ARP_PROTOCOL instance.\r
-  @param  TargetSwAddress Pointer to the protocol address to resolve.\r
-  @param  ResolvedEvent   Pointer to the event that will be signaled when the address is\r
-                          resolved or some error occurs.\r
-  @param  TargetHwAddress Pointer to the buffer for the resolved hardware address in\r
-                          network byte order. The buffer must be large enough to hold the\r
-                          resulting hardware address. TargetHwAddress must not be\r
-                          NULL.\r
-\r
-  @retval EFI_SUCCESS           The data was copied from the ARP cache into the\r
-                                TargetHwAddress buffer.\r
-  @retval EFI_INVALID_PARAMETER This or TargetHwAddress is NULL.\r
-  @retval EFI_ACCESS_DENIED     The requested address is not present in the normal ARP cache but\r
-                                is present in the deny address list. Outgoing traffic to that address is\r
-                                forbidden.\r
-  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
-  @retval EFI_NOT_READY         The request has been started and is not finished.\r
-  @retval EFI_UNSUPPORTED       The requested conversion is not supported in this implementation or\r
-                                configuration.\r
+  This function tries to resolve the TargetSwAddress and optionally returns a\r
+  TargetHwAddress if it already exists in the ARP cache.\r
+\r
+  @param  This                   Pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  TargetSwAddress        Pointer to the protocol address to resolve.\r
+  @param  ResolvedEvent          Pointer to the event that will be signaled when\r
+                                 the address is resolved or some error occurs.\r
+  @param  TargetHwAddress        Pointer to the buffer for the resolved hardware\r
+                                 address in network byte order.\r
+\r
+  @retval EFI_SUCCESS            The data is copied from the ARP cache into the\r
+                                 TargetHwAddress buffer.\r
+  @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:\r
+                                 This is NULL. TargetHwAddress is NULL.\r
+  @retval EFI_ACCESS_DENIED      The requested address is not present in the normal\r
+                                 ARP cache but is present in the deny address list.\r
+                                 Outgoing traffic to that address is forbidden.\r
+  @retval EFI_NOT_STARTED        The ARP driver instance has not been configured.\r
+  @retval EFI_NOT_READY          The request has been started and is not finished.\r
 \r
 **/\r
 typedef\r
@@ -289,22 +326,31 @@ EFI_STATUS
   );  \r
 \r
 /**\r
-  Cancels an ARP request session.\r
-\r
-  @param  This            A pointer to the EFI_ARP_PROTOCOL instance.\r
-  @param  TargetSwAddress Pointer to the protocol address in previous request session.\r
-  @param  ResolvedEvent   Pointer to the event that is used as the notification event in\r
-                          previous request session.\r
-\r
-  @retval EFI_SUCCESS           The pending request session(s) is/are aborted and corresponding\r
-                                event(s) is/are signaled.\r
-  @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
-                                This is NULL.\r
-                                TargetSwAddress is not NULL and ResolvedEvent is NULL.\r
-                                TargetSwAddress is NULL and ResolvedEvent is not NULL\r
-  @retval EFI_NOT_STARTED       The ARP driver instance has not been configured.\r
-  @retval EFI_NOT_FOUND         The request is not issued by\r
-                                EFI_ARP_PROTOCOL.Request().\r
+  This function aborts the previous ARP request (identified by This,  TargetSwAddress\r
+  and ResolvedEvent) that is issued by EFI_ARP_PROTOCOL.Request().\r
+  \r
+  If the request is in the internal ARP request queue, the request is aborted \r
+  immediately and its ResolvedEvent is signaled. Only an asynchronous address \r
+  request needs to be canceled. If TargeSwAddress and ResolveEvent are both \r
+  NULL, all the pending asynchronous requests that have been issued by This \r
+  instance will be cancelled and their corresponding events will be signaled.\r
+  \r
+  @param  This                   Pointer to the EFI_ARP_PROTOCOL instance.\r
+  @param  TargetSwAddress        Pointer to the protocol address in previous\r
+                                 request session.\r
+  @param  ResolvedEvent          Pointer to the event that is used as the\r
+                                 notification event in previous request session.\r
+\r
+  @retval EFI_SUCCESS            The pending request session(s) is/are aborted and\r
+                                 corresponding event(s) is/are signaled.\r
+  @retval EFI_INVALID_PARAMETER  One or more of the following conditions is TRUE:\r
+                                 This is NULL. TargetSwAddress is not NULL and\r
+                                 ResolvedEvent is NULL. TargetSwAddress is NULL and\r
+                                 ResolvedEvent is not NULL.\r
+  @retval EFI_NOT_STARTED        The ARP driver instance has not been configured.\r
+  @retval EFI_NOT_FOUND          The request is not issued by\r
+                                 EFI_ARP_PROTOCOL.Request().\r
+\r
 \r
 **/\r
 typedef\r