mirror of
https://github.com/reactos/reactos.git
synced 2026-05-29 21:19:51 +08:00
[USBSTOR] Do not try to retry a failed request
for all cases except receiving a USBD_STATUS_STALL_PID status. This decision should be made by higher-level driver (and classpnp drivers do it)
This commit is contained in:
@@ -107,7 +107,7 @@ USBSTOR_HandleTransferError(
|
||||
pCDB = (PCDB)Request->Cdb;
|
||||
ASSERT(pCDB);
|
||||
|
||||
if (Status != STATUS_SUCCESS || Context->RetryCount >= 1)
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
// Complete the master IRP
|
||||
Context->Irp->IoStatus.Status = Status;
|
||||
@@ -124,22 +124,6 @@ USBSTOR_HandleTransferError(
|
||||
// clear timer srb
|
||||
Context->FDODeviceExtension->LastTimerActiveSrb = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT1("Retrying Count %lu %p\n", Context->RetryCount, Stack->DeviceObject);
|
||||
|
||||
// re-schedule request
|
||||
USBSTOR_HandleExecuteSCSI(Stack->DeviceObject, Context->Irp, Context->RetryCount + 1);
|
||||
|
||||
// srb error handling finished
|
||||
Context->FDODeviceExtension->SrbErrorHandlingActive = FALSE;
|
||||
|
||||
// srb error handling finished
|
||||
Context->FDODeviceExtension->TimerWorkQueueEnabled = TRUE;
|
||||
|
||||
// clear timer srb
|
||||
Context->FDODeviceExtension->LastTimerActiveSrb = NULL;
|
||||
}
|
||||
|
||||
FreeItem(Context);
|
||||
|
||||
|
||||
@@ -355,7 +355,7 @@ USBSTOR_StartIo(
|
||||
return;
|
||||
}
|
||||
|
||||
USBSTOR_HandleExecuteSCSI(IoStack->DeviceObject, Irp, 0);
|
||||
USBSTOR_HandleExecuteSCSI(IoStack->DeviceObject, Irp);
|
||||
|
||||
// FIXME: handle error
|
||||
}
|
||||
|
||||
@@ -183,9 +183,9 @@ USBSTOR_CSWCompletionRoutine(
|
||||
{
|
||||
if (USBD_STATUS(Context->Urb.UrbHeader.Status) == USBD_STATUS(USBD_STATUS_STALL_PID))
|
||||
{
|
||||
if (Context->RetryCount < 2)
|
||||
if (Context->StallRetryCount < 2)
|
||||
{
|
||||
++Context->RetryCount;
|
||||
++Context->StallRetryCount;
|
||||
|
||||
// clear stall and resend cbw
|
||||
Context->ErrorIndex = 1;
|
||||
@@ -345,7 +345,7 @@ USBSTOR_DataCompletionRoutine(
|
||||
}
|
||||
else if (USBD_STATUS(Context->Urb.UrbHeader.Status) == USBD_STATUS(USBD_STATUS_STALL_PID))
|
||||
{
|
||||
++Context->RetryCount;
|
||||
++Context->StallRetryCount;
|
||||
|
||||
Request->SrbStatus = SRB_STATUS_DATA_OVERRUN;
|
||||
Request->DataTransferLength = Context->Urb.UrbBulkOrInterruptTransfer.TransferBufferLength;
|
||||
@@ -527,7 +527,7 @@ USBSTOR_SendCBWRequest(
|
||||
// initialize rest of context
|
||||
Context->Irp = Irp;
|
||||
Context->FDODeviceExtension = FDODeviceExtension;
|
||||
Context->RetryCount = 0;
|
||||
Context->StallRetryCount = 0;
|
||||
|
||||
return USBSTOR_IssueBulkOrInterruptRequest(
|
||||
FDODeviceExtension,
|
||||
@@ -586,8 +586,7 @@ USBSTOR_IssueRequestSense(
|
||||
NTSTATUS
|
||||
USBSTOR_HandleExecuteSCSI(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp,
|
||||
IN ULONG RetryCount)
|
||||
IN PIRP Irp)
|
||||
{
|
||||
PCDB pCDB;
|
||||
NTSTATUS Status;
|
||||
|
||||
@@ -286,7 +286,7 @@ typedef struct
|
||||
PIRP Irp;
|
||||
PFDO_DEVICE_EXTENSION FDODeviceExtension;
|
||||
ULONG ErrorIndex;
|
||||
ULONG RetryCount;
|
||||
ULONG StallRetryCount; // the number of retries after receiving USBD_STATUS_STALL_PID status
|
||||
union
|
||||
{
|
||||
CBW cbw;
|
||||
@@ -406,8 +406,7 @@ USBSTOR_GetPipeHandles(
|
||||
NTSTATUS
|
||||
USBSTOR_HandleExecuteSCSI(
|
||||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp,
|
||||
IN ULONG RetryCount);
|
||||
IN PIRP Irp);
|
||||
|
||||
NTSTATUS
|
||||
USBSTOR_SendCSWRequest(
|
||||
|
||||
Reference in New Issue
Block a user