]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Re-execute the failed SCSI command if iSCSI driver could reinstates the session succe...
authorFu Siyuan <siyuan.fu@intel.com>
Thu, 23 Jan 2014 08:36:37 +0000 (08:36 +0000)
committersfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 23 Jan 2014 08:36:37 +0000 (08:36 +0000)
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Dong, Guo <guo.dong@intel.com>
Reviewed-by: Tian, Feng <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15173 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/Network/IScsiDxe/IScsiExtScsiPassThru.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h

index dea7f7cb9585c750450c4932f980f38d7d005d29..da141055427eb1b8519110f85664214fee5aa3d7 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The IScsi's EFI_EXT_SCSI_PASS_THRU_PROTOCOL driver.\r
 \r
-Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2014, 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
@@ -67,6 +67,7 @@ IScsiExtScsiPassThruFunction (
 {\r
   ISCSI_DRIVER_DATA           *Private;\r
   ISCSI_SESSION_CONFIG_NVDATA *ConfigNvData;\r
+  EFI_STATUS                  Status; \r
 \r
   Private       = ISCSI_DRIVER_DATA_FROM_EXT_SCSI_PASS_THRU (This);\r
   ConfigNvData  = &Private->Session.ConfigData.NvData;\r
@@ -79,7 +80,19 @@ IScsiExtScsiPassThruFunction (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  return IScsiExecuteScsiCommand (This, Target, Lun, Packet);\r
+  Status = IScsiExecuteScsiCommand (This, Target, Lun, Packet);\r
+  if ((Status != EFI_SUCCESS) && (Status != EFI_NOT_READY)) {\r
+    //\r
+    // Try to reinstate the session and re-execute the Scsi command.\r
+    //\r
+    if (EFI_ERROR (IScsiSessionReinstatement (Private))) {\r
+      return EFI_DEVICE_ERROR;\r
+    }\r
+\r
+    Status = IScsiExecuteScsiCommand (This, Target, Lun, Packet);\r
+  }\r
+\r
+  return Status;\r
 }\r
 \r
 /**\r
index ffe0c6e1a84ad44e68ae85becc89cb2e5ace408f..60131b32db9891f384bfe4253143c7eab4205690 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The implementation of iSCSI protocol based on RFC3720.\r
 \r
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2014, 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
@@ -2504,6 +2504,7 @@ IScsiOnNopInRcvd (
                                the Packet.\r
   @retval EFI_DEVICE_ERROR     Session state was not as required.\r
   @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
+  @retval EFI_NOT_READY        The target can not accept new commands.\r
   @retval Others               Other errors as indicated.\r
 **/\r
 EFI_STATUS\r
@@ -2679,15 +2680,6 @@ ON_EXIT:
     IScsiDelTcb (Tcb);\r
   }\r
 \r
-  if ((Status != EFI_SUCCESS) && (Status != EFI_NOT_READY)) {\r
-    //\r
-    // Reinstate the session.\r
-    //\r
-    if (EFI_ERROR (IScsiSessionReinstatement (Private))) {\r
-      Status = EFI_DEVICE_ERROR;\r
-    }\r
-  }\r
-\r
   return Status;\r
 }\r
 \r
index cac98c8b3d29d358ba2487030f7f50a286ca17ad..48b4e7251f568df1c1d2ebb792906a7b85406899 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The header file of iSCSI Protocol that defines many specific data structures.\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2014, 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
@@ -950,6 +950,7 @@ IScsiNormalizeName (
                                the Packet.\r
   @retval EFI_DEVICE_ERROR     Session state was not as required.\r
   @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
+  @retval EFI_NOT_READY        The target can not accept new commands.\r
   @retval Others               Other errors as indicated.\r
 **/\r
 EFI_STATUS\r