ReactOS  0.4.13-dev-464-g6b95727
usbstor.h
Go to the documentation of this file.
1 #ifndef _USBSTOR_H_
2 #define _USBSTOR_H_
3 
4 #include <wdm.h>
5 #include <usbdi.h>
6 #include <usbbusif.h>
7 #include <usbdlib.h>
8 #include <classpnp.h>
9 
10 #define USB_STOR_TAG 'sbsu'
11 #define USB_MAXCHILDREN (16)
12 #define USBSTOR_DEFAULT_MAX_TRANSFER_LENGTH 0x10000
13 
14 #define HTONS(n) (((((unsigned short)(n) & 0xFF)) << 8) | (((unsigned short)(n) & 0xFF00) >> 8))
15 #define NTOHS(n) (((((unsigned short)(n) & 0xFF)) << 8) | (((unsigned short)(n) & 0xFF00) >> 8))
16 
17 #define HTONL(n) (((((unsigned long)(n) & 0xFF)) << 24) | \
18  ((((unsigned long)(n) & 0xFF00)) << 8) | \
19  ((((unsigned long)(n) & 0xFF0000)) >> 8) | \
20  ((((unsigned long)(n) & 0xFF000000)) >> 24))
21 
22 
23 #define NTOHL(n) (((((unsigned long)(n) & 0xFF)) << 24) | \
24  ((((unsigned long)(n) & 0xFF00)) << 8) | \
25  ((((unsigned long)(n) & 0xFF0000)) >> 8) | \
26  ((((unsigned long)(n) & 0xFF000000)) >> 24))
27 
28 #ifndef BooleanFlagOn
29 #define BooleanFlagOn(Flags, SingleFlag) ((BOOLEAN)((((Flags) & (SingleFlag)) != 0)))
30 #endif
31 
32 #define USB_RECOVERABLE_ERRORS (USBD_STATUS_STALL_PID | USBD_STATUS_DEV_NOT_RESPONDING \
33  | USBD_STATUS_ENDPOINT_HALTED | USBD_STATUS_NO_BANDWIDTH)
34 
36 {
38 
40 
41 #define USBSTOR_FDO_FLAGS_DEVICE_RESETTING 0x00000001 // hard reset is in progress
42 #define USBSTOR_FDO_FLAGS_IRP_LIST_FREEZE 0x00000002 // the irp list is freezed
43 
44 typedef struct
45 {
46  USBSTOR_COMMON_DEVICE_EXTENSION Common; // common device extension
47 
48  PDEVICE_OBJECT FunctionalDeviceObject; // functional device object
49  PDEVICE_OBJECT PhysicalDeviceObject; // physical device object
50  PDEVICE_OBJECT LowerDeviceObject; // lower device object
51  USB_BUS_INTERFACE_USBDI_V2 BusInterface; // bus interface of device
52  PUSB_DEVICE_DESCRIPTOR DeviceDescriptor; // usb device descriptor
53  PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; // usb configuration descriptor
54  PUSB_STRING_DESCRIPTOR SerialNumber; // usb serial number
55  PUSBD_INTERFACE_INFORMATION InterfaceInformation; // usb interface information
56  USBD_CONFIGURATION_HANDLE ConfigurationHandle; // usb configuration handle
57  UCHAR BulkInPipeIndex; // bulk in pipe index
58  UCHAR BulkOutPipeIndex; // bulk out pipe index
59  UCHAR MaxLUN; // max lun for device
60  PDEVICE_OBJECT ChildPDO[16]; // max 16 child pdo devices
61  KSPIN_LOCK IrpListLock; // irp list lock
62  LIST_ENTRY IrpListHead; // irp list head
63  ULONG IrpPendingCount; // count of irp pending
64  PSCSI_REQUEST_BLOCK ActiveSrb; // stores the current active SRB
65  KEVENT NoPendingRequests; // set if no pending or in progress requests
66  PSCSI_REQUEST_BLOCK LastTimerActiveSrb; // last timer tick active srb
67  ULONG SrbErrorHandlingActive; // error handling of srb is activated
68  ULONG TimerWorkQueueEnabled; // timer work queue enabled
69  ULONG InstanceCount; // pdo instance count
74 
75 typedef struct
76 {
79  UCHAR LUN; // lun id
80  PINQUIRYDATA InquiryData; // USB SCSI inquiry data
81  PUCHAR FormatData; // USB SCSI Read Format Capacity Data
82  UCHAR Claimed; // indicating if it has been claimed by upper driver
83  ULONG BlockLength; // length of block
84  ULONG LastLogicBlockAddress; // last block address
85  PDEVICE_OBJECT *PDODeviceObject; // entry in pdo list
87  UCHAR MediumTypeCode; // floppy medium type code
88  UCHAR IsFloppy; // is device floppy
90 
91 //
92 // max lun command identifier
93 //
94 #define USB_BULK_GET_MAX_LUN 0xFE
95 #define USB_BULK_RESET_DEVICE 0xFF
96 
97 #include <pshpack1.h>
98 typedef struct
99 {
100  ULONG Signature; // CBW signature
101  ULONG Tag; // CBW Tag of operation
102  ULONG DataTransferLength; // data transfer length
103  UCHAR Flags; // CBW Flags endpoint direction
104  UCHAR LUN; // lun unit
105  UCHAR CommandBlockLength; // Command block length
106  UCHAR CommandBlock[16];
107 }CBW, *PCBW;
108 
109 C_ASSERT(sizeof(CBW) == 31);
110 
111 
112 #define CBW_SIGNATURE 0x43425355
113 #define CSW_SIGNATURE 0x53425355
114 
115 #define MAX_LUN 0xF
116 
117 #define CSW_STATUS_COMMAND_PASSED 0x00
118 #define CSW_STATUS_COMMAND_FAILED 0x01
119 #define CSW_STATUS_PHASE_ERROR 0x02
120 
121 typedef struct
122 {
123  ULONG Signature; // CSW signature
124  ULONG Tag; // CSW tag
125  ULONG DataResidue; // CSW data transfer diff
126  UCHAR Status; // CSW status
127 }CSW, *PCSW;
128 
129 //--------------------------------------------------------------------------------------------------------------------------------------------
130 //
131 // UFI read cmd
132 //
133 typedef struct
134 {
135  UCHAR Code; // operation code
136  UCHAR LUN; // lun
137  UCHAR LogicalBlockByte0; // lba byte 0
138  UCHAR LogicalBlockByte1; // lba byte 1
139  UCHAR LogicalBlockByte2; // lba byte 2
140  UCHAR LogicalBlockByte3; // lba byte 3
141  UCHAR Reserved; // reserved 0x00
142  UCHAR ContiguousLogicBlocksByte0; // msb contiguous logic blocks byte
143  UCHAR ContiguousLogicBlocksByte1; // msb contiguous logic blocks
144  UCHAR Reserved1[3]; // reserved 0x00
146 
147 C_ASSERT(sizeof(UFI_READ_WRITE_CMD) == 12);
148 
149 #define UFI_READ_WRITE_CMD_LEN (0xA)
150 
151 //--------------------------------------------------------------------------------------------------------------------------------------------
152 //
153 // UFI read capacity cmd
154 //
155 typedef struct
156 {
157  UCHAR Code; // operation code 0x25
158  UCHAR LUN; // lun address
159  UCHAR LBA[4]; // logical block address, should be zero
160  UCHAR Reserved1[2]; // reserved 0x00
161  UCHAR PMI; // PMI = 0x00
162  UCHAR Reserved2[3]; // reserved 0x00
164 
165 C_ASSERT(sizeof(UFI_CAPACITY_CMD) == 12);
166 
167 #define UFI_CAPACITY_CMD_LEN 0xA //FIXME support length 16 too if requested
168 
169 //
170 // UFI Read Capacity command response
171 //
172 typedef struct
173 {
174  ULONG LastLogicalBlockAddress; // last logical block address
175  ULONG BlockLength; // block length in bytes
177 
178 #define UFI_READ_CAPACITY_CMD_LEN 0xA
179 C_ASSERT(sizeof(UFI_CAPACITY_RESPONSE) == 8);
180 
181 //--------------------------------------------------------------------------------------------------------------------------------------------
182 //
183 // UFI sense mode cmd
184 //
185 typedef struct
186 {
187  UCHAR Code; // operation code
188  UCHAR LUN; // lun address
189  UCHAR PageCode:6; // page code selector
190  UCHAR PC:2; // type of parameters to be returned
191  UCHAR Reserved[4]; // reserved 0x00
192  USHORT AllocationLength; // parameters length
195 
196 C_ASSERT(sizeof(UFI_SENSE_CMD) == 12);
197 
198 #define UFI_SENSE_CMD_LEN (6)
199 
200 typedef struct
201 {
202  USHORT ModeDataLength; // length of parameters for sense cmd
203  UCHAR MediumTypeCode; // 00 for mass storage, 0x94 for floppy
204  UCHAR WP:1; // write protect bit
205  UCHAR Reserved1:2; // reserved 00
206  UCHAR DPOFUA:1; // should be zero
207  UCHAR Reserved2:4; // reserved
208  UCHAR Reserved[4]; // reserved
210 
211 
212 C_ASSERT(sizeof(UFI_MODE_PARAMETER_HEADER) == 8);
213 
214 typedef struct
215 {
223 C_ASSERT(sizeof(UFI_TIMER_PROTECT_PAGE) == 8);
224 
225 //--------------------------------------------------------------------------------------------------------------------------------------------
226 //
227 // UFI read capacity cmd
228 //
229 
230 typedef struct
231 {
239 
240 C_ASSERT(sizeof(UFI_READ_FORMAT_CAPACITY) == 12);
241 
242 #define UFI_READ_FORMAT_CAPACITY_CMD_LEN (10)
243 
244 typedef struct
245 {
251 
253 
254 typedef struct
255 {
262 
263 #define UNFORMATTED_MEDIA_CODE_DESCRIPTORY_TYPE (1)
264 #define FORMAT_MEDIA_CODE_DESCRIPTOR_TYPE (2)
265 #define CARTRIDGE_MEDIA_CODE_DESCRIPTOR_TYPE (3)
266 
267 
268 
269 
270 //--------------------------------------------------------------------------------------------------------------------------------------------
271 //
272 // UFI test unit command
273 //
274 
275 typedef struct
276 {
277  UCHAR Code; // operation code 0x00
278  UCHAR LUN; // lun
279  UCHAR Reserved[10]; // reserved 0x00
281 
282 C_ASSERT(sizeof(UFI_TEST_UNIT_CMD) == 12);
283 
284 #define UFI_TEST_UNIT_CMD_LEN (6)
285 
286 //-------------------------------------------------------------------------------------------------------------------------------------------
287 typedef struct
288 {
291 
292 typedef struct
293 {
297  ULONG StallRetryCount; // the number of retries after receiving USBD_STATUS_STALL_PID status
298  union
299  {
302  };
306 
308 {
314 
315 
316 //---------------------------------------------------------------------
317 //
318 // fdo.c routines
319 //
320 NTSTATUS
323  IN OUT PIRP Irp);
324 
325 //---------------------------------------------------------------------
326 //
327 // pdo.c routines
328 //
329 NTSTATUS
332  IN OUT PIRP Irp);
333 
334 NTSTATUS
337  IN UCHAR LUN);
338 
339 //---------------------------------------------------------------------
340 //
341 // misc.c routines
342 //
343 NTSTATUS
344 NTAPI
347  IN OUT PIRP Irp);
348 
349 NTSTATUS
350 NTAPI
353  OUT PUSB_BUS_INTERFACE_USBDI_V2 BusInterface);
354 
355 PVOID
358  IN ULONG ItemSize);
359 
360 VOID
361 FreeItem(
362  IN PVOID Item);
363 
364 NTSTATUS
367  OUT PURB UrbRequest);
368 
369 NTSTATUS
372  IN PFDO_DEVICE_EXTENSION DeviceExtension);
373 
374 NTSTATUS
375 NTAPI
378  PIRP Irp,
379  PVOID Context);
380 
381 NTSTATUS
384  IN PFDO_DEVICE_EXTENSION DeviceExtension);
385 
386 BOOLEAN
388  IN PUCHAR Buffer,
390  OUT PUCHAR MediumTypeCode);
391 
392 //---------------------------------------------------------------------
393 //
394 // descriptor.c routines
395 //
396 
397 NTSTATUS
400 
401 NTSTATUS
404  IN PFDO_DEVICE_EXTENSION DeviceExtension);
405 
406 NTSTATUS
408  IN PFDO_DEVICE_EXTENSION DeviceExtension);
409 
410 //---------------------------------------------------------------------
411 //
412 // scsi.c routines
413 //
414 NTSTATUS
417  IN PIRP Irp);
418 
419 NTSTATUS
422  PIRP Irp);
423 
424 
425 //---------------------------------------------------------------------
426 //
427 // disk.c routines
428 //
429 NTSTATUS
432  IN PIRP Irp);
433 
434 NTSTATUS
437  IN PIRP Irp);
438 
439 //---------------------------------------------------------------------
440 //
441 // queue.c routines
442 //
443 VOID
444 NTAPI
447  PIRP Irp);
448 
449 VOID
452 
453 VOID
456 
457 BOOLEAN
460  IN PIRP Irp);
461 
462 VOID
463 NTAPI
466  IN PIRP Irp);
467 
468 VOID
470  PFDO_DEVICE_EXTENSION FDODeviceExtension);
471 
472 VOID
475 
476 VOID
479  IN PIRP Irp);
480 
481 /* error.c */
482 NTSTATUS
485  IN UCHAR bEndpointAddress,
486  OUT PUSHORT Value);
487 
488 NTSTATUS
492 
493 VOID
494 NTAPI
497  PVOID Context);
498 
499 VOID
500 NTAPI
502  IN PFDO_DEVICE_EXTENSION FDODeviceExtension,
504 
505 VOID
506 NTAPI
508  IN PFDO_DEVICE_EXTENSION FDODeviceExtension);
509 
510 #endif /* _USBSTOR_H_ */
ULONG LastLogicalBlockAddress
Definition: usbstor.h:174
ULONG Tag
Definition: usbstor.h:124
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2327
VOID NTAPI USBSTOR_QueueResetPipe(IN PFDO_DEVICE_EXTENSION FDODeviceExtension, IN PIRP_CONTEXT Context)
Definition: error.c:135
ULONG DataTransferLength
Definition: usbstor.h:102
USHORT AllocationLength
Definition: usbstor.h:192
#define IN
Definition: typedefs.h:38
ULONG DataResidue
Definition: usbstor.h:125
PUSBD_INTERFACE_INFORMATION InterfaceInformation
Definition: usbstor.h:55
struct UFI_TEST_UNIT_CMD * PUFI_TEST_UNIT_CMD
BOOLEAN USBSTOR_QueueAddIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: queue.c:75
VOID USBSTOR_QueueWaitForPendingRequests(IN PDEVICE_OBJECT DeviceObject)
Definition: queue.c:171
ULONG SrbErrorHandlingActive
Definition: usbstor.h:67
PDEVICE_OBJECT FunctionalDeviceObject
Definition: usbstor.h:48
UCHAR MediumTypeCode
Definition: usbstor.h:87
PIRP Irp
Definition: usbstor.h:294
ULONG LastLogicBlockAddress
Definition: usbstor.h:84
struct _ERRORHANDLER_WORKITEM_DATA * PERRORHANDLER_WORKITEM_DATA
VOID NTAPI USBSTOR_StartIo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: queue.c:300
_In_ PIRP Irp
Definition: csq.h:116
UCHAR ContiguousLogicBlocksByte0
Definition: usbstor.h:142
ULONG Tag
Definition: usbstor.h:101
UCHAR LogicalBlockByte1
Definition: usbstor.h:138
unsigned char * PUCHAR
Definition: retypes.h:3
LONG NTSTATUS
Definition: precomp.h:26
VOID USBSTOR_QueueTerminateRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: queue.c:186
_In_ UINT Bytes
Definition: mmcopy.h:9
LIST_ENTRY IrpListHead
Definition: usbstor.h:62
UCHAR Status
Definition: usbstor.h:126
Definition: usbstor.h:98
NTSTATUS NTAPI USBSTOR_SyncForwardIrp(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
PIO_WORKITEM ResetDeviceWorkItem
Definition: usbstor.h:71
UCHAR CommandBlockLength
Definition: usbstor.h:105
UCHAR LogicalBlockByte0
Definition: usbstor.h:137
BOOLEAN USBSTOR_IsFloppy(IN PUCHAR Buffer, IN ULONG BufferLength, OUT PUCHAR MediumTypeCode)
Definition: misc.c:427
NTSTATUS USBSTOR_GetPipeHandles(IN PFDO_DEVICE_EXTENSION DeviceExtension)
Definition: descriptor.c:319
PINQUIRYDATA InquiryData
Definition: usbstor.h:80
Definition: usbstor.h:121
WORK_QUEUE_ITEM WorkQueueItem
Definition: usbstor.h:311
PDEVICE_OBJECT Self
Definition: usbstor.h:86
UCHAR LUN
Definition: usbstor.h:188
PSCSI_REQUEST_BLOCK ActiveSrb
Definition: usbstor.h:64
USBSTOR_COMMON_DEVICE_EXTENSION Common
Definition: usbstor.h:46
NTSTATUS USBSTOR_PdoHandlePnp(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: pdo.c:549
PDEVICE_OBJECT DeviceObject
Definition: usbstor.h:309
UCHAR BulkOutPipeIndex
Definition: usbstor.h:58
ULONG Signature
Definition: usbstor.h:100
struct __COMMON_DEVICE_EXTENSION__ * PUSBSTOR_COMMON_DEVICE_EXTENSION
struct UFI_SENSE_CMD * PUFI_SENSE_CMD
struct CSW * PCSW
UCHAR PC
Definition: usbstor.h:190
UCHAR LogicalBlockByte2
Definition: usbstor.h:139
ULONG IrpPendingCount
Definition: usbstor.h:63
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
ULONG Signature
Definition: usbstor.h:123
struct UFI_CAPACITY_DESCRIPTOR * PUFI_CAPACITY_DESCRIPTOR
NTSTATUS USBSTOR_ResetDevice(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
Definition: misc.c:251
_In_ ULONG BufferLength
Definition: usbdlib.h:225
UCHAR Flags
Definition: usbstor.h:103
NTSTATUS USBSTOR_ResetPipeWithHandle(IN PDEVICE_OBJECT DeviceObject, IN USBD_PIPE_HANDLE PipeHandle)
Definition: error.c:46
unsigned char BOOLEAN
ULONG ErrorIndex
Definition: usbstor.h:296
ULONG TimerWorkQueueEnabled
Definition: usbstor.h:68
NTSTATUS USBSTOR_GetEndpointStatus(IN PDEVICE_OBJECT DeviceObject, IN UCHAR bEndpointAddress, OUT PUSHORT Value)
Definition: error.c:18
struct __COMMON_DEVICE_EXTENSION__ USBSTOR_COMMON_DEVICE_EXTENSION
C_ASSERT(sizeof(CBW)==31)
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
Definition: bufpool.h:45
Definition: bcd.h:202
VOID USBSTOR_QueueInitialize(PFDO_DEVICE_EXTENSION FDODeviceExtension)
Definition: queue.c:17
VOID NTAPI USBSTOR_QueueResetDevice(IN PFDO_DEVICE_EXTENSION FDODeviceExtension)
Definition: error.c:149
const KSDEVICE_DESCRIPTOR DeviceDescriptor
Definition: splitter.c:257
PDEVICE_OBJECT LowerDeviceObject
Definition: usbstor.h:50
NTSTATUS USBSTOR_HandleDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: disk.c:418
INT POOL_TYPE
Definition: typedefs.h:76
struct _FDO_DEVICE_EXTENSION FDO_DEVICE_EXTENSION
struct UFI_CAPACITY_RESPONSE * PUFI_CAPACITY_RESPONSE
NTSTATUS USBSTOR_SyncUrbRequest(IN PDEVICE_OBJECT DeviceObject, OUT PURB UrbRequest)
Definition: misc.c:107
PSCSI_REQUEST_BLOCK LastTimerActiveSrb
Definition: usbstor.h:66
UCHAR ContiguousLogicBlocksByte1
Definition: usbstor.h:143
NTSTATUS USBSTOR_FdoHandlePnp(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: fdo.c:273
USBSTOR_COMMON_DEVICE_EXTENSION Common
Definition: usbstor.h:77
struct IRP_CONTEXT * PIRP_CONTEXT
struct CBW * PCBW
PVOID AllocateItem(IN POOL_TYPE PoolType, IN ULONG ItemSize)
Definition: misc.c:30
PFDO_DEVICE_EXTENSION FDODeviceExtension
Definition: usbstor.h:295
SCSI_REQUEST_BLOCK SenseSrb
Definition: usbstor.h:304
NTSTATUS USBSTOR_HandleInternalDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: disk.c:81
struct _IRP_CONTEXT IRP_CONTEXT
struct UFI_TIMER_PROTECT_PAGE * PUFI_TIMER_PROTECT_PAGE
UCHAR BulkInPipeIndex
Definition: usbstor.h:57
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE ConfigurationHandle
Definition: ndis.h:3944
unsigned char UCHAR
Definition: xmlstorage.h:181
ULONG StallRetryCount
Definition: usbstor.h:297
VOID USBSTOR_QueueRelease(IN PDEVICE_OBJECT DeviceObject)
Definition: queue.c:262
PUSB_STRING_DESCRIPTOR SerialNumber
Definition: usbstor.h:54
Definition: typedefs.h:117
struct UFI_CAPACITY_CMD * PUFI_CAPACITY_CMD
static UCHAR ItemSize[4]
Definition: parser.c:16
UCHAR LUN
Definition: usbstor.h:104
KEVENT NoPendingRequests
Definition: usbstor.h:65
UCHAR Code
Definition: usbstor.h:187
UCHAR PageCode
Definition: usbstor.h:189
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
NTSTATUS USBSTOR_GetMaxLUN(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
Definition: misc.c:204
VOID NTAPI USBSTOR_TimerRoutine(PDEVICE_OBJECT DeviceObject, PVOID Context)
Definition: error.c:206
struct _PDO_DEVICE_EXTENSION PDO_DEVICE_EXTENSION
struct UFI_UNKNOWN_CMD * PUFI_UNKNOWN_CMD
Definition: usb.h:529
unsigned short USHORT
Definition: pedump.c:61
NTSTATUS USBSTOR_CreatePDO(IN PDEVICE_OBJECT DeviceObject, IN UCHAR LUN)
Definition: pdo.c:896
KSPIN_LOCK CommonLock
Definition: usbstor.h:70
struct UFI_CAPACITY_FORMAT_HEADER * PUFI_CAPACITY_FORMAT_HEADER
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
struct _ERRORHANDLER_WORKITEM_DATA ERRORHANDLER_WORKITEM_DATA
static HANDLE PipeHandle
Definition: dhcpcsvc.c:21
Definition: bcd.h:201
UCHAR LogicalBlockByte3
Definition: usbstor.h:140
PDEVICE_OBJECT LowerDeviceObject
Definition: usbstor.h:78
struct PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
NTSTATUS NTAPI USBSTOR_GetBusInterface(IN PDEVICE_OBJECT DeviceObject, OUT PUSB_BUS_INTERFACE_USBDI_V2 BusInterface)
Definition: misc.c:57
#define OUT
Definition: typedefs.h:39
NTSTATUS USBSTOR_SendCSWRequest(PIRP_CONTEXT Context, PIRP Irp)
Definition: scsi.c:258
NTSTATUS USBSTOR_GetDescriptors(IN PDEVICE_OBJECT DeviceObject)
Definition: descriptor.c:75
struct FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS USBSTOR_SelectConfigurationAndInterface(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
Definition: descriptor.c:234
VOID NTAPI USBSTOR_CancelIo(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: queue.c:28
NTSTATUS NTAPI USBSTOR_SyncForwardIrpCompletionRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context)
Definition: misc.c:22
VOID FreeItem(IN PVOID Item)
Definition: misc.c:43
USB_BUS_INTERFACE_USBDI_V2 BusInterface
Definition: usbstor.h:51
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T _In_ POOL_TYPE PoolType
Definition: fltkernel.h:1444
struct UFI_MODE_PARAMETER_HEADER * PUFI_MODE_PARAMETER_HEADER
NTSTATUS USBSTOR_HandleExecuteSCSI(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: scsi.c:562
unsigned short * PUSHORT
Definition: retypes.h:2
struct UFI_READ_FORMAT_CAPACITY * PUFI_READ_FORMAT_CAPACITY
VOID USBSTOR_QueueNextRequest(IN PDEVICE_OBJECT DeviceObject)
Definition: queue.c:220
PDEVICE_OBJECT * PDODeviceObject
Definition: usbstor.h:85
KSPIN_LOCK IrpListLock
Definition: usbstor.h:61