]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Impl.c
MdeModulePkg/DxeCapsuleLibFmp: Fix build failure issues
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Impl.c
index ac8fb1a7b03173d40a140c7b4fe78674e3074cfe..91f1a67370e79279abfe99e895eec2daa6b2b708 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2016, 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
@@ -563,55 +563,6 @@ Ip4InitProtocol (
 }\r
 \r
 \r
-/**\r
-  The event handle for IP4 auto reconfiguration. The original default\r
-  interface and route table will be removed as the default.\r
-\r
-  @param[in]  Context                The IP4 service binding instance.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-Ip4AutoReconfigCallBackDpc (\r
-  IN VOID                   *Context\r
-  )\r
-{\r
-  IP4_SERVICE               *IpSb;\r
-\r
-  IpSb      = (IP4_SERVICE *) Context;\r
-  NET_CHECK_SIGNATURE (IpSb, IP4_SERVICE_SIGNATURE);\r
-\r
-  if (IpSb->State > IP4_SERVICE_UNSTARTED) {\r
-    IpSb->State = IP4_SERVICE_UNSTARTED;\r
-  }\r
-\r
-  Ip4StartAutoConfig (&IpSb->Ip4Config2Instance);\r
-\r
-  return ;\r
-}\r
-\r
-\r
-/**\r
-  Request Ip4AutoReconfigCallBackDpc as a DPC at TPL_CALLBACK.\r
-\r
-  @param Event     The event that is signalled.\r
-  @param Context   The IP4 service binding instance.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-Ip4AutoReconfigCallBack (\r
-  IN EFI_EVENT              Event,\r
-  IN VOID                   *Context\r
-  )\r
-{\r
-  //\r
-  // Request Ip4AutoReconfigCallBackDpc as a DPC at TPL_CALLBACK\r
-  //\r
-  QueueDpc (TPL_CALLBACK, Ip4AutoReconfigCallBackDpc, Context);\r
-}\r
-\r
-\r
 /**\r
   Configure the IP4 child. If the child is already configured,\r
   change the configuration parameter. Otherwise configure it\r
@@ -722,31 +673,13 @@ Ip4ConfigProtocol (
 \r
   } else {\r
     //\r
-    // Use the default address. If the default configuration hasn't\r
-    // been started, start it.\r
+    // Use the default address. Check the state.\r
     //\r
     if (IpSb->State == IP4_SERVICE_UNSTARTED) {\r
-      //\r
-      // Create the ReconfigEvent to start the new configuration.\r
-      //\r
-      if (IpSb->ReconfigEvent == NULL) {\r
-        Status = gBS->CreateEvent (\r
-                        EVT_NOTIFY_SIGNAL,\r
-                        TPL_NOTIFY,\r
-                        Ip4AutoReconfigCallBack,\r
-                        IpSb,\r
-                        &IpSb->ReconfigEvent\r
-                        );\r
-\r
-        if (EFI_ERROR (Status)) {\r
-          goto ON_ERROR;\r
-        }\r
-      }\r
-      \r
       Status = Ip4StartAutoConfig (&IpSb->Ip4Config2Instance);\r
 \r
       if (EFI_ERROR (Status)) {\r
-        goto CLOSE_RECONFIG_EVENT;\r
+        goto ON_ERROR;\r
       }\r
     }\r
 \r
@@ -776,7 +709,7 @@ Ip4ConfigProtocol (
                     EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
                     );\r
     if (EFI_ERROR (Status)) {\r
-      goto CLOSE_RECONFIG_EVENT;\r
+      goto ON_ERROR;\r
     }\r
   }\r
   InsertTailList (&IpIf->IpInstances, &IpInstance->AddrLink);\r
@@ -795,12 +728,6 @@ Ip4ConfigProtocol (
 \r
   return EFI_SUCCESS;\r
 \r
-CLOSE_RECONFIG_EVENT:\r
-  if (IpSb->ReconfigEvent != NULL) {\r
-    gBS->CloseEvent (IpSb->ReconfigEvent);\r
-    IpSb->ReconfigEvent = NULL;\r
-  }\r
-\r
 ON_ERROR:\r
   Ip4FreeRouteTable (IpInstance->RouteTable);\r
   IpInstance->RouteTable = NULL;\r
@@ -914,7 +841,7 @@ Ip4StationAddressValid (
   //\r
   // Only support the continuous net masks\r
   //\r
-  if ((Len = NetGetMaskLength (Netmask)) == IP4_MASK_NUM) {\r
+  if ((Len = NetGetMaskLength (Netmask)) == (IP4_MASK_MAX + 1)) {\r
     return FALSE;\r
   }\r
 \r
@@ -2415,7 +2342,7 @@ Ip4TimerTicking (
   //\r
   // Media transimit Unpresent to Present means new link movement is detected.\r
   //\r
-  if (!OldMediaPresent && IpSb->MediaPresent) {\r
+  if (!OldMediaPresent && IpSb->MediaPresent && (IpSb->Ip4Config2Instance.Policy == Ip4Config2PolicyDhcp)) {\r
     //\r
     // Signal the IP4 to run the dhcp configuration again. IP4 driver will free\r
     // old IP address related resource, such as route table and Interface, then \r