]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/PxeBcDxe/Bc.c
1. Add EFI LOADED IMAGE DEVICE PATH Protocol in LoadImage() service, per UEFI 2.1b.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / PxeBcDxe / Bc.c
index 0c0eeffcff6afc9d5685bbabe29837b40a45bf5d..fbdeba5d5277a90cade07c439583970300d3dc67 100644 (file)
@@ -1201,7 +1201,6 @@ BcStart (
     return EFI_ALREADY_STARTED;\r
   }\r
 \r
-#if !SUPPORT_IPV6\r
   //\r
   // Fail if IPv6 is requested and not supported.\r
   //\r
@@ -1210,7 +1209,6 @@ BcStart (
     EfiReleaseLock (&Private->Lock);\r
     return EFI_UNSUPPORTED;\r
   }\r
-#endif\r
   //\r
   // Setup shortcuts to SNP protocol and data structure.\r
   //\r
@@ -1662,7 +1660,7 @@ IpFilter (
       Enable = EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST;\r
 \r
       for (Index = 0; Index < Filter->IpCnt; ++Index) {\r
-        PxebcMode->IpFilter.IpList[Index] = Filter->IpList[Index];\r
+        CopyMem (&PxebcMode->IpFilter.IpList[Index], &Filter->IpList[Index], sizeof (EFI_IP_ADDRESS));\r
 \r
         if (IS_MULTICAST (&Filter->IpList[Index])) {\r
           EFI_IP_ADDRESS  *TmpIp;\r
@@ -1674,7 +1672,7 @@ IpFilter (
           //\r
           if (!Index2)\r
           {\r
-              TmpIp = (EFI_IP_ADDRESS *) &AllSystemsGroup;\r
+            TmpIp = (EFI_IP_ADDRESS *) &AllSystemsGroup;\r
             --Index;\r
           } else {\r
             TmpIp = (EFI_IP_ADDRESS *) &Filter->IpList[Index];\r
@@ -2009,8 +2007,8 @@ BcSetStationIP (
     goto RELEASE_LOCK;\r
   }\r
 \r
-  PxebcMode->StationIp   = *StationIpPtr;\r
-  PxebcMode->SubnetMask  = *SubnetMaskPtr;\r
+  CopyMem (&PxebcMode->StationIp, StationIpPtr, sizeof (EFI_IP_ADDRESS));\r
+  CopyMem (&PxebcMode->SubnetMask, SubnetMaskPtr, sizeof (EFI_IP_ADDRESS));\r
   Private->GoodStationIp = TRUE;\r
 \r
 RELEASE_LOCK:\r
@@ -2172,19 +2170,9 @@ PxeBcDriverStart (
                   );\r
 \r
   if (EFI_ERROR (Status)) {\r
-    Status = gBS->OpenProtocol (\r
-                    Controller,\r
-                    &gEfiNetworkInterfaceIdentifierProtocolGuid,\r
-                    (VOID **) &Private->NiiPtr,\r
-                    This->DriverBindingHandle,\r
-                    Controller,\r
-                    EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
-                    );\r
-\r
-    if (EFI_ERROR (Status)) {\r
-      goto PxeBcError;\r
-    }\r
+    goto PxeBcError;\r
   }\r
+\r
   //\r
   // Get the Snp interface\r
   //\r
@@ -2233,12 +2221,8 @@ PxeBcDriverStart (
   // implementation supports IPv6.\r
   //\r
   Private->EfiBc.Mode->Ipv6Supported = SUPPORT_IPV6;\r
-\r
-#if SUPPORT_IPV6\r
-  Private->EfiBc.Mode->Ipv6Available = Private->NiiPtr->Ipv6Supported;\r
-#else\r
   Private->EfiBc.Mode->Ipv6Available = FALSE;\r
-#endif\r
+\r
   //\r
   // Set to TRUE by the BC constructor if this BC\r
   // implementation supports BIS.\r
@@ -2381,15 +2365,14 @@ InitializeBCDriver (
   //\r
   // Initialize EFI library\r
   //\r
-  Status = EfiLibInstallAllDriverProtocols (\r
-            ImageHandle,\r
-            SystemTable,\r
-            &mPxeBcDriverBinding,\r
-            NULL,\r
-            &gPxeBcComponentName,\r
-            NULL,\r
-            NULL\r
-            );\r
+  Status = EfiLibInstallDriverBindingComponentName2 (\r
+             ImageHandle,\r
+             SystemTable,\r
+             &mPxeBcDriverBinding,\r
+             NULL,\r
+             &gPxeBcComponentName,\r
+             &gPxeBcComponentName2\r
+             );\r
 \r
   InitArpHeader ();\r
   OptionsStrucInit ();\r