]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/IScsiDxe/IScsiMisc.c
Nt32Pkg: Use FaultTolerantWritePei driver.
[mirror_edk2.git] / NetworkPkg / IScsiDxe / IScsiMisc.c
index 2cf3db01b710abbc5997d7a68245dca2cd4e6219..971011eac52884a636eb7cf167dd2501da5c6148 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Miscellaneous routines for iSCSI driver.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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\r
@@ -921,7 +921,7 @@ IScsiGetConfigData (
   //\r
   AttemptConfigOrder = IScsiGetVariableAndSize (\r
                          L"AttemptOrder",\r
-                         &mVendorGuid,\r
+                         &gIScsiConfigGuid,\r
                          &AttemptConfigOrderSize\r
                          );\r
   if (AttemptConfigOrder == NULL || AttemptConfigOrderSize == 0) {\r
@@ -1076,10 +1076,12 @@ IScsiGetConfigData (
       (UINTN) AttemptConfigOrder[Index]\r
       );\r
 \r
-    AttemptConfigData = (ISCSI_ATTEMPT_CONFIG_NVDATA *) GetVariable (\r
-                                                          mPrivate->PortString,\r
-                                                          &gEfiIScsiInitiatorNameProtocolGuid\r
-                                                          );\r
+    GetVariable2 (\r
+                 mPrivate->PortString,\r
+                 &gEfiIScsiInitiatorNameProtocolGuid,\r
+                 (VOID**)&AttemptConfigData,\r
+                 NULL\r
+                 );\r
 \r
     if (AttemptConfigData == NULL) {\r
       continue;\r
@@ -1287,11 +1289,25 @@ IScsiGetTcpConnDevicePath (
     if (DevicePathType (&DPathNode->DevPath) == MESSAGING_DEVICE_PATH) {\r
       if (!Conn->Ipv6Flag && DevicePathSubType (&DPathNode->DevPath) == MSG_IPv4_DP) {\r
         DPathNode->Ipv4.LocalPort       = 0;\r
-        DPathNode->Ipv4.StaticIpAddress = (BOOLEAN) !Session->ConfigData->SessionConfigData.InitiatorInfoFromDhcp;\r
+\r
+        DPathNode->Ipv4.StaticIpAddress = \r
+          (BOOLEAN) (!Session->ConfigData->SessionConfigData.InitiatorInfoFromDhcp);\r
+\r
+        IP4_COPY_ADDRESS (\r
+          &DPathNode->Ipv4.GatewayIpAddress,\r
+          &Session->ConfigData->SessionConfigData.Gateway\r
+          );\r
+\r
+        IP4_COPY_ADDRESS (\r
+          &DPathNode->Ipv4.SubnetMask,\r
+          &Session->ConfigData->SessionConfigData.SubnetMask\r
+          );\r
         break;\r
       } else if (Conn->Ipv6Flag && DevicePathSubType (&DPathNode->DevPath) == MSG_IPv6_DP) {\r
         DPathNode->Ipv6.LocalPort       = 0;\r
-        DPathNode->Ipv6.StaticIpAddress = (BOOLEAN) !Session->ConfigData->SessionConfigData.InitiatorInfoFromDhcp;\r
+        DPathNode->Ipv6.IpAddressOrigin = 0;\r
+        DPathNode->Ipv6.PrefixLength    = IP6_PREFIX_LENGTH;\r
+        ZeroMem (&DPathNode->Ipv6.GatewayIpAddress, sizeof (EFI_IPv6_ADDRESS));\r
         break;\r
       }\r
     }\r