[USBSTOR] Move PDO's Inquiry data and FDO's SCSI context

to their Device Extensions.
This way the driver can better handle low memory situations
This commit is contained in:
Victor Perevertkin 2020-06-12 16:51:42 +03:00
parent a9b97aeded
commit 94e61c3080
No known key found for this signature in database
GPG key ID: C750B7222E9C7830
5 changed files with 113 additions and 148 deletions

View file

@ -77,15 +77,15 @@ USBSTOR_ResetPipeWorkItemRoutine(
IN PVOID Ctx)
{
NTSTATUS Status;
PIRP_CONTEXT Context = (PIRP_CONTEXT)Ctx;
PFDO_DEVICE_EXTENSION FDODeviceExtension = (PFDO_DEVICE_EXTENSION)FdoDevice->DeviceExtension;
PFDO_DEVICE_EXTENSION FDODeviceExtension = (PFDO_DEVICE_EXTENSION)Ctx;
PIRP_CONTEXT Context = &FDODeviceExtension->CurrentIrpContext;
// clear stall on the corresponding pipe
Status = USBSTOR_ResetPipeWithHandle(FDODeviceExtension->LowerDeviceObject, Context->Urb.UrbBulkOrInterruptTransfer.PipeHandle);
DPRINT1("USBSTOR_ResetPipeWithHandle Status %x\n", Status);
// now resend the csw as the stall got cleared
USBSTOR_SendCSWRequest(Context, Context->Irp);
USBSTOR_SendCSWRequest(FDODeviceExtension, Context->Irp);
}
VOID
@ -133,15 +133,14 @@ USBSTOR_ResetDeviceWorkItemRoutine(
VOID
NTAPI
USBSTOR_QueueResetPipe(
IN PFDO_DEVICE_EXTENSION FDODeviceExtension,
IN PIRP_CONTEXT Context)
IN PFDO_DEVICE_EXTENSION FDODeviceExtension)
{
DPRINT("USBSTOR_QueueResetPipe\n");
IoQueueWorkItem(FDODeviceExtension->ResetDeviceWorkItem,
USBSTOR_ResetPipeWorkItemRoutine,
CriticalWorkQueue,
Context);
FDODeviceExtension);
}
VOID