Re-execute the failed SCSI command if iSCSI driver could reinstates the session successfully.

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
This commit is contained in:
Fu Siyuan
2014-01-23 08:36:37 +00:00
committed by sfu5
parent 2b53e39435
commit f20fc992ae
3 changed files with 19 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
/** @file
The IScsi's EFI_EXT_SCSI_PASS_THRU_PROTOCOL driver.
Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -67,6 +67,7 @@ IScsiExtScsiPassThruFunction (
{
ISCSI_DRIVER_DATA *Private;
ISCSI_SESSION_CONFIG_NVDATA *ConfigNvData;
EFI_STATUS Status;
Private = ISCSI_DRIVER_DATA_FROM_EXT_SCSI_PASS_THRU (This);
ConfigNvData = &Private->Session.ConfigData.NvData;
@@ -79,7 +80,19 @@ IScsiExtScsiPassThruFunction (
return EFI_INVALID_PARAMETER;
}
return IScsiExecuteScsiCommand (This, Target, Lun, Packet);
Status = IScsiExecuteScsiCommand (This, Target, Lun, Packet);
if ((Status != EFI_SUCCESS) && (Status != EFI_NOT_READY)) {
//
// Try to reinstate the session and re-execute the Scsi command.
//
if (EFI_ERROR (IScsiSessionReinstatement (Private))) {
return EFI_DEVICE_ERROR;
}
Status = IScsiExecuteScsiCommand (This, Target, Lun, Packet);
}
return Status;
}
/**