]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4ConfigDxe/Ip4Config.c
sync comments, fix function header, rename variable name to follow coding style.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4ConfigDxe / Ip4Config.c
index 0c5c6bce376e4a0a73f0f011bc1101d8c0b84cba..736299bec026fa1ff9caa1410ce14c31080aab5e 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation\r
+Copyright (c) 2006 - 2008, Intel Corporation                                                         \r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -24,6 +24,16 @@ Abstract:
 \r
 IP4_CONFIG_INSTANCE *mIp4ConfigNicList[MAX_IP4_CONFIG_IN_VARIABLE];\r
 \r
+/**\r
+  Callback function when DHCP process finished. It will save the\r
+  retrieved IP configure parameter from DHCP to the NVRam.\r
+\r
+  @param  Event                  The callback event\r
+  @param  Context                Opaque context to the callback\r
+\r
+  @return None\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 Ip4ConfigOnDhcp4Complete (\r
@@ -44,7 +54,6 @@ Ip4ConfigOnDhcp4Complete (
   @retval EFI_SUCCESS            The name or address of the NIC are returned.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 EfiNicIp4ConfigGetName (\r
@@ -180,6 +189,7 @@ EfiNicIp4ConfigGetInfo (
   } else {\r
     Status = EFI_SUCCESS;\r
     CopyMem (NicConfig, Config, Len);\r
+    Ip4ConfigFixRouteTablePointer (&NicConfig->Ip4Info);\r
   }\r
 \r
   *ConfigLen = Len;\r
@@ -272,6 +282,7 @@ EfiNicIp4ConfigSetInfo (
   //\r
   if (Reconfig && (Instance->ReconfigEvent != NULL)) {\r
     Status = gBS->SignalEvent (Instance->ReconfigEvent);\r
+    NetLibDispatchDpc ();\r
   }\r
 \r
   return Status;\r
@@ -442,6 +453,8 @@ ON_ERROR:
 ON_EXIT:\r
   gBS->RestoreTPL (OldTpl);\r
 \r
+  NetLibDispatchDpc ();\r
+\r
   return Status;\r
 }\r
 \r
@@ -555,6 +568,7 @@ EfiIp4ConfigGetData (
       Status = EFI_BUFFER_TOO_SMALL;\r
     } else {\r
       CopyMem (ConfigData, &NicConfig->Ip4Info, Len);\r
+      Ip4ConfigFixRouteTablePointer (ConfigData);\r
     }\r
 \r
     *ConfigDataSize = Len;\r
@@ -676,6 +690,9 @@ Ip4ConfigOnDhcp4Complete (
 ON_EXIT:\r
   gBS->SignalEvent (Instance->DoneEvent);\r
   Ip4ConfigCleanDhcp4 (Instance);\r
+\r
+  NetLibDispatchDpc ();\r
+\r
   return ;\r
 }\r
 \r
@@ -725,7 +742,7 @@ Ip4ConfigCleanDhcp4 (
 \r
 \r
 /**\r
-  Clean up all the configuration parameters\r
+  Clean up all the configuration parameters.\r
 \r
   @param  Instance               The IP4 configure instance\r
 \r