mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 17:52:56 +00: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:
parent
c7ed299aaa
commit
aaa90f6986
4 changed files with 9 additions and 27 deletions
|
@ -107,7 +107,7 @@ USBSTOR_HandleTransferError(
|
||||||
pCDB = (PCDB)Request->Cdb;
|
pCDB = (PCDB)Request->Cdb;
|
||||||
ASSERT(pCDB);
|
ASSERT(pCDB);
|
||||||
|
|
||||||
if (Status != STATUS_SUCCESS || Context->RetryCount >= 1)
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
// Complete the master IRP
|
// Complete the master IRP
|
||||||
Context->Irp->IoStatus.Status = Status;
|
Context->Irp->IoStatus.Status = Status;
|
||||||
|
@ -124,22 +124,6 @@ USBSTOR_HandleTransferError(
|
||||||
// clear timer srb
|
// clear timer srb
|
||||||
Context->FDODeviceExtension->LastTimerActiveSrb = NULL;
|
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);
|
FreeItem(Context);
|
||||||
|
|
||||||
|
|
|
@ -355,7 +355,7 @@ USBSTOR_StartIo(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
USBSTOR_HandleExecuteSCSI(IoStack->DeviceObject, Irp, 0);
|
USBSTOR_HandleExecuteSCSI(IoStack->DeviceObject, Irp);
|
||||||
|
|
||||||
// FIXME: handle error
|
// FIXME: handle error
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,9 +183,9 @@ USBSTOR_CSWCompletionRoutine(
|
||||||
{
|
{
|
||||||
if (USBD_STATUS(Context->Urb.UrbHeader.Status) == USBD_STATUS(USBD_STATUS_STALL_PID))
|
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
|
// clear stall and resend cbw
|
||||||
Context->ErrorIndex = 1;
|
Context->ErrorIndex = 1;
|
||||||
|
@ -345,7 +345,7 @@ USBSTOR_DataCompletionRoutine(
|
||||||
}
|
}
|
||||||
else if (USBD_STATUS(Context->Urb.UrbHeader.Status) == USBD_STATUS(USBD_STATUS_STALL_PID))
|
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->SrbStatus = SRB_STATUS_DATA_OVERRUN;
|
||||||
Request->DataTransferLength = Context->Urb.UrbBulkOrInterruptTransfer.TransferBufferLength;
|
Request->DataTransferLength = Context->Urb.UrbBulkOrInterruptTransfer.TransferBufferLength;
|
||||||
|
@ -527,7 +527,7 @@ USBSTOR_SendCBWRequest(
|
||||||
// initialize rest of context
|
// initialize rest of context
|
||||||
Context->Irp = Irp;
|
Context->Irp = Irp;
|
||||||
Context->FDODeviceExtension = FDODeviceExtension;
|
Context->FDODeviceExtension = FDODeviceExtension;
|
||||||
Context->RetryCount = 0;
|
Context->StallRetryCount = 0;
|
||||||
|
|
||||||
return USBSTOR_IssueBulkOrInterruptRequest(
|
return USBSTOR_IssueBulkOrInterruptRequest(
|
||||||
FDODeviceExtension,
|
FDODeviceExtension,
|
||||||
|
@ -586,8 +586,7 @@ USBSTOR_IssueRequestSense(
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
USBSTOR_HandleExecuteSCSI(
|
USBSTOR_HandleExecuteSCSI(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp,
|
IN PIRP Irp)
|
||||||
IN ULONG RetryCount)
|
|
||||||
{
|
{
|
||||||
PCDB pCDB;
|
PCDB pCDB;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
|
@ -286,7 +286,7 @@ typedef struct
|
||||||
PIRP Irp;
|
PIRP Irp;
|
||||||
PFDO_DEVICE_EXTENSION FDODeviceExtension;
|
PFDO_DEVICE_EXTENSION FDODeviceExtension;
|
||||||
ULONG ErrorIndex;
|
ULONG ErrorIndex;
|
||||||
ULONG RetryCount;
|
ULONG StallRetryCount; // the number of retries after receiving USBD_STATUS_STALL_PID status
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
CBW cbw;
|
CBW cbw;
|
||||||
|
@ -406,8 +406,7 @@ USBSTOR_GetPipeHandles(
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
USBSTOR_HandleExecuteSCSI(
|
USBSTOR_HandleExecuteSCSI(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp,
|
IN PIRP Irp);
|
||||||
IN ULONG RetryCount);
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
USBSTOR_SendCSWRequest(
|
USBSTOR_SendCSWRequest(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue