ReactOS  0.4.14-dev-608-gd495a4f
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 #ifndef SrbGetCdb
33 #define SrbGetCdb(srb) ((PCDB)(srb->Cdb))
34 #endif
35 
36 #define USB_RECOVERABLE_ERRORS (USBD_STATUS_STALL_PID | USBD_STATUS_DEV_NOT_RESPONDING \
37  | USBD_STATUS_ENDPOINT_HALTED | USBD_STATUS_NO_BANDWIDTH)
38 
40 {
42 
44 
45 #define USBSTOR_FDO_FLAGS_DEVICE_RESETTING 0x00000001 // hard reset is in progress
46 #define USBSTOR_FDO_FLAGS_IRP_LIST_FREEZE 0x00000002 // the irp list is freezed
47 
48 typedef struct
49 {
50  USBSTOR_COMMON_DEVICE_EXTENSION Common; // common device extension
51 
52  PDEVICE_OBJECT FunctionalDeviceObject; // functional device object
53  PDEVICE_OBJECT PhysicalDeviceObject; // physical device object
54  PDEVICE_OBJECT LowerDeviceObject; // lower device object
55  USB_BUS_INTERFACE_USBDI_V2 BusInterface; // bus interface of device
56  PUSB_DEVICE_DESCRIPTOR DeviceDescriptor; // usb device descriptor
57  PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; // usb configuration descriptor
58  PUSB_STRING_DESCRIPTOR SerialNumber; // usb serial number
59  PUSBD_INTERFACE_INFORMATION InterfaceInformation; // usb interface information
60  USBD_CONFIGURATION_HANDLE ConfigurationHandle; // usb configuration handle
61  UCHAR BulkInPipeIndex; // bulk in pipe index
62  UCHAR BulkOutPipeIndex; // bulk out pipe index
63  UCHAR MaxLUN; // max lun for device
64  PDEVICE_OBJECT ChildPDO[16]; // max 16 child pdo devices
65  KSPIN_LOCK IrpListLock; // irp list lock
66  LIST_ENTRY IrpListHead; // irp list head
67  ULONG IrpPendingCount; // count of irp pending
68  PSCSI_REQUEST_BLOCK ActiveSrb; // stores the current active SRB
69  KEVENT NoPendingRequests; // set if no pending or in progress requests
70  PSCSI_REQUEST_BLOCK LastTimerActiveSrb; // last timer tick active srb
71  ULONG SrbErrorHandlingActive; // error handling of srb is activated
72  ULONG TimerWorkQueueEnabled; // timer work queue enabled
73  ULONG InstanceCount; // pdo instance count
78 
79 typedef struct
80 {
83  UCHAR LUN; // lun id
84  PINQUIRYDATA InquiryData; // USB SCSI inquiry data
85  PUCHAR FormatData; // USB SCSI Read Format Capacity Data
86  UCHAR Claimed; // indicating if it has been claimed by upper driver
87  ULONG BlockLength; // length of block
88  ULONG LastLogicBlockAddress; // last block address
89  PDEVICE_OBJECT *PDODeviceObject; // entry in pdo list
91  UCHAR MediumTypeCode; // floppy medium type code
92  UCHAR IsFloppy; // is device floppy
94 
95 //
96 // max lun command identifier
97 //
98 #define USB_BULK_GET_MAX_LUN 0xFE
99 #define USB_BULK_RESET_DEVICE 0xFF
100 
101 #include <pshpack1.h>
102 typedef struct
103 {
104  ULONG Signature; // CBW signature
105  ULONG Tag; // CBW Tag of operation
106  ULONG DataTransferLength; // data transfer length
107  UCHAR Flags; // CBW Flags endpoint direction
108  UCHAR LUN; // lun unit
109  UCHAR CommandBlockLength; // Command block length
110  UCHAR CommandBlock[16];
111 }CBW, *PCBW;
112 
113 C_ASSERT(sizeof(CBW) == 31);
114 
115 
116 #define CBW_SIGNATURE 0x43425355
117 #define CSW_SIGNATURE 0x53425355
118 
119 #define MAX_LUN 0xF
120 
121 #define CSW_STATUS_COMMAND_PASSED 0x00
122 #define CSW_STATUS_COMMAND_FAILED 0x01
123 #define CSW_STATUS_PHASE_ERROR 0x02
124 
125 typedef struct
126 {
127  ULONG Signature; // CSW signature
128  ULONG Tag; // CSW tag
129  ULONG DataResidue; // CSW data transfer diff
130  UCHAR Status; // CSW status
131 }CSW, *PCSW;
132 
133 //--------------------------------------------------------------------------------------------------------------------------------------------
134 //
135 // UFI read cmd
136 //
137 typedef struct
138 {
139  UCHAR Code; // operation code
140  UCHAR LUN; // lun
141  UCHAR LogicalBlockByte0; // lba byte 0
142  UCHAR LogicalBlockByte1; // lba byte 1
143  UCHAR LogicalBlockByte2; // lba byte 2
144  UCHAR LogicalBlockByte3; // lba byte 3
145  UCHAR Reserved; // reserved 0x00
146  UCHAR ContiguousLogicBlocksByte0; // msb contiguous logic blocks byte
147  UCHAR ContiguousLogicBlocksByte1; // msb contiguous logic blocks
148  UCHAR Reserved1[3]; // reserved 0x00
150 
151 C_ASSERT(sizeof(UFI_READ_WRITE_CMD) == 12);
152 
153 #define UFI_READ_WRITE_CMD_LEN (0xA)
154 
155 //--------------------------------------------------------------------------------------------------------------------------------------------
156 //
157 // UFI read capacity cmd
158 //
159 typedef struct
160 {
161  UCHAR Code; // operation code 0x25
162  UCHAR LUN; // lun address
163  UCHAR LBA[4]; // logical block address, should be zero
164  UCHAR Reserved1[2]; // reserved 0x00
165  UCHAR PMI; // PMI = 0x00
166  UCHAR Reserved2[3]; // reserved 0x00
168 
169 C_ASSERT(sizeof(UFI_CAPACITY_CMD) == 12);
170 
171 #define UFI_CAPACITY_CMD_LEN 0xA //FIXME support length 16 too if requested
172 
173 //
174 // UFI Read Capacity command response
175 //
176 typedef struct
177 {
178  ULONG LastLogicalBlockAddress; // last logical block address
179  ULONG BlockLength; // block length in bytes
181 
182 #define UFI_READ_CAPACITY_CMD_LEN 0xA
183 C_ASSERT(sizeof(UFI_CAPACITY_RESPONSE) == 8);
184 
185 //--------------------------------------------------------------------------------------------------------------------------------------------
186 //
187 // UFI sense mode cmd
188 //
189 typedef struct
190 {
191  UCHAR Code; // operation code
192  UCHAR LUN; // lun address
193  UCHAR PageCode:6; // page code selector
194  UCHAR PC:2; // type of parameters to be returned
195  UCHAR Reserved[4]; // reserved 0x00
196  USHORT AllocationLength; // parameters length
199 
200 C_ASSERT(sizeof(UFI_SENSE_CMD) == 12);
201 
202 #define UFI_SENSE_CMD_LEN (6)
203 
204 typedef struct
205 {
206  USHORT ModeDataLength; // length of parameters for sense cmd
207  UCHAR MediumTypeCode; // 00 for mass storage, 0x94 for floppy
208  UCHAR WP:1; // write protect bit
209  UCHAR Reserved1:2; // reserved 00
210  UCHAR DPOFUA:1; // should be zero
211  UCHAR Reserved2:4; // reserved
212  UCHAR Reserved[4]; // reserved
214 
215 
216 C_ASSERT(sizeof(UFI_MODE_PARAMETER_HEADER) == 8);
217 
218 typedef struct
219 {
227 C_ASSERT(sizeof(UFI_TIMER_PROTECT_PAGE) == 8);
228 
229 //--------------------------------------------------------------------------------------------------------------------------------------------
230 //
231 // UFI read capacity cmd
232 //
233 
234 typedef struct
235 {
243 
244 C_ASSERT(sizeof(UFI_READ_FORMAT_CAPACITY) == 12);
245 
246 #define UFI_READ_FORMAT_CAPACITY_CMD_LEN (10)
247 
248 typedef struct
249 {
255 
257 
258 typedef struct
259 {
266 
267 #define UNFORMATTED_MEDIA_CODE_DESCRIPTORY_TYPE (1)
268 #define FORMAT_MEDIA_CODE_DESCRIPTOR_TYPE (2)
269 #define CARTRIDGE_MEDIA_CODE_DESCRIPTOR_TYPE (3)
270 
271 
272 
273 
274 //--------------------------------------------------------------------------------------------------------------------------------------------
275 //
276 // UFI test unit command
277 //
278 
279 typedef struct
280 {
281  UCHAR Code; // operation code 0x00
282  UCHAR LUN; // lun
283  UCHAR Reserved[10]; // reserved 0x00
285 
286 C_ASSERT(sizeof(UFI_TEST_UNIT_CMD) == 12);
287 
288 #define UFI_TEST_UNIT_CMD_LEN (6)
289 
290 //-------------------------------------------------------------------------------------------------------------------------------------------
291 typedef struct
292 {
295 
296 typedef struct
297 {
301  ULONG StallRetryCount; // the number of retries after receiving USBD_STATUS_STALL_PID status
302  union
303  {
306  };
310 
312 {
318 
319 
320 //---------------------------------------------------------------------
321 //
322 // fdo.c routines
323 //
324 NTSTATUS
327  IN OUT PIRP Irp);
328 
329 //---------------------------------------------------------------------
330 //
331 // pdo.c routines
332 //
333 NTSTATUS
336  IN OUT PIRP Irp);
337 
338 NTSTATUS
341  IN UCHAR LUN);
342 
343 //---------------------------------------------------------------------
344 //
345 // misc.c routines
346 //
347 NTSTATUS
348 NTAPI
351  IN OUT PIRP Irp);
352 
353 NTSTATUS
354 NTAPI
357  OUT PUSB_BUS_INTERFACE_USBDI_V2 BusInterface);
358 
359 PVOID
362  IN ULONG ItemSize);
363 
364 VOID
365 FreeItem(
366  IN PVOID Item);
367 
368 NTSTATUS
371  OUT PURB UrbRequest);
372 
373 NTSTATUS
376  IN PFDO_DEVICE_EXTENSION DeviceExtension);
377 
378 NTSTATUS
379 NTAPI
382  PIRP Irp,
383  PVOID Context);
384 
385 NTSTATUS
388  IN PFDO_DEVICE_EXTENSION DeviceExtension);
389 
390 BOOLEAN
392  IN PUCHAR Buffer,
394  OUT PUCHAR MediumTypeCode);
395 
396 //---------------------------------------------------------------------
397 //
398 // descriptor.c routines
399 //
400 
401 NTSTATUS
404 
405 NTSTATUS
408  IN PFDO_DEVICE_EXTENSION DeviceExtension);
409 
410 NTSTATUS
412  IN PFDO_DEVICE_EXTENSION DeviceExtension);
413 
414 //---------------------------------------------------------------------
415 //
416 // scsi.c routines
417 //
418 NTSTATUS
421  IN PIRP Irp);
422 
423 NTSTATUS
426  PIRP Irp);
427 
428 
429 //---------------------------------------------------------------------
430 //
431 // disk.c routines
432 //
433 NTSTATUS
436  IN PIRP Irp);
437 
438 NTSTATUS
441  IN PIRP Irp);
442 
443 //---------------------------------------------------------------------
444 //
445 // queue.c routines
446 //
447 VOID
448 NTAPI
451  PIRP Irp);
452 
453 VOID
456 
457 VOID
460 
461 BOOLEAN
464  IN PIRP Irp);
465 
466 VOID
467 NTAPI
470  IN PIRP Irp);
471 
472 VOID
474  PFDO_DEVICE_EXTENSION FDODeviceExtension);
475 
476 VOID
479 
480 VOID
483  IN PIRP Irp);
484 
485 /* error.c */
486 NTSTATUS
489  IN UCHAR bEndpointAddress,
490  OUT PUSHORT Value);
491 
492 NTSTATUS
496 
497 VOID
498 NTAPI
501  PVOID Context);
502 
503 VOID
504 NTAPI
506  IN PFDO_DEVICE_EXTENSION FDODeviceExtension,
508 
509 VOID
510 NTAPI
512  IN PFDO_DEVICE_EXTENSION FDODeviceExtension);
513 
514 #endif /* _USBSTOR_H_ */
ULONG LastLogicalBlockAddress
Definition: usbstor.h:178
ULONG Tag
Definition: usbstor.h:128
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
VOID NTAPI USBSTOR_QueueResetPipe(IN PFDO_DEVICE_EXTENSION FDODeviceExtension, IN PIRP_CONTEXT Context)
Definition: error.c:135
ULONG DataTransferLength
Definition: usbstor.h:106
USHORT AllocationLength
Definition: usbstor.h:196
#define IN
Definition: typedefs.h:38
ULONG DataResidue
Definition: usbstor.h:129
PUSBD_INTERFACE_INFORMATION InterfaceInformation
Definition: usbstor.h:59
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:71
PDEVICE_OBJECT FunctionalDeviceObject
Definition: usbstor.h:52
UCHAR MediumTypeCode
Definition: usbstor.h:91
PIRP Irp
Definition: usbstor.h:298
ULONG LastLogicBlockAddress
Definition: usbstor.h:88
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:146
ULONG Tag
Definition: usbstor.h:105
UCHAR LogicalBlockByte1
Definition: usbstor.h:142
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:66
UCHAR Status
Definition: usbstor.h:130
Definition: usbstor.h:102
NTSTATUS NTAPI USBSTOR_SyncForwardIrp(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
PIO_WORKITEM ResetDeviceWorkItem
Definition: usbstor.h:75
UCHAR CommandBlockLength
Definition: usbstor.h:109
UCHAR LogicalBlockByte0
Definition: usbstor.h:141
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:84
Definition: usbstor.h:125
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1122
WORK_QUEUE_ITEM WorkQueueItem
Definition: usbstor.h:315
PDEVICE_OBJECT Self
Definition: usbstor.h:90
UCHAR LUN
Definition: usbstor.h:192
PSCSI_REQUEST_BLOCK ActiveSrb
Definition: usbstor.h:68
USBSTOR_COMMON_DEVICE_EXTENSION Common
Definition: usbstor.h:50
NTSTATUS USBSTOR_PdoHandlePnp(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: pdo.c:549
PDEVICE_OBJECT DeviceObject
Definition: usbstor.h:313
UCHAR BulkOutPipeIndex
Definition: usbstor.h:62
ULONG Signature
Definition: usbstor.h:104
struct __COMMON_DEVICE_EXTENSION__ * PUSBSTOR_COMMON_DEVICE_EXTENSION
struct UFI_SENSE_CMD * PUFI_SENSE_CMD
struct CSW * PCSW
UCHAR PC
Definition: usbstor.h:194
UCHAR LogicalBlockByte2
Definition: usbstor.h:143
ULONG IrpPendingCount
Definition: usbstor.h:67
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
ULONG Signature
Definition: usbstor.h:127
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:107
NTSTATUS USBSTOR_ResetPipeWithHandle(IN PDEVICE_OBJECT DeviceObject, IN USBD_PIPE_HANDLE PipeHandle)
Definition: error.c:46
unsigned char BOOLEAN
ULONG ErrorIndex
Definition: usbstor.h:300
ULONG TimerWorkQueueEnabled
Definition: usbstor.h:72
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:54
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:70
UCHAR ContiguousLogicBlocksByte1
Definition: usbstor.h:147
NTSTATUS USBSTOR_FdoHandlePnp(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
Definition: fdo.c:277
USBSTOR_COMMON_DEVICE_EXTENSION Common
Definition: usbstor.h:81
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:299
SCSI_REQUEST_BLOCK SenseSrb
Definition: usbstor.h:308
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:61
_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:301
VOID USBSTOR_QueueRelease(IN PDEVICE_OBJECT DeviceObject)
Definition: queue.c:262
PUSB_STRING_DESCRIPTOR SerialNumber
Definition: usbstor.h:58
Definition: typedefs.h:117
struct UFI_CAPACITY_CMD * PUFI_CAPACITY_CMD
static UCHAR ItemSize[4]
Definition: parser.c:16
UCHAR LUN
Definition: usbstor.h:108
KEVENT NoPendingRequests
Definition: usbstor.h:69
UCHAR Code
Definition: usbstor.h:191
UCHAR PageCode
Definition: usbstor.h:193
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:74
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:144
PDEVICE_OBJECT LowerDeviceObject
Definition: usbstor.h:82
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:55
_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:560
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:89
KSPIN_LOCK IrpListLock
Definition: usbstor.h:65