4 * This file is part of the ReactOS PSDK package.
9 * THIS SOFTWARE IS NOT COPYRIGHTED
11 * This source code is offered for use in the public domain. You may
12 * use, modify or distribute it freely.
14 * This code is distributed in the hope that it will be useful but
15 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
16 * DISCLAIMED. This includes but is not limited to warranties of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 /* Helper macro to enable gcc's extension. */
24 #ifndef __GNU_EXTENSION
26 #define __GNU_EXTENSION __extension__
28 #define __GNU_EXTENSION
36 typedef enum _USB_DEVICE_TYPE
{
41 typedef enum _USB_DEVICE_SPEED
{
47 #define USB_PORT_STATUS_CONNECT 0x0001
48 #define USB_PORT_STATUS_ENABLE 0x0002
49 #define USB_PORT_STATUS_SUSPEND 0x0004
50 #define USB_PORT_STATUS_OVER_CURRENT 0x0008
51 #define USB_PORT_STATUS_RESET 0x0010
52 #define USB_PORT_STATUS_POWER 0x0100
53 #define USB_PORT_STATUS_LOW_SPEED 0x0200
54 #define USB_PORT_STATUS_HIGH_SPEED 0x0400
57 typedef union _BM_REQUEST_TYPE
{
69 } BM_REQUEST_TYPE
, *PBM_REQUEST_TYPE
;
71 typedef struct _USB_DEFAULT_PIPE_SETUP_PACKET
{
72 BM_REQUEST_TYPE bmRequestType
;
75 __GNU_EXTENSION
struct {
82 __GNU_EXTENSION
struct {
89 } USB_DEFAULT_PIPE_SETUP_PACKET
, *PUSB_DEFAULT_PIPE_SETUP_PACKET
;
91 C_ASSERT(sizeof(USB_DEFAULT_PIPE_SETUP_PACKET
) == 8);
93 #define USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE 0x06
94 #define USB_OTHER_SPEED_CONFIGURATION_DESCRIPTOR_TYPE 0x07
96 typedef struct _USB_DEVICE_QUALIFIER_DESCRIPTOR
{
98 UCHAR bDescriptorType
;
101 UCHAR bDeviceSubClass
;
102 UCHAR bDeviceProtocol
;
103 UCHAR bMaxPacketSize0
;
104 UCHAR bNumConfigurations
;
106 } USB_DEVICE_QUALIFIER_DESCRIPTOR
, *PUSB_DEVICE_QUALIFIER_DESCRIPTOR
;
108 typedef union _USB_HIGH_SPEED_MAXPACKET
{
115 } USB_HIGH_SPEED_MAXPACKET
, *PUSB_HIGH_SPEED_MAXPACKET
;
117 #define USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE 0x0B
119 typedef struct _USB_INTERFACE_ASSOCIATION_DESCRIPTOR
{
121 UCHAR bDescriptorType
;
122 UCHAR bFirstInterface
;
123 UCHAR bInterfaceCount
;
124 UCHAR bFunctionClass
;
125 UCHAR bFunctionSubClass
;
126 UCHAR bFunctionProtocol
;
128 } USB_INTERFACE_ASSOCIATION_DESCRIPTOR
, *PUSB_INTERFACE_ASSOCIATION_DESCRIPTOR
;
130 typedef union _USB_20_PORT_CHANGE
{
133 USHORT ConnectStatusChange
:1;
134 USHORT PortEnableDisableChange
:1;
135 USHORT SuspendChange
:1;
136 USHORT OverCurrentIndicatorChange
:1;
137 USHORT ResetChange
:1;
140 } USB_20_PORT_CHANGE
, *PUSB_20_PORT_CHANGE
;
142 C_ASSERT(sizeof(USB_20_PORT_CHANGE
) == sizeof(USHORT
));
144 typedef union _USB_20_PORT_STATUS
{
147 USHORT CurrentConnectStatus
:1;
148 USHORT PortEnabledDisabled
:1;
150 USHORT OverCurrent
:1;
155 USHORT LowSpeedDeviceAttached
:1;
156 USHORT HighSpeedDeviceAttached
:1;
157 USHORT PortTestMode
:1;
158 USHORT PortIndicatorControl
:1;
161 } USB_20_PORT_STATUS
, *PUSB_20_PORT_STATUS
;
163 C_ASSERT(sizeof(USB_20_PORT_STATUS
) == sizeof(USHORT
));
165 typedef union _USB_30_PORT_STATUS
{
168 USHORT CurrentConnectStatus
:1;
169 USHORT PortEnabledDisabled
:1;
171 USHORT OverCurrent
:1;
173 USHORT PortLinkState
:4;
175 USHORT NegotiatedDeviceSpeed
:3;
178 } USB_30_PORT_STATUS
, *PUSB_30_PORT_STATUS
;
180 C_ASSERT(sizeof(USB_30_PORT_STATUS
) == sizeof(USHORT
));
182 typedef union _USB_PORT_STATUS
{
184 USB_20_PORT_STATUS Usb20PortStatus
;
185 USB_30_PORT_STATUS Usb30PortStatus
;
186 } USB_PORT_STATUS
, *PUSB_PORT_STATUS
;
188 typedef union _USB_HUB_STATUS
{
191 USHORT LocalPowerLost
:1;
192 USHORT OverCurrent
:1;
195 } USB_HUB_STATUS
, *PUSB_HUB_STATUS
;
197 C_ASSERT(sizeof(USB_HUB_STATUS
) == sizeof(USHORT
));
199 typedef union _USB_HUB_CHANGE
{
202 USHORT LocalPowerChange
:1;
203 USHORT OverCurrentChange
:1;
206 } USB_HUB_CHANGE
, *PUSB_HUB_CHANGE
;
208 C_ASSERT(sizeof(USB_HUB_CHANGE
) == sizeof(USHORT
));
210 typedef union _USB_HUB_STATUS_AND_CHANGE
{
213 USB_HUB_STATUS HubStatus
;
214 USB_HUB_CHANGE HubChange
;
216 } USB_HUB_STATUS_AND_CHANGE
, *PUSB_HUB_STATUS_AND_CHANGE
;
218 C_ASSERT(sizeof(USB_HUB_STATUS_AND_CHANGE
) == sizeof(ULONG
));
220 #define USB_DEVICE_CLASS_RESERVED 0x00
221 #define USB_DEVICE_CLASS_AUDIO 0x01
222 #define USB_DEVICE_CLASS_COMMUNICATIONS 0x02
223 #define USB_DEVICE_CLASS_HUMAN_INTERFACE 0x03
224 #define USB_DEVICE_CLASS_MONITOR 0x04
225 #define USB_DEVICE_CLASS_PHYSICAL_INTERFACE 0x05
226 #define USB_DEVICE_CLASS_POWER 0x06
227 #define USB_DEVICE_CLASS_IMAGE 0x06
228 #define USB_DEVICE_CLASS_PRINTER 0x07
229 #define USB_DEVICE_CLASS_STORAGE 0x08
230 #define USB_DEVICE_CLASS_HUB 0x09
231 #define USB_DEVICE_CLASS_CDC_DATA 0x0A
232 #define USB_DEVICE_CLASS_SMART_CARD 0x0B
233 #define USB_DEVICE_CLASS_CONTENT_SECURITY 0x0D
234 #define USB_DEVICE_CLASS_VIDEO 0x0E
235 #define USB_DEVICE_CLASS_PERSONAL_HEALTHCARE 0x0F
236 #define USB_DEVICE_CLASS_DIAGNOSTIC_DEVICE 0xDC
237 #define USB_DEVICE_CLASS_WIRELESS_CONTROLLER 0xE0
238 #define USB_DEVICE_CLASS_MISCELLANEOUS 0xEF
239 #define USB_DEVICE_CLASS_APPLICATION_SPECIFIC 0xFE
240 #define USB_DEVICE_CLASS_VENDOR_SPECIFIC 0xFF