ReactOS 0.4.15-dev-7953-g1f49173
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 {
46
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
55
56
57typedef union _BM_REQUEST_TYPE {
58#ifdef __cplusplus
59 struct {
60#else
61 struct _BM {
62#endif
67 };
70
74 union _wValue {
75 __GNU_EXTENSION struct {
78 };
80 } wValue;
81 union _wIndex {
82 __GNU_EXTENSION struct {
85 };
87 } wIndex;
90
92
93#define USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE 0x06
94#define USB_OTHER_SPEED_CONFIGURATION_DESCRIPTOR_TYPE 0x07
95
107
109 struct _MP {
116
117#define USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE 0x0B
118
129
130typedef union _USB_20_PORT_STATUS {
132 struct {
146 };
148
150
151#define USB_PORT_STATUS_CONNECT 0x0001
152#define USB_PORT_STATUS_ENABLE 0x0002
153#define USB_PORT_STATUS_SUSPEND 0x0004
154#define USB_PORT_STATUS_OVER_CURRENT 0x0008
155#define USB_PORT_STATUS_RESET 0x0010
156#define USB_PORT_STATUS_POWER 0x0100
157#define USB_PORT_STATUS_LOW_SPEED 0x0200
158#define USB_PORT_STATUS_HIGH_SPEED 0x0400
159
160typedef union _USB_20_PORT_CHANGE {
162 struct {
169 };
171
173
174typedef union _USB_30_PORT_STATUS {
176 struct {
186 };
188
190
191#define PORT_LINK_STATE_U0 0
192#define PORT_LINK_STATE_U1 1
193#define PORT_LINK_STATE_U2 2
194#define PORT_LINK_STATE_U3 3
195#define PORT_LINK_STATE_DISABLED 4
196#define PORT_LINK_STATE_RX_DETECT 5
197#define PORT_LINK_STATE_INACTIVE 6
198#define PORT_LINK_STATE_POLLING 7
199#define PORT_LINK_STATE_RECOVERY 8
200#define PORT_LINK_STATE_HOT_RESET 9
201#define PORT_LINK_STATE_COMPLIANCE_MODE 10
202#define PORT_LINK_STATE_LOOPBACK 11
203#define PORT_LINK_STATE_TEST_MODE 11 // xHCI-specific, replacing LOOPBACK
204
205typedef union _USB_30_PORT_CHANGE {
207 struct {
216 };
218
220
221typedef union _USB_PORT_STATUS {
226
227C_ASSERT(sizeof(USB_PORT_STATUS) == sizeof(USHORT));
228
229typedef union _USB_PORT_CHANGE {
234
235C_ASSERT(sizeof(USB_PORT_CHANGE) == sizeof(USHORT));
236
239 struct {
242 };
244
246
247typedef union _USB_HUB_STATUS {
249 struct {
253 };
255
256C_ASSERT(sizeof(USB_HUB_STATUS) == sizeof(USHORT));
257
258typedef union _USB_HUB_CHANGE {
260 struct {
264 };
266
267C_ASSERT(sizeof(USB_HUB_CHANGE) == sizeof(USHORT));
268
271 struct {
274 };
276
278
279#define USB_20_HUB_DESCRIPTOR_TYPE 0x29
280#define USB_30_HUB_DESCRIPTOR_TYPE 0x2A
281
282#define USB_REQUEST_CLEAR_TT_BUFFER 0x08
283#define USB_REQUEST_RESET_TT 0x09
284#define USB_REQUEST_GET_TT_STATE 0x0A
285#define USB_REQUEST_STOP_TT 0x0B
286
287#define USB_REQUEST_SET_HUB_DEPTH 0x0C
288#define USB_REQUEST_GET_PORT_ERR_COUNT 0x0D
289
290#define USB_DEVICE_CLASS_RESERVED 0x00
291#define USB_DEVICE_CLASS_AUDIO 0x01
292#define USB_DEVICE_CLASS_COMMUNICATIONS 0x02
293#define USB_DEVICE_CLASS_HUMAN_INTERFACE 0x03
294#define USB_DEVICE_CLASS_MONITOR 0x04
295#define USB_DEVICE_CLASS_PHYSICAL_INTERFACE 0x05
296#define USB_DEVICE_CLASS_POWER 0x06
297#define USB_DEVICE_CLASS_IMAGE 0x06
298#define USB_DEVICE_CLASS_PRINTER 0x07
299#define USB_DEVICE_CLASS_STORAGE 0x08
300#define USB_DEVICE_CLASS_HUB 0x09
301#define USB_DEVICE_CLASS_CDC_DATA 0x0A
302#define USB_DEVICE_CLASS_SMART_CARD 0x0B
303#define USB_DEVICE_CLASS_CONTENT_SECURITY 0x0D
304#define USB_DEVICE_CLASS_VIDEO 0x0E
305#define USB_DEVICE_CLASS_PERSONAL_HEALTHCARE 0x0F
306#define USB_DEVICE_CLASS_AUDIO_VIDEO 0x10
307#define USB_DEVICE_CLASS_BILLBOARD 0x11
308#define USB_DEVICE_CLASS_DIAGNOSTIC_DEVICE 0xDC
309#define USB_DEVICE_CLASS_WIRELESS_CONTROLLER 0xE0
310#define USB_DEVICE_CLASS_MISCELLANEOUS 0xEF
311#define USB_DEVICE_CLASS_APPLICATION_SPECIFIC 0xFE
312#define USB_DEVICE_CLASS_VENDOR_SPECIFIC 0xFF
313
314#include <poppack.h>
#define __GNU_EXTENSION
Definition: _mingw_mac.h:135
#define C_ASSERT(e)
Definition: intsafe.h:73
#define _MP
Definition: msvcrt.h:816
unsigned short USHORT
Definition: pedump.c:61
BM_REQUEST_TYPE bmRequestType
Definition: usb200.h:72
uint32_t ULONG
Definition: typedefs.h:59
USHORT AsUshort16
Definition: usb200.h:161
USHORT PortEnableDisableChange
Definition: usb200.h:164
USHORT ResetChange
Definition: usb200.h:167
USHORT Reserved2
Definition: usb200.h:168
USHORT SuspendChange
Definition: usb200.h:165
USHORT OverCurrentIndicatorChange
Definition: usb200.h:166
USHORT ConnectStatusChange
Definition: usb200.h:163
USHORT PortIndicatorControl
Definition: usb200.h:144
USHORT LowSpeedDeviceAttached
Definition: usb200.h:141
USHORT PortTestMode
Definition: usb200.h:143
USHORT Reserved0
Definition: usb200.h:139
USHORT PortPower
Definition: usb200.h:140
USHORT CurrentConnectStatus
Definition: usb200.h:133
USHORT Reserved1
Definition: usb200.h:145
USHORT AsUshort16
Definition: usb200.h:131
USHORT OverCurrent
Definition: usb200.h:136
USHORT HighSpeedDeviceAttached
Definition: usb200.h:142
USHORT PortEnabledDisabled
Definition: usb200.h:134
USHORT Reserved3
Definition: usb200.h:215
USHORT ResetChange
Definition: usb200.h:211
USHORT Reserved2
Definition: usb200.h:209
USHORT BHResetChange
Definition: usb200.h:212
USHORT AsUshort16
Definition: usb200.h:206
USHORT PortLinkStateChange
Definition: usb200.h:213
USHORT OverCurrentIndicatorChange
Definition: usb200.h:210
USHORT ConnectStatusChange
Definition: usb200.h:208
USHORT PortConfigErrorChange
Definition: usb200.h:214
USHORT AsUshort16
Definition: usb200.h:175
USHORT NegotiatedDeviceSpeed
Definition: usb200.h:184
USHORT PortEnabledDisabled
Definition: usb200.h:178
USHORT PortPower
Definition: usb200.h:183
USHORT Reserved0
Definition: usb200.h:179
USHORT OverCurrent
Definition: usb200.h:180
USHORT CurrentConnectStatus
Definition: usb200.h:177
USHORT PortLinkState
Definition: usb200.h:182
USHORT Reserved1
Definition: usb200.h:185
USHORT Reserved
Definition: usb200.h:263
USHORT OverCurrentChange
Definition: usb200.h:262
USHORT LocalPowerChange
Definition: usb200.h:261
USHORT AsUshort16
Definition: usb200.h:259
USB_HUB_STATUS HubStatus
Definition: usb200.h:272
USB_HUB_CHANGE HubChange
Definition: usb200.h:273
USHORT LocalPowerLost
Definition: usb200.h:250
USHORT AsUshort16
Definition: usb200.h:248
USHORT OverCurrent
Definition: usb200.h:251
USHORT Reserved
Definition: usb200.h:252
USB_20_PORT_CHANGE Usb20PortChange
Definition: usb200.h:231
USB_30_PORT_CHANGE Usb30PortChange
Definition: usb200.h:232
USHORT AsUshort16
Definition: usb200.h:230
USB_PORT_STATUS PortStatus
Definition: usb200.h:240
USB_PORT_CHANGE PortChange
Definition: usb200.h:241
USB_30_PORT_STATUS Usb30PortStatus
Definition: usb200.h:224
USB_20_PORT_STATUS Usb20PortStatus
Definition: usb200.h:223
USHORT AsUshort16
Definition: usb200.h:222
_USB_DEVICE_SPEED
Definition: usb200.h:41
@ 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
unsigned char UCHAR
Definition: xmlstorage.h:181