mirror of
https://github.com/reactos/reactos.git
synced 2025-05-25 20:18:22 +00:00
[USBSTOR] Do not print device descriptor by default.
Add SrbGetCdb macro
This commit is contained in:
parent
10260f40d9
commit
e831f8530b
3 changed files with 35 additions and 31 deletions
|
@ -14,25 +14,28 @@
|
|||
#include <debug.h>
|
||||
|
||||
|
||||
#if DBG
|
||||
static
|
||||
VOID
|
||||
USBSTOR_DumpDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor)
|
||||
{
|
||||
DPRINT1("Dumping Device Descriptor %p\n", DeviceDescriptor);
|
||||
DPRINT1("bLength %x\n", DeviceDescriptor->bLength);
|
||||
DPRINT1("bDescriptorType %x\n", DeviceDescriptor->bDescriptorType);
|
||||
DPRINT1("bcdUSB %x\n", DeviceDescriptor->bcdUSB);
|
||||
DPRINT1("bDeviceClass %x\n", DeviceDescriptor->bDeviceClass);
|
||||
DPRINT1("bDeviceSubClass %x\n", DeviceDescriptor->bDeviceSubClass);
|
||||
DPRINT1("bDeviceProtocol %x\n", DeviceDescriptor->bDeviceProtocol);
|
||||
DPRINT1("bMaxPacketSize0 %x\n", DeviceDescriptor->bMaxPacketSize0);
|
||||
DPRINT1("idVendor %x\n", DeviceDescriptor->idVendor);
|
||||
DPRINT1("idProduct %x\n", DeviceDescriptor->idProduct);
|
||||
DPRINT1("bcdDevice %x\n", DeviceDescriptor->bcdDevice);
|
||||
DPRINT1("iManufacturer %x\n", DeviceDescriptor->iManufacturer);
|
||||
DPRINT1("iProduct %x\n", DeviceDescriptor->iProduct);
|
||||
DPRINT1("iSerialNumber %x\n", DeviceDescriptor->iSerialNumber);
|
||||
DPRINT1("bNumConfigurations %x\n", DeviceDescriptor->bNumConfigurations);
|
||||
DPRINT("Dumping Device Descriptor %p\n", DeviceDescriptor);
|
||||
DPRINT("bLength %x\n", DeviceDescriptor->bLength);
|
||||
DPRINT("bDescriptorType %x\n", DeviceDescriptor->bDescriptorType);
|
||||
DPRINT("bcdUSB %x\n", DeviceDescriptor->bcdUSB);
|
||||
DPRINT("bDeviceClass %x\n", DeviceDescriptor->bDeviceClass);
|
||||
DPRINT("bDeviceSubClass %x\n", DeviceDescriptor->bDeviceSubClass);
|
||||
DPRINT("bDeviceProtocol %x\n", DeviceDescriptor->bDeviceProtocol);
|
||||
DPRINT("bMaxPacketSize0 %x\n", DeviceDescriptor->bMaxPacketSize0);
|
||||
DPRINT("idVendor %x\n", DeviceDescriptor->idVendor);
|
||||
DPRINT("idProduct %x\n", DeviceDescriptor->idProduct);
|
||||
DPRINT("bcdDevice %x\n", DeviceDescriptor->bcdDevice);
|
||||
DPRINT("iManufacturer %x\n", DeviceDescriptor->iManufacturer);
|
||||
DPRINT("iProduct %x\n", DeviceDescriptor->iProduct);
|
||||
DPRINT("iSerialNumber %x\n", DeviceDescriptor->iSerialNumber);
|
||||
DPRINT("bNumConfigurations %x\n", DeviceDescriptor->bNumConfigurations);
|
||||
}
|
||||
#endif
|
||||
|
||||
NTSTATUS
|
||||
USBSTOR_FdoHandleDeviceRelations(
|
||||
|
@ -184,8 +187,9 @@ USBSTOR_FdoHandleStartDevice(
|
|||
return Status;
|
||||
}
|
||||
|
||||
#if DBG
|
||||
USBSTOR_DumpDeviceDescriptor(DeviceExtension->DeviceDescriptor);
|
||||
|
||||
#endif
|
||||
|
||||
// Check that this device uses bulk transfers and is SCSI
|
||||
|
||||
|
|
|
@ -526,7 +526,6 @@ USBSTOR_IssueRequestSense(
|
|||
PIO_STACK_LOCATION IoStack;
|
||||
PSCSI_REQUEST_BLOCK CurrentSrb;
|
||||
PSCSI_REQUEST_BLOCK SenseSrb;
|
||||
PCDB pCDB;
|
||||
|
||||
DPRINT("USBSTOR_IssueRequestSense: \n");
|
||||
|
||||
|
@ -551,9 +550,8 @@ USBSTOR_IssueRequestSense(
|
|||
SenseSrb->DataTransferLength = CurrentSrb->SenseInfoBufferLength;
|
||||
SenseSrb->DataBuffer = CurrentSrb->SenseInfoBuffer;
|
||||
|
||||
pCDB = (PCDB)SenseSrb->Cdb;
|
||||
pCDB->CDB6GENERIC.OperationCode = SCSIOP_REQUEST_SENSE;
|
||||
pCDB->AsByte[4] = CurrentSrb->SenseInfoBufferLength;
|
||||
SrbGetCdb(SenseSrb)->CDB6GENERIC.OperationCode = SCSIOP_REQUEST_SENSE;
|
||||
SrbGetCdb(SenseSrb)->AsByte[4] = CurrentSrb->SenseInfoBufferLength;
|
||||
|
||||
return USBSTOR_SendCBWRequest(FDODeviceExtension, Irp, Context);
|
||||
}
|
||||
|
@ -563,7 +561,6 @@ USBSTOR_HandleExecuteSCSI(
|
|||
IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp)
|
||||
{
|
||||
PCDB pCDB;
|
||||
NTSTATUS Status;
|
||||
PIO_STACK_LOCATION IoStack;
|
||||
PSCSI_REQUEST_BLOCK Request;
|
||||
|
@ -575,12 +572,11 @@ USBSTOR_HandleExecuteSCSI(
|
|||
|
||||
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
||||
Request = IoStack->Parameters.Scsi.Srb;
|
||||
pCDB = (PCDB)Request->Cdb;
|
||||
|
||||
DPRINT("USBSTOR_HandleExecuteSCSI Operation Code %x, Length %lu\n", pCDB->CDB10.OperationCode, Request->DataTransferLength);
|
||||
DPRINT("USBSTOR_HandleExecuteSCSI Operation Code %x, Length %lu\n", SrbGetCdb(Request)->CDB10.OperationCode, Request->DataTransferLength);
|
||||
|
||||
// check that we're sending to the right LUN
|
||||
ASSERT(pCDB->CDB10.LogicalUnitNumber == (PDODeviceExtension->LUN & MAX_LUN));
|
||||
ASSERT(SrbGetCdb(Request)->CDB10.LogicalUnitNumber == (PDODeviceExtension->LUN & MAX_LUN));
|
||||
Context = ExAllocatePoolWithTag(NonPagedPool, sizeof(IRP_CONTEXT), USB_STOR_TAG);
|
||||
|
||||
if (!Context)
|
||||
|
|
|
@ -29,6 +29,10 @@
|
|||
#define BooleanFlagOn(Flags, SingleFlag) ((BOOLEAN)((((Flags) & (SingleFlag)) != 0)))
|
||||
#endif
|
||||
|
||||
#ifndef SrbGetCdb
|
||||
#define SrbGetCdb(srb) ((PCDB)(srb->Cdb))
|
||||
#endif
|
||||
|
||||
#define USB_RECOVERABLE_ERRORS (USBD_STATUS_STALL_PID | USBD_STATUS_DEV_NOT_RESPONDING \
|
||||
| USBD_STATUS_ENDPOINT_HALTED | USBD_STATUS_NO_BANDWIDTH)
|
||||
|
||||
|
|
Loading…
Reference in a new issue