More work on USB related definitions
[reactos.git] / include / ddk / usb.h
1
2
3 #ifndef __USB_H__
4 #define __USB_H__
5
6 /* Helper macro to enable gcc's extension. */
7 #ifndef __GNU_EXTENSION
8 #ifdef __GNUC__
9 #define __GNU_EXTENSION __extension__
10 #else
11 #define __GNU_EXTENSION
12 #endif
13 #endif
14
15 #ifdef __USBDI_H__
16 error
17 #endif
18
19 #ifdef OSR21_COMPAT
20 #pragma message("WARNING: OSR21_COMPAT SWITCH NOT SUPPORTED")
21 #endif
22
23 #ifndef _NTDDK_
24 #ifndef _WDMDDK_
25 typedef PVOID PIRP;
26 typedef PVOID PMDL;
27 #endif
28 #endif
29
30 #define USBDI_VERSION 0x00000500
31
32 #include "usb200.h"
33
34 typedef LONG USBD_STATUS;
35 typedef PVOID USBD_PIPE_HANDLE;
36 typedef PVOID USBD_CONFIGURATION_HANDLE;
37 typedef PVOID USBD_INTERFACE_HANDLE;
38
39 typedef enum _USB_CONTROLLER_FLAVOR
40 {
41 USB_HcGeneric = 0,
42 OHCI_Generic = 100,
43 OHCI_Hydra,
44 OHCI_NEC,
45 UHCI_Generic = 200,
46 UHCI_Piix4,
47 UHCI_Piix3,
48 UHCI_Ich2_1,
49 UHCI_Ich2_2,
50 UHCI_Ich1,
51 UHCI_VIA = 250,
52 EHCI_Generic = 1000,
53 EHCI_NEC = 2000,
54 EHCI_Lucent = 3000
55 } USB_CONTROLLER_FLAVOR;
56
57 typedef enum _USBD_PIPE_TYPE
58 {
59 UsbdPipeTypeControl,
60 UsbdPipeTypeIsochronous,
61 UsbdPipeTypeBulk,
62 UsbdPipeTypeInterrupt
63 } USBD_PIPE_TYPE;
64
65 typedef struct _USBD_VERSION_INFORMATION
66 {
67 ULONG USBDI_Version;
68 ULONG Supported_USB_Version;
69 } USBD_VERSION_INFORMATION, *PUSBD_VERSION_INFORMATION;
70
71 typedef struct _USBD_PIPE_INFORMATION
72 {
73 USHORT MaximumPacketSize;
74 UCHAR EndpointAddress;
75 UCHAR Interval;
76 USBD_PIPE_TYPE PipeType;
77 USBD_PIPE_HANDLE PipeHandle;
78 ULONG MaximumTransferSize;
79 ULONG PipeFlags;
80 } USBD_PIPE_INFORMATION, *PUSBD_PIPE_INFORMATION;
81
82 typedef struct _USBD_DEVICE_INFORMATION
83 {
84 ULONG OffsetNext;
85 PVOID UsbdDeviceHandle;
86 USB_DEVICE_DESCRIPTOR DeviceDescriptor;
87 } USBD_DEVICE_INFORMATION, *PUSBD_DEVICE_INFORMATION;
88
89 typedef struct _USBD_INTERFACE_INFORMATION
90 {
91 USHORT Length;
92 UCHAR InterfaceNumber;
93 UCHAR AlternateSetting;
94 UCHAR Class;
95 UCHAR SubClass;
96 UCHAR Protocol;
97 UCHAR Reserved;
98 USBD_INTERFACE_HANDLE InterfaceHandle;
99 ULONG NumberOfPipes;
100 USBD_PIPE_INFORMATION Pipes[1];
101 } USBD_INTERFACE_INFORMATION, *PUSBD_INTERFACE_INFORMATION;
102
103 struct _URB_HCD_AREA
104 {
105 PVOID Reserved8[8];
106 };
107
108 struct _URB_HEADER
109 {
110 USHORT Length;
111 USHORT Function;
112 USBD_STATUS Status;
113 PVOID UsbdDeviceHandle;
114 ULONG UsbdFlags;
115 };
116
117 struct _URB_SELECT_INTERFACE
118 {
119 struct _URB_HEADER Hdr;
120 USBD_CONFIGURATION_HANDLE ConfigurationHandle;
121 USBD_INTERFACE_INFORMATION Interface;
122 };
123
124 struct _URB_SELECT_CONFIGURATION
125 {
126 struct _URB_HEADER Hdr;
127 PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor;
128 USBD_CONFIGURATION_HANDLE ConfigurationHandle;
129 USBD_INTERFACE_INFORMATION Interface;
130 };
131
132 struct _URB_PIPE_REQUEST
133 {
134 struct _URB_HEADER Hdr;
135 USBD_PIPE_HANDLE PipeHandle;
136 ULONG Reserved;
137 };
138
139 struct _URB_FRAME_LENGTH_CONTROL
140 {
141 struct _URB_HEADER Hdr;
142 };
143
144 struct _URB_GET_FRAME_LENGTH
145 {
146 struct _URB_HEADER Hdr;
147 ULONG FrameLength;
148 ULONG FrameNumber;
149 };
150
151 struct _URB_SET_FRAME_LENGTH
152 {
153 struct _URB_HEADER Hdr;
154 LONG FrameLengthDelta;
155 };
156
157 struct _URB_GET_CURRENT_FRAME_NUMBER
158 {
159 struct _URB_HEADER Hdr;
160 ULONG FrameNumber;
161 };
162
163 struct _URB_CONTROL_DESCRIPTOR_REQUEST
164 {
165 struct _URB_HEADER Hdr;
166 PVOID Reserved;
167 ULONG Reserved0;
168 ULONG TransferBufferLength;
169 PVOID TransferBuffer;
170 PMDL TransferBufferMDL;
171 struct _URB *UrbLink;
172 struct _URB_HCD_AREA hca;
173 USHORT Reserved1;
174 UCHAR Index;
175 UCHAR DescriptorType;
176 USHORT LanguageId;
177 USHORT Reserved2;
178 };
179
180 struct _URB_CONTROL_GET_STATUS_REQUEST
181 {
182 struct _URB_HEADER Hdr;
183 PVOID Reserved;
184 ULONG Reserved0;
185 ULONG TransferBufferLength;
186 PVOID TransferBuffer;
187 PMDL TransferBufferMDL;
188 struct _URB *UrbLink;
189 struct _URB_HCD_AREA hca;
190 UCHAR Reserved1[4];
191 USHORT Index;
192 USHORT Reserved2;
193 };
194
195 struct _URB_CONTROL_FEATURE_REQUEST
196 {
197 struct _URB_HEADER Hdr;
198 PVOID Reserved;
199 ULONG Reserved2;
200 ULONG Reserved3;
201 PVOID Reserved4;
202 PMDL Reserved5;
203 struct _URB *UrbLink;
204 struct _URB_HCD_AREA hca;
205 USHORT Reserved0;
206 USHORT FeatureSelector;
207 USHORT Index;
208 USHORT Reserved1;
209 };
210
211 struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST
212 {
213 struct _URB_HEADER Hdr;
214 PVOID Reserved;
215 ULONG TransferFlags;
216 ULONG TransferBufferLength;
217 PVOID TransferBuffer;
218 PMDL TransferBufferMDL;
219 struct _URB *UrbLink;
220 struct _URB_HCD_AREA hca;
221 UCHAR RequestTypeReservedBits;
222 UCHAR Request;
223 USHORT Value;
224 USHORT Index;
225 USHORT Reserved1;
226 };
227
228 struct _URB_CONTROL_GET_INTERFACE_REQUEST
229 {
230 struct _URB_HEADER Hdr;
231 PVOID Reserved;
232 ULONG Reserved0;
233 ULONG TransferBufferLength;
234 PVOID TransferBuffer;
235 PMDL TransferBufferMDL;
236 struct _URB *UrbLink;
237 struct _URB_HCD_AREA hca;
238 UCHAR Reserved1[4];
239 USHORT Interface;
240 USHORT Reserved2;
241 };
242
243 struct _URB_CONTROL_GET_CONFIGURATION_REQUEST
244 {
245 struct _URB_HEADER Hdr;
246 PVOID Reserved;
247 ULONG Reserved0;
248 ULONG TransferBufferLength;
249 PVOID TransferBuffer;
250 PMDL TransferBufferMDL;
251 struct _URB *UrbLink;
252 struct _URB_HCD_AREA hca;
253 UCHAR Reserved1[8];
254 };
255
256 typedef struct _OS_STRING
257 {
258 UCHAR bLength;
259 UCHAR bDescriptorType;
260 WCHAR MicrosoftString[7];
261 UCHAR bVendorCode;
262 UCHAR bPad;
263 } OS_STRING, *POS_STRING;
264
265
266 struct _URB_OS_FEATURE_DESCRIPTOR_REQUEST
267 {
268 struct _URB_HEADER Hdr;
269 PVOID Reserved;
270 ULONG Reserved0;
271 ULONG TransferBufferLength;
272 PVOID TransferBuffer;
273 PMDL TransferBufferMDL;
274 struct _URB *UrbLink;
275 struct _URB_HCD_AREA hca;
276 UCHAR Recipient:5;
277 UCHAR Reserved1:3;
278 UCHAR Reserved2;
279 UCHAR InterfaceNumber;
280 UCHAR MS_PageIndex;
281 USHORT MS_FeatureDescriptorIndex;
282 USHORT Reserved3;
283 };
284
285 struct _URB_CONTROL_TRANSFER
286 {
287 struct _URB_HEADER Hdr;
288 USBD_PIPE_HANDLE PipeHandle;
289 ULONG TransferFlags;
290 ULONG TransferBufferLength;
291 PVOID TransferBuffer;
292 PMDL TransferBufferMDL;
293 struct _URB *UrbLink;
294 struct _URB_HCD_AREA hca;
295 UCHAR SetupPacket[8];
296 };
297
298 struct _URB_BULK_OR_INTERRUPT_TRANSFER
299 {
300 struct _URB_HEADER Hdr;
301 USBD_PIPE_HANDLE PipeHandle;
302 ULONG TransferFlags;
303 ULONG TransferBufferLength;
304 PVOID TransferBuffer;
305 PMDL TransferBufferMDL;
306 struct _URB *UrbLink;
307 struct _URB_HCD_AREA hca;
308 };
309
310 typedef struct _USBD_ISO_PACKET_DESCRIPTOR
311 {
312 ULONG Offset;
313 ULONG Length;
314 USBD_STATUS Status;
315 } USBD_ISO_PACKET_DESCRIPTOR, *PUSBD_ISO_PACKET_DESCRIPTOR;
316
317 struct _URB_ISOCH_TRANSFER
318 {
319 struct _URB_HEADER Hdr;
320 USBD_PIPE_HANDLE PipeHandle;
321 ULONG TransferFlags;
322 ULONG TransferBufferLength;
323 PVOID TransferBuffer;
324 PMDL TransferBufferMDL;
325 struct _URB *UrbLink;
326 struct _URB_HCD_AREA hca;
327 ULONG StartFrame;
328 ULONG NumberOfPackets;
329 ULONG ErrorCount;
330 USBD_ISO_PACKET_DESCRIPTOR IsoPacket[1];
331 };
332
333 typedef struct _URB
334 {
335 __GNU_EXTENSION union
336 {
337 struct _URB_HEADER
338 UrbHeader;
339 struct _URB_SELECT_INTERFACE
340 UrbSelectInterface;
341 struct _URB_SELECT_CONFIGURATION
342 UrbSelectConfiguration;
343 struct _URB_PIPE_REQUEST
344 UrbPipeRequest;
345 struct _URB_FRAME_LENGTH_CONTROL
346 UrbFrameLengthControl;
347 struct _URB_GET_FRAME_LENGTH
348 UrbGetFrameLength;
349 struct _URB_SET_FRAME_LENGTH
350 UrbSetFrameLength;
351 struct _URB_GET_CURRENT_FRAME_NUMBER
352 UrbGetCurrentFrameNumber;
353 struct _URB_CONTROL_TRANSFER
354 UrbControlTransfer;
355 struct _URB_BULK_OR_INTERRUPT_TRANSFER
356 UrbBulkOrInterruptTransfer;
357 struct _URB_ISOCH_TRANSFER
358 UrbIsochronousTransfer;
359 struct _URB_CONTROL_DESCRIPTOR_REQUEST
360 UrbControlDescriptorRequest;
361 struct _URB_CONTROL_GET_STATUS_REQUEST
362 UrbControlGetStatusRequest;
363 struct _URB_CONTROL_FEATURE_REQUEST
364 UrbControlFeatureRequest;
365 struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST
366 UrbControlVendorClassRequest;
367 struct _URB_CONTROL_GET_INTERFACE_REQUEST
368 UrbControlGetInterfaceRequest;
369 struct _URB_CONTROL_GET_CONFIGURATION_REQUEST
370 UrbControlGetConfigurationRequest;
371 struct _URB_OS_FEATURE_DESCRIPTOR_REQUEST
372 UrbOSFeatureDescriptorRequest;
373 };
374 } URB, *PURB;
375
376 #define USB_PORTATTR_NO_CONNECTOR 0x00000001
377 #define USB_PORTATTR_SHARED_USB2 0x00000002
378 #define USB_PORTATTR_MINI_CONNECTOR 0x00000004
379 #define USB_PORTATTR_OEM_CONNECTOR 0x00000008
380 #define USB_PORTATTR_OWNED_BY_CC 0x01000000
381 #define USB_PORTATTR_NO_OVERCURRENT_UI 0x02000000
382 #define USB_DEFAULT_DEVICE_ADDRESS 0
383 #define USB_DEFAULT_ENDPOINT_ADDRESS 0
384 #define USB_DEFAULT_MAX_PACKET 64
385 #define URB_FROM_IRP(Irp) ((IoGetCurrentIrpStackLocation(Irp))->Parameters.Others.Argument1)
386 #define URB_FUNCTION_SELECT_CONFIGURATION 0x0000
387 #define URB_FUNCTION_SELECT_INTERFACE 0x0001
388 #define URB_FUNCTION_ABORT_PIPE 0x0002
389 #define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003
390 #define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004
391 #define URB_FUNCTION_GET_FRAME_LENGTH 0x0005
392 #define URB_FUNCTION_SET_FRAME_LENGTH 0x0006
393 #define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007
394 #define URB_FUNCTION_CONTROL_TRANSFER 0x0008
395 #define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009
396 #define URB_FUNCTION_ISOCH_TRANSFER 0x000A
397 #define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B
398 #define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C
399 #define URB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D
400 #define URB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E
401 #define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F
402 #define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010
403 #define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011
404 #define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012
405 #define URB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013
406 #define URB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014
407 #define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015
408 #define URB_FUNCTION_RESERVED_0X0016 0x0016
409 #define URB_FUNCTION_VENDOR_DEVICE 0x0017
410 #define URB_FUNCTION_VENDOR_INTERFACE 0x0018
411 #define URB_FUNCTION_VENDOR_ENDPOINT 0x0019
412 #define URB_FUNCTION_CLASS_DEVICE 0x001A
413 #define URB_FUNCTION_CLASS_INTERFACE 0x001B
414 #define URB_FUNCTION_CLASS_ENDPOINT 0x001C
415 #define URB_FUNCTION_RESERVE_0X001D 0x001D
416 #define URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL 0x001E
417 #define URB_FUNCTION_CLASS_OTHER 0x001F
418 #define URB_FUNCTION_VENDOR_OTHER 0x0020
419 #define URB_FUNCTION_GET_STATUS_FROM_OTHER 0x0021
420 #define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER 0x0022
421 #define URB_FUNCTION_SET_FEATURE_TO_OTHER 0x0023
422 #define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT 0x0024
423 #define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT 0x0025
424 #define URB_FUNCTION_GET_CONFIGURATION 0x0026
425 #define URB_FUNCTION_GET_INTERFACE 0x0027
426 #define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028
427 #define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE 0x0029
428 #define URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR 0x002A
429 #define URB_FUNCTION_RESERVE_0X002B 0x002B
430 #define URB_FUNCTION_RESERVE_0X002C 0x002C
431 #define URB_FUNCTION_RESERVE_0X002D 0x002D
432 #define URB_FUNCTION_RESERVE_0X002E 0x002E
433 #define URB_FUNCTION_RESERVE_0X002F 0x002F
434 #define URB_FUNCTION_SYNC_RESET_PIPE 0x0030
435 #define URB_FUNCTION_SYNC_CLEAR_STALL 0x0031
436 #define URB_FUNCTION_RESET_PIPE URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL
437 #define USBD_TRANSFER_DIRECTION 0x00000001
438 #define USBD_SHORT_TRANSFER_OK 0x00000002
439 #define USBD_START_ISO_TRANSFER_ASAP 0x00000004
440 #define USBD_DEFAULT_PIPE_TRANSFER 0x00000008
441 #define USBD_TRANSFER_DIRECTION_FLAG(flags) ((flags) & USBD_TRANSFER_DIRECTION)
442
443 #define USBD_TRANSFER_DIRECTION_OUT 0
444 #define USBD_TRANSFER_DIRECTION_IN 1
445 #define VALID_TRANSFER_FLAGS_MASK (USBD_SHORT_TRANSFER_OK | USBD_TRANSFER_DIRECTION | \
446 USBD_START_ISO_TRANSFER_ASAP | USBD_DEFAULT_PIPE_TRANSFER)
447 #define USBD_ISO_START_FRAME_RANGE 1024
448 #define USBD_SUCCESS(Status) ((USBD_STATUS)(Status) >= 0)
449 #define USBD_PENDING(Status) ((ULONG)(Status) >> 30 == 1)
450 #define USBD_ERROR(Status) ((USBD_STATUS)(Status) < 0)
451 #define USBD_STATUS_SUCCESS ((USBD_STATUS)0x00000000L)
452 #define USBD_STATUS_PENDING ((USBD_STATUS)0x40000000L)
453 #define USBD_STATUS_CRC ((USBD_STATUS)0xC0000001L)
454 #define USBD_STATUS_BTSTUFF ((USBD_STATUS)0xC0000002L)
455 #define USBD_STATUS_DATA_TOGGLE_MISMATCH ((USBD_STATUS)0xC0000003L)
456 #define USBD_STATUS_STALL_PID ((USBD_STATUS)0xC0000004L)
457 #define USBD_STATUS_DEV_NOT_RESPONDING ((USBD_STATUS)0xC0000005L)
458 #define USBD_STATUS_PID_CHECK_FAILURE ((USBD_STATUS)0xC0000006L)
459 #define USBD_STATUS_UNEXPECTED_PID ((USBD_STATUS)0xC0000007L)
460 #define USBD_STATUS_DATA_OVERRUN ((USBD_STATUS)0xC0000008L)
461 #define USBD_STATUS_DATA_UNDERRUN ((USBD_STATUS)0xC0000009L)
462 #define USBD_STATUS_RESERVED1 ((USBD_STATUS)0xC000000AL)
463 #define USBD_STATUS_RESERVED2 ((USBD_STATUS)0xC000000BL)
464 #define USBD_STATUS_BUFFER_OVERRUN ((USBD_STATUS)0xC000000CL)
465 #define USBD_STATUS_BUFFER_UNDERRUN ((USBD_STATUS)0xC000000DL)
466 #define USBD_STATUS_NOT_ACCESSED ((USBD_STATUS)0xC000000FL)
467 #define USBD_STATUS_FIFO ((USBD_STATUS)0xC0000010L)
468 #define USBD_STATUS_XACT_ERROR ((USBD_STATUS)0xC0000011L)
469 #define USBD_STATUS_BABBLE_DETECTED ((USBD_STATUS)0xC0000012L)
470 #define USBD_STATUS_DATA_BUFFER_ERROR ((USBD_STATUS)0xC0000013L)
471 #define USBD_STATUS_ENDPOINT_HALTED ((USBD_STATUS)0xC0000030L)
472 #define USBD_STATUS_INVALID_URB_FUNCTION ((USBD_STATUS)0x80000200L)
473 #define USBD_STATUS_INVALID_PARAMETER ((USBD_STATUS)0x80000300L)
474 #define USBD_STATUS_ERROR_BUSY ((USBD_STATUS)0x80000400L)
475 #define USBD_STATUS_INVALID_PIPE_HANDLE ((USBD_STATUS)0x80000600L)
476 #define USBD_STATUS_NO_BANDWIDTH ((USBD_STATUS)0x80000700L)
477 #define USBD_STATUS_INTERNAL_HC_ERROR ((USBD_STATUS)0x80000800L)
478 #define USBD_STATUS_ERROR_SHORT_TRANSFER ((USBD_STATUS)0x80000900L)
479 #define USBD_STATUS_BAD_START_FRAME ((USBD_STATUS)0xC0000A00L)
480 #define USBD_STATUS_ISOCH_REQUEST_FAILED ((USBD_STATUS)0xC0000B00L)
481 #define USBD_STATUS_FRAME_CONTROL_OWNED ((USBD_STATUS)0xC0000C00L)
482 #define USBD_STATUS_FRAME_CONTROL_NOT_OWNED ((USBD_STATUS)0xC0000D00L)
483 #define USBD_STATUS_NOT_SUPPORTED ((USBD_STATUS)0xC0000E00L)
484 #define USBD_STATUS_INAVLID_CONFIGURATION_DESCRIPTOR ((USBD_STATUS)0xC0000F00L)
485 #define USBD_STATUS_INSUFFICIENT_RESOURCES ((USBD_STATUS)0xC0001000L)
486 #define USBD_STATUS_SET_CONFIG_FAILED ((USBD_STATUS)0xC0002000L)
487 #define USBD_STATUS_BUFFER_TOO_SMALL ((USBD_STATUS)0xC0003000L)
488 #define USBD_STATUS_INTERFACE_NOT_FOUND ((USBD_STATUS)0xC0004000L)
489 #define USBD_STATUS_INAVLID_PIPE_FLAGS ((USBD_STATUS)0xC0005000L)
490 #define USBD_STATUS_TIMEOUT ((USBD_STATUS)0xC0006000L)
491 #define USBD_STATUS_DEVICE_GONE ((USBD_STATUS)0xC0007000L)
492 #define USBD_STATUS_STATUS_NOT_MAPPED ((USBD_STATUS)0xC0008000L)
493 #define USBD_STATUS_CANCELED ((USBD_STATUS)0xC0010000L)
494 #define USBD_STATUS_ISO_NOT_ACCESSED_BY_HW ((USBD_STATUS)0xC0020000L)
495 #define USBD_STATUS_ISO_TD_ERROR ((USBD_STATUS)0xC0030000L)
496 #define USBD_STATUS_ISO_NA_LATE_USBPORT ((USBD_STATUS)0xC0040000L)
497 #define USBD_STATUS_ISO_NOT_ACCESSED_LATE ((USBD_STATUS)0xC0050000L)
498 #define USBD_DEFAULT_MAXIMUM_TRANSFER_SIZE 0xFFFFFFFF
499 #define USBD_PF_CHANGE_MAX_PACKET 0x00000001
500 #define USBD_PF_SHORT_PACKET_OPT 0x00000002
501 #define USBD_PF_ENABLE_RT_THREAD_ACCESS 0x00000004
502 #define USBD_PF_MAP_ADD_TRANSFERS 0x00000008
503 #define USBD_PF_VALID_MASK (USBD_PF_CHANGE_MAX_PACKET | USBD_PF_SHORT_PACKET_OPT | \
504 USBD_PF_ENABLE_RT_THREAD_ACCESS | USBD_PF_MAP_ADD_TRANSFERS)
505 #define OS_STRING_DESCRIPTOR_INDEX 0xEE
506 #define MS_GENRE_DESCRIPTOR_INDEX 0x0001
507 #define MS_POWER_DESCRIPTOR_INDEX 0x0002
508 #define MS_OS_STRING_SIGNATURE L"MSFT100"
509 #define USBD_PIPE_DIRECTION_IN(pipeInformation) ((pipeInformation)->EndpointAddress & USB_ENDPOINT_DIRECTION_MASK)
510
511 #endif /* __USB_H */