ReactOS 0.4.17-dev-1190-g4c812f4
usb200.h
Go to the documentation of this file.
1/*
2 * usb200.h
3 *
4 * This file is part of the ReactOS PSDK package.
5 *
6 * Contributors:
7 * Magnus Olsen.
8 *
9 * THIS SOFTWARE IS NOT COPYRIGHTED
10 *
11 * This source code is offered for use in the public domain. You may
12 * use, modify or distribute it freely.
13 *
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.
18 *
19 */
20
21#pragma once
22
23/* Helper macro to enable gcc's extension. */
24#ifndef __GNU_EXTENSION
25#ifdef __GNUC__
26#define __GNU_EXTENSION __extension__
27#else
28#define __GNU_EXTENSION
29#endif
30#endif
31
32#include "usb100.h"
33
34#include <pshpack1.h>
35
36typedef enum _USB_DEVICE_TYPE {
40
41typedef enum _USB_DEVICE_SPEED {
47
48#define USB_PORT_STATUS_CONNECT 0x0001
49#define USB_PORT_STATUS_ENABLE 0x0002
50#define USB_PORT_STATUS_SUSPEND 0x0004
51#define USB_PORT_STATUS_OVER_CURRENT 0x0008
52#define USB_PORT_STATUS_RESET 0x0010
53#define USB_PORT_STATUS_POWER 0x0100
54#define USB_PORT_STATUS_LOW_SPEED 0x0200
55#define USB_PORT_STATUS_HIGH_SPEED 0x0400
56
57
58typedef union _BM_REQUEST_TYPE {
59#ifdef __cplusplus
60 struct {
61#else
62 struct _BM {
63#endif
68 };
71
75 union _wValue {
76 __GNU_EXTENSION struct {
79 };
81 } wValue;
82 union _wIndex {
83 __GNU_EXTENSION struct {
86 };
88 } wIndex;
91
93
94#define USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE 0x06
95#define USB_OTHER_SPEED_CONFIGURATION_DESCRIPTOR_TYPE 0x07
96
108
110 struct _MP {
114 };
117
118#define USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE 0x0B
119
130
131typedef union _USB_20_PORT_STATUS {
133 struct {
147 };
149
151
152#define USB_PORT_STATUS_CONNECT 0x0001
153#define USB_PORT_STATUS_ENABLE 0x0002
154#define USB_PORT_STATUS_SUSPEND 0x0004
155#define USB_PORT_STATUS_OVER_CURRENT 0x0008
156#define USB_PORT_STATUS_RESET 0x0010
157#define USB_PORT_STATUS_POWER 0x0100
158#define USB_PORT_STATUS_LOW_SPEED 0x0200
159#define USB_PORT_STATUS_HIGH_SPEED 0x0400
160
161typedef union _USB_20_PORT_CHANGE {
163 struct {
170 };
172
174
175typedef union _USB_30_PORT_STATUS {
177 struct {
187 };
189
191
192#define PORT_LINK_STATE_U0 0
193#define PORT_LINK_STATE_U1 1
194#define PORT_LINK_STATE_U2 2
195#define PORT_LINK_STATE_U3 3
196#define PORT_LINK_STATE_DISABLED 4
197#define PORT_LINK_STATE_RX_DETECT 5
198#define PORT_LINK_STATE_INACTIVE 6
199#define PORT_LINK_STATE_POLLING 7
200#define PORT_LINK_STATE_RECOVERY 8
201#define PORT_LINK_STATE_HOT_RESET 9
202#define PORT_LINK_STATE_COMPLIANCE_MODE 10
203#define PORT_LINK_STATE_LOOPBACK 11
204#define PORT_LINK_STATE_TEST_MODE 11 // xHCI-specific, replacing LOOPBACK
205
206typedef union _USB_30_PORT_CHANGE {
208 struct {
217 };
219
221
222typedef union _USB_PORT_STATUS {
227
228C_ASSERT(sizeof(USB_PORT_STATUS) == sizeof(USHORT));
229
230typedef union _USB_PORT_CHANGE {
235
236C_ASSERT(sizeof(USB_PORT_CHANGE) == sizeof(USHORT));
237
240 struct {
243 };
245
247
248typedef union _USB_HUB_STATUS {
250 struct {
254 };
256
257C_ASSERT(sizeof(USB_HUB_STATUS) == sizeof(USHORT));
258
259typedef union _USB_HUB_CHANGE {
261 struct {
265 };
267
268C_ASSERT(sizeof(USB_HUB_CHANGE) == sizeof(USHORT));
269
272 struct {
275 };
277
279
280#define USB_20_HUB_DESCRIPTOR_TYPE 0x29
281#define USB_30_HUB_DESCRIPTOR_TYPE 0x2A
282
283#define USB_REQUEST_CLEAR_TT_BUFFER 0x08
284#define USB_REQUEST_RESET_TT 0x09
285#define USB_REQUEST_GET_TT_STATE 0x0A
286#define USB_REQUEST_STOP_TT 0x0B
287
288#define USB_REQUEST_SET_HUB_DEPTH 0x0C
289#define USB_REQUEST_GET_PORT_ERR_COUNT 0x0D
290
291#define USB_DEVICE_CLASS_RESERVED 0x00
292#define USB_DEVICE_CLASS_AUDIO 0x01
293#define USB_DEVICE_CLASS_COMMUNICATIONS 0x02
294#define USB_DEVICE_CLASS_HUMAN_INTERFACE 0x03
295#define USB_DEVICE_CLASS_MONITOR 0x04
296#define USB_DEVICE_CLASS_PHYSICAL_INTERFACE 0x05
297#define USB_DEVICE_CLASS_POWER 0x06
298#define USB_DEVICE_CLASS_IMAGE 0x06
299#define USB_DEVICE_CLASS_PRINTER 0x07
300#define USB_DEVICE_CLASS_STORAGE 0x08
301#define USB_DEVICE_CLASS_HUB 0x09
302#define USB_DEVICE_CLASS_CDC_DATA 0x0A
303#define USB_DEVICE_CLASS_SMART_CARD 0x0B
304#define USB_DEVICE_CLASS_CONTENT_SECURITY 0x0D
305#define USB_DEVICE_CLASS_VIDEO 0x0E
306#define USB_DEVICE_CLASS_PERSONAL_HEALTHCARE 0x0F
307#define USB_DEVICE_CLASS_AUDIO_VIDEO 0x10
308#define USB_DEVICE_CLASS_BILLBOARD 0x11
309#define USB_DEVICE_CLASS_DIAGNOSTIC_DEVICE 0xDC
310#define USB_DEVICE_CLASS_WIRELESS_CONTROLLER 0xE0
311#define USB_DEVICE_CLASS_MISCELLANEOUS 0xEF
312#define USB_DEVICE_CLASS_APPLICATION_SPECIFIC 0xFE
313#define USB_DEVICE_CLASS_VENDOR_SPECIFIC 0xFF
314
315#include <poppack.h>
#define C_ASSERT(e)
Definition: intsafe.h:73
#define __GNU_EXTENSION
Definition: pecoff.h:69
unsigned short USHORT
Definition: pedump.c:61
BM_REQUEST_TYPE bmRequestType
Definition: usb200.h:73
unsigned char UCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
USHORT AsUshort16
Definition: usb200.h:162
USHORT PortEnableDisableChange
Definition: usb200.h:165
USHORT ResetChange
Definition: usb200.h:168
USHORT Reserved2
Definition: usb200.h:169
USHORT SuspendChange
Definition: usb200.h:166
USHORT OverCurrentIndicatorChange
Definition: usb200.h:167
USHORT ConnectStatusChange
Definition: usb200.h:164
USHORT PortIndicatorControl
Definition: usb200.h:145
USHORT LowSpeedDeviceAttached
Definition: usb200.h:142
USHORT PortTestMode
Definition: usb200.h:144
USHORT Reserved0
Definition: usb200.h:140
USHORT PortPower
Definition: usb200.h:141
USHORT CurrentConnectStatus
Definition: usb200.h:134
USHORT Reserved1
Definition: usb200.h:146
USHORT AsUshort16
Definition: usb200.h:132
USHORT OverCurrent
Definition: usb200.h:137
USHORT HighSpeedDeviceAttached
Definition: usb200.h:143
USHORT PortEnabledDisabled
Definition: usb200.h:135
USHORT Reserved3
Definition: usb200.h:216
USHORT ResetChange
Definition: usb200.h:212
USHORT Reserved2
Definition: usb200.h:210
USHORT BHResetChange
Definition: usb200.h:213
USHORT AsUshort16
Definition: usb200.h:207
USHORT PortLinkStateChange
Definition: usb200.h:214
USHORT OverCurrentIndicatorChange
Definition: usb200.h:211
USHORT ConnectStatusChange
Definition: usb200.h:209
USHORT PortConfigErrorChange
Definition: usb200.h:215
USHORT AsUshort16
Definition: usb200.h:176
USHORT NegotiatedDeviceSpeed
Definition: usb200.h:185
USHORT PortEnabledDisabled
Definition: usb200.h:179
USHORT PortPower
Definition: usb200.h:184
USHORT Reserved0
Definition: usb200.h:180
USHORT OverCurrent
Definition: usb200.h:181
USHORT CurrentConnectStatus
Definition: usb200.h:178
USHORT PortLinkState
Definition: usb200.h:183
USHORT Reserved1
Definition: usb200.h:186
USHORT Reserved
Definition: usb200.h:264
USHORT OverCurrentChange
Definition: usb200.h:263
USHORT LocalPowerChange
Definition: usb200.h:262
USHORT AsUshort16
Definition: usb200.h:260
USB_HUB_STATUS HubStatus
Definition: usb200.h:273
USB_HUB_CHANGE HubChange
Definition: usb200.h:274
USHORT LocalPowerLost
Definition: usb200.h:251
USHORT AsUshort16
Definition: usb200.h:249
USHORT OverCurrent
Definition: usb200.h:252
USHORT Reserved
Definition: usb200.h:253
USB_20_PORT_CHANGE Usb20PortChange
Definition: usb200.h:232
USB_30_PORT_CHANGE Usb30PortChange
Definition: usb200.h:233
USHORT AsUshort16
Definition: usb200.h:231
USB_PORT_STATUS PortStatus
Definition: usb200.h:241
USB_PORT_CHANGE PortChange
Definition: usb200.h:242
USB_30_PORT_STATUS Usb30PortStatus
Definition: usb200.h:225
USB_20_PORT_STATUS Usb20PortStatus
Definition: usb200.h:224
USHORT AsUshort16
Definition: usb200.h:223
_USB_DEVICE_SPEED
Definition: usb200.h:41
@ UsbSuperSpeed
Definition: usb200.h:45
@ UsbHighSpeed
Definition: usb200.h:44
@ UsbLowSpeed
Definition: usb200.h:42
@ UsbFullSpeed
Definition: usb200.h:43
union _USB_PORT_CHANGE USB_PORT_CHANGE
union _BM_REQUEST_TYPE * PBM_REQUEST_TYPE
_USB_DEVICE_TYPE
Definition: usb200.h:36
@ Usb20Device
Definition: usb200.h:38
@ Usb11Device
Definition: usb200.h:37
union _USB_30_PORT_CHANGE USB_30_PORT_CHANGE
enum _USB_DEVICE_SPEED USB_DEVICE_SPEED
union _USB_20_PORT_CHANGE * PUSB_20_PORT_CHANGE
union _USB_HUB_CHANGE * PUSB_HUB_CHANGE
union _USB_HUB_CHANGE USB_HUB_CHANGE
union _USB_20_PORT_CHANGE USB_20_PORT_CHANGE
union _USB_HUB_STATUS_AND_CHANGE USB_HUB_STATUS_AND_CHANGE
union _USB_HIGH_SPEED_MAXPACKET USB_HIGH_SPEED_MAXPACKET
struct _USB_DEVICE_QUALIFIER_DESCRIPTOR USB_DEVICE_QUALIFIER_DESCRIPTOR
struct _USB_DEFAULT_PIPE_SETUP_PACKET * PUSB_DEFAULT_PIPE_SETUP_PACKET
union _USB_PORT_CHANGE * PUSB_PORT_CHANGE
union _USB_20_PORT_STATUS * PUSB_20_PORT_STATUS
union _USB_20_PORT_STATUS USB_20_PORT_STATUS
union _USB_PORT_STATUS * PUSB_PORT_STATUS
enum _USB_DEVICE_TYPE USB_DEVICE_TYPE
union _USB_HIGH_SPEED_MAXPACKET * PUSB_HIGH_SPEED_MAXPACKET
union _USB_HUB_STATUS USB_HUB_STATUS
struct _USB_INTERFACE_ASSOCIATION_DESCRIPTOR * PUSB_INTERFACE_ASSOCIATION_DESCRIPTOR
union _USB_HUB_STATUS_AND_CHANGE * PUSB_HUB_STATUS_AND_CHANGE
union _BM_REQUEST_TYPE BM_REQUEST_TYPE
union _USB_30_PORT_STATUS * PUSB_30_PORT_STATUS
struct _USB_DEVICE_QUALIFIER_DESCRIPTOR * PUSB_DEVICE_QUALIFIER_DESCRIPTOR
struct _USB_DEFAULT_PIPE_SETUP_PACKET USB_DEFAULT_PIPE_SETUP_PACKET
union _USB_PORT_STATUS_AND_CHANGE USB_PORT_STATUS_AND_CHANGE
union _USB_30_PORT_STATUS USB_30_PORT_STATUS
union _USB_PORT_STATUS USB_PORT_STATUS
struct _USB_INTERFACE_ASSOCIATION_DESCRIPTOR USB_INTERFACE_ASSOCIATION_DESCRIPTOR
union _USB_30_PORT_CHANGE * PUSB_30_PORT_CHANGE
union _USB_HUB_STATUS * PUSB_HUB_STATUS
union _USB_PORT_STATUS_AND_CHANGE * PUSB_PORT_STATUS_AND_CHANGE