ReactOS  0.4.15-dev-2720-g5ee0925
umusb.h
Go to the documentation of this file.
1 //
2 // Copyright (C) Microsoft. All rights reserved.
3 //
4 #pragma once
5 
6 #include <WinUsb.h>
7 
8 #define UMURB_FUNCTION_SELECT_CONFIGURATION 0x0000
9 #define UMURB_FUNCTION_SELECT_INTERFACE 0x0001
10 #define UMURB_FUNCTION_ABORT_PIPE 0x0002
11 #define UMURB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003
12 #define UMURB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004
13 #define UMURB_FUNCTION_GET_FRAME_LENGTH 0x0005
14 #define UMURB_FUNCTION_SET_FRAME_LENGTH 0x0006
15 #define UMURB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007
16 #define UMURB_FUNCTION_CONTROL_TRANSFER 0x0008
17 #define UMURB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009
18 #define UMURB_FUNCTION_ISOCH_TRANSFER 0x000A
19 #define UMURB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B
20 #define UMURB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C
21 #define UMURB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D
22 #define UMURB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E
23 #define UMURB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F
24 #define UMURB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010
25 #define UMURB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011
26 #define UMURB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012
27 #define UMURB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013
28 #define UMURB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014
29 #define UMURB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015
30 #define UMURB_FUNCTION_RESERVED_0X0016 0x0016
31 #define UMURB_FUNCTION_VENDOR_DEVICE 0x0017
32 #define UMURB_FUNCTION_VENDOR_INTERFACE 0x0018
33 #define UMURB_FUNCTION_VENDOR_ENDPOINT 0x0019
34 #define UMURB_FUNCTION_CLASS_DEVICE 0x001A
35 #define UMURB_FUNCTION_CLASS_INTERFACE 0x001B
36 #define UMURB_FUNCTION_CLASS_ENDPOINT 0x001C
37 #define UMURB_FUNCTION_RESERVE_0X001D 0x001D
38 #define UMURB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL 0x001E
39 #define UMURB_FUNCTION_GET_INTERFACE 0x0027
40 #define UMURB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028
41 #define UMURB_FUNCTION_RESET_PORT 0x0029
42 
43 //
44 //These are specific to user-mode (WinUsb) and have no km counterpart
45 //
46 #define UMURB_FUNCTION_QUERY_PIPE 0x0101 //in km this is done as a part of Interface info
47 #define UMURB_FUNCTION_SET_PIPE_POLICY 0x0102
48 #define UMURB_FUNCTION_GET_PIPE_POLICY 0x0103
49 #define UMURB_FUNCTION_SET_INTERFACE_POWER_POLICY 0x0104
50 #define UMURB_FUNCTION_GET_INTERFACE_POWER_POLICY 0x0105
51 #define UMURB_FUNCTION_ENABLE_INTERFACE_IDLE 0x0106
52 #define UMURB_FUNCTION_DISABLE_INTERFACE_IDLE 0x0107
53 #define UMURB_FUNCTION_FLUSH_PIPE 0x0108
54 #define UMURB_FUNCTION_GET_ASSOCIATED_INTERFACE 0x0109
55 #define UMURB_FUNCTION_GET_DEVICE_INFORMATION 0x010A
56 #define UMURB_FUNCTION_GET_DESCRIPTOR 0x010B //WinUsb has a common function for all descriptors
57 #define UMURB_FUNCTION_RELEASE_ASSOCIATED_INTERFACE 0x010C
58 
60 {
61  //
62  // Fields filled in by client driver
63  //
66  IN WINUSB_INTERFACE_HANDLE InterfaceHandle;
67 
68  OUT DWORD Status; //obtained using GetLastError();
69 };
70 
72 
74  struct _UMURB_HEADER Hdr; // function code indicates get or set.
77 };
78 
80  struct _UMURB_HEADER Hdr; // function code indicates get or set.
82 };
83 
85  struct _UMURB_HEADER Hdr; // function code indicates get or set.
86  IN UCHAR Reserved; //maybe use for PipeID
89  IN WINUSB_SETUP_PACKET SetupPacket;
90 };
91 
93  struct _UMURB_HEADER Hdr; // function code indicates get or set.
95  IN BOOL InPipe; //in km this is determined based on the pipe,
96  //but WinUsb has two different functions
97  //since host can't store pipe type and it would be expensive to discover it
98  //with every transfer, it is better if direction is sent in as a parameter
101 };
102 
104  struct _UMURB_HEADER Hdr; // function code indicates get or set.
113 };
114 
116 {
122 };
123 
125 {
130 };
131 
133 {
137  OUT WINUSB_PIPE_INFORMATION PipeInformation;
138 };
139 
141  struct _UMURB_HEADER Hdr; // function code indicates get or set.
143 };
144 
148  OUT WINUSB_INTERFACE_HANDLE InterfaceHandle;
149 };
150 
155 };
156 
162 };
163 
171 };
172 
173 typedef struct _UMURB {
174  union {
176  UmUrbHeader;
177 
180 
181 
182 
183 
184 
185 
188 
189 
190 
191 
192 
193 
194 
195 
196 
197 
198 
199 
202 
205 
206  // for standard control transfers on the default pipe
209 
210 
211 
212 
213 
214 
215 
216 
217 
218 
221 
222 
223 
224 
225 
226 
227 
228 
229 
230 
231 
232 
247  };
248 } UMURB, *PUMURB;
249 
250 
251 #define FILE_DEVICE_UMDF ((ULONG)(0x8002))
252 
253 //
254 // Device IO Control
255 //
256 #define UMDF_IOCTL_CODE(id) \
257  CTL_CODE(FILE_DEVICE_UMDF, (id), METHOD_BUFFERED, FILE_READ_ACCESS|FILE_WRITE_ACCESS)
258 
259 #define IOCTL_INETRNAL_USB_SUBMIT_UMURB UMDF_IOCTL_CODE(0x100)
260 
IN ULONG Reserved
Definition: umusb.h:76
#define IN
Definition: typedefs.h:39
struct _UMURB_CONTROL_TRANSFER UmUrbControlTransfer
Definition: umusb.h:200
struct _UMURB_PIPE_REQUEST UmUrbPipeRequest
Definition: umusb.h:186
IN UCHAR PipeID
Definition: umusb.h:75
struct _UMURB_HEADER Hdr
Definition: umusb.h:104
struct _UMURB_HEADER UmUrbHeader
Definition: umusb.h:175
IN OUT PVOID TransferBuffer
Definition: umusb.h:87
IN OUT ULONG TransferBufferLength
Definition: umusb.h:99
struct _UMURB_CONTROL_GET_INTERFACE_REQUEST UmUrbControlGetInterfaceRequest
Definition: umusb.h:219
IN struct _UMURB_HEADER Hdr
Definition: umusb.h:146
IN struct _UMURB_HEADER Hdr
Definition: umusb.h:152
IN OUT ULONG TransferBufferLength
Definition: umusb.h:107
Definition: umusb.h:173
IN OUT ULONG TransferBufferLength
Definition: umusb.h:88
IN ULONG InformationType
Definition: umusb.h:159
struct _UMURB_HEADER Hdr
Definition: umusb.h:85
unsigned int BOOL
Definition: ntddk_ex.h:94
IN UCHAR Reserved
Definition: umusb.h:86
IN WINUSB_SETUP_PACKET SetupPacket
Definition: umusb.h:89
OUT WINUSB_PIPE_INFORMATION PipeInformation
Definition: umusb.h:137
_UMURB_HEADER * PUMURB_HEADER
Definition: umusb.h:71
OUT WINUSB_INTERFACE_HANDLE InterfaceHandle
Definition: umusb.h:148
struct _UMURB_HEADER Hdr
Definition: umusb.h:74
IN OUT ULONG BufferLength
Definition: umusb.h:169
IN UCHAR AlternateSetting
Definition: umusb.h:135
struct _UMURB_HEADER Hdr
Definition: umusb.h:93
IN WINUSB_INTERFACE_HANDLE InterfaceHandle
Definition: umusb.h:66
IN UCHAR PipeID
Definition: umusb.h:136
IN UCHAR AlternateSetting
Definition: umusb.h:81
IN OUT ULONG BufferLength
Definition: umusb.h:160
unsigned long DWORD
Definition: ntddk_ex.h:95
IN struct _UMURB_HEADER Hdr
Definition: umusb.h:158
struct _UMURB_BULK_OR_INTERRUPT_TRANSFER UmUrbBulkOrInterruptTransfer
Definition: umusb.h:203
struct _UMURB_PIPE_POLICY_REQUEST UmUrbPipePolicyRequest
Definition: umusb.h:235
struct _UMURB_DESCRIPTOR_REQUEST UmUrbDescriptorRequest
Definition: umusb.h:245
OUT DWORD Status
Definition: umusb.h:68
unsigned char UCHAR
Definition: xmlstorage.h:181
IN OUT ULONG ValueLength
Definition: umusb.h:120
IN OUT PVOID Value
Definition: umusb.h:121
IN struct _UMURB_HEADER Hdr
Definition: umusb.h:165
struct _UMURB_INTERFACE_INFORMATION UmUrbInterfaceInformation
Definition: umusb.h:241
OUT USB_INTERFACE_DESCRIPTOR UsbInterfaceDescriptor
Definition: umusb.h:154
struct _UMURB_GET_ASSOCIATED_INTERFACE UmUrbGetAssociatedInterface
Definition: umusb.h:239
IN UCHAR DescriptorType
Definition: umusb.h:166
struct _UMURB * PUMURB
unsigned short USHORT
Definition: pedump.c:61
IN USHORT Length
Definition: umusb.h:64
struct _UMURB_HEADER Hdr
Definition: umusb.h:126
struct _UMURB UMURB
struct _UMURB_DEVICE_INFORMATION UmUrbDeviceInformation
Definition: umusb.h:243
struct _UMURB_QUERY_PIPE UmUrbQueryPipe
Definition: umusb.h:237
#define OUT
Definition: typedefs.h:40
unsigned int ULONG
Definition: retypes.h:1
struct _UMURB_INTERFACE_POLICY_REQUEST UmUrbInterfacePolicyRequest
Definition: umusb.h:233
struct _UMURB_HEADER Hdr
Definition: umusb.h:134
struct _UMURB_SELECT_INTERFACE UmUrbSelectInterface
Definition: umusb.h:178
struct _UMURB_CONTROL_DESCRIPTOR_REQUEST UmUrbControlDescriptorRequest
Definition: umusb.h:207
IN USHORT LanguageID
Definition: umusb.h:168
struct _UMURB_HEADER Hdr
Definition: umusb.h:141
struct _UMURB_HEADER Hdr
Definition: umusb.h:117
IN USHORT Function
Definition: umusb.h:65
struct _UMURB_HEADER Hdr
Definition: umusb.h:80