2 * Copyright (C) the Wine project
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include <ddk/usb200.h>
24 #define URB_FUNCTION_SELECT_CONFIGURATION 0x0000
25 #define URB_FUNCTION_SELECT_INTERFACE 0x0001
26 #define URB_FUNCTION_ABORT_PIPE 0x0002
27 #define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003
28 #define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004
29 #define URB_FUNCTION_GET_FRAME_LENGTH 0x0005
30 #define URB_FUNCTION_SET_FRAME_LENGTH 0x0006
31 #define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007
32 #define URB_FUNCTION_CONTROL_TRANSFER 0x0008
33 #define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009
34 #define URB_FUNCTION_ISOCH_TRANSFER 0x000A
35 #define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B
36 #define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C
37 #define URB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D
38 #define URB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E
39 #define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F
40 #define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010
41 #define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011
42 #define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012
43 #define URB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013
44 #define URB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014
45 #define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015
46 #define URB_FUNCTION_RESERVED_0X0016 0x0016
47 #define URB_FUNCTION_VENDOR_DEVICE 0x0017
48 #define URB_FUNCTION_VENDOR_INTERFACE 0x0018
49 #define URB_FUNCTION_VENDOR_ENDPOINT 0x0019
50 #define URB_FUNCTION_CLASS_DEVICE 0x001A
51 #define URB_FUNCTION_CLASS_INTERFACE 0x001B
52 #define URB_FUNCTION_CLASS_ENDPOINT 0x001C
53 #define URB_FUNCTION_RESERVE_0X001D 0x001D
54 #define URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL 0x001E
55 #define URB_FUNCTION_CLASS_OTHER 0x001F
56 #define URB_FUNCTION_VENDOR_OTHER 0x0020
57 #define URB_FUNCTION_GET_STATUS_FROM_OTHER 0x0021
58 #define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER 0x0022
59 #define URB_FUNCTION_SET_FEATURE_TO_OTHER 0x0023
60 #define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT 0x0024
61 #define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT 0x0025
62 #define URB_FUNCTION_GET_CONFIGURATION 0x0026
63 #define URB_FUNCTION_GET_INTERFACE 0x0027
64 #define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028
65 #define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE 0x0029
66 #define URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR 0x002A
67 #define URB_FUNCTION_RESERVE_0X002B 0x002B
68 #define URB_FUNCTION_RESERVE_0X002C 0x002C
69 #define URB_FUNCTION_RESERVE_0X002D 0x002D
70 #define URB_FUNCTION_RESERVE_0X002E 0x002E
71 #define URB_FUNCTION_RESERVE_0X002F 0x002F
72 #define URB_FUNCTION_SYNC_RESET_PIPE 0x0030
73 #define URB_FUNCTION_SYNC_CLEAR_STALL 0x0031
75 #define USBD_SHORT_TRANSFER_OK 0x00000002
76 #define USBD_TRANSFER_DIRECTION_OUT 0
77 #define USBD_TRANSFER_DIRECTION_IN 1
79 typedef LONG USBD_STATUS
;
81 typedef PVOID USBD_PIPE_HANDLE
;
82 typedef PVOID USBD_CONFIGURATION_HANDLE
;
83 typedef PVOID USBD_INTERFACE_HANDLE
;
85 typedef enum _USBD_PIPE_TYPE
{
87 UsbdPipeTypeIsochronous
,
92 typedef struct _USBD_PIPE_INFORMATION
{
93 USHORT MaximumPacketSize
;
94 UCHAR EndpointAddress
;
96 USBD_PIPE_TYPE PipeType
;
97 USBD_PIPE_HANDLE PipeHandle
;
98 ULONG MaximumTransferSize
;
100 } USBD_PIPE_INFORMATION
;
101 typedef struct _USBD_PIPE_INFORMATION
*PUSBD_PIPE_INFORMATION
;
103 typedef struct _USBD_INTERFACE_INFORMATION
{
105 UCHAR InterfaceNumber
;
106 UCHAR AlternateSetting
;
111 USBD_INTERFACE_HANDLE InterfaceHandle
;
113 USBD_PIPE_INFORMATION Pipes
[1];
114 } USBD_INTERFACE_INFORMATION
;
115 typedef struct _USBD_INTERFACE_INFORMATION
*PUSBD_INTERFACE_INFORMATION
;
117 typedef struct _USBD_ISO_PACKET_DESCRIPTOR
{
121 } USBD_ISO_PACKET_DESCRIPTOR
;
122 typedef struct _USBD_ISO_PACKET_DESCRIPTOR
*PUSBD_ISO_PACKET_DESCRIPTOR
;
124 struct _URB_HCD_AREA
{
132 PVOID UsbdDeviceHandle
;
136 struct _URB_SELECT_INTERFACE
{
137 struct _URB_HEADER Hdr
;
138 USBD_CONFIGURATION_HANDLE ConfigurationHandle
;
139 USBD_INTERFACE_INFORMATION Interface
;
142 struct _URB_SELECT_CONFIGURATION
{
143 struct _URB_HEADER Hdr
;
144 PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
;
145 USBD_CONFIGURATION_HANDLE ConfigurationHandle
;
146 USBD_INTERFACE_INFORMATION Interface
;
149 struct _URB_PIPE_REQUEST
{
150 struct _URB_HEADER Hdr
;
151 USBD_PIPE_HANDLE PipeHandle
;
155 struct _URB_FRAME_LENGTH_CONTROL
{
156 struct _URB_HEADER Hdr
;
159 struct _URB_GET_FRAME_LENGTH
{
160 struct _URB_HEADER Hdr
;
165 struct _URB_SET_FRAME_LENGTH
{
166 struct _URB_HEADER Hdr
;
167 LONG FrameLengthDelta
;
170 struct _URB_GET_CURRENT_FRAME_NUMBER
{
171 struct _URB_HEADER Hdr
;
175 struct _URB_CONTROL_TRANSFER
{
176 struct _URB_HEADER Hdr
;
177 USBD_PIPE_HANDLE PipeHandle
;
179 ULONG TransferBufferLength
;
180 PVOID TransferBuffer
;
181 PMDL TransferBufferMDL
;
182 struct _URB
*UrbLink
;
183 struct _URB_HCD_AREA hca
;
184 UCHAR SetupPacket
[8];
187 struct _URB_BULK_OR_INTERRUPT_TRANSFER
{
188 struct _URB_HEADER Hdr
;
189 USBD_PIPE_HANDLE PipeHandle
;
191 ULONG TransferBufferLength
;
192 PVOID TransferBuffer
;
193 PMDL TransferBufferMDL
;
194 struct _URB
*UrbLink
;
195 struct _URB_HCD_AREA hca
;
198 struct _URB_ISOCH_TRANSFER
{
199 struct _URB_HEADER Hdr
;
200 USBD_PIPE_HANDLE PipeHandle
;
202 ULONG TransferBufferLength
;
203 PVOID TransferBuffer
;
204 PMDL TransferBufferMDL
;
205 struct _URB
*UrbLink
;
206 struct _URB_HCD_AREA hca
;
208 ULONG NumberOfPackets
;
210 USBD_ISO_PACKET_DESCRIPTOR IsoPacket
[1];
213 struct _URB_CONTROL_DESCRIPTOR_REQUEST
{
214 struct _URB_HEADER Hdr
;
217 ULONG TransferBufferLength
;
218 PVOID TransferBuffer
;
219 PMDL TransferBufferMDL
;
220 struct _URB
*UrbLink
;
221 struct _URB_HCD_AREA hca
;
224 UCHAR DescriptorType
;
229 struct _URB_CONTROL_GET_STATUS_REQUEST
{
230 struct _URB_HEADER Hdr
;
233 ULONG TransferBufferLength
;
234 PVOID TransferBuffer
;
235 PMDL TransferBufferMDL
;
236 struct _URB
*UrbLink
;
237 struct _URB_HCD_AREA hca
;
243 struct _URB_CONTROL_FEATURE_REQUEST
{
244 struct _URB_HEADER Hdr
;
250 struct _URB
*UrbLink
;
251 struct _URB_HCD_AREA hca
;
253 USHORT FeatureSelector
;
258 struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST
{
259 struct _URB_HEADER Hdr
;
262 ULONG TransferBufferLength
;
263 PVOID TransferBuffer
;
264 PMDL TransferBufferMDL
;
265 struct _URB
*UrbLink
;
266 struct _URB_HCD_AREA hca
;
267 UCHAR RequestTypeReservedBits
;
274 struct _URB_CONTROL_GET_INTERFACE_REQUEST
{
275 struct _URB_HEADER Hdr
;
278 ULONG TransferBufferLength
;
279 PVOID TransferBuffer
;
280 PMDL TransferBufferMDL
;
281 struct _URB
*UrbLink
;
282 struct _URB_HCD_AREA hca
;
288 struct _URB_CONTROL_GET_CONFIGURATION_REQUEST
{
289 struct _URB_HEADER Hdr
;
292 ULONG TransferBufferLength
;
293 PVOID TransferBuffer
;
294 PMDL TransferBufferMDL
;
295 struct _URB
*UrbLink
;
296 struct _URB_HCD_AREA hca
;
300 struct _URB_OS_FEATURE_DESCRIPTOR_REQUEST
{
301 struct _URB_HEADER Hdr
;
304 ULONG TransferBufferLength
;
305 PVOID TransferBuffer
;
306 PMDL TransferBufferMDL
;
307 struct _URB
*UrbLink
;
308 struct _URB_HCD_AREA hca
;
312 UCHAR InterfaceNumber
;
314 USHORT MS_FeatureDescriptorIndex
;
318 typedef struct _URB
{
320 struct _URB_HEADER UrbHeader
;
321 struct _URB_SELECT_INTERFACE UrbSelectInterface
;
322 struct _URB_SELECT_CONFIGURATION UrbSelectConfiguration
;
323 struct _URB_PIPE_REQUEST UrbPipeRequest
;
324 struct _URB_FRAME_LENGTH_CONTROL UrbFrameLengthControl
;
325 struct _URB_GET_FRAME_LENGTH UrbGetFrameLength
;
326 struct _URB_SET_FRAME_LENGTH UrbSetFrameLength
;
327 struct _URB_GET_CURRENT_FRAME_NUMBER UrbGetCurrentFrameNumber
;
328 struct _URB_CONTROL_TRANSFER UrbControlTransfer
;
329 struct _URB_BULK_OR_INTERRUPT_TRANSFER UrbBulkOrInterruptTransfer
;
330 struct _URB_ISOCH_TRANSFER UrbIsochronousTransfer
;
331 struct _URB_CONTROL_DESCRIPTOR_REQUEST UrbControlDescriptorRequest
;
332 struct _URB_CONTROL_GET_STATUS_REQUEST UrbControlGetStatusRequest
;
333 struct _URB_CONTROL_FEATURE_REQUEST UrbControlFeatureRequest
;
334 struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST UrbControlVendorClassRequest
;
335 struct _URB_CONTROL_GET_INTERFACE_REQUEST UrbControlGetInterfaceRequest
;
336 struct _URB_CONTROL_GET_CONFIGURATION_REQUEST UrbControlGetConfigurationRequest
;
337 struct _URB_OS_FEATURE_DESCRIPTOR_REQUEST UrbOSFeatureDescriptorRequest
;
340 typedef struct _URB
*PURB
;