]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/IScsiDxe/IScsiMisc.c
MdeModulePkg-DxeCore: rename CoreGetMemoryMapPropertiesTable
[mirror_edk2.git] / NetworkPkg / IScsiDxe / IScsiMisc.c
index f5c54e70188e91e1e22d609b2ce42824c54815db..a1f2672f3709725a0fa79acddea07535b976f0b2 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Miscellaneous routines for iSCSI driver.\r
 \r
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
@@ -683,7 +683,7 @@ IScsiGetNicInfoByIndex (
 \r
 \r
 /**\r
-  Get the NIC's PCI location and return it accroding to the composited\r
+  Get the NIC's PCI location and return it according to the composited\r
   format defined in iSCSI Boot Firmware Table.\r
 \r
   @param[in]   Controller        The handle of the controller.\r
@@ -857,22 +857,30 @@ IScsiCreateDriverData (
 /**\r
   Clean the iSCSI driver data.\r
 \r
-  @param[in]  Private The iSCSI driver data.\r
+  @param[in]              Private The iSCSI driver data.\r
+\r
+  @retval EFI_SUCCESS     The clean operation is successful.\r
+  @retval Others          Other errors as indicated.\r
 \r
 **/\r
-VOID\r
+EFI_STATUS\r
 IScsiCleanDriverData (\r
   IN ISCSI_DRIVER_DATA  *Private\r
   )\r
 {\r
   EFI_STATUS            Status;\r
 \r
+  Status = EFI_SUCCESS;\r
+\r
   if (Private->DevicePath != NULL) {\r
-    gBS->UninstallProtocolInterface (\r
-           Private->ExtScsiPassThruHandle,\r
-           &gEfiDevicePathProtocolGuid,\r
-           Private->DevicePath\r
-           );\r
+    Status = gBS->UninstallProtocolInterface (\r
+                    Private->ExtScsiPassThruHandle,\r
+                    &gEfiDevicePathProtocolGuid,\r
+                    Private->DevicePath\r
+                    );\r
+    if (EFI_ERROR (Status)) {\r
+      goto EXIT;\r
+    }\r
 \r
     FreePool (Private->DevicePath);\r
   }\r
@@ -888,9 +896,12 @@ IScsiCleanDriverData (
     }\r
   }\r
 \r
+EXIT:\r
+\r
   gBS->CloseEvent (Private->ExitBootServiceEvent);\r
 \r
   FreePool (Private);\r
+  return Status;\r
 }\r
 \r
 /**\r
@@ -1054,7 +1065,7 @@ IScsiGetConfigData (
       // Check the autoconfig path to see whether it should be retried.\r
       //\r
       if (AttemptTmp->SessionConfigData.IpMode == IP_MODE_AUTOCONFIG &&\r
-          AttemptTmp->AutoConfigureMode != IP_MODE_AUTOCONFIG_SUCCESS) {\r
+          !AttemptTmp->AutoConfigureSuccess) {\r
         if (mPrivate->Ipv6Flag &&\r
             AttemptTmp->AutoConfigureMode == IP_MODE_AUTOCONFIG_IP6) {\r
           //\r
@@ -1197,6 +1208,7 @@ IScsiGetConfigData (
 \r
       AttemptConfigData->AutoConfigureMode =\r
         (UINT8) (mPrivate->Ipv6Flag ? IP_MODE_AUTOCONFIG_IP6 : IP_MODE_AUTOCONFIG_IP4);\r
+      AttemptConfigData->AutoConfigureSuccess = FALSE;\r
     }\r
     \r
     //\r