]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg: Remove Ip4ConfigDxe and related guid definition
authorJiaxin Wu <jiaxin.wu@intel.com>
Fri, 10 Jul 2015 05:49:48 +0000 (05:49 +0000)
committerjiaxinwu <jiaxinwu@Edk2>
Fri, 10 Jul 2015 05:49:48 +0000 (05:49 +0000)
Ip4ConfigDxe driver is deprecated in UEFI 2.5, so we will not support original Ip4Config Protocol,
which is replace by Ip4Config2 Protocol integrated in Ip4Dxe driver(git commit 1f6729ff (SVN r17853)).

Dependent network drivers, libraries and applications have been migrated to (or extended to) the new protocol version.
For example:
git 7c25b7ea (SVN r17869): ping & ifconfig
git 00a6ad1b (SVN r17870): UefiHandleParsingLib
git 6c5c70d6 (SVN r17873): DxeNetLib
git 39561686 (SVN r17874): IpSecDxe
git c581e503 (SVN r17875): EfiSocketLib

This patch is based on related packages(MdeModulePkg, Nt32Pkg,  ArmPlatformPkg, ArmVirtPkg, EmulatorPkg, OvmfPkg, Vlv2TbltDevicePkg) clean-up work finished.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17917 6f19259b-4bc3-4df7-8a09-765794883524

18 files changed:
MdeModulePkg/Include/Guid/Ip4ConfigHii.h [deleted file]
MdeModulePkg/Include/Guid/NicIp4ConfigNvData.h [deleted file]
MdeModulePkg/MdeModulePkg.dec
MdeModulePkg/MdeModulePkg.dsc
MdeModulePkg/Universal/Network/Ip4ConfigDxe/ComponentName.c [deleted file]
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c [deleted file]
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h [deleted file]
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c [deleted file]
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.inf [deleted file]
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.uni [deleted file]
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.vfr [deleted file]
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxeExtra.uni [deleted file]
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxeStrings.uni [deleted file]
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c [deleted file]
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.h [deleted file]
MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4NvData.h [deleted file]
MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c [deleted file]
MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.h [deleted file]

diff --git a/MdeModulePkg/Include/Guid/Ip4ConfigHii.h b/MdeModulePkg/Include/Guid/Ip4ConfigHii.h
deleted file mode 100644 (file)
index 87c54a0..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/** @file\r
-  GUIDs used as HII FormSet and HII Package list GUID in Ip4ConfigDxe driver. \r
-  \r
-Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials are licensed and made available under \r
-the terms and conditions of the BSD License that accompanies this distribution.  \r
-The full text of the license may be found at\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
-\r
-**/\r
-\r
-#ifndef __IP4_CONFIG_HII_GUID_H__\r
-#define __IP4_CONFIG_HII_GUID_H__\r
-\r
-#define EFI_NIC_IP4_CONFIG_NVDATA_GUID \\r
-  { \\r
-    0x9d5b53f, 0xf4b0, 0x4f59, { 0xa0, 0xb1, 0x7b, 0x57, 0xd3, 0x5c, 0xe, 0x5 } \\r
-  }\r
-\r
-extern EFI_GUID gNicIp4ConfigNvDataGuid;\r
-\r
-#endif\r
diff --git a/MdeModulePkg/Include/Guid/NicIp4ConfigNvData.h b/MdeModulePkg/Include/Guid/NicIp4ConfigNvData.h
deleted file mode 100644 (file)
index d3ce76f..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/** @file\r
-  This file defines NIC_IP4_CONFIG_INFO structure.\r
-  \r
-Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials are licensed and made available under \r
-the terms and conditions of the BSD License that accompanies this distribution.  \r
-The full text of the license may be found at\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
-\r
-**/\r
-\r
-#ifndef __NIC_IP4_CONFIG_NVDATA_H__\r
-#define __NIC_IP4_CONFIG_NVDATA_H__\r
-\r
-#include <Protocol/Ip4Config.h>\r
-\r
-#define EFI_NIC_IP4_CONFIG_VARIABLE_GUID \\r
-  { \\r
-    0xd8944553, 0xc4dd, 0x41f4, { 0x9b, 0x30, 0xe1, 0x39, 0x7c, 0xfb, 0x26, 0x7b } \\r
-  }\r
-\r
-#define EFI_NIC_IP4_CONFIG_VARIABLE          L"EfiNicIp4ConfigVariable"\r
-\r
-\r
-//\r
-// Config source: dhcp or static\r
-//\r
-#define IP4_CONFIG_SOURCE_DHCP     0\r
-#define IP4_CONFIG_SOURCE_STATIC   1\r
-#define IP4_CONFIG_SOURCE_MAX      2\r
-\r
-#define IP4_NIC_NAME_LENGTH        64\r
-#define MAX_IP4_CONFIG_IN_VARIABLE 16\r
-\r
-//\r
-// The following structures are used by drivers/applications other\r
-// than EFI_IP4_PROTOCOL, such as the ifconfig shell application, to\r
-// communicate the IP configuration information to the EFI_IP4_CONFIG_PROTOCOL.\r
-// The EFI_IP4_PROTOCOL uses the EFI_IP4_CONFIG_PROTOCOL to get\r
-// the default IP4 configuration.\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;       ///< 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                   Permanent;    ///< Survive the reboot or not.\r
-  EFI_IP4_IPCONFIG_DATA     Ip4Info;      ///< IP addresses.\r
-} NIC_IP4_CONFIG_INFO;\r
-\r
-extern EFI_GUID gEfiNicIp4ConfigVariableGuid;\r
-\r
-#endif\r
index b5acce1dbe963b137a641eb86d642664a3826c91..623b07f9c6a2ef9feade84c40149559686f019e7 100644 (file)
   #  Include/Guid/Crc32GuidedSectionExtraction.h\r
   gEfiCrc32GuidedSectionExtractionGuid = { 0xFC1BCDB0, 0x7D31, 0x49aa, {0x93, 0x6A, 0xA4, 0x60, 0x0D, 0x9D, 0xD0, 0x83 } }\r
 \r
-  ## Include/Guid/NicIp4ConfigNvData.h\r
-  gEfiNicIp4ConfigVariableGuid   = {0xd8944553, 0xc4dd, 0x41f4, { 0x9b, 0x30, 0xe1, 0x39, 0x7c, 0xfb, 0x26, 0x7b }}\r
-\r
   ## Include/Guid/StatusCodeCallbackGuid.h\r
   gStatusCodeCallbackGuid   = {0xe701458c, 0x4900, 0x4ca5, {0xb7, 0x72, 0x3d, 0x37, 0x94, 0x9f, 0x79, 0x27}}\r
 \r
   ## Include/Guid/PlatDriOverrideHii.h\r
   gPlatformOverridesManagerGuid      = { 0x8614567d, 0x35be, 0x4415, { 0x8d, 0x88, 0xbd, 0x7d, 0xc, 0x9c, 0x70, 0xc0 }}\r
 \r
-  ## Include/Guid/Ip4ConfigHii.h\r
-  gNicIp4ConfigNvDataGuid            = { 0x9d5b53f, 0xf4b0, 0x4f59, { 0xa0, 0xb1, 0x7b, 0x57, 0xd3, 0x5c, 0xe, 0x5 }}\r
-\r
   ## Include/Guid/Ip4Config2Hii.h\r
   gIp4Config2NvDataGuid              = { 0x9b942747, 0x154e, 0x4d29, { 0xa4, 0x36, 0xbf, 0x71, 0x0, 0xc8, 0xb5, 0x3b }}\r
 \r
index fc518d0e97ce2c40942dea12180edba4b04335a0..3537ca8820d160df635221a8c495e6839e86289f 100644 (file)
   MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf\r
   MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf\r
   MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf\r
-  MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.inf\r
   MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf\r
   MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf\r
   MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf\r
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/ComponentName.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/ComponentName.c
deleted file mode 100644 (file)
index ca68746..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/** @file\r
-  UEFI Component Name(2) protocol implementation for Ip4ConfigDxe driver.\r
-  \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
-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
-\r
-**/\r
-\r
-#include "Ip4Config.h"\r
-\r
-//\r
-// EFI Component Name Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL  gIp4ConfigComponentName = {\r
-  Ip4ConfigComponentNameGetDriverName,\r
-  Ip4ConfigComponentNameGetControllerName,\r
-  "eng"\r
-};\r
-\r
-//\r
-// EFI Component Name 2 Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gIp4ConfigComponentName2 = {\r
-  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) Ip4ConfigComponentNameGetDriverName,\r
-  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) Ip4ConfigComponentNameGetControllerName,\r
-  "en"\r
-};\r
-\r
-\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIp4ConfigDriverNameTable[] = {\r
-  {"eng;en", L"IP4 CONFIG Network Service Driver"},\r
-  {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
-  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 4646 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
-  return LookupUnicodeString2 (\r
-           Language,\r
-           This->SupportedLanguages,\r
-           mIp4ConfigDriverNameTable,\r
-           DriverName,\r
-           (BOOLEAN)(This == &gIp4ConfigComponentName)\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
-  @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 4646 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 NULL.\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
-  return EFI_UNSUPPORTED;\r
-}\r
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c
deleted file mode 100644 (file)
index 3d2f0a4..0000000
+++ /dev/null
@@ -1,745 +0,0 @@
-/** @file\r
-  This code implements the IP4Config and NicIp4Config protocols.\r
-\r
-Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>\r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
-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
-\r
-**/\r
-\r
-#include "Ip4Config.h"\r
-#include "NicIp4Variable.h"\r
-\r
-//\r
-// Ip4 Config Protocol\r
-//\r
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_IP4_CONFIG_PROTOCOL     mIp4ConfigProtocolTemplate = {\r
-  EfiIp4ConfigStart,\r
-  EfiIp4ConfigStop,\r
-  EfiIp4ConfigGetData\r
-};\r
-\r
-/**\r
-  Get the NIC's configure information from the IP4 configure variable.\r
-  It will remove the invalid variable.\r
-\r
-  @param  Instance               The IP4 CONFIG instance.\r
-\r
-  @return NULL if no configure for the NIC in the variable, or it is invalid.\r
-          Otherwise the pointer to the NIC's IP configure parameter will be returned.\r
-\r
-**/\r
-NIC_IP4_CONFIG_INFO *\r
-EfiNicIp4ConfigGetInfo (\r
-  IN  IP4_CONFIG_INSTANCE   *Instance\r
-  )\r
-{\r
-  NIC_IP4_CONFIG_INFO *NicConfig;\r
-\r
-  //\r
-  // Read the configuration parameter for this NIC from\r
-  // the EFI variable\r
-  //\r
-  NicConfig = Ip4ConfigReadVariable (Instance);\r
-  if (NicConfig == NULL) {\r
-    return NULL;\r
-  }\r
-\r
-  //\r
-  // Validate the configuration, if the configuration is invalid,\r
-  // remove it from the variable.\r
-  //\r
-  if (!Ip4ConfigIsValid (NicConfig)) {\r
-    Ip4ConfigWriteVariable (Instance, NULL);\r
-\r
-    FreePool (NicConfig);\r
-    NicConfig = NULL;\r
-  }\r
-\r
-  return NicConfig;\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  Instance               The IP4 CONFIG instance.\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
-EFI_STATUS\r
-EFIAPI\r
-EfiNicIp4ConfigSetInfo (\r
-  IN IP4_CONFIG_INSTANCE          *Instance,\r
-  IN NIC_IP4_CONFIG_INFO          *NicConfig     OPTIONAL,\r
-  IN BOOLEAN                      Reconfig\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-  //\r
-  // Validate the parameters\r
-  //\r
-  if (Instance == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if ((NicConfig != NULL) && (!Ip4ConfigIsValid (NicConfig) ||\r
-      !NIC_ADDR_EQUAL (&NicConfig->NicAddr, &Instance->NicAddr))) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  if (Instance->State == IP4_CONFIG_STATE_STARTED) {\r
-    return EFI_ALREADY_STARTED;\r
-  }\r
-\r
-  //\r
-  // Update the parameter in the configure variable\r
-  //\r
-  Status = Ip4ConfigWriteVariable (Instance, NicConfig);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Signal the IP4 to run the auto configuration again\r
-  //\r
-  if (Reconfig && (Instance->ReconfigEvent != NULL)) {\r
-    //\r
-    // When NicConfig is NULL, NIC IP4 configuration parameter is removed,\r
-    // the auto configuration process should stop running the configuration\r
-    // policy for the EFI IPv4 Protocol driver.\r
-    //\r
-    if (NicConfig == NULL) {\r
-      Instance->DoNotStart = TRUE;\r
-    }\r
-\r
-    Status = gBS->SignalEvent (Instance->ReconfigEvent);\r
-    DispatchDpc ();\r
-  }\r
-\r
-  if (NicConfig == NULL) {\r
-    return Status;\r
-  }\r
-  //\r
-  // A dedicated timer is used to poll underlying media status.In case of\r
-  // cable swap, a new round auto configuration will be initiated. The timer\r
-  // starts in DHCP policy only. STATIC policy stops the timer.\r
-  // \r
-  if (NicConfig->Source == IP4_CONFIG_SOURCE_DHCP) {\r
-    gBS->SetTimer (Instance->Timer, TimerPeriodic, TICKS_PER_SECOND);\r
-  } else if (NicConfig->Source == IP4_CONFIG_SOURCE_STATIC) {\r
-    gBS->SetTimer (Instance->Timer, TimerCancel, 0);\r
-  }\r
-  \r
-  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                   Permanent;\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
-    Permanent = FALSE;\r
-\r
-    if (Instance->NicConfig != NULL) {\r
-      ASSERT (Instance->NicConfig->Source == IP4_CONFIG_SOURCE_DHCP);\r
-      Permanent = Instance->NicConfig->Permanent;\r
-      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->Permanent = Permanent;\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, Instance->NicConfig, FALSE);\r
-  }\r
-\r
-ON_EXIT:\r
-  gBS->SignalEvent (Instance->DoneEvent);\r
-  Ip4ConfigCleanDhcp4 (Instance);\r
-\r
-  DispatchDpc ();\r
-\r
-  return ;\r
-}\r
-\r
-/**\r
-  Starts running the configuration policy for the EFI IPv4 Protocol driver.\r
-\r
-  The Start() function is called to determine and to begin the platform\r
-  configuration policy by the EFI IPv4 Protocol driver. This determination may\r
-  be as simple as returning EFI_UNSUPPORTED if there is no EFI IPv4 Protocol\r
-  driver configuration policy. It may be as involved as loading some defaults\r
-  from nonvolatile storage, downloading dynamic data from a DHCP server, and\r
-  checking permissions with a site policy server.\r
-  Starting the configuration policy is just the beginning. It may finish almost\r
-  instantly or it may take several minutes before it fails to retrieve configuration\r
-  information from one or more servers. Once the policy is started, drivers\r
-  should use the DoneEvent parameter to determine when the configuration policy\r
-  has completed. EFI_IP4_CONFIG_PROTOCOL.GetData() must then be called to\r
-  determine if the configuration succeeded or failed.\r
-  Until the configuration completes successfully, EFI IPv4 Protocol driver instances\r
-  that are attempting to use default configurations must return EFI_NO_MAPPING.\r
-  Once the configuration is complete, the EFI IPv4 Configuration Protocol driver\r
-  signals DoneEvent. The configuration may need to be updated in the future,\r
-  however; in this case, the EFI IPv4 Configuration Protocol driver must signal\r
-  ReconfigEvent, and all EFI IPv4 Protocol driver instances that are using default\r
-  configurations must return EFI_NO_MAPPING until the configuration policy has\r
-  been rerun.\r
-\r
-  @param  This                   Pointer to the EFI_IP4_CONFIG_PROTOCOL instance.\r
-  @param  DoneEvent              Event that will be signaled when the EFI IPv4\r
-                                 Protocol driver configuration policy completes\r
-                                 execution. This event must be of type EVT_NOTIFY_SIGNAL.\r
-  @param  ReconfigEvent          Event that will be signaled when the EFI IPv4\r
-                                 Protocol driver configuration needs to be updated.\r
-                                 This event must be of type EVT_NOTIFY_SIGNAL.\r
-\r
-  @retval EFI_SUCCESS            The configuration policy for the EFI IPv4 Protocol\r
-                                 driver is now running.\r
-  @retval EFI_INVALID_PARAMETER  One or more of the following parameters is NULL:\r
-                                  This\r
-                                  DoneEvent\r
-                                  ReconfigEvent\r
-  @retval EFI_OUT_OF_RESOURCES   Required system resources could not be allocated.\r
-  @retval EFI_ALREADY_STARTED    The configuration policy for the EFI IPv4 Protocol\r
-                                 driver was already started.\r
-  @retval EFI_DEVICE_ERROR       An unexpected system error or network error occurred.\r
-  @retval EFI_UNSUPPORTED        This interface does not support the EFI IPv4 Protocol\r
-                                 driver configuration.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiIp4ConfigStart (\r
-  IN EFI_IP4_CONFIG_PROTOCOL  *This,\r
-  IN EFI_EVENT                DoneEvent,\r
-  IN EFI_EVENT                ReconfigEvent\r
-  )\r
-{\r
-  IP4_CONFIG_INSTANCE       *Instance;\r
-  EFI_DHCP4_PROTOCOL        *Dhcp4;\r
-  EFI_DHCP4_MODE_DATA       Dhcp4Mode;\r
-  EFI_DHCP4_PACKET_OPTION   *OptionList[1];\r
-  IP4_CONFIG_DHCP4_OPTION   ParaList;\r
-  EFI_STATUS                Status;\r
-  UINT32                    Source;\r
-  EFI_TPL                   OldTpl;\r
-\r
-  if ((This == NULL) || (DoneEvent == NULL) || (ReconfigEvent == NULL)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Instance = IP4_CONFIG_INSTANCE_FROM_IP4CONFIG (This);\r
-\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  if (Instance->State != IP4_CONFIG_STATE_IDLE) {\r
-    Status = EFI_ALREADY_STARTED;\r
-\r
-    goto ON_EXIT;\r
-  }\r
-\r
-  Instance->DoneEvent     = DoneEvent;\r
-  Instance->ReconfigEvent = ReconfigEvent;\r
-\r
-  Instance->NicConfig     = EfiNicIp4ConfigGetInfo (Instance);\r
-\r
-  if (Instance->NicConfig == NULL) {\r
-    if (Instance->DoNotStart) {\r
-      Instance->DoNotStart = FALSE;\r
-      Status = EFI_SUCCESS;\r
-      goto ON_EXIT;\r
-    }\r
-\r
-    Source = IP4_CONFIG_SOURCE_DHCP;\r
-  } else {\r
-    Source = Instance->NicConfig->Source;\r
-  }\r
-\r
-  //\r
-  // If the source is static, the auto configuration is done.\r
-  // return now.\r
-  //\r
-  if (Source == IP4_CONFIG_SOURCE_STATIC) {\r
-    Instance->State  = IP4_CONFIG_STATE_CONFIGURED;\r
-    Instance->Result = EFI_SUCCESS;\r
-\r
-    gBS->SignalEvent (Instance->DoneEvent);\r
-    Status = EFI_SUCCESS;\r
-    goto ON_EXIT;\r
-  }\r
-\r
-  //\r
-  // Start the dhcp process\r
-  //\r
-  ASSERT ((Source == IP4_CONFIG_SOURCE_DHCP) && (Instance->Dhcp4 == NULL));\r
-\r
-  Status = NetLibCreateServiceChild (\r
-             Instance->Controller,\r
-             Instance->Image,\r
-             &gEfiDhcp4ServiceBindingProtocolGuid,\r
-             &Instance->Dhcp4Handle\r
-             );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_ERROR;\r
-  }\r
-\r
-  Status = gBS->OpenProtocol (\r
-                  Instance->Dhcp4Handle,\r
-                  &gEfiDhcp4ProtocolGuid,\r
-                  (VOID **) &Instance->Dhcp4,\r
-                  Instance->Image,\r
-                  Instance->Controller,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_ERROR;\r
-  }\r
-\r
-  //\r
-  // Check the current DHCP status, if the DHCP process has\r
-  // already finished, return now.\r
-  //\r
-  Dhcp4  = Instance->Dhcp4;\r
-  Status = Dhcp4->GetModeData (Dhcp4, &Dhcp4Mode);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_ERROR;\r
-  }\r
-\r
-  if (Dhcp4Mode.State == Dhcp4Bound) {\r
-    Ip4ConfigOnDhcp4Complete (NULL, Instance);\r
-\r
-    goto ON_EXIT;\r
-  }\r
-\r
-  //\r
-  // Try to start the DHCP process. Use most of the current\r
-  // DHCP configuration to avoid problems if some DHCP client\r
-  // yields the control of this DHCP service to us.\r
-  //\r
-  ParaList.Head.OpCode             = DHCP_TAG_PARA_LIST;\r
-  ParaList.Head.Length             = 2;\r
-  ParaList.Head.Data[0]            = DHCP_TAG_NETMASK;\r
-  ParaList.Route                   = DHCP_TAG_ROUTER;\r
-  OptionList[0]                    = &ParaList.Head;\r
-  Dhcp4Mode.ConfigData.OptionCount = 1;\r
-  Dhcp4Mode.ConfigData.OptionList  = OptionList;\r
-\r
-  Status = Dhcp4->Configure (Dhcp4, &Dhcp4Mode.ConfigData);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_ERROR;\r
-  }\r
-\r
-  //\r
-  // Start the DHCP process\r
-  //\r
-  Status = gBS->CreateEvent (\r
-                  EVT_NOTIFY_SIGNAL,\r
-                  TPL_CALLBACK,\r
-                  Ip4ConfigOnDhcp4Complete,\r
-                  Instance,\r
-                  &Instance->Dhcp4Event\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_ERROR;\r
-  }\r
-\r
-  Status = Dhcp4->Start (Dhcp4, Instance->Dhcp4Event);\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_ERROR;\r
-  }\r
-\r
-  Instance->State  = IP4_CONFIG_STATE_STARTED;\r
-  Instance->Result = EFI_NOT_READY;\r
-\r
-ON_ERROR:\r
-  if (EFI_ERROR (Status)) {\r
-    Ip4ConfigCleanConfig (Instance);\r
-  }\r
-\r
-ON_EXIT:\r
-  gBS->RestoreTPL (OldTpl);\r
-\r
-  DispatchDpc ();\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-/**\r
-  Stops running the configuration policy for the EFI IPv4 Protocol driver.\r
-\r
-  The Stop() function stops the configuration policy for the EFI IPv4 Protocol driver.\r
-  All configuration data will be lost after calling Stop().\r
-\r
-  @param  This                   Pointer to the EFI_IP4_CONFIG_PROTOCOL instance.\r
-\r
-  @retval EFI_SUCCESS            The configuration policy for the EFI IPv4 Protocol\r
-                                 driver has been stopped.\r
-  @retval EFI_INVALID_PARAMETER  This is NULL.\r
-  @retval EFI_NOT_STARTED        The configuration policy for the EFI IPv4 Protocol\r
-                                 driver was not started.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiIp4ConfigStop (\r
-  IN EFI_IP4_CONFIG_PROTOCOL  *This\r
-  )\r
-{\r
-  IP4_CONFIG_INSTANCE  *Instance;\r
-  EFI_STATUS           Status;\r
-  EFI_TPL              OldTpl;\r
-\r
-  if (This == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Instance = IP4_CONFIG_INSTANCE_FROM_IP4CONFIG (This);\r
-\r
-  Status = EFI_SUCCESS;\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  if (Instance->State == IP4_CONFIG_STATE_IDLE) {\r
-    Status = EFI_NOT_STARTED;\r
-    goto ON_EXIT;\r
-  }\r
-\r
-  //\r
-  // Release all the configure parameters. Don't signal the user\r
-  // event. The user wants to abort the configuration, this isn't\r
-  // the configuration done or reconfiguration.\r
-  //\r
-  Ip4ConfigCleanConfig (Instance);\r
-\r
-ON_EXIT:\r
-  gBS->RestoreTPL (OldTpl);\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-/**\r
-  Returns the default configuration data (if any) for the EFI IPv4 Protocol driver.\r
-\r
-  The GetData() function returns the current configuration data for the EFI IPv4\r
-  Protocol driver after the configuration policy has completed.\r
-\r
-  @param  This                   Pointer to the EFI_IP4_CONFIG_PROTOCOL instance.\r
-  @param  ConfigDataSize         On input, the size of the ConfigData buffer.\r
-                                 On output, the count of bytes that were written\r
-                                 into the ConfigData buffer.\r
-  @param  ConfigData             Pointer to the EFI IPv4 Configuration Protocol\r
-                                 driver configuration data structure.\r
-                                 Type EFI_IP4_IPCONFIG_DATA is defined in\r
-                                 "Related Definitions" below.\r
-\r
-  @retval EFI_SUCCESS            The EFI IPv4 Protocol driver configuration has been returned.\r
-  @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
-                                 Currently not implemented.\r
-  @retval EFI_BUFFER_TOO_SMALL   *ConfigDataSize is smaller than the configuration\r
-                                 data buffer or ConfigData is NULL.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiIp4ConfigGetData (\r
-  IN  EFI_IP4_CONFIG_PROTOCOL *This,\r
-  IN  OUT  UINTN              *ConfigDataSize,\r
-  OUT EFI_IP4_IPCONFIG_DATA   *ConfigData           OPTIONAL\r
-  )\r
-{\r
-  IP4_CONFIG_INSTANCE       *Instance;\r
-  NIC_IP4_CONFIG_INFO       *NicConfig;\r
-  EFI_STATUS                Status;\r
-  EFI_TPL                   OldTpl;\r
-  UINTN                     Len;\r
-\r
-  if ((This == NULL) || (ConfigDataSize == NULL)) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  Instance  = IP4_CONFIG_INSTANCE_FROM_IP4CONFIG (This);\r
-\r
-  Status = EFI_SUCCESS;\r
-  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
-\r
-  if (Instance->State == IP4_CONFIG_STATE_IDLE) {\r
-    Status = EFI_NOT_STARTED;\r
-  } else if (Instance->State == IP4_CONFIG_STATE_STARTED) {\r
-    Status = EFI_NOT_READY;\r
-  }\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_EXIT;\r
-  }\r
-\r
-  //\r
-  // Copy the configure data if auto configuration succeeds.\r
-  //\r
-  Status = Instance->Result;\r
-\r
-  if (Status == EFI_SUCCESS) {\r
-    ASSERT (Instance->NicConfig != NULL);\r
-\r
-    NicConfig = Instance->NicConfig;\r
-    Len       = SIZEOF_IP4_CONFIG_INFO (&NicConfig->Ip4Info);\r
-\r
-    if ((*ConfigDataSize < Len) || (ConfigData == NULL)) {\r
-      Status = EFI_BUFFER_TOO_SMALL;\r
-    } else {\r
-      CopyMem (ConfigData, &NicConfig->Ip4Info, Len);\r
-      Ip4ConfigFixRouteTablePointer (ConfigData);\r
-    }\r
-\r
-    *ConfigDataSize = Len;\r
-  }\r
-\r
-ON_EXIT:\r
-  gBS->RestoreTPL (OldTpl);\r
-\r
-  return Status;\r
-}\r
-\r
-/**\r
-  Release all the DHCP related resources.\r
-\r
-  @param  This                   The IP4 configure instance\r
-\r
-  @return None\r
-\r
-**/\r
-VOID\r
-Ip4ConfigCleanDhcp4 (\r
-  IN IP4_CONFIG_INSTANCE    *This\r
-  )\r
-{\r
-  if (This->Dhcp4 != NULL) {\r
-    This->Dhcp4->Stop (This->Dhcp4);\r
-\r
-    gBS->CloseProtocol (\r
-          This->Dhcp4Handle,\r
-          &gEfiDhcp4ProtocolGuid,\r
-          This->Image,\r
-          This->Controller\r
-          );\r
-\r
-    This->Dhcp4 = NULL;\r
-  }\r
-\r
-  if (This->Dhcp4Handle != NULL) {\r
-    NetLibDestroyServiceChild (\r
-      This->Controller,\r
-      This->Image,\r
-      &gEfiDhcp4ServiceBindingProtocolGuid,\r
-      This->Dhcp4Handle\r
-      );\r
-\r
-    This->Dhcp4Handle = NULL;\r
-  }\r
-\r
-  if (This->Dhcp4Event != NULL) {\r
-    gBS->CloseEvent (This->Dhcp4Event);\r
-    This->Dhcp4Event = NULL;\r
-  }\r
-}\r
-\r
-\r
-/**\r
-  Clean up all the configuration parameters.\r
-\r
-  @param  Instance               The IP4 configure instance\r
-\r
-  @return None\r
-\r
-**/\r
-VOID\r
-Ip4ConfigCleanConfig (\r
-  IN IP4_CONFIG_INSTANCE        *Instance\r
-  )\r
-{\r
-  if (Instance->NicConfig != NULL) {\r
-    FreePool (Instance->NicConfig);\r
-    Instance->NicConfig = NULL;\r
-  }\r
-\r
-  Instance->State         = IP4_CONFIG_STATE_IDLE;\r
-  Instance->DoneEvent     = NULL;\r
-  Instance->ReconfigEvent = NULL;\r
-\r
-  Ip4ConfigCleanDhcp4 (Instance);\r
-}\r
-\r
-\r
-/**\r
-  A dedicated timer is used to poll underlying media status. In case of\r
-  cable swap, a new round auto configuration will be initiated. The timer \r
-  will signal the IP4 to run the auto configuration again. IP4 driver will free\r
-  old IP address related resource, such as route table and Interface, then\r
-  initiate a DHCP process by IP4Config->Start to acquire new IP, eventually\r
-  create route table for new IP address.\r
-\r
-  @param[in]  Event                  The IP4 service instance's heart beat timer.\r
-  @param[in]  Context                The IP4 service instance.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-MediaChangeDetect (\r
-  IN EFI_EVENT              Event,\r
-  IN VOID                   *Context\r
-  )\r
-{\r
-  BOOLEAN                      OldMediaPresent;\r
-  EFI_STATUS                   Status;\r
-  EFI_SIMPLE_NETWORK_MODE      SnpModeData;\r
-  IP4_CONFIG_INSTANCE         *Instance;  \r
-\r
-  Instance = (IP4_CONFIG_INSTANCE *) Context;\r
-\r
-  OldMediaPresent = Instance->MediaPresent;\r
-  \r
-  //\r
-  // Get fresh mode data from MNP, since underlying media status may change\r
-  //\r
-  Status = Instance->Mnp->GetModeData (Instance->Mnp, NULL, &SnpModeData);\r
-  if (EFI_ERROR (Status) && (Status != EFI_NOT_STARTED)) {\r
-    return;\r
-  }\r
-\r
-  Instance->MediaPresent = SnpModeData.MediaPresent;\r
-  //\r
-  // Media transimit Unpresent to Present means new link movement is detected.\r
-  //\r
-  if (!OldMediaPresent && Instance->MediaPresent) {\r
-    //\r
-    // Signal the IP4 to run the auto configuration again. IP4 driver will free\r
-    // old IP address related resource, such as route table and Interface, then \r
-    // initiate a DHCP round by IP4Config->Start to acquire new IP, eventually \r
-    // create route table for new IP address.\r
-    //\r
-    if (Instance->ReconfigEvent != NULL) {\r
-      Status = gBS->SignalEvent (Instance->ReconfigEvent);\r
-      DispatchDpc ();\r
-    }\r
-  }\r
-}\r
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.h
deleted file mode 100644 (file)
index cbe8ec5..0000000
+++ /dev/null
@@ -1,533 +0,0 @@
-/** @file\r
-  Header file for IP4Config driver.\r
-\r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
-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
-\r
-**/\r
-\r
-#ifndef _EFI_IP4CONFIG_H_\r
-#define _EFI_IP4CONFIG_H_\r
-\r
-#include <Uefi.h>\r
-\r
-#include <Protocol/Dhcp4.h>\r
-#include <Protocol/Ip4Config.h>\r
-#include <Protocol/ManagedNetwork.h>\r
-#include <Protocol/HiiConfigAccess.h>\r
-#include <Protocol/HiiDatabase.h>\r
-#include <Protocol/HiiConfigRouting.h>\r
-#include <Protocol/ServiceBinding.h>\r
-\r
-#include <Guid/MdeModuleHii.h>\r
-#include <Guid/NicIp4ConfigNvData.h>\r
-\r
-#include <Library/DevicePathLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/UefiRuntimeServicesTableLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/NetLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/HiiLib.h>\r
-#include <Library/PrintLib.h>\r
-#include <Library/DpcLib.h>\r
-#include <Library/UefiHiiServicesLib.h>\r
-\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 EFI_IP4_CONFIG_PROTOCOL         mIp4ConfigProtocolTemplate;\r
-\r
-#define IP4_PROTO_ICMP                 0x01\r
-#define IP4_CONFIG_INSTANCE_SIGNATURE  SIGNATURE_32 ('I', 'P', '4', 'C')\r
-\r
-#define IP4_CONFIG_STATE_IDLE          0\r
-#define IP4_CONFIG_STATE_STARTED       1\r
-#define IP4_CONFIG_STATE_CONFIGURED    2\r
-\r
-#define DHCP_TAG_PARA_LIST             55\r
-#define DHCP_TAG_NETMASK               1\r
-#define DHCP_TAG_ROUTER                3\r
-\r
-\r
-//\r
-// Configure the DHCP to request the routers and netmask\r
-// from server. The DHCP_TAG_NETMASK is included in Head.\r
-//\r
-#pragma pack(1)\r
-typedef struct {\r
-  EFI_DHCP4_PACKET_OPTION Head;\r
-  UINT8                   Route;\r
-} IP4_CONFIG_DHCP4_OPTION;\r
-#pragma pack()\r
-\r
-typedef struct _IP4CONFIG_CALLBACK_INFO {\r
-  BOOLEAN                          Configured;\r
-  BOOLEAN                          DhcpEnabled;\r
-  EFI_IPv4_ADDRESS                 LocalIp;\r
-  EFI_IPv4_ADDRESS                 SubnetMask;\r
-  EFI_IPv4_ADDRESS                 Gateway;\r
-} IP4_SETTING_INFO;\r
-\r
-typedef struct _IP4_CONFIG_INSTANCE {\r
-  UINT32                          Signature;\r
-  EFI_HANDLE                      Controller;\r
-  EFI_HANDLE                      Image;\r
-  EFI_DEVICE_PATH_PROTOCOL        *ParentDevicePath;\r
-\r
-  EFI_IP4_CONFIG_PROTOCOL         Ip4ConfigProtocol;\r
-\r
-  EFI_HII_CONFIG_ACCESS_PROTOCOL  HiiConfigAccessProtocol;\r
-  EFI_HANDLE                      ChildHandle;\r
-  EFI_DEVICE_PATH_PROTOCOL        *HiiVendorDevicePath;\r
-  EFI_HII_HANDLE                  RegisteredHandle;\r
-  IP4_SETTING_INFO                Ip4ConfigCallbackInfo;\r
-\r
-  //\r
-  // NicConfig's state, such as IP4_CONFIG_STATE_IDLE\r
-  //\r
-  INTN                            State;\r
-\r
-  //\r
-  // Mnp child to keep the connection with MNP.\r
-  //\r
-  EFI_MANAGED_NETWORK_PROTOCOL    *Mnp;\r
-  EFI_HANDLE                      MnpHandle;\r
-\r
-  //\r
-  // User's requests data\r
-  //\r
-  EFI_EVENT                       DoneEvent;\r
-  EFI_EVENT                       ReconfigEvent;\r
-  EFI_STATUS                      Result;\r
-\r
-  //\r
-  // Identity of this interface and some configuration info.\r
-  //\r
-  NIC_ADDR                        NicAddr;\r
-  CHAR16                          *MacString;\r
-  NIC_IP4_CONFIG_INFO             *NicConfig;\r
-\r
-  //\r
-  // DHCP handles to access DHCP\r
-  //\r
-  EFI_DHCP4_PROTOCOL              *Dhcp4;\r
-  EFI_HANDLE                      Dhcp4Handle;\r
-  EFI_EVENT                       Dhcp4Event;\r
-\r
-  //\r
-  // A dedicated timer is used to poll underlying media status\r
-  //\r
-  EFI_EVENT                       Timer;\r
-\r
-  //\r
-  // Underlying media present status. \r
-  //\r
-  BOOLEAN                         MediaPresent;\r
-\r
-  //\r
-  // A flag to indicate EfiIp4ConfigStart should not run\r
-  //\r
-  BOOLEAN                         DoNotStart;\r
-} IP4_CONFIG_INSTANCE;\r
-\r
-#define IP4_CONFIG_INSTANCE_FROM_IP4CONFIG(this) \\r
-  CR (this, IP4_CONFIG_INSTANCE, Ip4ConfigProtocol, IP4_CONFIG_INSTANCE_SIGNATURE)\r
-\r
-#define IP4_CONFIG_INSTANCE_FROM_CONFIG_ACCESS(this) \\r
-  CR (this, IP4_CONFIG_INSTANCE, HiiConfigAccessProtocol, IP4_CONFIG_INSTANCE_SIGNATURE)\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  Instance               The IP4 CONFIG instance.\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
-EFI_STATUS\r
-EFIAPI\r
-EfiNicIp4ConfigSetInfo (\r
-  IN IP4_CONFIG_INSTANCE          *Instance,\r
-  IN NIC_IP4_CONFIG_INFO          *NicConfig     OPTIONAL,\r
-  IN BOOLEAN                      Reconfig\r
-  );\r
-\r
-/**\r
-  Get the NIC's configure information from the IP4 configure variable.\r
-  It will remove the invalid variable.\r
-\r
-  @param  Instance               The IP4 CONFIG instance.\r
-\r
-  @return NULL if no configure for the NIC in the variable, or it is invalid.\r
-          Otherwise the pointer to the NIC's IP configure parameter will be returned.\r
-\r
-**/\r
-NIC_IP4_CONFIG_INFO *\r
-EfiNicIp4ConfigGetInfo (\r
-  IN  IP4_CONFIG_INSTANCE   *Instance\r
-  );\r
-\r
-/**\r
-  Release all the DHCP related resources.\r
-\r
-  @param  This                   The IP4 configure instance\r
-\r
-  @return None\r
-\r
-**/\r
-VOID\r
-Ip4ConfigCleanDhcp4 (\r
-  IN IP4_CONFIG_INSTANCE    *This\r
-  );\r
-\r
-/**\r
-  Clean up all the configuration parameters.\r
-\r
-  @param  Instance               The IP4 configure instance\r
-\r
-  @return None\r
-\r
-**/\r
-VOID\r
-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 NULL.\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
-/**\r
-  Starts running the configuration policy for the EFI IPv4 Protocol driver.\r
-\r
-  The Start() function is called to determine and to begin the platform\r
-  configuration policy by the EFI IPv4 Protocol driver. This determination may\r
-  be as simple as returning EFI_UNSUPPORTED if there is no EFI IPv4 Protocol\r
-  driver configuration policy. It may be as involved as loading some defaults\r
-  from nonvolatile storage, downloading dynamic data from a DHCP server, and\r
-  checking permissions with a site policy server.\r
-  Starting the configuration policy is just the beginning. It may finish almost\r
-  instantly or it may take several minutes before it fails to retrieve configuration\r
-  information from one or more servers. Once the policy is started, drivers\r
-  should use the DoneEvent parameter to determine when the configuration policy\r
-  has completed. EFI_IP4_CONFIG_PROTOCOL.GetData() must then be called to\r
-  determine if the configuration succeeded or failed.\r
-  Until the configuration completes successfully, EFI IPv4 Protocol driver instances\r
-  that are attempting to use default configurations must return EFI_NO_MAPPING.\r
-  Once the configuration is complete, the EFI IPv4 Configuration Protocol driver\r
-  signals DoneEvent. The configuration may need to be updated in the future,\r
-  however; in this case, the EFI IPv4 Configuration Protocol driver must signal\r
-  ReconfigEvent, and all EFI IPv4 Protocol driver instances that are using default\r
-  configurations must return EFI_NO_MAPPING until the configuration policy has\r
-  been rerun.\r
-\r
-  @param  This                   Pointer to the EFI_IP4_CONFIG_PROTOCOL instance.\r
-  @param  DoneEvent              Event that will be signaled when the EFI IPv4\r
-                                 Protocol driver configuration policy completes\r
-                                 execution. This event must be of type EVT_NOTIFY_SIGNAL.\r
-  @param  ReconfigEvent          Event that will be signaled when the EFI IPv4\r
-                                 Protocol driver configuration needs to be updated.\r
-                                 This event must be of type EVT_NOTIFY_SIGNAL.\r
-\r
-  @retval EFI_SUCCESS            The configuration policy for the EFI IPv4 Protocol\r
-                                 driver is now running.\r
-  @retval EFI_INVALID_PARAMETER  One or more of the following parameters is NULL:\r
-                                  This\r
-                                  DoneEvent\r
-                                  ReconfigEvent\r
-  @retval EFI_OUT_OF_RESOURCES   Required system resources could not be allocated.\r
-  @retval EFI_ALREADY_STARTED    The configuration policy for the EFI IPv4 Protocol\r
-                                 driver was already started.\r
-  @retval EFI_DEVICE_ERROR       An unexpected system error or network error occurred.\r
-  @retval EFI_UNSUPPORTED        This interface does not support the EFI IPv4 Protocol\r
-                                 driver configuration.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiIp4ConfigStart (\r
-  IN EFI_IP4_CONFIG_PROTOCOL  *This,\r
-  IN EFI_EVENT                DoneEvent,\r
-  IN EFI_EVENT                ReconfigEvent\r
-  );\r
-\r
-/**\r
-  Stops running the configuration policy for the EFI IPv4 Protocol driver.\r
-\r
-  The Stop() function stops the configuration policy for the EFI IPv4 Protocol driver.\r
-  All configuration data will be lost after calling Stop().\r
-\r
-  @param  This                   Pointer to the EFI_IP4_CONFIG_PROTOCOL instance.\r
-\r
-  @retval EFI_SUCCESS            The configuration policy for the EFI IPv4 Protocol\r
-                                 driver has been stopped.\r
-  @retval EFI_INVALID_PARAMETER  This is NULL.\r
-  @retval EFI_NOT_STARTED        The configuration policy for the EFI IPv4 Protocol\r
-                                 driver was not started.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiIp4ConfigStop (\r
-  IN EFI_IP4_CONFIG_PROTOCOL  *This\r
-  );\r
-\r
-/**\r
-  Returns the default configuration data (if any) for the EFI IPv4 Protocol driver.\r
-\r
-  The GetData() function returns the current configuration data for the EFI IPv4\r
-  Protocol driver after the configuration policy has completed.\r
-\r
-  @param  This                   Pointer to the EFI_IP4_CONFIG_PROTOCOL instance.\r
-  @param  ConfigDataSize         On input, the size of the ConfigData buffer.\r
-                                 On output, the count of bytes that were written\r
-                                 into the ConfigData buffer.\r
-  @param  ConfigData             Pointer to the EFI IPv4 Configuration Protocol\r
-                                 driver configuration data structure.\r
-                                 Type EFI_IP4_IPCONFIG_DATA is defined in\r
-                                 "Related Definitions" below.\r
-\r
-  @retval EFI_SUCCESS            The EFI IPv4 Protocol driver configuration has been returned.\r
-  @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
-                                 Currently not implemented.\r
-  @retval EFI_BUFFER_TOO_SMALL   *ConfigDataSize is smaller than the configuration\r
-                                 data buffer or ConfigData is NULL.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-EfiIp4ConfigGetData (\r
-  IN  EFI_IP4_CONFIG_PROTOCOL *This,\r
-  IN  OUT  UINTN              *ConfigDataSize,\r
-  OUT EFI_IP4_IPCONFIG_DATA   *ConfigData           OPTIONAL\r
-  );\r
-\r
-/**\r
-  A dedicated timer is used to poll underlying media status. In case of\r
-  cable swap, a new round auto configuration will be initiated. The timer \r
-  will signal the IP4 to run the auto configuration again. IP4 driver will free\r
-  old IP address related resource, such as route table and Interface, then\r
-  initiate a DHCP round by IP4Config->Start to acquire new IP, eventually\r
-  create route table for new IP address.\r
-\r
-  @param[in]  Event                  The IP4 service instance's heart beat timer.\r
-  @param[in]  Context                The IP4 service instance.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-MediaChangeDetect (\r
-  IN EFI_EVENT              Event,\r
-  IN VOID                   *Context\r
-  );\r
-\r
-#endif\r
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDriver.c
deleted file mode 100644 (file)
index 56cce6e..0000000
+++ /dev/null
@@ -1,505 +0,0 @@
-/** @file\r
-  The driver binding for IP4 CONFIG protocol.\r
-\r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
-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
-\r
-**/\r
-\r
-\r
-#include "Ip4Config.h"\r
-#include "Ip4ConfigNv.h"\r
-#include "NicIp4Variable.h"\r
-\r
-EFI_DRIVER_BINDING_PROTOCOL gIp4ConfigDriverBinding = {\r
-  Ip4ConfigDriverBindingSupported,\r
-  Ip4ConfigDriverBindingStart,\r
-  Ip4ConfigDriverBindingStop,\r
-  0xa,\r
-  NULL,\r
-  NULL\r
-};\r
-\r
-//\r
-// The intance of template of IP4 Config private data\r
-//\r
-IP4_CONFIG_INSTANCE        mIp4ConfigTemplate = {\r
-  IP4_CONFIG_INSTANCE_SIGNATURE,\r
-  NULL,\r
-  NULL,\r
-  (EFI_DEVICE_PATH_PROTOCOL *) NULL,\r
-  {\r
-    NULL,\r
-    NULL,\r
-    NULL\r
-  },\r
-  {\r
-    NULL,\r
-    NULL,\r
-    NULL\r
-  },\r
-  NULL,\r
-  (EFI_DEVICE_PATH_PROTOCOL *) NULL,\r
-  NULL,\r
-  {\r
-    FALSE,\r
-    FALSE,\r
-    {\r
-      {\r
-        0\r
-      }\r
-    },\r
-    {\r
-      {\r
-        0\r
-      }\r
-    },\r
-    {\r
-      {\r
-        0\r
-      }\r
-    }\r
-  },\r
-  0,\r
-  (EFI_MANAGED_NETWORK_PROTOCOL *) NULL,\r
-  NULL,\r
-  NULL,\r
-  NULL,\r
-  0,\r
-  {\r
-    0,\r
-    0,\r
-    {\r
-      {\r
-        0\r
-      }\r
-    }\r
-  },\r
-  (CHAR16 *) NULL,\r
-  (NIC_IP4_CONFIG_INFO *) NULL,\r
-  (EFI_DHCP4_PROTOCOL *) NULL,\r
-  NULL,\r
-  NULL,\r
-  NULL,\r
-  TRUE,\r
-  FALSE\r
-};\r
-\r
-/**\r
-  The entry point for IP4 config driver which install the driver\r
-  binding and component name protocol on its image.\r
-\r
-  @param  ImageHandle            The image handle of the driver.\r
-  @param  SystemTable            The system table.\r
-\r
-  @retval EFI_SUCCES             All the related protocols are installed on the driver.\r
-  @retval Others                 Failed to install protocols.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Ip4ConfigDriverEntryPoint (\r
-  IN EFI_HANDLE             ImageHandle,\r
-  IN EFI_SYSTEM_TABLE       *SystemTable\r
-  )\r
-{\r
-  mIp4ConfigTemplate.Result = EFI_NOT_READY;\r
-\r
-  return EfiLibInstallDriverBindingComponentName2 (\r
-           ImageHandle,\r
-           SystemTable,\r
-           &gIp4ConfigDriverBinding,\r
-           ImageHandle,\r
-           &gIp4ConfigComponentName,\r
-           &gIp4ConfigComponentName2\r
-           );\r
-}\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
-  EFI_STATUS  Status;\r
-\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiManagedNetworkServiceBindingProtocolGuid,\r
-                  NULL,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_TEST_PROTOCOL\r
-                  );\r
-\r
-  return Status;\r
-}\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
-  EFI_IP4_CONFIG_PROTOCOL       *Ip4Config;\r
-  EFI_MANAGED_NETWORK_PROTOCOL  *Mnp;\r
-  EFI_HANDLE                    MnpHandle;\r
-  IP4_CONFIG_INSTANCE           *Instance;\r
-  EFI_SIMPLE_NETWORK_MODE       SnpMode;\r
-  NIC_IP4_CONFIG_INFO           *NicConfig;\r
-  EFI_STATUS                    Status;\r
-  EFI_DEVICE_PATH_PROTOCOL      *ParentDevicePath;\r
-\r
-  Status = gBS->HandleProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiDevicePathProtocolGuid,\r
-                  (VOID **) &ParentDevicePath\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Check for multiple start.\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  ControllerHandle,\r
-                  &gEfiIp4ConfigProtocolGuid,\r
-                  (VOID **) &Ip4Config,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-\r
-  if (!EFI_ERROR (Status)) {\r
-    return EFI_ALREADY_STARTED;\r
-  }\r
-\r
-  //\r
-  // Create a MNP child\r
-  //\r
-  Mnp       = NULL;\r
-  MnpHandle = NULL;\r
-  Instance  = NULL;\r
-\r
-  Status    = NetLibCreateServiceChild (\r
-                ControllerHandle,\r
-                This->DriverBindingHandle,\r
-                &gEfiManagedNetworkServiceBindingProtocolGuid,\r
-                &MnpHandle\r
-                );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Status = gBS->OpenProtocol (\r
-                  MnpHandle,\r
-                  &gEfiManagedNetworkProtocolGuid,\r
-                  (VOID **) &Mnp,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_BY_DRIVER\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_ERROR;\r
-  }\r
-\r
-  //\r
-  // Allocate an instance then initialize it\r
-  //\r
-  Instance = AllocateCopyPool (sizeof (IP4_CONFIG_INSTANCE), &mIp4ConfigTemplate);\r
-\r
-  if (Instance == NULL) {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-    goto ON_ERROR;\r
-  }\r
-\r
-  Instance->Controller        = ControllerHandle;\r
-  Instance->Image             = This->DriverBindingHandle;\r
-  Instance->ParentDevicePath  = ParentDevicePath;\r
-\r
-  CopyMem (&Instance->Ip4ConfigProtocol, &mIp4ConfigProtocolTemplate, sizeof (mIp4ConfigProtocolTemplate));\r
-\r
-  Instance->State             = IP4_CONFIG_STATE_IDLE;\r
-  Instance->Mnp               = Mnp;\r
-  Instance->MnpHandle         = MnpHandle;\r
-\r
-  Status = Mnp->GetModeData (Mnp, NULL, &SnpMode);\r
-\r
-  if (EFI_ERROR (Status) && (Status != EFI_NOT_STARTED)) {\r
-    goto ON_ERROR;\r
-  }\r
-\r
-  Instance->NicAddr.Type    = (UINT16) SnpMode.IfType;\r
-  Instance->NicAddr.Len     = (UINT8) SnpMode.HwAddressSize;\r
-  CopyMem (&Instance->NicAddr.MacAddr, &SnpMode.CurrentAddress, Instance->NicAddr.Len);\r
-\r
-  //\r
-  // Add it to the global list, and compose the name\r
-  //\r
-  Status = NetLibGetMacString (Instance->Controller, Instance->Image, &Instance->MacString);\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_ERROR;\r
-  }\r
-\r
-  Status = Ip4ConfigDeviceInit (Instance);\r
-\r
-  //\r
-  // Install the IP4_CONFIG protocols\r
-  //\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &ControllerHandle,\r
-                  &gEfiIp4ConfigProtocolGuid,\r
-                  &Instance->Ip4ConfigProtocol,\r
-                  NULL\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_ERROR;\r
-  }\r
-\r
-  //\r
-  // A dedicated timer is used to poll underlying media status.\r
-  //\r
-  Status = gBS->CreateEvent (\r
-                  EVT_NOTIFY_SIGNAL | EVT_TIMER,\r
-                  TPL_CALLBACK,\r
-                  MediaChangeDetect,\r
-                  Instance,\r
-                  &Instance->Timer\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto ON_ERROR;\r
-  }\r
-\r
-  //\r
-  // Get the previous configure parameters. If an error happend here,\r
-  // just ignore it because the driver should be able to operate.\r
-  //\r
-  NicConfig = Ip4ConfigReadVariable (Instance);\r
-  if (NicConfig != NULL) {\r
-    if (!NicConfig->Permanent) {\r
-      //\r
-      // Delete the non-permanent configuration.\r
-      //\r
-      Ip4ConfigWriteVariable (Instance, NULL);\r
-    }\r
-\r
-    FreePool (NicConfig);\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-\r
-ON_ERROR:\r
-  if (Instance != NULL) {\r
-    FreePool (Instance);\r
-  }\r
-\r
-  if (Mnp != NULL) {\r
-    gBS->CloseProtocol (\r
-          MnpHandle,\r
-          &gEfiManagedNetworkProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          ControllerHandle\r
-          );\r
-  }\r
-\r
-  NetLibDestroyServiceChild (\r
-    ControllerHandle,\r
-    This->DriverBindingHandle,\r
-    &gEfiManagedNetworkServiceBindingProtocolGuid,\r
-    MnpHandle\r
-    );\r
-\r
-  return Status;\r
-}\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
-  IP4_CONFIG_INSTANCE       *Instance;\r
-  EFI_IP4_CONFIG_PROTOCOL   *Ip4Config;\r
-  EFI_HANDLE                NicHandle;\r
-  EFI_STATUS                Status;\r
-\r
-  //\r
-  // IP4_CONFIG instance opens an MNP child. It may also create and open\r
-  // a DHCP child. If this is the DHCP handle, stop the DHCP process. If\r
-  // it is the MNP child, stop the whole driver.\r
-  //\r
-  //\r
-  NicHandle = NetLibGetNicHandle (ControllerHandle, &gEfiDhcp4ProtocolGuid);\r
-\r
-  if (NicHandle != NULL) {\r
-    //\r
-    // Get our context back then clean the DHCP up. Notify the user if necessary.\r
-    //\r
-    Status = gBS->OpenProtocol (\r
-                    NicHandle,\r
-                    &gEfiIp4ConfigProtocolGuid,\r
-                    (VOID **) &Ip4Config,\r
-                    This->DriverBindingHandle,\r
-                    ControllerHandle,\r
-                    EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                    );\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      return Status;\r
-    }\r
-\r
-    Instance = IP4_CONFIG_INSTANCE_FROM_IP4CONFIG (Ip4Config);\r
-    ASSERT (ControllerHandle == Instance->Dhcp4Handle);\r
-\r
-    Ip4ConfigCleanDhcp4 (Instance);\r
-\r
-    Instance->State   = IP4_CONFIG_STATE_CONFIGURED;\r
-    Instance->Result  = EFI_DEVICE_ERROR;\r
-\r
-    if (Instance->DoneEvent != NULL) {\r
-      gBS->SignalEvent (Instance->DoneEvent);\r
-    }\r
-\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  //\r
-  // This is a MNP handle, stop the whole driver\r
-  //\r
-  NicHandle = NetLibGetNicHandle (ControllerHandle, &gEfiManagedNetworkProtocolGuid);\r
-\r
-  if (NicHandle == NULL) {\r
-    return EFI_SUCCESS;\r
-  }\r
-\r
-  //\r
-  // Get our context back.\r
-  //\r
-  Status = gBS->OpenProtocol (\r
-                  NicHandle,\r
-                  &gEfiIp4ConfigProtocolGuid,\r
-                  (VOID **) &Ip4Config,\r
-                  This->DriverBindingHandle,\r
-                  ControllerHandle,\r
-                  EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Instance = IP4_CONFIG_INSTANCE_FROM_IP4CONFIG (Ip4Config);\r
-\r
-  Ip4ConfigDeviceUnload (Instance);\r
-\r
-  //\r
-  // Unload the protocols first to inform the top drivers\r
-  //\r
-  Status = gBS->UninstallMultipleProtocolInterfaces (\r
-                  NicHandle,\r
-                  &gEfiIp4ConfigProtocolGuid,\r
-                  &Instance->Ip4ConfigProtocol,\r
-                  NULL\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // Release all the resources\r
-  //\r
-  if (Instance->MnpHandle != NULL) {\r
-    gBS->CloseProtocol (\r
-          Instance->MnpHandle,\r
-          &gEfiManagedNetworkProtocolGuid,\r
-          This->DriverBindingHandle,\r
-          NicHandle\r
-          );\r
-\r
-    NetLibDestroyServiceChild (\r
-      NicHandle,\r
-      Instance->Image,\r
-      &gEfiManagedNetworkServiceBindingProtocolGuid,\r
-      Instance->MnpHandle\r
-      );\r
-\r
-    Instance->Mnp       = NULL;\r
-    Instance->MnpHandle = NULL;\r
-  }\r
-\r
-  if (Instance->MacString != NULL) {\r
-    FreePool (Instance->MacString);\r
-  }\r
-\r
-  if (Instance->Timer != NULL) {\r
-    gBS->SetTimer (Instance->Timer, TimerCancel, 0);\r
-    gBS->CloseEvent (Instance->Timer);\r
-    Instance->Timer = NULL;\r
-  }\r
-  \r
-  Ip4ConfigCleanConfig (Instance);\r
-  FreePool (Instance);\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.inf b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.inf
deleted file mode 100644 (file)
index c119982..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-## @file\r
-#  This module produces EFI IPv4 Configuration Protocol.\r
-#\r
-#  This module produces EFI IPv4 Configuration Protocol upon EFI MNP Protocol,\r
-#  to performs platform- and policy-dependent configuration for the EFI IPv4\r
-#  Protocol driver. It installs EFI HII Configuration Access Protocol to provide\r
-#  one way to configurate the IPv4 network setting.\r
-#\r
-#  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
-#  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
-#\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
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = Ip4ConfigDxe\r
-  MODULE_UNI_FILE                = Ip4ConfigDxe.uni\r
-  FILE_GUID                      = 26841BDE-920A-4e7a-9FBE-637F477143A6\r
-  MODULE_TYPE                    = UEFI_DRIVER\r
-  VERSION_STRING                 = 1.0\r
-  ENTRY_POINT                    = Ip4ConfigDriverEntryPoint\r
-  UNLOAD_IMAGE                   = NetLibDefaultUnload\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = IA32 X64 IPF EBC\r
-#\r
-\r
-[Sources]\r
-  ComponentName.c\r
-  NicIp4Variable.c\r
-  Ip4ConfigDriver.c\r
-  Ip4Config.h\r
-  NicIp4Variable.h\r
-  Ip4Config.c\r
-  Ip4ConfigDxe.vfr\r
-  Ip4ConfigDxeStrings.uni\r
-  Ip4NvData.h\r
-  Ip4ConfigNv.h\r
-  Ip4ConfigNv.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  MdeModulePkg/MdeModulePkg.dec\r
-\r
-\r
-[LibraryClasses]\r
-  UefiLib\r
-  UefiBootServicesTableLib\r
-  UefiDriverEntryPoint\r
-  UefiRuntimeServicesTableLib\r
-  DebugLib\r
-  NetLib\r
-  HiiLib\r
-  PrintLib\r
-  DpcLib\r
-  DevicePathLib\r
-\r
-[Protocols]\r
-  gEfiIp4ConfigProtocolGuid                     ## BY_START\r
-  gEfiManagedNetworkServiceBindingProtocolGuid  ## TO_START\r
-  gEfiManagedNetworkProtocolGuid                ## TO_START\r
-  gEfiDhcp4ServiceBindingProtocolGuid           ## TO_START\r
-  gEfiDhcp4ProtocolGuid                         ## TO_START\r
-  gEfiHiiConfigAccessProtocolGuid               ## BY_START\r
-  ## TO_START\r
-  ## BY_START\r
-  gEfiDevicePathProtocolGuid\r
-\r
-[Guids]\r
-  ## SOMETIMES_CONSUMES ## GUID # HiiIsConfigHdrMatch   EFI_NIC_IP4_CONFIG_VARIABLE\r
-  ## SOMETIMES_PRODUCES ## GUID # HiiConstructConfigHdr EFI_NIC_IP4_CONFIG_VARIABLE\r
-  ## SOMETIMES_PRODUCES ## Variable\r
-  ## SOMETIMES_CONSUMES ## Variable\r
-  ## SOMETIMES_PRODUCES ## GUID # Device Path Node\r
-  gEfiNicIp4ConfigVariableGuid\r
-  ## SOMETIMES_CONSUMES ## GUID # HiiIsConfigHdrMatch   EFI_NIC_IP4_CONFIG_VARIABLE\r
-  ## SOMETIMES_PRODUCES ## GUID # HiiConstructConfigHdr EFI_NIC_IP4_CONFIG_VARIABLE\r
-  ## SOMETIMES_PRODUCES ## GUID # HiiGetBrowserData     EFI_NIC_IP4_CONFIG_VARIABLE\r
-  ## SOMETIMES_CONSUMES ## HII\r
-  gNicIp4ConfigNvDataGuid\r
-\r
-[UserExtensions.TianoCore."ExtraFiles"]\r
-  Ip4ConfigDxeExtra.uni\r
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.uni b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.uni
deleted file mode 100644 (file)
index efd16bd..0000000
Binary files a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.uni and /dev/null differ
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.vfr b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxe.vfr
deleted file mode 100644 (file)
index bd3e36a..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file\r
-  Vfr file for IP4 config.\r
-\r
-Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
-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
-\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
-#include "Ip4NvData.h"\r
-\r
-#define EFI_NETWORK_DEVICE_CLASS  0x04\r
-\r
-formset\r
-  guid     = EFI_NIC_IP4_CONFIG_NVDATA_GUID,\r
-  title    = STRING_TOKEN(STR_IP4_CONFIG_FORM_TITLE),\r
-  help     = STRING_TOKEN(STR_IP4_CONFIG_FORM_HELP),\r
-\r
-  varstore IP4_CONFIG_IFR_NVDATA,\r
-    name = EfiNicIp4ConfigVariable,\r
-    guid = EFI_NIC_IP4_CONFIG_NVDATA_GUID;\r
-\r
-  form formid = FORMID_MAIN_FORM,\r
-    title  = STRING_TOKEN(STR_IP4_DEVICE_FORM_TITLE);\r
-\r
-    checkbox varid = EfiNicIp4ConfigVariable.Configure,\r
-            prompt = STRING_TOKEN(STR_IP4_CONFIGURE),\r
-            help   = STRING_TOKEN(STR_IP4_CONFIGURE),\r
-            flags  = INTERACTIVE,\r
-            key    = KEY_ENABLE,\r
-    endcheckbox;\r
-\r
-    suppressif ideqval EfiNicIp4ConfigVariable.Configure == 0x00;\r
-\r
-      checkbox varid = EfiNicIp4ConfigVariable.DhcpEnable,\r
-              prompt = STRING_TOKEN(STR_IP4_ENABLE_DHCP),\r
-              help   = STRING_TOKEN(STR_IP4_ENABLE_DHCP),\r
-              flags  = INTERACTIVE,\r
-              key    = KEY_DHCP_ENABLE,\r
-      endcheckbox;\r
-    endif;\r
-\r
-    suppressif ideqval EfiNicIp4ConfigVariable.DhcpEnable == 0x01 OR ideqval EfiNicIp4ConfigVariable.Configure == 0x00;\r
-\r
-      string  varid   = EfiNicIp4ConfigVariable.StationAddress,\r
-              prompt  = STRING_TOKEN(STR_IP4_LOCAL_IP_ADDRESS),\r
-              help    = STRING_TOKEN(STR_IP4_IP_ADDRESS_HELP),\r
-              flags   = INTERACTIVE,\r
-              key     = KEY_LOCAL_IP,\r
-              minsize = IP_MIN_SIZE,\r
-              maxsize = IP_MAX_SIZE,\r
-      endstring;\r
-\r
-      string  varid   = EfiNicIp4ConfigVariable.SubnetMask,\r
-              prompt  = STRING_TOKEN(STR_IP4_LOCAL_MASK),\r
-              help    = STRING_TOKEN(STR_IP4_IP_ADDRESS_HELP),\r
-              flags   = INTERACTIVE,\r
-              key     = KEY_SUBNET_MASK,\r
-              minsize = IP_MIN_SIZE,\r
-             maxsize = IP_MAX_SIZE,\r
-      endstring;\r
-\r
-      string  varid   = EfiNicIp4ConfigVariable.GatewayAddress,\r
-              prompt  = STRING_TOKEN(STR_IP4_LOCAL_GATEWAY),\r
-              help    = STRING_TOKEN(STR_IP4_IP_ADDRESS_HELP),\r
-              flags   = INTERACTIVE,\r
-              key     = KEY_GATE_WAY,\r
-              minsize = IP_MIN_SIZE,\r
-              maxsize = IP_MAX_SIZE,\r
-      endstring;\r
-\r
-    endif;\r
-\r
-    subtitle text = STRING_TOKEN(STR_NULL);\r
-    \r
-    text\r
-      help   = STRING_TOKEN(STR_SAVE_CHANGES),\r
-      text   = STRING_TOKEN(STR_SAVE_CHANGES),\r
-      flags  = INTERACTIVE,\r
-      key    = KEY_SAVE_CHANGES;\r
-      \r
-  endform;\r
-\r
-endformset;\r
-\r
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxeExtra.uni b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxeExtra.uni
deleted file mode 100644 (file)
index a0bf5a8..0000000
Binary files a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxeExtra.uni and /dev/null differ
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxeStrings.uni b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxeStrings.uni
deleted file mode 100644 (file)
index 5a578a4..0000000
Binary files a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigDxeStrings.uni and /dev/null differ
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.c
deleted file mode 100644 (file)
index 794bb79..0000000
+++ /dev/null
@@ -1,909 +0,0 @@
-/** @file\r
-  Helper functions for configuring or getting the parameters relating to Ip4.\r
-\r
-Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
-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
-\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
-#include "Ip4ConfigNv.h"\r
-#include "NicIp4Variable.h"\r
-\r
-/**\r
-  Calculate the prefix length of the IPv4 subnet mask.\r
-\r
-  @param[in]  SubnetMask The IPv4 subnet mask.\r
-\r
-  @return The prefix length of the subnet mask.\r
-  @retval 0 Other errors as indicated.\r
-**/\r
-UINT8\r
-GetSubnetMaskPrefixLength (\r
-  IN EFI_IPv4_ADDRESS  *SubnetMask\r
-  )\r
-{\r
-  UINT8   Len;\r
-  UINT32  ReverseMask;\r
-\r
-  //\r
-  // The SubnetMask is in network byte order.\r
-  //\r
-  ReverseMask = SwapBytes32 (*(UINT32 *)&SubnetMask[0]);\r
-\r
-  //\r
-  // Reverse it.\r
-  //\r
-  ReverseMask = ~ReverseMask;\r
-\r
-  if ((ReverseMask & (ReverseMask + 1)) != 0) {\r
-    return 0;\r
-  }\r
-\r
-  Len = 0;\r
-\r
-  while (ReverseMask != 0) {\r
-    ReverseMask = ReverseMask >> 1;\r
-    Len++;\r
-  }\r
-\r
-  return (UINT8) (32 - Len);\r
-}\r
-\r
-/**\r
-  Convert the decimal dotted IPv4 address into the binary IPv4 address.\r
-\r
-  @param[in]   Str             The UNICODE string.\r
-  @param[out]  Ip              The storage to return the IPv4 address.\r
-\r
-  @retval EFI_SUCCESS           The binary IP address is returned in Ip.\r
-  @retval EFI_INVALID_PARAMETER The IP string is malformatted.\r
-**/\r
-EFI_STATUS\r
-Ip4StrToIp (\r
-  IN  CHAR16            *Str,\r
-  OUT EFI_IPv4_ADDRESS  *Ip\r
-  )\r
-{\r
-  UINTN Index;\r
-  UINTN Number;\r
-\r
-  Index = 0;\r
-\r
-  while (*Str != L'\0') {\r
-\r
-    if (Index > 3) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-    Number = 0;\r
-    while ((*Str >= L'0') && (*Str <= L'9')) {\r
-      Number = Number * 10 + (*Str - L'0');\r
-      Str++;\r
-    }\r
-\r
-    if (Number > 0xFF) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-    Ip->Addr[Index] = (UINT8) Number;\r
-\r
-    if ((*Str != L'\0') && (*Str != L'.')) {\r
-      //\r
-      // The current character should be either the NULL terminator or\r
-      // the dot delimiter.\r
-      //\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-    if (*Str == L'.') {\r
-      //\r
-      // Skip the delimiter.\r
-      //\r
-      Str++;\r
-    }\r
-\r
-    Index++;\r
-  }\r
-\r
-  if (Index != 4) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Convert the IPv4 address into a dotted string.\r
-\r
-  @param[in]   Ip   The IPv4 address.\r
-  @param[out]  Str  The dotted IP string.\r
-**/\r
-VOID\r
-Ip4ConfigIpToStr (\r
-  IN  EFI_IPv4_ADDRESS  *Ip,\r
-  OUT CHAR16            *Str\r
-  )\r
-{\r
-  UnicodeSPrint (Str, 2 * IP4_STR_MAX_SIZE, L"%d.%d.%d.%d", Ip->Addr[0], Ip->Addr[1], Ip->Addr[2], Ip->Addr[3]);\r
-}\r
-\r
-\r
-/**\r
-  Convert the network configuration data into the IFR data.\r
-\r
-  @param[in]   Ip4ConfigInstance The IP4Config instance\r
-  @param[out]  IfrFormNvData     The IFR nv data.\r
-**/\r
-VOID\r
-Ip4ConfigConvertDeviceConfigDataToIfrNvData (\r
-  IN  IP4_CONFIG_INSTANCE       *Ip4ConfigInstance,\r
-  OUT IP4_CONFIG_IFR_NVDATA     *IfrFormNvData\r
-  )\r
-{\r
-  NIC_IP4_CONFIG_INFO  *NicConfig;\r
-\r
-  NicConfig = EfiNicIp4ConfigGetInfo (Ip4ConfigInstance);\r
-  if (NicConfig != NULL) {\r
-    IfrFormNvData->Configure = 1;\r
-    Ip4ConfigInstance->Ip4ConfigCallbackInfo.Configured = TRUE;\r
-    if (NicConfig->Source == IP4_CONFIG_SOURCE_DHCP) {\r
-      IfrFormNvData->DhcpEnable = 1;\r
-      Ip4ConfigInstance->Ip4ConfigCallbackInfo.DhcpEnabled = TRUE;\r
-    } else {\r
-      IfrFormNvData->DhcpEnable = 0;\r
-      Ip4ConfigIpToStr (&NicConfig->Ip4Info.StationAddress, IfrFormNvData->StationAddress);\r
-      Ip4ConfigIpToStr (&NicConfig->Ip4Info.SubnetMask, IfrFormNvData->SubnetMask);\r
-      Ip4ConfigIpToStr (&NicConfig->Ip4Info.RouteTable[1].GatewayAddress, IfrFormNvData->GatewayAddress);\r
-\r
-      Ip4ConfigInstance->Ip4ConfigCallbackInfo.DhcpEnabled = FALSE;\r
-      CopyMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo.LocalIp, &NicConfig->Ip4Info.StationAddress, sizeof (EFI_IPv4_ADDRESS));\r
-      CopyMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo.SubnetMask, &NicConfig->Ip4Info.SubnetMask, sizeof (EFI_IPv4_ADDRESS));\r
-      CopyMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo.Gateway, &NicConfig->Ip4Info.RouteTable[1].GatewayAddress, sizeof (EFI_IPv4_ADDRESS));\r
-    }\r
-\r
-    FreePool (NicConfig);\r
-  } else {\r
-    IfrFormNvData->Configure = 0;\r
-    Ip4ConfigInstance->Ip4ConfigCallbackInfo.Configured = FALSE;\r
-  }\r
-}\r
-\r
-/**\r
-  Convert the IFR data into the network configuration data and set the IP\r
-  configure parameters for the NIC.\r
-\r
-  @param[in]       IfrFormNvData     The IFR NV data.\r
-  @param[in, out]  Ip4ConfigInstance The IP4Config instance.\r
-\r
-  @retval EFI_SUCCESS            The configure parameter for this NIC was\r
-                                 set successfully.\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
-EFI_STATUS\r
-Ip4ConfigConvertIfrNvDataToDeviceConfigData (\r
-  IN     IP4_CONFIG_IFR_NVDATA     *IfrFormNvData,\r
-  IN OUT IP4_CONFIG_INSTANCE       *Ip4ConfigInstance\r
-  )\r
-{\r
-  EFI_STATUS                Status;\r
-  EFI_IP_ADDRESS            HostIp;\r
-  EFI_IP_ADDRESS            SubnetMask;\r
-  EFI_IP_ADDRESS            Gateway;\r
-  EFI_INPUT_KEY             Key;\r
-  NIC_IP4_CONFIG_INFO       *NicInfo;\r
-  EFI_IP_ADDRESS            Ip;\r
-\r
-  ZeroMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo, sizeof (IP4_SETTING_INFO));\r
-\r
-  Ip4ConfigInstance->Ip4ConfigCallbackInfo.Configured = IfrFormNvData->Configure;\r
-  Ip4ConfigInstance->Ip4ConfigCallbackInfo.DhcpEnabled = IfrFormNvData->DhcpEnable;\r
-  Ip4StrToIp (IfrFormNvData->StationAddress, &Ip4ConfigInstance->Ip4ConfigCallbackInfo.LocalIp);\r
-  Ip4StrToIp (IfrFormNvData->SubnetMask, &Ip4ConfigInstance->Ip4ConfigCallbackInfo.SubnetMask);\r
-  Ip4StrToIp (IfrFormNvData->GatewayAddress, &Ip4ConfigInstance->Ip4ConfigCallbackInfo.Gateway);\r
-\r
-  if (!Ip4ConfigInstance->Ip4ConfigCallbackInfo.Configured) {\r
-    //\r
-    // Clear the variable\r
-    //\r
-    ZeroMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo, sizeof (IP4_SETTING_INFO));\r
-\r
-    Status = EfiNicIp4ConfigSetInfo (Ip4ConfigInstance, NULL, TRUE);\r
-    if (Status == EFI_NOT_FOUND) {\r
-      return EFI_SUCCESS;\r
-    }\r
-\r
-    return Status;\r
-  }\r
-\r
-  NicInfo = AllocateZeroPool (sizeof (NIC_IP4_CONFIG_INFO) + 2 * sizeof (EFI_IP4_ROUTE_TABLE));\r
-  ASSERT (NicInfo != NULL);\r
-\r
-  NicInfo->Ip4Info.RouteTable = (EFI_IP4_ROUTE_TABLE *) (NicInfo + 1);\r
-\r
-  if (!Ip4ConfigInstance->Ip4ConfigCallbackInfo.DhcpEnabled) {\r
-    CopyMem (&HostIp.v4, &Ip4ConfigInstance->Ip4ConfigCallbackInfo.LocalIp, sizeof (HostIp.v4));\r
-    CopyMem (&SubnetMask.v4, &Ip4ConfigInstance->Ip4ConfigCallbackInfo.SubnetMask, sizeof (SubnetMask.v4));\r
-    CopyMem (&Gateway.v4, &Ip4ConfigInstance->Ip4ConfigCallbackInfo.Gateway, sizeof (Gateway.v4));\r
-\r
-    if (!NetIp4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {\r
-      CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid IP address!", NULL);\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-    if (EFI_IP4_EQUAL (&SubnetMask, &mZeroIp4Addr)) {\r
-      CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid Subnet Mask!", NULL);\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
-\r
-    if ((Gateway.Addr[0] != 0)) {\r
-      if (SubnetMask.Addr[0] == 0) {\r
-        CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Gateway address is set but subnet mask is zero.", NULL);\r
-        return EFI_INVALID_PARAMETER;\r
-\r
-      } else if (!IP4_NET_EQUAL (HostIp.Addr[0], Gateway.Addr[0], SubnetMask.Addr[0])) {\r
-        CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Local IP and Gateway are not in the same subnet.", NULL);\r
-        return EFI_INVALID_PARAMETER;      }\r
-    }\r
-\r
-    NicInfo->Source = IP4_CONFIG_SOURCE_STATIC;\r
-    NicInfo->Ip4Info.RouteTableSize = 2;\r
-\r
-    CopyMem (&NicInfo->Ip4Info.StationAddress, &HostIp.v4, sizeof (EFI_IPv4_ADDRESS));\r
-    CopyMem (&NicInfo->Ip4Info.SubnetMask, &SubnetMask.v4, sizeof (EFI_IPv4_ADDRESS));\r
-\r
-    Ip.Addr[0] = HostIp.Addr[0] & SubnetMask.Addr[0];\r
-\r
-    CopyMem (&NicInfo->Ip4Info.RouteTable[0].SubnetAddress, &Ip.v4, sizeof (EFI_IPv4_ADDRESS));\r
-    CopyMem (&NicInfo->Ip4Info.RouteTable[0].SubnetMask, &SubnetMask.v4, sizeof (EFI_IPv4_ADDRESS));\r
-    CopyMem (&NicInfo->Ip4Info.RouteTable[1].GatewayAddress, &Gateway.v4, sizeof (EFI_IPv4_ADDRESS));\r
-\r
-  } else {\r
-    NicInfo->Source = IP4_CONFIG_SOURCE_DHCP;\r
-    ZeroMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo.LocalIp, sizeof (EFI_IPv4_ADDRESS));\r
-    ZeroMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo.SubnetMask, sizeof (EFI_IPv4_ADDRESS));\r
-    ZeroMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo.Gateway, sizeof (EFI_IPv4_ADDRESS));\r
-  }\r
-\r
-  NicInfo->Permanent = TRUE;\r
-  CopyMem (&NicInfo->NicAddr, &Ip4ConfigInstance->NicAddr, sizeof (NIC_ADDR));\r
-\r
-  return EfiNicIp4ConfigSetInfo (Ip4ConfigInstance, NicInfo, TRUE);\r
-}\r
-\r
-/**\r
-  This function allows the caller to request the current\r
-  configuration for one or more named elements. The resulting\r
-  string is in <ConfigAltResp> format. Any and all alternative\r
-  configuration strings shall also be appended to the end of the\r
-  current configuration string. If they are, they must appear\r
-  after the current configuration. They must contain the same\r
-  routing (GUID, NAME, PATH) as the current configuration string.\r
-  They must have an additional description indicating the type of\r
-  alternative configuration the string represents,\r
-  "ALTCFG=<StringToken>". That <StringToken> (when\r
-  converted from Hex UNICODE to binary) is a reference to a\r
-  string in the associated string pack.\r
-\r
-  @param[in] This       Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
-  @param[in] Request    A null-terminated Unicode string in\r
-                        <ConfigRequest> format. Note that this\r
-                        includes the routing information as well as\r
-                        the configurable name / value pairs. It is\r
-                        invalid for this string to be in\r
-                        <MultiConfigRequest> format.\r
-  @param[out] Progress  On return, points to a character in the\r
-                        Request string. Points to the string's null\r
-                        terminator if request was successful. Points\r
-                        to the most recent "&" before the first\r
-                        failing name / value pair (or the beginning\r
-                        of the string if the failure is in the first\r
-                        name / value pair) if the request was not\r
-                        successful.\r
-  @param[out] Results   A null-terminated Unicode string in\r
-                        <ConfigAltResp> format which has all values\r
-                        filled in for the names in the Request string.\r
-                        String to be allocated by the called function.\r
-\r
-  @retval EFI_SUCCESS             The Results string is filled with the\r
-                                  values corresponding to all requested\r
-                                  names.\r
-  @retval EFI_OUT_OF_RESOURCES    Not enough memory to store the\r
-                                  parts of the results that must be\r
-                                  stored awaiting possible future\r
-                                  protocols.\r
-  @retval EFI_NOT_FOUND           Routing data doesn't match any\r
-                                  known driver. Progress set to the\r
-                                  first character in the routing header.\r
-                                  Note: There is no requirement that the\r
-                                  driver validate the routing data. It\r
-                                  must skip the <ConfigHdr> in order to\r
-                                  process the names.\r
-  @retval EFI_INVALID_PARAMETER   Illegal syntax. Progress set\r
-                                  to most recent & before the\r
-                                  error or the beginning of the\r
-                                  string.\r
-  @retval EFI_INVALID_PARAMETER   Unknown name. Progress points\r
-                                  to the & before the name in\r
-                                  question.Currently not implemented.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Ip4DeviceExtractConfig (\r
-  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,\r
-  IN  CONST EFI_STRING                       Request,\r
-  OUT EFI_STRING                             *Progress,\r
-  OUT EFI_STRING                             *Results\r
-  )\r
-{\r
-  EFI_STATUS                       Status;\r
-  NIC_IP4_CONFIG_INFO              *IfrDeviceNvData;\r
-  NIC_IP4_CONFIG_INFO              *NicConfig;\r
-  IP4_CONFIG_INSTANCE              *Ip4ConfigInstance;\r
-  IP4_CONFIG_IFR_NVDATA            *IfrFormNvData;\r
-  EFI_STRING                       ConfigRequestHdr;\r
-  EFI_STRING                       ConfigRequest;\r
-  EFI_STRING                       DeviceResult;\r
-  EFI_STRING                       FormResult;\r
-  CHAR16                           *StrPointer;\r
-  BOOLEAN                          AllocatedRequest;\r
-  UINTN                            Size;\r
-  UINTN                            BufferSize;\r
-\r
-  if (Progress == NULL || Results == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  *Progress     = Request;\r
-  Size          = 0;\r
-  DeviceResult  = NULL;\r
-  FormResult    = NULL;\r
-  ConfigRequest = NULL;\r
-  Status        = EFI_SUCCESS;\r
-  AllocatedRequest  = FALSE;\r
-  Ip4ConfigInstance = IP4_CONFIG_INSTANCE_FROM_CONFIG_ACCESS (This);\r
-\r
-  //\r
-  // Check Request data in <ConfigHdr>.\r
-  //\r
-  if ((Request == NULL) || HiiIsConfigHdrMatch (Request, &gEfiNicIp4ConfigVariableGuid, EFI_NIC_IP4_CONFIG_VARIABLE)) {\r
-    IfrDeviceNvData = AllocateZeroPool (NIC_ITEM_CONFIG_SIZE);\r
-    if (IfrDeviceNvData == NULL) {\r
-      return EFI_OUT_OF_RESOURCES;\r
-    }\r
-\r
-    NicConfig = EfiNicIp4ConfigGetInfo (Ip4ConfigInstance);\r
-    if (NicConfig == NULL) {\r
-      return EFI_NOT_FOUND;\r
-    }\r
-    CopyMem (IfrDeviceNvData, NicConfig, SIZEOF_NIC_IP4_CONFIG_INFO (NicConfig));\r
-    FreePool (NicConfig);\r
-\r
-    ConfigRequest = Request;\r
-    if ((Request == NULL) || (StrStr (Request, L"OFFSET") == NULL)) {\r
-      //\r
-      // Request has no request element, construct full request string.\r
-      // Allocate and fill a buffer large enough to hold the <ConfigHdr> template\r
-      // followed by "&OFFSET=0&WIDTH=WWWWWWWWWWWWWWWW" followed by a Null-terminator\r
-      //\r
-      ConfigRequestHdr = HiiConstructConfigHdr (&gEfiNicIp4ConfigVariableGuid, EFI_NIC_IP4_CONFIG_VARIABLE, Ip4ConfigInstance->ChildHandle);\r
-      Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16);\r
-      ConfigRequest = AllocateZeroPool (Size);\r
-      ASSERT (ConfigRequest != NULL);\r
-      AllocatedRequest = TRUE;\r
-      BufferSize = NIC_ITEM_CONFIG_SIZE;\r
-      UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize);\r
-      FreePool (ConfigRequestHdr);\r
-    }\r
-\r
-    //\r
-    // Convert buffer data to <ConfigResp> by helper function BlockToConfig()\r
-    //\r
-    Status = gHiiConfigRouting->BlockToConfig (\r
-                                  gHiiConfigRouting,\r
-                                  ConfigRequest,\r
-                                  (UINT8 *) IfrDeviceNvData,\r
-                                  NIC_ITEM_CONFIG_SIZE,\r
-                                  &DeviceResult,\r
-                                  Progress\r
-                                  );\r
-\r
-    FreePool (IfrDeviceNvData);\r
-    //\r
-    // Free the allocated config request string.\r
-    //\r
-    if (AllocatedRequest) {\r
-      FreePool (ConfigRequest);\r
-      ConfigRequest = NULL;\r
-    }\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      goto Failure;\r
-    }\r
-  }\r
-\r
-  if ((Request == NULL) || HiiIsConfigHdrMatch (Request, &gNicIp4ConfigNvDataGuid, EFI_NIC_IP4_CONFIG_VARIABLE)) {\r
-\r
-    IfrFormNvData = AllocateZeroPool (sizeof (IP4_CONFIG_IFR_NVDATA));\r
-    if (IfrFormNvData == NULL) {\r
-      return EFI_OUT_OF_RESOURCES;\r
-    }\r
-\r
-    Ip4ConfigConvertDeviceConfigDataToIfrNvData (Ip4ConfigInstance, IfrFormNvData);\r
-\r
-    ConfigRequest = Request;\r
-    if ((Request == NULL) || (StrStr (Request, L"OFFSET") == NULL)) {\r
-      //\r
-      // Request has no request element, construct full request string.\r
-      // Allocate and fill a buffer large enough to hold the <ConfigHdr> template\r
-      // followed by "&OFFSET=0&WIDTH=WWWWWWWWWWWWWWWW" followed by a Null-terminator\r
-      //\r
-      ConfigRequestHdr = HiiConstructConfigHdr (&gNicIp4ConfigNvDataGuid, EFI_NIC_IP4_CONFIG_VARIABLE, Ip4ConfigInstance->ChildHandle);\r
-      Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16);\r
-      ConfigRequest = AllocateZeroPool (Size);\r
-      ASSERT (ConfigRequest != NULL);\r
-      AllocatedRequest = TRUE;\r
-      BufferSize = sizeof (IP4_CONFIG_IFR_NVDATA);\r
-      UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize);\r
-      FreePool (ConfigRequestHdr);\r
-    }\r
-\r
-    //\r
-    // Convert buffer data to <ConfigResp> by helper function BlockToConfig()\r
-    //\r
-    Status = gHiiConfigRouting->BlockToConfig (\r
-                                  gHiiConfigRouting,\r
-                                  ConfigRequest,\r
-                                  (UINT8 *) IfrFormNvData,\r
-                                  sizeof (IP4_CONFIG_IFR_NVDATA),\r
-                                  &FormResult,\r
-                                  Progress\r
-                                  );\r
-\r
-    FreePool (IfrFormNvData);\r
-    //\r
-    // Free the allocated config request string.\r
-    //\r
-    if (AllocatedRequest) {\r
-      FreePool (ConfigRequest);\r
-      ConfigRequest = NULL;\r
-    }\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      goto Failure;\r
-    }\r
-  }\r
-\r
-  if (Request == NULL) {\r
-    Size = StrLen (DeviceResult);\r
-    Size = Size + 1;\r
-    Size = Size + StrLen (FormResult) + 1;\r
-    *Results = AllocateZeroPool (Size * sizeof (CHAR16));\r
-    ASSERT (*Results != NULL);\r
-    StrPointer  = *Results;\r
-    StrCpyS (StrPointer, Size, DeviceResult);\r
-    StrPointer  = StrPointer + StrLen (StrPointer);\r
-    *StrPointer = L'&';\r
-    StrCpyS (StrPointer + 1, StrLen (FormResult) + 1, FormResult);\r
-    FreePool (DeviceResult);\r
-    FreePool (FormResult);\r
-  } else if (HiiIsConfigHdrMatch (Request, &gEfiNicIp4ConfigVariableGuid, EFI_NIC_IP4_CONFIG_VARIABLE)) {\r
-    *Results = DeviceResult;\r
-  } else if (HiiIsConfigHdrMatch (Request, &gNicIp4ConfigNvDataGuid, EFI_NIC_IP4_CONFIG_VARIABLE)) {\r
-    *Results = FormResult;\r
-  } else {\r
-    return EFI_NOT_FOUND;\r
-  }\r
-\r
-Failure:\r
-  //\r
-  // Set Progress string to the original request string.\r
-  //\r
-  if (Request == NULL) {\r
-    *Progress = NULL;\r
-  } else if (StrStr (Request, L"OFFSET") == NULL) {\r
-    *Progress = Request + StrLen (Request);\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-/**\r
-  This function applies changes in a driver's configuration.\r
-  Input is a Configuration, which has the routing data for this\r
-  driver followed by name / value configuration pairs. The driver\r
-  must apply those pairs to its configurable storage. If the\r
-  driver's configuration is stored in a linear block of data\r
-  and the driver's name / value pairs are in <BlockConfig>\r
-  format, it may use the ConfigToBlock helper function (above) to\r
-  simplify the job. Currently not implemented.\r
-\r
-  @param[in]  This           Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
-  @param[in]  Configuration  A null-terminated Unicode string in\r
-                             <ConfigString> format.\r
-  @param[out] Progress       A pointer to a string filled in with the\r
-                             offset of the most recent '&' before the\r
-                             first failing name / value pair (or the\r
-                             beginn ing of the string if the failure\r
-                             is in the first name / value pair) or\r
-                             the terminating NULL if all was\r
-                             successful.\r
-\r
-  @retval EFI_SUCCESS             The results have been distributed or are\r
-                                  awaiting distribution.\r
-  @retval EFI_OUT_OF_MEMORY       Not enough memory to store the\r
-                                  parts of the results that must be\r
-                                  stored awaiting possible future\r
-                                  protocols.\r
-  @retval EFI_INVALID_PARAMETERS  Passing in a NULL for the\r
-                                  Results parameter would result\r
-                                  in this type of error.\r
-  @retval EFI_NOT_FOUND           Target for the specified routing data\r
-                                  was not found.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Ip4DeviceRouteConfig (\r
-  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,\r
-  IN  CONST EFI_STRING                       Configuration,\r
-  OUT EFI_STRING                             *Progress\r
-  )\r
-{\r
-  EFI_STATUS                       Status;\r
-  UINTN                            BufferSize;\r
-  NIC_IP4_CONFIG_INFO              *IfrDeviceNvData;\r
-  IP4_CONFIG_IFR_NVDATA            *IfrFormNvData;\r
-  NIC_IP4_CONFIG_INFO              *NicInfo;\r
-  IP4_CONFIG_INSTANCE              *Ip4ConfigInstance;\r
-  EFI_MAC_ADDRESS                  ZeroMac;\r
-\r
-  if (Configuration == NULL || Progress == NULL) {\r
-    return EFI_INVALID_PARAMETER;\r
-  }\r
-\r
-  //\r
-  // Reclaim Ip4Config variable\r
-  //\r
-  Ip4ConfigReclaimVariable ();\r
-\r
-  *Progress = Configuration;\r
-\r
-  Ip4ConfigInstance = IP4_CONFIG_INSTANCE_FROM_CONFIG_ACCESS (This);\r
-\r
-  //\r
-  // Check Routing data in <ConfigHdr>.\r
-  //\r
-  if (HiiIsConfigHdrMatch (Configuration, &gNicIp4ConfigNvDataGuid, EFI_NIC_IP4_CONFIG_VARIABLE)) {\r
-    //\r
-    // Convert buffer data to <ConfigResp> by helper function BlockToConfig()\r
-    //\r
-    IfrFormNvData = AllocateZeroPool (sizeof (IP4_CONFIG_IFR_NVDATA));\r
-    if (IfrFormNvData == NULL) {\r
-      return EFI_OUT_OF_RESOURCES;\r
-    }\r
-\r
-    BufferSize = NIC_ITEM_CONFIG_SIZE;\r
-    Status = gHiiConfigRouting->ConfigToBlock (\r
-                                  gHiiConfigRouting,\r
-                                  Configuration,\r
-                                  (UINT8 *) IfrFormNvData,\r
-                                  &BufferSize,\r
-                                  Progress\r
-                                  );\r
-    if (!EFI_ERROR (Status)) {\r
-      Status = Ip4ConfigConvertIfrNvDataToDeviceConfigData (IfrFormNvData, Ip4ConfigInstance);\r
-    }\r
-\r
-    FreePool (IfrFormNvData);\r
-\r
-  } else if (HiiIsConfigHdrMatch (Configuration, &gEfiNicIp4ConfigVariableGuid, EFI_NIC_IP4_CONFIG_VARIABLE)) {\r
-\r
-    IfrDeviceNvData = AllocateZeroPool (NIC_ITEM_CONFIG_SIZE);\r
-    if (IfrDeviceNvData == NULL) {\r
-      return EFI_OUT_OF_RESOURCES;\r
-    }\r
-\r
-    BufferSize = NIC_ITEM_CONFIG_SIZE;\r
-    Status = gHiiConfigRouting->ConfigToBlock (\r
-                                  gHiiConfigRouting,\r
-                                  Configuration,\r
-                                  (UINT8 *) IfrDeviceNvData,\r
-                                  &BufferSize,\r
-                                  Progress\r
-                                  );\r
-    if (!EFI_ERROR (Status)) {\r
-      ZeroMem (&ZeroMac, sizeof (EFI_MAC_ADDRESS));\r
-      if (CompareMem (&IfrDeviceNvData->NicAddr.MacAddr, &ZeroMac, IfrDeviceNvData->NicAddr.Len) != 0) {\r
-        BufferSize = SIZEOF_NIC_IP4_CONFIG_INFO (IfrDeviceNvData);\r
-        NicInfo = AllocateCopyPool (BufferSize, IfrDeviceNvData);\r
-        if (NicInfo == NULL) {\r
-          return EFI_OUT_OF_RESOURCES;\r
-        }\r
-        Status = EfiNicIp4ConfigSetInfo (Ip4ConfigInstance, NicInfo, TRUE);\r
-        FreePool (NicInfo);\r
-      } else {\r
-        ZeroMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo, sizeof (IP4_SETTING_INFO));\r
-        Status = EfiNicIp4ConfigSetInfo (Ip4ConfigInstance, NULL, TRUE);\r
-      }\r
-    }\r
-\r
-    FreePool (IfrDeviceNvData);\r
-\r
-  } else {\r
-\r
-    return EFI_NOT_FOUND;\r
-  }\r
-\r
-  return Status;\r
-\r
-}\r
-\r
-/**\r
-  This function is called to provide results data to the driver.\r
-  This data consists of a unique key that is used to identify\r
-  which data is either being passed back or being asked for.\r
-\r
-  @param[in]  This               Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
-  @param[in]  Action             Specifies the type of action taken by the browser.\r
-  @param[in]  QuestionId         A unique value which is sent to the original\r
-                                 exporting driver so that it can identify the type\r
-                                 of data to expect. The format of the data tends to\r
-                                 vary based on the opcode that enerated the callback.\r
-  @param[in]  Type               The type of value for the question.\r
-  @param[in]  Value              A pointer to the data being sent to the original\r
-                                 exporting driver.\r
-  @param[out]  ActionRequest     On return, points to the action requested by the\r
-                                 callback function.\r
-\r
-  @retval EFI_SUCCESS            The callback successfully handled the action.\r
-  @retval EFI_OUT_OF_RESOURCES   Not enough storage is available to hold the\r
-                                 variable and its data.\r
-  @retval EFI_DEVICE_ERROR       The variable could not be saved.\r
-  @retval EFI_UNSUPPORTED        The specified Action is not supported by the\r
-                                 callback.Currently not implemented.\r
-  @retval EFI_INVALID_PARAMETERS Passing in wrong parameter.\r
-  @retval Others                 Other errors as indicated.\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-Ip4FormCallback (\r
-  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,\r
-  IN  EFI_BROWSER_ACTION                     Action,\r
-  IN  EFI_QUESTION_ID                        QuestionId,\r
-  IN  UINT8                                  Type,\r
-  IN  EFI_IFR_TYPE_VALUE                     *Value,\r
-  OUT EFI_BROWSER_ACTION_REQUEST             *ActionRequest\r
-  )\r
-{\r
-  IP4_CONFIG_INSTANCE       *Ip4ConfigInstance;\r
-  IP4_CONFIG_IFR_NVDATA     *IfrFormNvData;\r
-  EFI_IP_ADDRESS            HostIp;\r
-  EFI_IP_ADDRESS            SubnetMask;\r
-  EFI_IP_ADDRESS            Gateway;\r
-  EFI_STATUS                Status;\r
-  EFI_INPUT_KEY             Key;\r
-\r
-  if (Action == EFI_BROWSER_ACTION_CHANGED) {\r
-    Ip4ConfigInstance = IP4_CONFIG_INSTANCE_FROM_CONFIG_ACCESS (This);\r
-\r
-    IfrFormNvData = AllocateZeroPool (sizeof (IP4_CONFIG_IFR_NVDATA));\r
-    if (IfrFormNvData == NULL) {\r
-      return EFI_OUT_OF_RESOURCES;\r
-    }\r
-\r
-    //\r
-    // Retrive uncommitted data from Browser\r
-    //\r
-    if (!HiiGetBrowserData (&gNicIp4ConfigNvDataGuid, EFI_NIC_IP4_CONFIG_VARIABLE, sizeof (IP4_CONFIG_IFR_NVDATA), (UINT8 *) IfrFormNvData)) {\r
-      FreePool (IfrFormNvData);\r
-      return EFI_NOT_FOUND;\r
-    }\r
-\r
-    Status = EFI_SUCCESS;\r
-\r
-    switch (QuestionId) {\r
-    case KEY_LOCAL_IP:\r
-      Status = Ip4StrToIp (IfrFormNvData->StationAddress, &HostIp.v4);\r
-      if (EFI_ERROR (Status) || !NetIp4IsUnicast (NTOHL (HostIp.Addr[0]), 0)) {\r
-        CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid IP address!", NULL);\r
-        Status = EFI_INVALID_PARAMETER;\r
-      } else {\r
-        CopyMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo.LocalIp, &HostIp.v4, sizeof (HostIp.v4));\r
-      }\r
-\r
-      break;\r
-\r
-    case KEY_SUBNET_MASK:\r
-      Status = Ip4StrToIp (IfrFormNvData->SubnetMask, &SubnetMask.v4);\r
-      if (EFI_ERROR (Status) || ((SubnetMask.Addr[0] != 0) && (GetSubnetMaskPrefixLength (&SubnetMask.v4) == 0))) {\r
-        CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid Subnet Mask!", NULL);\r
-        Status = EFI_INVALID_PARAMETER;\r
-      } else {\r
-        CopyMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo.SubnetMask, &SubnetMask.v4, sizeof (SubnetMask.v4));\r
-      }\r
-\r
-      break;\r
-\r
-    case KEY_GATE_WAY:\r
-      Status = Ip4StrToIp (IfrFormNvData->GatewayAddress, &Gateway.v4);\r
-      if (EFI_ERROR (Status) || ((Gateway.Addr[0] != 0) && !NetIp4IsUnicast (NTOHL (Gateway.Addr[0]), 0))) {\r
-        CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, L"Invalid Gateway!", NULL);\r
-        Status = EFI_INVALID_PARAMETER;\r
-      } else {\r
-        CopyMem (&Ip4ConfigInstance->Ip4ConfigCallbackInfo.Gateway, &Gateway.v4, sizeof (Gateway.v4));\r
-      }\r
-\r
-      break;\r
-\r
-    case KEY_SAVE_CHANGES:\r
-      Status = Ip4ConfigConvertIfrNvDataToDeviceConfigData (IfrFormNvData, Ip4ConfigInstance);\r
-      *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;\r
-      break;\r
-\r
-    default:\r
-      break;\r
-    }\r
-\r
-    FreePool (IfrFormNvData);\r
-\r
-    return Status;\r
-  }\r
-\r
-  //\r
-  // All other action return unsupported.\r
-  //\r
-  return EFI_UNSUPPORTED;\r
-}\r
-\r
-/**\r
-  Install HII Config Access protocol for network device and allocate resource.\r
-\r
-  @param[in]  Instance            The IP4 Config instance.\r
-\r
-  @retval EFI_SUCCESS              The HII Config Access protocol is installed.\r
-  @retval EFI_OUT_OF_RESOURCES     Failed to allocate memory.\r
-  @retval Others                   Other errors as indicated.\r
-**/\r
-EFI_STATUS\r
-Ip4ConfigDeviceInit (\r
-  IN IP4_CONFIG_INSTANCE         *Instance\r
-  )\r
-{\r
-  EFI_STATUS                     Status;\r
-  EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;\r
-  VENDOR_DEVICE_PATH             VendorDeviceNode;\r
-  EFI_SERVICE_BINDING_PROTOCOL   *MnpSb;\r
-  CHAR16                         *MacString;\r
-  CHAR16                         MenuString[128];\r
-  CHAR16                         PortString[128];\r
-  CHAR16                         *OldMenuString;\r
-\r
-  ConfigAccess = &Instance->HiiConfigAccessProtocol;\r
-  ConfigAccess->ExtractConfig = Ip4DeviceExtractConfig;\r
-  ConfigAccess->RouteConfig   = Ip4DeviceRouteConfig;\r
-  ConfigAccess->Callback      = Ip4FormCallback;\r
-\r
-  //\r
-  // Construct device path node for EFI HII Config Access protocol,\r
-  // which consists of controller physical device path and one hardware\r
-  // vendor guid node.\r
-  //\r
-  ZeroMem (&VendorDeviceNode, sizeof (VENDOR_DEVICE_PATH));\r
-  VendorDeviceNode.Header.Type = HARDWARE_DEVICE_PATH;\r
-  VendorDeviceNode.Header.SubType = HW_VENDOR_DP;\r
-\r
-  CopyGuid (&VendorDeviceNode.Guid, &gEfiNicIp4ConfigVariableGuid);\r
-\r
-  SetDevicePathNodeLength (&VendorDeviceNode.Header, sizeof (VENDOR_DEVICE_PATH));\r
-  Instance->HiiVendorDevicePath = AppendDevicePathNode (\r
-                                    Instance->ParentDevicePath,\r
-                                    (EFI_DEVICE_PATH_PROTOCOL *) &VendorDeviceNode\r
-                                    );\r
-\r
-  Instance->ChildHandle = NULL;\r
-  //\r
-  // Install Device Path Protocol and Config Access protocol on new handle\r
-  //\r
-  Status = gBS->InstallMultipleProtocolInterfaces (\r
-                  &Instance->ChildHandle,\r
-                  &gEfiDevicePathProtocolGuid,\r
-                  Instance->HiiVendorDevicePath,\r
-                  &gEfiHiiConfigAccessProtocolGuid,\r
-                  ConfigAccess,\r
-                  NULL\r
-                  );\r
-  if (!EFI_ERROR (Status)) {\r
-    //\r
-    // Open the Parent Handle for the child\r
-    //\r
-    Status = gBS->OpenProtocol (\r
-                    Instance->Controller,\r
-                    &gEfiManagedNetworkServiceBindingProtocolGuid,\r
-                    (VOID **) &MnpSb,\r
-                    Instance->Image,\r
-                    Instance->ChildHandle,\r
-                    EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
-                    );\r
-  }\r
-\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Publish our HII data\r
-  //\r
-  Instance->RegisteredHandle = HiiAddPackages (\r
-                                 &gNicIp4ConfigNvDataGuid,\r
-                                 Instance->ChildHandle,\r
-                                 Ip4ConfigDxeStrings,\r
-                                 Ip4ConfigDxeBin,\r
-                                 NULL\r
-                                 );\r
-  if (Instance->RegisteredHandle == NULL) {\r
-    return EFI_OUT_OF_RESOURCES;\r
-  }\r
-\r
-  //\r
-  // Append MAC string in the menu help string and tile help string\r
-  //\r
-  Status = NetLibGetMacString (Instance->Controller, Instance->Image, &MacString);\r
-  if (!EFI_ERROR (Status)) {\r
-    OldMenuString = HiiGetString (Instance->RegisteredHandle, STRING_TOKEN (STR_IP4_CONFIG_FORM_HELP), NULL);\r
-    UnicodeSPrint (MenuString, 128, L"%s (MAC:%s)", OldMenuString, MacString);\r
-    HiiSetString (Instance->RegisteredHandle, STRING_TOKEN (STR_IP4_CONFIG_FORM_HELP), MenuString, NULL);\r
-\r
-    UnicodeSPrint (PortString, 128, L"MAC:%s", MacString);\r
-    HiiSetString (Instance->RegisteredHandle, STRING_TOKEN (STR_IP4_DEVICE_FORM_HELP), PortString, NULL);\r
-    FreePool (MacString);\r
-  }\r
-\r
-  return Status;\r
-}\r
-\r
-/**\r
-  Uninstall HII Config Access protocol for network device and free resource.\r
-\r
-  @param[in]  Instance            The IP4 Config instance.\r
-\r
-  @retval EFI_SUCCESS             The HII Config Access protocol is uninstalled.\r
-  @retval Others                  Other errors as indicated.\r
-**/\r
-EFI_STATUS\r
-Ip4ConfigDeviceUnload (\r
-  IN IP4_CONFIG_INSTANCE              *Instance\r
-  )\r
-{\r
-  //\r
-  // Remove HII package list\r
-  //\r
-  HiiRemovePackages (Instance->RegisteredHandle);\r
-\r
-  //\r
-  // Close the child handle\r
-  //\r
-  gBS->CloseProtocol (\r
-         Instance->Controller,\r
-         &gEfiManagedNetworkServiceBindingProtocolGuid,\r
-         Instance->Image,\r
-         Instance->ChildHandle\r
-         );\r
-\r
-  //\r
-  // Uninstall EFI_HII_CONFIG_ACCESS_PROTOCOL\r
-  //\r
-  gBS->UninstallMultipleProtocolInterfaces (\r
-         Instance->ChildHandle,\r
-         &gEfiDevicePathProtocolGuid,\r
-         Instance->HiiVendorDevicePath,\r
-         &gEfiHiiConfigAccessProtocolGuid,\r
-         &Instance->HiiConfigAccessProtocol,\r
-         NULL\r
-         );\r
-\r
-  return EFI_SUCCESS;\r
-}\r
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.h b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4ConfigNv.h
deleted file mode 100644 (file)
index 3b4168e..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/** @file\r
-  The header file of IP4ConfigNv.c\r
-\r
-Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
-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
-\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
-#ifndef _IP4_CONFIGNV_H_\r
-#define _IP4_CONFIGNV_H_\r
-\r
-#include "Ip4Config.h"\r
-#include "Ip4NvData.h"\r
-\r
-extern UINT8  Ip4ConfigDxeBin[];\r
-extern UINT8  Ip4ConfigDxeStrings[];\r
-\r
-#define NIC_ITEM_CONFIG_SIZE   (sizeof (NIC_IP4_CONFIG_INFO) + (sizeof (EFI_IP4_ROUTE_TABLE) * MAX_IP4_CONFIG_IN_VARIABLE))\r
-\r
-\r
-/**\r
-  Install HII Config Access protocol for network device and allocate resource.\r
-\r
-  @param[in]  Instance            The IP4 Config instance.\r
-\r
-  @retval EFI_SUCCESS              The HII Config Access protocol is installed.\r
-  @retval EFI_OUT_OF_RESOURCES     Failed to allocate memory.\r
-  @retval Others                   Other errors as indicated.\r
-**/\r
-EFI_STATUS\r
-Ip4ConfigDeviceInit (\r
-    IN IP4_CONFIG_INSTANCE                   *Instance\r
-  );\r
-\r
-/**\r
-  Uninstall HII Config Access protocol for network device and free resource.\r
-\r
-  @param[in]  Instance            The IP4 Config instance.\r
-\r
-  @retval EFI_SUCCESS             The HII Config Access protocol is uninstalled.\r
-  @retval Others                  Other errors as indicated.\r
-**/\r
-EFI_STATUS\r
-Ip4ConfigDeviceUnload (\r
-    IN IP4_CONFIG_INSTANCE                   *Instance\r
-  );\r
-\r
-#endif\r
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4NvData.h b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4NvData.h
deleted file mode 100644 (file)
index 2a09527..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/** @file\r
-  Routines used to operate the Ip4 configure variable.\r
-\r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
-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
-\r
-**/\r
-\r
-#ifndef _NIC_IP4_NV_DATA_H_\r
-#define _NIC_IP4_NV_DATA_H_\r
-\r
-#include <Guid/Ip4ConfigHii.h>\r
-\r
-#define FORMID_MAIN_FORM    1\r
-#define FORMID_DEVICE_FORM  2\r
-\r
-#define KEY_ENABLE                0x100\r
-#define KEY_DHCP_ENABLE           0x101\r
-#define KEY_LOCAL_IP              0x102\r
-#define KEY_SUBNET_MASK           0x103\r
-#define KEY_GATE_WAY              0x104\r
-#define KEY_SAVE_CHANGES          0x105\r
-\r
-#define IP_MIN_SIZE               7\r
-#define IP_MAX_SIZE               15\r
-#define IP4_STR_MAX_SIZE          16\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
-  UINT8           Configure;                         ///< NIC configure status\r
-  UINT8           DhcpEnable;                        ///< Static or DHCP\r
-  CHAR16          StationAddress[IP4_STR_MAX_SIZE];  ///< IP addresses\r
-  CHAR16          SubnetMask[IP4_STR_MAX_SIZE];      ///< Subnet address\r
-  CHAR16          GatewayAddress[IP4_STR_MAX_SIZE];  ///< Gateway address\r
-} IP4_CONFIG_IFR_NVDATA;\r
-\r
-#endif\r
-\r
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.c
deleted file mode 100644 (file)
index f0e03af..0000000
+++ /dev/null
@@ -1,319 +0,0 @@
-/** @file\r
-  Routines used to operate the Ip4 configure variable.\r
-\r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
-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
-\r
-**/\r
-\r
-#include "Ip4Config.h"\r
-#include "NicIp4Variable.h"\r
-\r
-BOOLEAN  mIp4ConfigVariableReclaimed = FALSE;\r
-\r
-/**\r
-  Check whether the configure parameter is valid.\r
-\r
-  @param  NicConfig    The configure parameter to check\r
-\r
-  @return TRUE if the parameter is valid for the interface, otherwise FALSE.\r
-\r
-**/\r
-BOOLEAN\r
-Ip4ConfigIsValid (\r
-  IN NIC_IP4_CONFIG_INFO    *NicConfig\r
-  )\r
-{\r
-  EFI_IP4_IPCONFIG_DATA     *IpConfig;\r
-  IP4_ADDR                  Station;\r
-  IP4_ADDR                  Netmask;\r
-  IP4_ADDR                  Gateway;\r
-  UINT32                    Index;\r
-\r
-  IpConfig = &NicConfig->Ip4Info;\r
-\r
-  if (NicConfig->Source == IP4_CONFIG_SOURCE_STATIC) {\r
-    //\r
-    // Validate that the addresses are unicast and mask\r
-    // is properly formated\r
-    //\r
-    Station = EFI_NTOHL (IpConfig->StationAddress);\r
-    Netmask = EFI_NTOHL (IpConfig->SubnetMask);\r
-\r
-    if ((Netmask == 0) || !IP4_IS_VALID_NETMASK (Netmask) ||\r
-        (Station == 0) || !NetIp4IsUnicast (Station, Netmask)) {\r
-      return FALSE;\r
-    }\r
-\r
-    //\r
-    // Validate that the next hops are on the connected network\r
-    // or that is a direct route (Gateway == 0).\r
-    //\r
-    for (Index = 0; Index < IpConfig->RouteTableSize; Index++) {\r
-      Gateway = EFI_NTOHL (IpConfig->RouteTable[Index].GatewayAddress);\r
-\r
-      if ((Gateway != 0) && (!IP4_NET_EQUAL (Station, Gateway, Netmask) ||\r
-          !NetIp4IsUnicast (Gateway, Netmask))) {\r
-        return FALSE;\r
-      }\r
-    }\r
-\r
-    return TRUE;\r
-  }\r
-\r
-  //\r
-  // return false if it is an unkown configure source. Valid\r
-  // sources are static and dhcp.\r
-  //\r
-  return (BOOLEAN) (NicConfig->Source == IP4_CONFIG_SOURCE_DHCP);\r
-}\r
-\r
-\r
-\r
-/**\r
-  Read the ip4 configure variable from the EFI variable.\r
-\r
-  @param  Instance     The IP4 CONFIG instance.\r
-\r
-  @return The IP4 configure read if it is there and is valid, otherwise NULL.\r
-\r
-**/\r
-NIC_IP4_CONFIG_INFO *\r
-Ip4ConfigReadVariable (\r
-  IN  IP4_CONFIG_INSTANCE   *Instance\r
-  )\r
-{\r
-  NIC_IP4_CONFIG_INFO *NicConfig;\r
-\r
-  GetVariable2 (Instance->MacString, &gEfiNicIp4ConfigVariableGuid, (VOID**)&NicConfig, NULL);\r
-  if (NicConfig != NULL) {\r
-    Ip4ConfigFixRouteTablePointer (&NicConfig->Ip4Info);\r
-  }\r
-\r
-  return NicConfig;\r
-}\r
-\r
-/**\r
-  Write the IP4 configure variable to the NVRAM. If Config\r
-  is NULL, remove the variable.\r
-\r
-  @param  Instance     The IP4 CONFIG instance.\r
-  @param  NicConfig    The IP4 configure data to write.\r
-\r
-  @retval EFI_SUCCESS  The variable is written to the NVRam.\r
-  @retval Others       Failed to write the variable.\r
-\r
-**/\r
-EFI_STATUS\r
-Ip4ConfigWriteVariable (\r
-  IN IP4_CONFIG_INSTANCE    *Instance,\r
-  IN NIC_IP4_CONFIG_INFO    *NicConfig OPTIONAL\r
-  )\r
-{\r
-  EFI_STATUS  Status;\r
-\r
-  Status = gRT->SetVariable (\r
-                  Instance->MacString,\r
-                  &gEfiNicIp4ConfigVariableGuid,\r
-                  IP4_CONFIG_VARIABLE_ATTRIBUTES,\r
-                  (NicConfig == NULL) ? 0 : SIZEOF_NIC_IP4_CONFIG_INFO (NicConfig),\r
-                  NicConfig\r
-                  );\r
-\r
-  return Status;\r
-}\r
-\r
-/**\r
-  Check whether a NIC exist in the platform given its MAC address.\r
-\r
-  @param  NicAddr      The MAC address for the NIC to be checked.\r
-\r
-  @retval TRUE         The NIC exist in the platform.\r
-  @retval FALSE        The NIC doesn't exist in the platform.\r
-\r
-**/\r
-BOOLEAN\r
-Ip4ConfigIsNicExist (\r
-  IN NIC_ADDR               *NicAddr\r
-  )\r
-{\r
-  EFI_STATUS      Status;\r
-  EFI_HANDLE      *HandleBuffer;\r
-  UINTN           NumberOfHandles;\r
-  UINTN           Index;\r
-  BOOLEAN         Found;\r
-  UINTN           AddrSize;\r
-  EFI_MAC_ADDRESS MacAddr;\r
-\r
-  //\r
-  // Locate Service Binding handles.\r
-  //\r
-  Status = gBS->LocateHandleBuffer (\r
-                 ByProtocol,\r
-                 &gEfiManagedNetworkServiceBindingProtocolGuid,\r
-                 NULL,\r
-                 &NumberOfHandles,\r
-                 &HandleBuffer\r
-                 );\r
-  if (EFI_ERROR (Status)) {\r
-    return FALSE;\r
-  }\r
-\r
-  Found = FALSE;\r
-  for (Index = 0; Index < NumberOfHandles; Index++) {\r
-    //\r
-    // Get MAC address.\r
-    //\r
-    AddrSize = 0;\r
-    Status = NetLibGetMacAddress (HandleBuffer[Index], &MacAddr, &AddrSize);\r
-    if (EFI_ERROR (Status)) {\r
-      Found = FALSE;\r
-      goto Exit;\r
-    }\r
-\r
-    if ((NicAddr->Len == AddrSize) && (CompareMem (NicAddr->MacAddr.Addr, MacAddr.Addr, AddrSize) == 0)) {\r
-      Found = TRUE;\r
-      goto Exit;\r
-    }\r
-  }\r
-\r
-Exit:\r
-  FreePool (HandleBuffer);\r
-  return Found;\r
-}\r
-\r
-/**\r
-  Reclaim Ip4Config Variables for NIC which has been removed from the platform.\r
-\r
-**/\r
-VOID\r
-Ip4ConfigReclaimVariable (\r
-  VOID\r
-  )\r
-{\r
-  EFI_STATUS           Status;\r
-  UINTN                VariableNameSize;\r
-  CHAR16               *VariableName;\r
-  CHAR16               *CurrentVariableName;\r
-  EFI_GUID             VendorGuid;\r
-  UINTN                VariableNameBufferSize;\r
-  NIC_IP4_CONFIG_INFO  *NicConfig;\r
-\r
-  //\r
-  // Check whether we need perform reclaim.\r
-  //\r
-  if (mIp4ConfigVariableReclaimed) {\r
-    return;\r
-  }\r
-  mIp4ConfigVariableReclaimed = TRUE;\r
-\r
-  //\r
-  // Get all Ip4Config Variable.\r
-  //\r
-  VariableNameSize = sizeof (CHAR16);\r
-  VariableName = AllocateZeroPool (VariableNameSize);\r
-  VariableNameBufferSize = VariableNameSize;\r
-\r
-  while (TRUE) {\r
-    Status = gRT->GetNextVariableName (\r
-                    &VariableNameSize,\r
-                    VariableName,\r
-                    &VendorGuid\r
-                    );\r
-\r
-Check:\r
-    if (Status == EFI_BUFFER_TOO_SMALL) {\r
-      VariableName = ReallocatePool (VariableNameBufferSize, VariableNameSize, VariableName);\r
-      VariableNameBufferSize = VariableNameSize;\r
-      //\r
-      // Try again using the new buffer.\r
-      //\r
-      Status = gRT->GetNextVariableName (\r
-                      &VariableNameSize,\r
-                      VariableName,\r
-                      &VendorGuid\r
-                      );\r
-    }\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      //\r
-      // No more variable available, finish search.\r
-      //\r
-      break;\r
-    }\r
-\r
-    //\r
-    // Check variable GUID.\r
-    //\r
-    if (!CompareGuid (&VendorGuid, &gEfiNicIp4ConfigVariableGuid)) {\r
-      continue;\r
-    }\r
-\r
-    GetVariable2 (VariableName, &gEfiNicIp4ConfigVariableGuid, (VOID**)&NicConfig, NULL);\r
-    if (NicConfig == NULL) {\r
-      break;\r
-    }\r
-\r
-    if (!Ip4ConfigIsNicExist (&NicConfig->NicAddr)) {\r
-      //\r
-      // No NIC found for this Ip4Config variable, remove it.\r
-      // Since we are in loop of GetNextVariableName(), we need move on to next\r
-      // Variable first and then delete current Variable.\r
-      //\r
-      CurrentVariableName = AllocateCopyPool (VariableNameSize, VariableName);\r
-      Status = gRT->GetNextVariableName (\r
-                      &VariableNameSize,\r
-                      VariableName,\r
-                      &VendorGuid\r
-                      );\r
-\r
-      gRT->SetVariable (\r
-             CurrentVariableName,\r
-             &gEfiNicIp4ConfigVariableGuid,\r
-             IP4_CONFIG_VARIABLE_ATTRIBUTES,\r
-             0,\r
-             NULL\r
-             );\r
-      FreePool (CurrentVariableName);\r
-\r
-      //\r
-      // We already get next variable, go to check it.\r
-      //\r
-      goto Check;\r
-    }\r
-  }\r
-\r
-  FreePool (VariableName);\r
-}\r
-\r
-/**\r
-  Fix the RouteTable pointer in an EFI_IP4_IPCONFIG_DATA structure.\r
-\r
-  The pointer is set to be immediately follow the ConfigData if there're entries\r
-  in the RouteTable. Otherwise it is set to NULL.\r
-\r
-  @param  ConfigData     The IP4 IP configure data.\r
-\r
-**/\r
-VOID\r
-Ip4ConfigFixRouteTablePointer (\r
-  IN OUT EFI_IP4_IPCONFIG_DATA  *ConfigData\r
-  )\r
-{\r
-  //\r
-  // The memory used for route table entries must immediately follow\r
-  // the ConfigData and be not packed.\r
-  //\r
-  if (ConfigData->RouteTableSize > 0) {\r
-    ConfigData->RouteTable = (EFI_IP4_ROUTE_TABLE *) (ConfigData + 1);\r
-  } else {\r
-    ConfigData->RouteTable = NULL;\r
-  }\r
-}\r
-\r
diff --git a/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.h b/MdeModulePkg/Universal/Network/Ip4ConfigDxe/NicIp4Variable.h
deleted file mode 100644 (file)
index 2f8defe..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/** @file\r
-  Routines used to operate the Ip4 configure variable.\r
-\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
-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
-\r
-**/\r
-\r
-#ifndef _NIC_IP4_VARIABLE_H_\r
-#define _NIC_IP4_VARIABLE_H_\r
-\r
-//\r
-// Return the size of NIC_IP4_CONFIG_INFO and EFI_IP4_IPCONFIG_DATA.\r
-// They are of variable size\r
-//\r
-#define SIZEOF_IP4_CONFIG_INFO(Ip4Config) \\r
-  (sizeof (EFI_IP4_IPCONFIG_DATA) + \\r
-   sizeof (EFI_IP4_ROUTE_TABLE) * (Ip4Config)->RouteTableSize)\r
-\r
-#define SIZEOF_NIC_IP4_CONFIG_INFO(NicConfig) \\r
-  (sizeof (NIC_IP4_CONFIG_INFO) + \\r
-   sizeof (EFI_IP4_ROUTE_TABLE) * (NicConfig)->Ip4Info.RouteTableSize)\r
-\r
-//\r
-// Compare whether two NIC address are equal includes their type and length.\r
-//\r
-#define NIC_ADDR_EQUAL(Nic1, Nic2) \\r
-  (((Nic1)->Type == (Nic2)->Type) && ((Nic1)->Len == (Nic2)->Len) && \\r
-   NET_MAC_EQUAL (&(Nic1)->MacAddr, &(Nic2)->MacAddr, (Nic1)->Len))\r
-\r
-/**\r
-  Check whether the configure parameter is valid.\r
-\r
-  @param  NicConfig    The configure parameter to check\r
-\r
-  @return TRUE if the parameter is valid for the interface, otherwise FALSE.\r
-\r
-**/\r
-BOOLEAN\r
-Ip4ConfigIsValid (\r
-  IN NIC_IP4_CONFIG_INFO    *NicConfig\r
-  );\r
-\r
-/**\r
-  Read the ip4 configure variable from the EFI variable.\r
-\r
-  @param  Instance     The IP4 CONFIG instance.\r
-\r
-  @return The IP4 configure read if it is there and is valid, otherwise NULL.\r
-\r
-**/\r
-NIC_IP4_CONFIG_INFO *\r
-Ip4ConfigReadVariable (\r
-  IN  IP4_CONFIG_INSTANCE   *Instance\r
-  );\r
-\r
-/**\r
-  Write the IP4 configure variable to the NVRAM. If Config\r
-  is NULL, remove the variable.\r
-\r
-  @param  Instance     The IP4 CONFIG instance.\r
-  @param  NicConfig    The IP4 configure data to write.\r
-\r
-  @retval EFI_SUCCESS  The variable is written to the NVRam.\r
-  @retval Others       Failed to write the variable.\r
-\r
-**/\r
-EFI_STATUS\r
-Ip4ConfigWriteVariable (\r
-  IN IP4_CONFIG_INSTANCE    *Instance,\r
-  IN NIC_IP4_CONFIG_INFO    *NicConfig OPTIONAL\r
-  );\r
-\r
-/**\r
-  Reclaim Ip4Config Variables for NIC which has been removed from the platform.\r
-\r
-**/\r
-VOID\r
-Ip4ConfigReclaimVariable (\r
-  VOID\r
-  );\r
-\r
-/**\r
-  Fix the RouteTable pointer in an EFI_IP4_IPCONFIG_DATA structure.\r
-\r
-  The pointer is set to be immediately follow the ConfigData if there're entries\r
-  in the RouteTable. Otherwise it is set to NULL.\r
-\r
-  @param  ConfigData     The IP4 IP configure data.\r
-\r
-**/\r
-VOID\r
-Ip4ConfigFixRouteTablePointer (\r
-  IN OUT EFI_IP4_IPCONFIG_DATA  *ConfigData\r
-  );\r
-\r
-#endif\r
-\r