summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Scsi
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2015-12-22 13:56:54 +0000
committerhwu1225 <hwu1225@Edk2>2015-12-22 13:56:54 +0000
commit032800eccab02bd4fa7dd2afe529ad8b9a712c41 (patch)
treeda259003c130ea01693a67c528071249c4cf5cfb /MdeModulePkg/Bus/Scsi
parent1f09197d196b2a1befaa587e0504d0f2f408f594 (diff)
downloadedk2-032800eccab02bd4fa7dd2afe529ad8b9a712c41.zip
edk2-032800eccab02bd4fa7dd2afe529ad8b9a712c41.tar.gz
edk2-032800eccab02bd4fa7dd2afe529ad8b9a712c41.tar.bz2
MdeModulePkg ScsiDiskDxe: Fix async request retry times info lost issue
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19450 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus/Scsi')
-rw-r--r--MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c24
-rw-r--r--MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h8
2 files changed, 32 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
index ba7f5a5..4725cf4 100644
--- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
+++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.c
@@ -2692,6 +2692,7 @@ ScsiDiskAsyncReadSectors (
Status = ScsiDiskAsyncRead10 (
ScsiDiskDevice,
Timeout,
+ 0,
PtrBuffer,
ByteCount,
(UINT32) Lba,
@@ -2703,6 +2704,7 @@ ScsiDiskAsyncReadSectors (
Status = ScsiDiskAsyncRead16 (
ScsiDiskDevice,
Timeout,
+ 0,
PtrBuffer,
ByteCount,
Lba,
@@ -2853,6 +2855,7 @@ ScsiDiskAsyncWriteSectors (
Status = ScsiDiskAsyncWrite10 (
ScsiDiskDevice,
Timeout,
+ 0,
PtrBuffer,
ByteCount,
(UINT32) Lba,
@@ -2864,6 +2867,7 @@ ScsiDiskAsyncWriteSectors (
Status = ScsiDiskAsyncWrite16 (
ScsiDiskDevice,
Timeout,
+ 0,
PtrBuffer,
ByteCount,
Lba,
@@ -3527,6 +3531,7 @@ Retry:
Status = ScsiDiskAsyncRead10 (
ScsiDiskDevice,
Request->Timeout,
+ Request->TimesRetry,
Request->InBuffer,
Request->DataLength,
(UINT32) Request->StartLba,
@@ -3538,6 +3543,7 @@ Retry:
Status = ScsiDiskAsyncRead16 (
ScsiDiskDevice,
Request->Timeout,
+ Request->TimesRetry,
Request->InBuffer,
Request->DataLength,
Request->StartLba,
@@ -3559,6 +3565,7 @@ Retry:
Status = ScsiDiskAsyncRead10 (
ScsiDiskDevice,
Request->Timeout,
+ 0,
Request->InBuffer + Request->SectorCount * ScsiDiskDevice->BlkIo.Media->BlockSize,
OldDataLength - Request->DataLength,
(UINT32) Request->StartLba + Request->SectorCount,
@@ -3570,6 +3577,7 @@ Retry:
Status = ScsiDiskAsyncRead16 (
ScsiDiskDevice,
Request->Timeout,
+ 0,
Request->InBuffer + Request->SectorCount * ScsiDiskDevice->BlkIo.Media->BlockSize,
OldDataLength - Request->DataLength,
Request->StartLba + Request->SectorCount,
@@ -3591,6 +3599,7 @@ Retry:
Status = ScsiDiskAsyncWrite10 (
ScsiDiskDevice,
Request->Timeout,
+ Request->TimesRetry,
Request->OutBuffer,
Request->DataLength,
(UINT32) Request->StartLba,
@@ -3602,6 +3611,7 @@ Retry:
Status = ScsiDiskAsyncWrite16 (
ScsiDiskDevice,
Request->Timeout,
+ Request->TimesRetry,
Request->OutBuffer,
Request->DataLength,
Request->StartLba,
@@ -3623,6 +3633,7 @@ Retry:
Status = ScsiDiskAsyncWrite10 (
ScsiDiskDevice,
Request->Timeout,
+ 0,
Request->OutBuffer + Request->SectorCount * ScsiDiskDevice->BlkIo.Media->BlockSize,
OldDataLength - Request->DataLength,
(UINT32) Request->StartLba + Request->SectorCount,
@@ -3634,6 +3645,7 @@ Retry:
Status = ScsiDiskAsyncWrite16 (
ScsiDiskDevice,
Request->Timeout,
+ 0,
Request->OutBuffer + Request->SectorCount * ScsiDiskDevice->BlkIo.Media->BlockSize,
OldDataLength - Request->DataLength,
Request->StartLba + Request->SectorCount,
@@ -3670,6 +3682,7 @@ Exit:
@param ScsiDiskDevice The pointer of ScsiDiskDevice.
@param Timeout The time to complete the command.
+ @param TimesRetry The number of times the command has been retried.
@param DataBuffer The buffer to fill with the read out data.
@param DataLength The length of buffer.
@param StartLba The start logic block address.
@@ -3688,6 +3701,7 @@ EFI_STATUS
ScsiDiskAsyncRead10 (
IN SCSI_DISK_DEV *ScsiDiskDevice,
IN UINT64 Timeout,
+ IN UINT8 TimesRetry,
OUT UINT8 *DataBuffer,
IN UINT32 DataLength,
IN UINT32 StartLba,
@@ -3717,6 +3731,7 @@ ScsiDiskAsyncRead10 (
Request->ScsiDiskDevice = ScsiDiskDevice;
Request->Timeout = Timeout;
+ Request->TimesRetry = TimesRetry;
Request->InBuffer = DataBuffer;
Request->DataLength = DataLength;
Request->StartLba = StartLba;
@@ -3779,6 +3794,7 @@ ErrorExit:
@param ScsiDiskDevice The pointer of ScsiDiskDevice.
@param Timeout The time to complete the command.
+ @param TimesRetry The number of times the command has been retried.
@param DataBuffer The buffer contains the data to write.
@param DataLength The length of buffer.
@param StartLba The start logic block address.
@@ -3797,6 +3813,7 @@ EFI_STATUS
ScsiDiskAsyncWrite10 (
IN SCSI_DISK_DEV *ScsiDiskDevice,
IN UINT64 Timeout,
+ IN UINT8 TimesRetry,
IN UINT8 *DataBuffer,
IN UINT32 DataLength,
IN UINT32 StartLba,
@@ -3826,6 +3843,7 @@ ScsiDiskAsyncWrite10 (
Request->ScsiDiskDevice = ScsiDiskDevice;
Request->Timeout = Timeout;
+ Request->TimesRetry = TimesRetry;
Request->OutBuffer = DataBuffer;
Request->DataLength = DataLength;
Request->StartLba = StartLba;
@@ -3888,6 +3906,7 @@ ErrorExit:
@param ScsiDiskDevice The pointer of ScsiDiskDevice.
@param Timeout The time to complete the command.
+ @param TimesRetry The number of times the command has been retried.
@param DataBuffer The buffer to fill with the read out data.
@param DataLength The length of buffer.
@param StartLba The start logic block address.
@@ -3906,6 +3925,7 @@ EFI_STATUS
ScsiDiskAsyncRead16 (
IN SCSI_DISK_DEV *ScsiDiskDevice,
IN UINT64 Timeout,
+ IN UINT8 TimesRetry,
OUT UINT8 *DataBuffer,
IN UINT32 DataLength,
IN UINT64 StartLba,
@@ -3935,6 +3955,7 @@ ScsiDiskAsyncRead16 (
Request->ScsiDiskDevice = ScsiDiskDevice;
Request->Timeout = Timeout;
+ Request->TimesRetry = TimesRetry;
Request->InBuffer = DataBuffer;
Request->DataLength = DataLength;
Request->StartLba = StartLba;
@@ -3997,6 +4018,7 @@ ErrorExit:
@param ScsiDiskDevice The pointer of ScsiDiskDevice.
@param Timeout The time to complete the command.
+ @param TimesRetry The number of times the command has been retried.
@param DataBuffer The buffer contains the data to write.
@param DataLength The length of buffer.
@param StartLba The start logic block address.
@@ -4015,6 +4037,7 @@ EFI_STATUS
ScsiDiskAsyncWrite16 (
IN SCSI_DISK_DEV *ScsiDiskDevice,
IN UINT64 Timeout,
+ IN UINT8 TimesRetry,
IN UINT8 *DataBuffer,
IN UINT32 DataLength,
IN UINT64 StartLba,
@@ -4044,6 +4067,7 @@ ScsiDiskAsyncWrite16 (
Request->ScsiDiskDevice = ScsiDiskDevice;
Request->Timeout = Timeout;
+ Request->TimesRetry = TimesRetry;
Request->OutBuffer = DataBuffer;
Request->DataLength = DataLength;
Request->StartLba = StartLba;
diff --git a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
index b6f801d..7a287d3 100644
--- a/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
+++ b/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDisk.h
@@ -1029,6 +1029,7 @@ ScsiDiskWrite16 (
@param ScsiDiskDevice The pointer of ScsiDiskDevice.
@param Timeout The time to complete the command.
+ @param TimesRetry The number of times the command has been retried.
@param DataBuffer The buffer to fill with the read out data.
@param DataLength The length of buffer.
@param StartLba The start logic block address.
@@ -1047,6 +1048,7 @@ EFI_STATUS
ScsiDiskAsyncRead10 (
IN SCSI_DISK_DEV *ScsiDiskDevice,
IN UINT64 Timeout,
+ IN UINT8 TimesRetry,
OUT UINT8 *DataBuffer,
IN UINT32 DataLength,
IN UINT32 StartLba,
@@ -1060,6 +1062,7 @@ ScsiDiskAsyncRead10 (
@param ScsiDiskDevice The pointer of ScsiDiskDevice.
@param Timeout The time to complete the command.
+ @param TimesRetry The number of times the command has been retried.
@param DataBuffer The buffer contains the data to write.
@param DataLength The length of buffer.
@param StartLba The start logic block address.
@@ -1078,6 +1081,7 @@ EFI_STATUS
ScsiDiskAsyncWrite10 (
IN SCSI_DISK_DEV *ScsiDiskDevice,
IN UINT64 Timeout,
+ IN UINT8 TimesRetry,
IN UINT8 *DataBuffer,
IN UINT32 DataLength,
IN UINT32 StartLba,
@@ -1091,6 +1095,7 @@ ScsiDiskAsyncWrite10 (
@param ScsiDiskDevice The pointer of ScsiDiskDevice.
@param Timeout The time to complete the command.
+ @param TimesRetry The number of times the command has been retried.
@param DataBuffer The buffer to fill with the read out data.
@param DataLength The length of buffer.
@param StartLba The start logic block address.
@@ -1109,6 +1114,7 @@ EFI_STATUS
ScsiDiskAsyncRead16 (
IN SCSI_DISK_DEV *ScsiDiskDevice,
IN UINT64 Timeout,
+ IN UINT8 TimesRetry,
OUT UINT8 *DataBuffer,
IN UINT32 DataLength,
IN UINT64 StartLba,
@@ -1122,6 +1128,7 @@ ScsiDiskAsyncRead16 (
@param ScsiDiskDevice The pointer of ScsiDiskDevice.
@param Timeout The time to complete the command.
+ @param TimesRetry The number of times the command has been retried.
@param DataBuffer The buffer contains the data to write.
@param DataLength The length of buffer.
@param StartLba The start logic block address.
@@ -1140,6 +1147,7 @@ EFI_STATUS
ScsiDiskAsyncWrite16 (
IN SCSI_DISK_DEV *ScsiDiskDevice,
IN UINT64 Timeout,
+ IN UINT8 TimesRetry,
IN UINT8 *DataBuffer,
IN UINT32 DataLength,
IN UINT64 StartLba,