]> git.proxmox.com Git - mirror_edk2.git/commitdiff
code scrub for Ip4ConfigDxe
authorjgong5 <jgong5@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 30 Dec 2008 02:21:34 +0000 (02:21 +0000)
committerjgong5 <jgong5@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 30 Dec 2008 02:21:34 +0000 (02:21 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7149 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Include/Protocol/NicIp4Config.h
MdeModulePkg/Universal/Network/Ip4ConfigDxe/ComponentName.c
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c
MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.h

index 71bd7c4ebe97ede322503f92be55a4cf9fccd926..28284febda2ea9395dad03e9833cb6fa40197550 100644 (file)
@@ -1,5 +1,6 @@
 /** @file\r
   This file defines NicIp4Config Protocol.\r
+  EFI_NIC_IP4_CONFIG_PROTOCOL is a proprietary protocol, not defined by UEFI2.0.\r
 \r
 Copyright (c) 2006 - 2008, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -54,34 +55,58 @@ typedef enum {
 // because it don't know how to configure the default IP address even\r
 // it has got the address.\r
 //\r
-// NIC_ADDR contains the interface's type and MAC address to identify\r
-// a specific NIC. NIC_IP4_CONFIG_INFO contains the IP4 configure\r
-// parameters for that NIC. IP4_CONFIG_VARIABLE is the EFI variable to\r
-// save the configuration. NIC_IP4_CONFIG_INFO and IP4_CONFIG_VARIABLE\r
-// is of variable length.\r
-//\r
-// EFI_NIC_IP4_CONFIG_PROTOCOL is a priority protocol, not defined by UEFI2.0\r
-//\r
+\r
+///\r
+/// NIC_ADDR contains the interface's type and MAC address to identify\r
+/// a specific NIC.\r
+///\r
 typedef struct {\r
-  UINT16                    Type;\r
-  UINT8                     Len;\r
-  EFI_MAC_ADDRESS           MacAddr;\r
+  UINT16                    Type;       ///< Interface type\r
+  UINT8                     Len;        ///< Length of MAC address\r
+  EFI_MAC_ADDRESS           MacAddr;    ///< MAC address of interface\r
 } NIC_ADDR;\r
 \r
+///\r
+/// NIC_IP4_CONFIG_INFO contains the IP4 configure\r
+/// parameters for that NIC. NIC_IP4_CONFIG_INFO is\r
+/// of variable length.\r
+///\r
 typedef struct {\r
-  NIC_ADDR                  NicAddr;    // Link layer address to identify the NIC\r
-  UINT32                    Source;     // Static or DHCP\r
-  BOOLEAN                   Perment;    // Survive the reboot or not\r
-  EFI_IP4_IPCONFIG_DATA     Ip4Info;    // IP addresses\r
+  NIC_ADDR                  NicAddr;    ///< Link layer address to identify the NIC\r
+  UINT32                    Source;     ///< Static or DHCP\r
+  BOOLEAN                   Perment;    ///< Survive the reboot or not\r
+  EFI_IP4_IPCONFIG_DATA     Ip4Info;    ///< IP addresses\r
 } NIC_IP4_CONFIG_INFO;\r
 \r
+///\r
+/// IP4_CONFIG_VARIABLE is the EFI variable to\r
+/// save the configuration. IP4_CONFIG_VARIABLE is\r
+/// of variable length.\r
+///\r
 typedef struct {\r
-  UINT32                    Len;        // Total length of the variable\r
-  UINT16                    CheckSum;   // CheckSum, the same as IP4 head checksum\r
-  UINT32                    Count;      // Number of NIC_IP4_CONFIG_INFO follows\r
+  UINT32                    Len;        ///< Total length of the variable\r
+  UINT16                    CheckSum;   ///< CheckSum, the same as IP4 head checksum\r
+  UINT32                    Count;      ///< Number of NIC_IP4_CONFIG_INFO follows\r
   NIC_IP4_CONFIG_INFO       ConfigInfo;\r
 } IP4_CONFIG_VARIABLE;\r
 \r
+/**\r
+  Get the configure parameter for this NIC.\r
+\r
+  @param  This                   The NIC IP4 CONFIG protocol.\r
+  @param  Len                    The length of the NicConfig buffer.\r
+  @param  NicConfig              The buffer to receive the NIC's configure\r
+                                 parameter.\r
+\r
+  @retval EFI_SUCCESS            The configure parameter for this NIC was \r
+                                 obtained successfully .\r
+  @retval EFI_INVALID_PARAMETER  This or ConfigLen is NULL.\r
+  @retval EFI_NOT_FOUND          There is no configure parameter for the NIC in\r
+                                 NVRam.\r
+  @retval EFI_BUFFER_TOO_SMALL   The ConfigLen is too small or the NicConfig is \r
+                                 NULL.\r
+\r
+**/\r
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_NIC_IP4_CONFIG_GET_INFO)(\r
@@ -90,20 +115,55 @@ EFI_STATUS
   OUT NIC_IP4_CONFIG_INFO         *NicConfig     OPTIONAL\r
   );\r
 \r
+/**\r
+  Set the IP configure parameters for this NIC. \r
+\r
+  If Reconfig is TRUE, the IP driver will be informed to discard current \r
+  auto configure parameter and restart the auto configuration process. \r
+  If current there is a pending auto configuration, EFI_ALREADY_STARTED is\r
+  returned. You can only change the configure setting when either\r
+  the configure has finished or not started yet. If NicConfig, the\r
+  NIC's configure parameter is removed from the variable.\r
+\r
+  @param  This                   The NIC IP4 CONFIG protocol\r
+  @param  NicConfig              The new NIC IP4 configure parameter\r
+  @param  Reconfig               Inform the IP4 driver to restart the auto\r
+                                 configuration\r
+                                 \r
+  @retval EFI_SUCCESS            The configure parameter for this NIC was \r
+                                 set successfully .\r
+  @retval EFI_INVALID_PARAMETER  This is NULL or the configure parameter is\r
+                                 invalid.\r
+  @retval EFI_ALREADY_STARTED    There is a pending auto configuration.\r
+  @retval EFI_NOT_FOUND          No auto configure parameter is found\r
+\r
+**/\r
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_NIC_IP4_CONFIG_SET_INFO)(\r
   IN EFI_NIC_IP4_CONFIG_PROTOCOL  *This,\r
-  IN NIC_IP4_CONFIG_INFO          *NicConfig,    OPTIONAL\r
+  IN NIC_IP4_CONFIG_INFO          *NicConfig     OPTIONAL,\r
   IN BOOLEAN                      ReConfig\r
   );\r
 \r
+/**\r
+  Return the name and MAC address for the NIC. The Name, if not NULL,\r
+  has at least IP4_NIC_NAME_LENGTH bytes.\r
+\r
+  @param  This                   The NIC IP4 CONFIG protocol\r
+  @param  Name                   The buffer to return the name\r
+  @param  NicAddr                The buffer to return the MAC addr\r
+\r
+  @retval EFI_INVALID_PARAMETER  This is NULL\r
+  @retval EFI_SUCCESS            The name or address of the NIC are returned.\r
+\r
+**/\r
 typedef\r
 EFI_STATUS\r
 (EFIAPI *EFI_NIC_IP4_CONFIG_GET_NAME)(\r
   IN  EFI_NIC_IP4_CONFIG_PROTOCOL *This,\r
-  IN  UINT16                      *Name,         OPTIONAL\r
-  IN  NIC_ADDR                    *NicAddr       OPTIONAL\r
+  OUT  UINT16                     *Name          OPTIONAL,\r
+  OUT  NIC_ADDR                   *NicAddr       OPTIONAL\r
   );\r
 \r
 struct _EFI_NIC_IP4_CONFIG_PROTOCOL {\r
index 9d6fe0f407dae04a3a686761d874245c6467ae8c..7d149df04f34df84f78b21322a2f6e0a414181e1 100644 (file)
@@ -1,5 +1,6 @@
 /** @file\r
-\r
+  UEFI Component Name(2) protocol implementation for Ip4ConfigDxe driver.\r
+  \r
 Copyright (c) 2006 - 2007, 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
@@ -11,139 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-\r
 #include "Ip4Config.h"\r
 \r
-//\r
-// EFI Component Name Functions\r
-//\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the driver.\r
-\r
-  This function retrieves the user readable name of a driver in the form of a\r
-  Unicode string. If the driver specified by This has a user readable name in\r
-  the language specified by Language, then a pointer to the driver name is\r
-  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
-  by This does not support the language specified by Language,\r
-  then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language. This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified\r
-                                in RFC 3066 or ISO 639-2 language code format.\r
-\r
-  @param  DriverName[out]       A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                driver specified by This in the language\r
-                                specified by Language.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
-                                This and the language specified by Language was\r
-                                returned in DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Ip4ConfigComponentNameGetDriverName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
-  IN  CHAR8                        *Language,\r
-  OUT CHAR16                       **DriverName\r
-  );\r
-\r
-\r
-/**\r
-  Retrieves a Unicode string that is the user readable name of the controller\r
-  that is being managed by a driver.\r
-\r
-  This function retrieves the user readable name of the controller specified by\r
-  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
-  driver specified by This has a user readable name in the language specified by\r
-  Language, then a pointer to the controller name is returned in ControllerName,\r
-  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
-  managing the controller specified by ControllerHandle and ChildHandle,\r
-  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
-  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
-\r
-  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
-                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
-  @param  ControllerHandle[in]  The handle of a controller that the driver\r
-                                specified by This is managing.  This handle\r
-                                specifies the controller whose name is to be\r
-                                returned.\r
-\r
-  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
-                                the name of.  This is an optional parameter that\r
-                                may be NULL.  It will be NULL for device\r
-                                drivers.  It will also be NULL for a bus drivers\r
-                                that wish to retrieve the name of the bus\r
-                                controller.  It will not be NULL for a bus\r
-                                driver that wishes to retrieve the name of a\r
-                                child controller.\r
-\r
-  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
-                                array indicating the language.  This is the\r
-                                language of the driver name that the caller is\r
-                                requesting, and it must match one of the\r
-                                languages specified in SupportedLanguages. The\r
-                                number of languages supported by a driver is up\r
-                                to the driver writer. Language is specified in\r
-                                RFC 3066 or ISO 639-2 language code format.\r
-\r
-  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
-                                This Unicode string is the name of the\r
-                                controller specified by ControllerHandle and\r
-                                ChildHandle in the language specified by\r
-                                Language from the point of view of the driver\r
-                                specified by This.\r
-\r
-  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
-                                the language specified by Language for the\r
-                                driver specified by This was returned in\r
-                                DriverName.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
-                                EFI_HANDLE.\r
-\r
-  @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
-  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
-                                managing the controller specified by\r
-                                ControllerHandle and ChildHandle.\r
-\r
-  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
-                                the language specified by Language.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Ip4ConfigComponentNameGetControllerName (\r
-  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
-  IN  EFI_HANDLE                                      ControllerHandle,\r
-  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
-  IN  CHAR8                                           *Language,\r
-  OUT CHAR16                                          **ControllerName\r
-  );\r
-\r
-\r
 //\r
 // EFI Component Name Protocol\r
 //\r
@@ -168,6 +38,10 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIp4ConfigDriverNameTable
   {NULL, NULL}\r
 };\r
 \r
+//\r
+// EFI Component Name Functions\r
+//\r
+\r
 /**\r
   Retrieves a Unicode string that is the user readable name of the driver.\r
 \r
@@ -180,7 +54,6 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIp4ConfigDriverNameTable
 \r
   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
                                 EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
   @param  Language[in]          A pointer to a Null-terminated ASCII string\r
                                 array indicating the language. This is the\r
                                 language of the driver name that the caller is\r
@@ -188,8 +61,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIp4ConfigDriverNameTable
                                 languages specified in SupportedLanguages. The\r
                                 number of languages supported by a driver is up\r
                                 to the driver writer. Language is specified\r
-                                in RFC 3066 or ISO 639-2 language code format.\r
-\r
+                                in RFC 3066 or ISO 639-2 language code format.                                \r
   @param  DriverName[out]       A pointer to the Unicode string to return.\r
                                 This Unicode string is the name of the\r
                                 driver specified by This in the language\r
@@ -198,11 +70,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIp4ConfigDriverNameTable
   @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
                                 This and the language specified by Language was\r
                                 returned in DriverName.\r
-\r
   @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
   @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
-\r
   @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
                                 the language specified by Language.\r
 \r
@@ -239,12 +108,10 @@ Ip4ConfigComponentNameGetDriverName (
 \r
   @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
                                 EFI_COMPONENT_NAME_PROTOCOL instance.\r
-\r
   @param  ControllerHandle[in]  The handle of a controller that the driver\r
                                 specified by This is managing.  This handle\r
                                 specifies the controller whose name is to be\r
                                 returned.\r
-\r
   @param  ChildHandle[in]       The handle of the child controller to retrieve\r
                                 the name of.  This is an optional parameter that\r
                                 may be NULL.  It will be NULL for device\r
@@ -253,7 +120,6 @@ Ip4ConfigComponentNameGetDriverName (
                                 controller.  It will not be NULL for a bus\r
                                 driver that wishes to retrieve the name of a\r
                                 child controller.\r
-\r
   @param  Language[in]          A pointer to a Null-terminated ASCII string\r
                                 array indicating the language.  This is the\r
                                 language of the driver name that the caller is\r
@@ -262,32 +128,25 @@ Ip4ConfigComponentNameGetDriverName (
                                 number of languages supported by a driver is up\r
                                 to the driver writer. Language is specified in\r
                                 RFC 3066 or ISO 639-2 language code format.\r
-\r
   @param  ControllerName[out]   A pointer to the Unicode string to return.\r
                                 This Unicode string is the name of the\r
                                 controller specified by ControllerHandle and\r
                                 ChildHandle in the language specified by\r
                                 Language from the point of view of the driver\r
                                 specified by This.\r
-\r
+                                \r
   @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
                                 the language specified by Language for the\r
                                 driver specified by This was returned in\r
                                 DriverName.\r
-\r
   @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
-\r
   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
                                 EFI_HANDLE.\r
-\r
   @retval EFI_INVALID_PARAMETER Language is NULL.\r
-\r
   @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
-\r
   @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
                                 managing the controller specified by\r
                                 ControllerHandle and ChildHandle.\r
-\r
   @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
                                 the language specified by Language.\r
 \r
index 4c72a540451adbf2e32d5bde0e3da0b4bc45707a..d7672cbedf07781bde4b7c9603a73fd1181c321d 100644 (file)
@@ -16,24 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 IP4_CONFIG_INSTANCE *mIp4ConfigNicList[MAX_IP4_CONFIG_IN_VARIABLE];\r
 \r
-/**\r
-  Callback function when DHCP process finished. It will save the\r
-  retrieved IP configure parameter from DHCP to the NVRam.\r
-\r
-  @param  Event                  The callback event\r
-  @param  Context                Opaque context to the callback\r
-\r
-  @return None\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-Ip4ConfigOnDhcp4Complete (\r
-  IN EFI_EVENT                  Event,\r
-  IN VOID                       *Context\r
-  );\r
-\r
-\r
 /**\r
   Return the name and MAC address for the NIC. The Name, if not NULL,\r
   has at least IP4_NIC_NAME_LENGTH bytes.\r
@@ -49,9 +31,9 @@ Ip4ConfigOnDhcp4Complete (
 EFI_STATUS\r
 EFIAPI\r
 EfiNicIp4ConfigGetName (\r
-  IN  EFI_NIC_IP4_CONFIG_PROTOCOL *This,\r
-  IN  UINT16                      *Name,          OPTIONAL\r
-  IN  NIC_ADDR                    *NicAddr       OPTIONAL\r
+  IN  EFI_NIC_IP4_CONFIG_PROTOCOL  *This,\r
+  OUT  UINT16                      *Name          OPTIONAL,\r
+  OUT  NIC_ADDR                    *NicAddr       OPTIONAL\r
   )\r
 {\r
   IP4_CONFIG_INSTANCE       *Instance;\r
@@ -75,13 +57,13 @@ EfiNicIp4ConfigGetName (
 \r
 \r
 /**\r
-  Get the NIC's configure information from the IP4 configure  variable.\r
+  Get the NIC's configure information from the IP4 configure variable.\r
   It will remove the invalid variable.\r
 \r
   @param  NicAddr                The NIC to check\r
 \r
   @return NULL if no configure for the NIC in the variable, or it is invalid.\r
-  @return Otherwise the NIC's IP configure parameter.\r
+          Otherwise the pointer to the NIC's IP configure parameter will be returned.\r
 \r
 **/\r
 NIC_IP4_CONFIG_INFO *\r
@@ -134,14 +116,18 @@ Ip4ConfigGetNicInfo (
 /**\r
   Get the configure parameter for this NIC.\r
 \r
-  @param  This                   The NIC IP4 CONFIG protocol\r
+  @param  This                   The NIC IP4 CONFIG protocol.\r
   @param  ConfigLen              The length of the NicConfig buffer.\r
   @param  NicConfig              The buffer to receive the NIC's configure\r
                                  parameter.\r
 \r
-  @retval EFI_INVALID_PARAMETER  This or ConfigLen is NULL\r
+  @retval EFI_SUCCESS            The configure parameter for this NIC was \r
+                                 obtained successfully .\r
+  @retval EFI_INVALID_PARAMETER  This or ConfigLen is NULL.\r
   @retval EFI_NOT_FOUND          There is no configure parameter for the NIC in\r
                                  NVRam.\r
+  @retval EFI_BUFFER_TOO_SMALL   The ConfigLen is too small or the NicConfig is \r
+                                 NULL.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -192,10 +178,11 @@ EfiNicIp4ConfigGetInfo (
 \r
 \r
 /**\r
-  Set the IP configure parameters for this NIC. If Reconfig is TRUE,\r
-  the IP driver will be informed to discard current auto configure\r
-  parameter and restart the auto configuration process. If current\r
-  there is a pending auto configuration, EFI_ALREADY_STARTED is\r
+  Set the IP configure parameters for this NIC. \r
+\r
+  If Reconfig is TRUE, the IP driver will be informed to discard current \r
+  auto configure parameter and restart the auto configuration process. \r
+  If current there is a pending auto configuration, EFI_ALREADY_STARTED is\r
   returned. You can only change the configure setting when either\r
   the configure has finished or not started yet. If NicConfig, the\r
   NIC's configure parameter is removed from the variable.\r
@@ -204,7 +191,9 @@ EfiNicIp4ConfigGetInfo (
   @param  NicConfig              The new NIC IP4 configure parameter\r
   @param  Reconfig               Inform the IP4 driver to restart the auto\r
                                  configuration\r
-\r
+                                 \r
+  @retval EFI_SUCCESS            The configure parameter for this NIC was \r
+                                 set successfully .\r
   @retval EFI_INVALID_PARAMETER  This is NULL or the configure parameter is\r
                                  invalid.\r
   @retval EFI_ALREADY_STARTED    There is a pending auto configuration.\r
@@ -280,6 +269,120 @@ EfiNicIp4ConfigSetInfo (
   return Status;\r
 }\r
 \r
+/**\r
+  Callback function when DHCP process finished. It will save the\r
+  retrieved IP configure parameter from DHCP to the NVRam.\r
+\r
+  @param  Event                  The callback event\r
+  @param  Context                Opaque context to the callback\r
+\r
+  @return None\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+Ip4ConfigOnDhcp4Complete (\r
+  IN EFI_EVENT              Event,\r
+  IN VOID                   *Context\r
+  )\r
+{\r
+  IP4_CONFIG_INSTANCE       *Instance;\r
+  EFI_DHCP4_MODE_DATA       Dhcp4Mode;\r
+  EFI_IP4_IPCONFIG_DATA     *Ip4Config;\r
+  EFI_STATUS                Status;\r
+  BOOLEAN                   Perment;\r
+  IP4_ADDR                  Subnet;\r
+  IP4_ADDR                  Ip1;\r
+  IP4_ADDR                  Ip2;\r
+\r
+  Instance = (IP4_CONFIG_INSTANCE *) Context;\r
+  ASSERT (Instance->Dhcp4 != NULL);\r
+\r
+  Instance->State   = IP4_CONFIG_STATE_CONFIGURED;\r
+  Instance->Result  = EFI_TIMEOUT;\r
+\r
+  //\r
+  // Get the DHCP retrieved parameters\r
+  //\r
+  Status = Instance->Dhcp4->GetModeData (Instance->Dhcp4, &Dhcp4Mode);\r
+\r
+  if (EFI_ERROR (Status)) {\r
+    goto ON_EXIT;\r
+  }\r
+\r
+  if (Dhcp4Mode.State == Dhcp4Bound) {\r
+    //\r
+    // Save the new configuration retrieved by DHCP both in\r
+    // the instance and to NVRam. So, both the IP4 driver and\r
+    // other user can get that address.\r
+    //\r
+    Perment = FALSE;\r
+\r
+    if (Instance->NicConfig != NULL) {\r
+      ASSERT (Instance->NicConfig->Source == IP4_CONFIG_SOURCE_DHCP);\r
+      Perment = Instance->NicConfig->Perment;\r
+      gBS->FreePool (Instance->NicConfig);\r
+    }\r
+\r
+    Instance->NicConfig = AllocatePool (sizeof (NIC_IP4_CONFIG_INFO) + 2* sizeof (EFI_IP4_ROUTE_TABLE));\r
+\r
+    if (Instance->NicConfig == NULL) {\r
+      Instance->Result = EFI_OUT_OF_RESOURCES;\r
+      goto ON_EXIT;\r
+    }\r
+\r
+    Instance->NicConfig->Ip4Info.RouteTable = (EFI_IP4_ROUTE_TABLE *) (Instance->NicConfig + 1);\r
+\r
+    CopyMem (&Instance->NicConfig->NicAddr, &Instance->NicAddr, sizeof (Instance->NicConfig->NicAddr));\r
+    Instance->NicConfig->Source  = IP4_CONFIG_SOURCE_DHCP;\r
+    Instance->NicConfig->Perment = Perment;\r
+\r
+    Ip4Config                    = &Instance->NicConfig->Ip4Info;\r
+    Ip4Config->StationAddress    = Dhcp4Mode.ClientAddress;\r
+    Ip4Config->SubnetMask        = Dhcp4Mode.SubnetMask;\r
+\r
+    //\r
+    // Create a route for the connected network\r
+    //\r
+    Ip4Config->RouteTableSize    = 1;\r
+\r
+    CopyMem (&Ip1, &Dhcp4Mode.ClientAddress, sizeof (IP4_ADDR));\r
+    CopyMem (&Ip2, &Dhcp4Mode.SubnetMask, sizeof (IP4_ADDR));\r
+\r
+    Subnet = Ip1 & Ip2;\r
+\r
+    CopyMem (&Ip4Config->RouteTable[0].SubnetAddress, &Subnet, sizeof (EFI_IPv4_ADDRESS));\r
+    CopyMem (&Ip4Config->RouteTable[0].SubnetMask, &Dhcp4Mode.SubnetMask, sizeof (EFI_IPv4_ADDRESS));\r
+    ZeroMem (&Ip4Config->RouteTable[0].GatewayAddress, sizeof (EFI_IPv4_ADDRESS));\r
+\r
+    //\r
+    // Create a route if there is a default router.\r
+    //\r
+    if (!EFI_IP4_EQUAL (&Dhcp4Mode.RouterAddress, &mZeroIp4Addr)) {\r
+      Ip4Config->RouteTableSize = 2;\r
+\r
+      ZeroMem (&Ip4Config->RouteTable[1].SubnetAddress, sizeof (EFI_IPv4_ADDRESS));\r
+      ZeroMem (&Ip4Config->RouteTable[1].SubnetMask, sizeof (EFI_IPv4_ADDRESS));\r
+      CopyMem (&Ip4Config->RouteTable[1].GatewayAddress, &Dhcp4Mode.RouterAddress, sizeof (EFI_IPv4_ADDRESS));\r
+    }\r
+\r
+    Instance->Result = EFI_SUCCESS;\r
+\r
+    //\r
+    // ignore the return status of EfiNicIp4ConfigSetInfo. Network\r
+    // stack can operate even that failed.\r
+    //\r
+    EfiNicIp4ConfigSetInfo (&Instance->NicIp4Protocol, Instance->NicConfig, FALSE);\r
+  }\r
+\r
+ON_EXIT:\r
+  gBS->SignalEvent (Instance->DoneEvent);\r
+  Ip4ConfigCleanDhcp4 (Instance);\r
+\r
+  NetLibDispatchDpc ();\r
+\r
+  return ;\r
+}\r
 \r
 /**\r
   Starts running the configuration policy for the EFI IPv4 Protocol driver.\r
@@ -557,8 +660,9 @@ ON_EXIT:
   @retval EFI_INVALID_PARAMETER  This is NULL.\r
   @retval EFI_NOT_STARTED        The configuration policy for the EFI IPv4 Protocol \r
                                  driver is not running.\r
-  @retval EFI_NOT_READY EFI      IPv4 Protocol driver configuration is still running.\r
-  @retval EFI_ABORTED EFI        IPv4 Protocol driver configuration could not complete.\r
+  @retval EFI_NOT_READY          EFI IPv4 Protocol driver configuration is still running.\r
+  @retval EFI_ABORTED            EFI IPv4 Protocol driver configuration could not complete.\r
+                                 Currently not implemented.\r
   @retval EFI_BUFFER_TOO_SMALL   *ConfigDataSize is smaller than the configuration \r
                                  data buffer or ConfigData is NULL.\r
 \r
@@ -623,123 +727,6 @@ ON_EXIT:
   return Status;\r
 }\r
 \r
-\r
-/**\r
-  Callback function when DHCP process finished. It will save the\r
-  retrieved IP configure parameter from DHCP to the NVRam.\r
-\r
-  @param  Event                  The callback event\r
-  @param  Context                Opaque context to the callback\r
-\r
-  @return None\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-Ip4ConfigOnDhcp4Complete (\r
-  IN EFI_EVENT              Event,\r
-  IN VOID                   *Context\r
-  )\r
-{\r
-  IP4_CONFIG_INSTANCE       *Instance;\r
-  EFI_DHCP4_MODE_DATA       Dhcp4Mode;\r
-  EFI_IP4_IPCONFIG_DATA     *Ip4Config;\r
-  EFI_STATUS                Status;\r
-  BOOLEAN                   Perment;\r
-  IP4_ADDR                  Subnet;\r
-  IP4_ADDR                  Ip1;\r
-  IP4_ADDR                  Ip2;\r
-\r
-  Instance = (IP4_CONFIG_INSTANCE *) Context;\r
-  ASSERT (Instance->Dhcp4 != NULL);\r
-\r
-  Instance->State   = IP4_CONFIG_STATE_CONFIGURED;\r
-  Instance->Result  = EFI_TIMEOUT;\r
-\r
-  //\r
-  // Get the DHCP retrieved parameters\r
-  //\r
-  Status = Instance->Dhcp4->GetModeData (Instance->Dhcp4, &Dhcp4Mode);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_EXIT;\r
-  }\r
-\r
-  if (Dhcp4Mode.State == Dhcp4Bound) {\r
-    //\r
-    // Save the new configuration retrieved by DHCP both in\r
-    // the instance and to NVRam. So, both the IP4 driver and\r
-    // other user can get that address.\r
-    //\r
-    Perment = FALSE;\r
-\r
-    if (Instance->NicConfig != NULL) {\r
-      ASSERT (Instance->NicConfig->Source == IP4_CONFIG_SOURCE_DHCP);\r
-      Perment = Instance->NicConfig->Perment;\r
-      gBS->FreePool (Instance->NicConfig);\r
-    }\r
-\r
-    Instance->NicConfig = AllocatePool (sizeof (NIC_IP4_CONFIG_INFO) + 2* sizeof (EFI_IP4_ROUTE_TABLE));\r
-\r
-    if (Instance->NicConfig == NULL) {\r
-      Instance->Result = EFI_OUT_OF_RESOURCES;\r
-      goto ON_EXIT;\r
-    }\r
-\r
-    Instance->NicConfig->Ip4Info.RouteTable = (EFI_IP4_ROUTE_TABLE *) (Instance->NicConfig + 1);\r
-\r
-    CopyMem (&Instance->NicConfig->NicAddr, &Instance->NicAddr, sizeof (Instance->NicConfig->NicAddr));\r
-    Instance->NicConfig->Source  = IP4_CONFIG_SOURCE_DHCP;\r
-    Instance->NicConfig->Perment = Perment;\r
-\r
-    Ip4Config                    = &Instance->NicConfig->Ip4Info;\r
-    Ip4Config->StationAddress    = Dhcp4Mode.ClientAddress;\r
-    Ip4Config->SubnetMask        = Dhcp4Mode.SubnetMask;\r
-\r
-    //\r
-    // Create a route for the connected network\r
-    //\r
-    Ip4Config->RouteTableSize    = 1;\r
-\r
-    CopyMem (&Ip1, &Dhcp4Mode.ClientAddress, sizeof (IP4_ADDR));\r
-    CopyMem (&Ip2, &Dhcp4Mode.SubnetMask, sizeof (IP4_ADDR));\r
-\r
-    Subnet = Ip1 & Ip2;\r
-\r
-    CopyMem (&Ip4Config->RouteTable[0].SubnetAddress, &Subnet, sizeof (EFI_IPv4_ADDRESS));\r
-    CopyMem (&Ip4Config->RouteTable[0].SubnetMask, &Dhcp4Mode.SubnetMask, sizeof (EFI_IPv4_ADDRESS));\r
-    ZeroMem (&Ip4Config->RouteTable[0].GatewayAddress, sizeof (EFI_IPv4_ADDRESS));\r
-\r
-    //\r
-    // Create a route if there is a default router.\r
-    //\r
-    if (!EFI_IP4_EQUAL (&Dhcp4Mode.RouterAddress, &mZeroIp4Addr)) {\r
-      Ip4Config->RouteTableSize = 2;\r
-\r
-      ZeroMem (&Ip4Config->RouteTable[1].SubnetAddress, sizeof (EFI_IPv4_ADDRESS));\r
-      ZeroMem (&Ip4Config->RouteTable[1].SubnetMask, sizeof (EFI_IPv4_ADDRESS));\r
-      CopyMem (&Ip4Config->RouteTable[1].GatewayAddress, &Dhcp4Mode.RouterAddress, sizeof (EFI_IPv4_ADDRESS));\r
-    }\r
-\r
-    Instance->Result = EFI_SUCCESS;\r
-\r
-    //\r
-    // ignore the return status of EfiNicIp4ConfigSetInfo. Network\r
-    // stack can operate even that failed.\r
-    //\r
-    EfiNicIp4ConfigSetInfo (&Instance->NicIp4Protocol, Instance->NicConfig, FALSE);\r
-  }\r
-\r
-ON_EXIT:\r
-  gBS->SignalEvent (Instance->DoneEvent);\r
-  Ip4ConfigCleanDhcp4 (Instance);\r
-\r
-  NetLibDispatchDpc ();\r
-\r
-  return ;\r
-}\r
-\r
-\r
 /**\r
   Release all the DHCP related resources.\r
 \r
index c6c7caa1cc296e9834256c84b09049987e9d2cf6..860ccf067da86659f3ef0e052ebc1484250929b5 100644 (file)
@@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef _EFI_IP4CONFIG_H_\r
 #define _EFI_IP4CONFIG_H_\r
 \r
-#include <PiDxe.h>\r
+#include <Uefi.h>\r
 \r
 #include <Protocol/Dhcp4.h>\r
 #include <Protocol/Ip4Config.h>\r
@@ -34,15 +34,26 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 typedef struct _IP4_CONFIG_INSTANCE IP4_CONFIG_INSTANCE;\r
 \r
+//\r
+// Global variables \r
+//\r
+extern EFI_DRIVER_BINDING_PROTOCOL   gIp4ConfigDriverBinding;\r
+extern EFI_COMPONENT_NAME_PROTOCOL   gIp4ConfigComponentName;\r
+extern EFI_COMPONENT_NAME2_PROTOCOL  gIp4ConfigComponentName2;\r
+\r
+extern IP4_CONFIG_INSTANCE           *mIp4ConfigNicList[MAX_IP4_CONFIG_IN_VARIABLE];\r
+extern EFI_IP4_CONFIG_PROTOCOL       mIp4ConfigProtocolTemplate;\r
+extern EFI_NIC_IP4_CONFIG_PROTOCOL   mNicIp4ConfigProtocolTemplate;\r
+\r
+#define IP4_PROTO_ICMP                 0x01\r
+#define IP4_CONFIG_INSTANCE_SIGNATURE  SIGNATURE_32 ('I', 'P', '4', 'C')\r
+\r
 typedef enum {\r
   IP4_CONFIG_STATE_IDLE         = 0,\r
   IP4_CONFIG_STATE_STARTED,\r
   IP4_CONFIG_STATE_CONFIGURED\r
 } IP4_CONFIG_STATE;\r
 \r
-#define IP4_PROTO_ICMP                 0x01\r
-#define IP4_CONFIG_INSTANCE_SIGNATURE  SIGNATURE_32 ('I', 'P', '4', 'C')\r
-\r
 typedef enum {\r
   DHCP_TAG_PARA_LIST            = 55,\r
   DHCP_TAG_NETMASK              = 1,\r
@@ -108,13 +119,6 @@ struct _IP4_CONFIG_INSTANCE {
 #define IP4_CONFIG_INSTANCE_FROM_NIC_IP4CONFIG(this) \\r
   CR (this, IP4_CONFIG_INSTANCE, NicIp4Protocol, IP4_CONFIG_INSTANCE_SIGNATURE)\r
 \r
-extern EFI_DRIVER_BINDING_PROTOCOL   gIp4ConfigDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL   gIp4ConfigComponentName;\r
-extern EFI_COMPONENT_NAME2_PROTOCOL  gIp4ConfigComponentName2;\r
-extern IP4_CONFIG_INSTANCE           *mIp4ConfigNicList[MAX_IP4_CONFIG_IN_VARIABLE];\r
-extern EFI_IP4_CONFIG_PROTOCOL       mIp4ConfigProtocolTemplate;\r
-extern EFI_NIC_IP4_CONFIG_PROTOCOL   mNicIp4ConfigProtocolTemplate;\r
-\r
 /**\r
   Release all the DHCP related resources.\r
 \r
@@ -125,7 +129,7 @@ extern EFI_NIC_IP4_CONFIG_PROTOCOL   mNicIp4ConfigProtocolTemplate;
 **/\r
 VOID\r
 Ip4ConfigCleanDhcp4 (\r
-  IN IP4_CONFIG_INSTANCE        *This\r
+  IN IP4_CONFIG_INSTANCE    *This\r
   );\r
 \r
 /**\r
@@ -140,4 +144,183 @@ VOID
 Ip4ConfigCleanConfig (\r
   IN IP4_CONFIG_INSTANCE        *Instance\r
   );\r
+  \r
+//\r
+// EFI Component Name Functions\r
+//\r
+\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the driver.\r
+\r
+  This function retrieves the user readable name of a driver in the form of a\r
+  Unicode string. If the driver specified by This has a user readable name in\r
+  the language specified by Language, then a pointer to the driver name is\r
+  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
+  by This does not support the language specified by Language,\r
+  then EFI_UNSUPPORTED is returned.\r
+\r
+  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
+  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
+                                array indicating the language. This is the\r
+                                language of the driver name that the caller is\r
+                                requesting, and it must match one of the\r
+                                languages specified in SupportedLanguages. The\r
+                                number of languages supported by a driver is up\r
+                                to the driver writer. Language is specified\r
+                                in RFC 3066 or ISO 639-2 language code format.                                \r
+  @param  DriverName[out]       A pointer to the Unicode string to return.\r
+                                This Unicode string is the name of the\r
+                                driver specified by This in the language\r
+                                specified by Language.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
+                                This and the language specified by Language was\r
+                                returned in DriverName.\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                the language specified by Language.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Ip4ConfigComponentNameGetDriverName (\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL  *This,\r
+  IN  CHAR8                        *Language,\r
+  OUT CHAR16                       **DriverName\r
+  );\r
+\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the controller\r
+  that is being managed by a driver.\r
+\r
+  This function retrieves the user readable name of the controller specified by\r
+  ControllerHandle and ChildHandle in the form of a Unicode string. If the\r
+  driver specified by This has a user readable name in the language specified by\r
+  Language, then a pointer to the controller name is returned in ControllerName,\r
+  and EFI_SUCCESS is returned.  If the driver specified by This is not currently\r
+  managing the controller specified by ControllerHandle and ChildHandle,\r
+  then EFI_UNSUPPORTED is returned.  If the driver specified by This does not\r
+  support the language specified by Language, then EFI_UNSUPPORTED is returned.\r
+\r
+  @param  This[in]              A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r
+                                EFI_COMPONENT_NAME_PROTOCOL instance.\r
+  @param  ControllerHandle[in]  The handle of a controller that the driver\r
+                                specified by This is managing.  This handle\r
+                                specifies the controller whose name is to be\r
+                                returned.\r
+  @param  ChildHandle[in]       The handle of the child controller to retrieve\r
+                                the name of.  This is an optional parameter that\r
+                                may be NULL.  It will be NULL for device\r
+                                drivers.  It will also be NULL for a bus drivers\r
+                                that wish to retrieve the name of the bus\r
+                                controller.  It will not be NULL for a bus\r
+                                driver that wishes to retrieve the name of a\r
+                                child controller.\r
+  @param  Language[in]          A pointer to a Null-terminated ASCII string\r
+                                array indicating the language.  This is the\r
+                                language of the driver name that the caller is\r
+                                requesting, and it must match one of the\r
+                                languages specified in SupportedLanguages. The\r
+                                number of languages supported by a driver is up\r
+                                to the driver writer. Language is specified in\r
+                                RFC 3066 or ISO 639-2 language code format.\r
+  @param  ControllerName[out]   A pointer to the Unicode string to return.\r
+                                This Unicode string is the name of the\r
+                                controller specified by ControllerHandle and\r
+                                ChildHandle in the language specified by\r
+                                Language from the point of view of the driver\r
+                                specified by This.\r
+                                \r
+  @retval EFI_SUCCESS           The Unicode string for the user readable name in\r
+                                the language specified by Language for the\r
+                                driver specified by This was returned in\r
+                                DriverName.\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
+                                EFI_HANDLE.\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This is not currently\r
+                                managing the controller specified by\r
+                                ControllerHandle and ChildHandle.\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                the language specified by Language.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Ip4ConfigComponentNameGetControllerName (\r
+  IN  EFI_COMPONENT_NAME_PROTOCOL                     *This,\r
+  IN  EFI_HANDLE                                      ControllerHandle,\r
+  IN  EFI_HANDLE                                      ChildHandle        OPTIONAL,\r
+  IN  CHAR8                                           *Language,\r
+  OUT CHAR16                                          **ControllerName\r
+  );\r
+  \r
+/**\r
+  Test to see if this driver supports ControllerHandle.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  ControllerHandle     Handle of device to test\r
+  @param  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
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Ip4ConfigDriverBindingSupported (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
+  IN EFI_HANDLE                   ControllerHandle,\r
+  IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath  OPTIONAL\r
+  );\r
+  \r
+/**\r
+  Start this driver on ControllerHandle.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  ControllerHandle     Handle of device to bind driver to\r
+  @param  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
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Ip4ConfigDriverBindingStart (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
+  IN EFI_HANDLE                   ControllerHandle,\r
+  IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath OPTIONAL\r
+  );\r
+  \r
+/**\r
+  Stop this driver on ControllerHandle.\r
+\r
+  @param  This                 Protocol instance pointer.\r
+  @param  ControllerHandle     Handle of device to stop driver on\r
+  @param  NumberOfChildren     Number of Handles in ChildHandleBuffer. If number of\r
+                                children is zero stop the entire bus driver.\r
+  @param  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
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+Ip4ConfigDriverBindingStop (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  *This,\r
+  IN EFI_HANDLE                   ControllerHandle,\r
+  IN UINTN                        NumberOfChildren,\r
+  IN EFI_HANDLE                   *ChildHandleBuffer\r
+  );\r
+  \r
 #endif\r
index d913857e306b2d6d3cbb3817f0e89c33dce399e8..1f8fa92bb1a52b79c286778091ecad2d944b233d 100644 (file)
@@ -15,6 +15,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "Ip4Config.h"\r
 \r
+EFI_DRIVER_BINDING_PROTOCOL gIp4ConfigDriverBinding = {\r
+  Ip4ConfigDriverBindingSupported,\r
+  Ip4ConfigDriverBindingStart,\r
+  Ip4ConfigDriverBindingStop,\r
+  0xa,\r
+  NULL,\r
+  NULL\r
+};\r
 \r
 /**\r
   Stop all the auto configuration when the IP4 configure driver is\r
@@ -500,11 +508,3 @@ Ip4ConfigDriverBindingStop (
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_DRIVER_BINDING_PROTOCOL gIp4ConfigDriverBinding = {\r
-  Ip4ConfigDriverBindingSupported,\r
-  Ip4ConfigDriverBindingStart,\r
-  Ip4ConfigDriverBindingStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
index f213dfa8cd20569e50f375f75ea1940b66e3b01b..012da5d33f9b50d14077e4f8064b4fbe6b74ac9b 100644 (file)
@@ -12,15 +12,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include <Uefi.h>\r
-\r
-#include <Library/NetLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiRuntimeServicesTableLib.h>\r
-\r
 #include "NicIp4Variable.h"\r
 \r
 \r
@@ -206,7 +197,7 @@ Ip4ConfigWriteVariable (
   @param  NicAddr      The interface address to check\r
 \r
   @return The point to the NIC's IP4 configure info if it is found\r
-  @return in the IP4 variable, otherwise NULL.\r
+          in the IP4 variable, otherwise NULL.\r
 \r
 **/\r
 NIC_IP4_CONFIG_INFO *\r
@@ -263,9 +254,9 @@ Ip4ConfigFindNicVariable (
   @param  Config       The new configuration parameter (NULL to remove the old)\r
 \r
   @return The new IP4_CONFIG_VARIABLE variable if the new variable has at\r
-  @return least one NIC configure and no EFI_OUT_OF_RESOURCES failure.\r
-  @return Return NULL either because failed to locate memory for new variable\r
-  @return or the only NIC configure is removed from the Variable.\r
+          least one NIC configure and no EFI_OUT_OF_RESOURCES failure.\r
+          Return NULL either because failed to locate memory for new variable\r
+          or the only NIC configure is removed from the Variable.\r
 \r
 **/\r
 IP4_CONFIG_VARIABLE *\r
@@ -387,7 +378,7 @@ Ip4ConfigModifyVariable (
 **/\r
 VOID\r
 Ip4ConfigFixRouteTablePointer (\r
-  IN EFI_IP4_IPCONFIG_DATA  *ConfigData\r
+  IN OUT EFI_IP4_IPCONFIG_DATA  *ConfigData\r
   )\r
 {\r
   //\r
index 635ffdb7c35e67258abd7d4dad121d645db0a37b..9d191de811110517a8f0d56a0e5b86c4b6fbdb3e 100644 (file)
@@ -15,9 +15,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef _NIC_IP4_VARIABLE_H_\r
 #define _NIC_IP4_VARIABLE_H_\r
 \r
+#include <Uefi.h>\r
+\r
+#include <Library/NetLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
 \r
 #include <Protocol/NicIp4Config.h>\r
 \r
+\r
 //\r
 // Return the size of NIC_IP4_CONFIG_INFO and EFI_IP4_IPCONFIG_DATA.\r
 // They are of variable size\r
@@ -75,7 +84,7 @@ Ip4ConfigReadVariable (
 **/\r
 EFI_STATUS\r
 Ip4ConfigWriteVariable (\r
-  IN IP4_CONFIG_VARIABLE    *Config       OPTIONAL\r
+  IN IP4_CONFIG_VARIABLE    *Config        OPTIONAL\r
   );\r
 \r
 /**\r
@@ -107,9 +116,9 @@ Ip4ConfigFindNicVariable (
   @param  Config       The new configuration parameter (NULL to remove the old)\r
 \r
   @return The new IP4_CONFIG_VARIABLE variable if the new variable has at\r
-  @return least one NIC configure and no EFI_OUT_OF_RESOURCES failure.\r
-  @return Return NULL either because failed to locate memory for new variable\r
-  @return or the only NIC configure is removed from the Variable.\r
+          least one NIC configure and no EFI_OUT_OF_RESOURCES failure.\r
+          Return NULL either because failed to locate memory for new variable\r
+          or the only NIC configure is removed from the Variable.\r
 \r
 **/\r
 IP4_CONFIG_VARIABLE *\r
@@ -130,7 +139,7 @@ Ip4ConfigModifyVariable (
 **/\r
 VOID\r
 Ip4ConfigFixRouteTablePointer (\r
-  IN EFI_IP4_IPCONFIG_DATA  *ConfigData\r
+  IN OUT EFI_IP4_IPCONFIG_DATA  *ConfigData\r
   );\r
 \r
 #endif\r