24
24
#define USB_STATUS_SUCCESS 0x00000000
25
25
#define USB_STATUS_ERROR 0x80000000
27
#define FUNC_SELECT_CONFIGURATION 0x0000
28
#define FUNC_BULK_OR_INTERRUPT_TRANSFER 0x0009
29
#define FUNC_GET_DESCRIPTOR_FROM_DEVICE 0x000B
30
#define FUNC_VENDOR_DEVICE 0x0017
31
#define FUNC_VENDOR_INTERFACE 0x0018
32
#define FUNC_CLASS_INTERFACE 0x001B
33
#define FUNC_RESET_PIPE 0x001E
27
#define URB_FUNCTION_SELECT_CONFIGURATION 0x0000
28
#define URB_FUNCTION_SELECT_INTERFACE 0x0001
29
#define URB_FUNCTION_ABORT_PIPE 0x0002
30
#define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003
31
#define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004
32
#define URB_FUNCTION_GET_FRAME_LENGTH 0x0005
33
#define URB_FUNCTION_SET_FRAME_LENGTH 0x0006
34
#define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007
35
#define URB_FUNCTION_CONTROL_TRANSFER 0x0008
36
#define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009
37
#define URB_FUNCTION_ISOCH_TRANSFER 0x000A
38
#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B
39
#define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C
40
#define URB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D
41
#define URB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E
42
#define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F
43
#define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010
44
#define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011
45
#define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012
46
#define URB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013
47
#define URB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014
48
#define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015
49
#define URB_FUNCTION_RESERVED_0X0016 0x0016
50
#define URB_FUNCTION_VENDOR_DEVICE 0x0017
51
#define URB_FUNCTION_VENDOR_INTERFACE 0x0018
52
#define URB_FUNCTION_VENDOR_ENDPOINT 0x0019
53
#define URB_FUNCTION_CLASS_DEVICE 0x001A
54
#define URB_FUNCTION_CLASS_INTERFACE 0x001B
55
#define URB_FUNCTION_CLASS_ENDPOINT 0x001C
56
#define URB_FUNCTION_RESERVE_0X001D 0x001D
57
#define URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL 0x001E
58
#define URB_FUNCTION_CLASS_OTHER 0x001F
59
#define URB_FUNCTION_VENDOR_OTHER 0x0020
60
#define URB_FUNCTION_GET_STATUS_FROM_OTHER 0x0021
61
#define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER 0x0022
62
#define URB_FUNCTION_SET_FEATURE_TO_OTHER 0x0023
63
#define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT 0x0024
64
#define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT 0x0025
65
#define URB_FUNCTION_GET_CONFIGURATION 0x0026
66
#define URB_FUNCTION_GET_INTERFACE 0x0027
67
#define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028
68
#define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE 0x0029
69
#define URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR 0x002A
70
#define URB_FUNCTION_RESERVE_0X002B 0x002B
71
#define URB_FUNCTION_RESERVE_0X002C 0x002C
72
#define URB_FUNCTION_RESERVE_0X002D 0x002D
73
#define URB_FUNCTION_RESERVE_0X002E 0x002E
74
#define URB_FUNCTION_RESERVE_0X002F 0x002F
75
// USB 2.0 calls start at 0x0030
76
#define URB_FUNCTION_SYNC_RESET_PIPE 0x0030
77
#define URB_FUNCTION_SYNC_CLEAR_STALL 0x0031
35
79
#define USBD_TRANSFER_DIRECTION_IN 0x00000001
36
80
#define USBD_SHORT_TRANSFER_OK 0x00000002
38
82
union pipe_handle {
41
85
unsigned char endpointAddr;
42
86
unsigned char pipeType;
43
87
unsigned char interval;
81
125
unsigned long fill2;
84
struct packed select_configuration {
128
struct select_configuration {
85
129
struct nt_urb_header header;
86
130
struct usb_config_descriptor *config;
87
131
void *configHandle;
88
132
struct usbd_interface_information intf;
91
struct packed bulk_or_intr_transfer {
135
struct bulk_or_intr_transfer {
92
136
struct nt_urb_header header;
93
137
union pipe_handle pipeHandle;
94
138
unsigned long transferFlags;