]> 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>
Wed, 22 Jan 2014 01:57:06 +0000 (01:57 +0000)
committersfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 22 Jan 2014 01:57:06 +0000 (01:57 +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@15152 6f19259b-4bc3-4df7-8a09-765794883524

NetworkPkg/IScsiDxe/IScsiExtScsiPassThru.c
NetworkPkg/IScsiDxe/IScsiProto.c
NetworkPkg/IScsiDxe/IScsiProto.h

index c4aed4c4ab5820d0fda796ff7802440b6b997361..c785853bd8f27583080c1a836256dfafcf2ad065 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The implementation of EFI_EXT_SCSI_PASS_THRU_PROTOCOL.\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
@@ -86,6 +86,9 @@ IScsiExtScsiPassThruFunction (
   IN EFI_EVENT                                                Event     OPTIONAL\r
   )\r
 {\r
+  EFI_STATUS         Status;\r
+  ISCSI_DRIVER_DATA  *Private;\r
+  \r
   if (Target[0] != 0) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -94,7 +97,20 @@ 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
+    Private = ISCSI_DRIVER_DATA_FROM_EXT_SCSI_PASS_THRU (This);\r
+    if (EFI_ERROR (IScsiSessionReinstatement (Private->Session))) {\r
+      return EFI_DEVICE_ERROR;\r
+    }\r
+\r
+    Status = IScsiExecuteScsiCommand (This, Target, Lun, Packet);\r
+  }\r
+\r
+  return Status;\r
 }\r
 \r
 \r
index 29b3c24997ea7231c8ea06005ffebf0e0a534820..fb5d396aaaa28423a285a49c77ee78c1c444ae76 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
@@ -2820,6 +2820,7 @@ IScsiOnNopInRcvd (
   @retval EFI_DEVICE_ERROR     Session state was not as required.\r
   @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
   @retval EFI_PROTOCOL_ERROR   There is no such data in the net buffer.\r
+  @retval EFI_NOT_READY        The target can not accept new commands.\r
   @retval Others               Other errors as indicated.\r
 \r
 **/\r
@@ -2998,15 +2999,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 (Session))) {\r
-      Status = EFI_DEVICE_ERROR;\r
-    }\r
-  }\r
-\r
   return Status;\r
 }\r
 \r
index d97fa083e2ca326b184248e855befa0f82358bb0..8099f34596a39885edcbf04d688544405c644c6e 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 - 2012, 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
@@ -982,6 +982,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
 **/\r