ReactOS  0.4.14-dev-50-g13bb5e2
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 
36 typedef enum _USB_DEVICE_TYPE {
40 
41 typedef 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 
57 typedef 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 {
113  } _MP;
116 
117 #define USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE 0x0B
118 
129 
130 typedef union _USB_20_PORT_STATUS {
132  struct {
146  };
148 
149 C_ASSERT(sizeof(USB_20_PORT_STATUS) == sizeof(USHORT));
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 
160 typedef union _USB_20_PORT_CHANGE {
162  struct {
169  };
171 
172 C_ASSERT(sizeof(USB_20_PORT_CHANGE) == sizeof(USHORT));
173 
174 typedef union _USB_30_PORT_STATUS {
176  struct {
186  };
188 
189 C_ASSERT(sizeof(USB_30_PORT_STATUS) == sizeof(USHORT));
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 
205 typedef union _USB_30_PORT_CHANGE {
207  struct {
216  };
218 
219 C_ASSERT(sizeof(USB_30_PORT_CHANGE) == sizeof(USHORT));
220 
221 typedef union _USB_PORT_STATUS {
226 
227 C_ASSERT(sizeof(USB_PORT_STATUS) == sizeof(USHORT));
228 
229 typedef union _USB_PORT_CHANGE {
234 
235 C_ASSERT(sizeof(USB_PORT_CHANGE) == sizeof(USHORT));
236 
239  struct {
242  };
244 
245 C_ASSERT(sizeof(USB_PORT_STATUS_AND_CHANGE) == sizeof(ULONG));
246 
247 typedef union _USB_HUB_STATUS {
249  struct {
253  };
255 
256 C_ASSERT(sizeof(USB_HUB_STATUS) == sizeof(USHORT));
257 
258 typedef union _USB_HUB_CHANGE {
260  struct {
264  };
266 
267 C_ASSERT(sizeof(USB_HUB_CHANGE) == sizeof(USHORT));
268 
271  struct {
274  };
276 
277 C_ASSERT(sizeof(USB_HUB_STATUS_AND_CHANGE) == sizeof(ULONG));
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>
enum _USB_DEVICE_TYPE USB_DEVICE_TYPE
USHORT LocalPowerLost
Definition: usb200.h:250
USB_20_PORT_STATUS Usb20PortStatus
Definition: usb200.h:223
struct _USB_INTERFACE_ASSOCIATION_DESCRIPTOR USB_INTERFACE_ASSOCIATION_DESCRIPTOR
USHORT AsUshort16
Definition: usb200.h:230
USHORT OverCurrent
Definition: usb200.h:251
union _USB_PORT_STATUS_AND_CHANGE * PUSB_PORT_STATUS_AND_CHANGE
C_ASSERT(sizeof(USB_DEFAULT_PIPE_SETUP_PACKET)==8)
USHORT PortLinkState
Definition: usb200.h:182
USHORT Reserved1
Definition: usb200.h:145
USHORT OverCurrent
Definition: usb200.h:180
USHORT Reserved2
Definition: usb200.h:168
union _USB_20_PORT_STATUS USB_20_PORT_STATUS
USHORT AsUshort16
Definition: usb200.h:175
#define _MP
Definition: msvcrt.h:816
USHORT CurrentConnectStatus
Definition: usb200.h:133
union _BM_REQUEST_TYPE * PBM_REQUEST_TYPE
USHORT CurrentConnectStatus
Definition: usb200.h:177
USHORT PortConfigErrorChange
Definition: usb200.h:214
union _USB_HUB_STATUS_AND_CHANGE USB_HUB_STATUS_AND_CHANGE
union _USB_HIGH_SPEED_MAXPACKET USB_HIGH_SPEED_MAXPACKET
USHORT Reserved
Definition: usb200.h:263
USHORT NegotiatedDeviceSpeed
Definition: usb200.h:184
USHORT AsUshort16
Definition: usb200.h:259
USHORT LocalPowerChange
Definition: usb200.h:261
USHORT HighSpeedDeviceAttached
Definition: usb200.h:142
USHORT OverCurrentChange
Definition: usb200.h:262
union _USB_20_PORT_CHANGE USB_20_PORT_CHANGE
USHORT PortPower
Definition: usb200.h:140
union _USB_HIGH_SPEED_MAXPACKET * PUSB_HIGH_SPEED_MAXPACKET
union _USB_PORT_STATUS_AND_CHANGE USB_PORT_STATUS_AND_CHANGE
union _USB_PORT_STATUS * PUSB_PORT_STATUS
union _USB_30_PORT_STATUS * PUSB_30_PORT_STATUS
union _USB_HUB_STATUS * PUSB_HUB_STATUS
union _USB_30_PORT_CHANGE USB_30_PORT_CHANGE
USHORT PortPower
Definition: usb200.h:183
struct _USB_DEVICE_QUALIFIER_DESCRIPTOR * PUSB_DEVICE_QUALIFIER_DESCRIPTOR
union _USB_20_PORT_STATUS * PUSB_20_PORT_STATUS
USB_30_PORT_CHANGE Usb30PortChange
Definition: usb200.h:232
USHORT SuspendChange
Definition: usb200.h:165
USHORT BHResetChange
Definition: usb200.h:212
union _USB_PORT_CHANGE USB_PORT_CHANGE
USB_30_PORT_STATUS Usb30PortStatus
Definition: usb200.h:224
union _USB_HUB_STATUS_AND_CHANGE * PUSB_HUB_STATUS_AND_CHANGE
USHORT PortEnableDisableChange
Definition: usb200.h:164
union _USB_HUB_CHANGE USB_HUB_CHANGE
union _USB_PORT_CHANGE * PUSB_PORT_CHANGE
struct _USB_DEVICE_QUALIFIER_DESCRIPTOR USB_DEVICE_QUALIFIER_DESCRIPTOR
enum _USB_DEVICE_SPEED USB_DEVICE_SPEED
USHORT AsUshort16
Definition: usb200.h:222
USB_HUB_STATUS HubStatus
Definition: usb200.h:272
USHORT OverCurrent
Definition: usb200.h:136
USHORT PortLinkStateChange
Definition: usb200.h:213
USHORT AsUshort16
Definition: usb200.h:248
USHORT Reserved2
Definition: usb200.h:209
USHORT Reserved1
Definition: usb200.h:185
USB_PORT_CHANGE PortChange
Definition: usb200.h:241
USHORT AsUshort16
Definition: usb200.h:131
USB_HUB_CHANGE HubChange
Definition: usb200.h:273
struct _USB_DEFAULT_PIPE_SETUP_PACKET USB_DEFAULT_PIPE_SETUP_PACKET
USHORT AsUshort16
Definition: usb200.h:161
USHORT PortTestMode
Definition: usb200.h:143
unsigned char UCHAR
Definition: xmlstorage.h:181
USHORT Reserved0
Definition: usb200.h:179
USHORT ConnectStatusChange
Definition: usb200.h:163
USB_20_PORT_CHANGE Usb20PortChange
Definition: usb200.h:231
USHORT PortEnabledDisabled
Definition: usb200.h:178
_USB_DEVICE_TYPE
Definition: usb200.h:36
USHORT LowSpeedDeviceAttached
Definition: usb200.h:141
unsigned short USHORT
Definition: pedump.c:61
union _BM_REQUEST_TYPE BM_REQUEST_TYPE
USHORT PortEnabledDisabled
Definition: usb200.h:134
USHORT PortIndicatorControl
Definition: usb200.h:144
union _USB_30_PORT_CHANGE * PUSB_30_PORT_CHANGE
struct _USB_DEFAULT_PIPE_SETUP_PACKET * PUSB_DEFAULT_PIPE_SETUP_PACKET
union _USB_30_PORT_STATUS USB_30_PORT_STATUS
#define __GNU_EXTENSION
Definition: usb200.h:28
struct _USB_INTERFACE_ASSOCIATION_DESCRIPTOR * PUSB_INTERFACE_ASSOCIATION_DESCRIPTOR
USHORT ConnectStatusChange
Definition: usb200.h:208
_USB_DEVICE_SPEED
Definition: usb200.h:41
unsigned int ULONG
Definition: retypes.h:1
USHORT Reserved3
Definition: usb200.h:215
USHORT AsUshort16
Definition: usb200.h:206
USHORT Reserved0
Definition: usb200.h:139
USHORT OverCurrentIndicatorChange
Definition: usb200.h:166
USB_PORT_STATUS PortStatus
Definition: usb200.h:240
union _USB_PORT_STATUS USB_PORT_STATUS
USHORT ResetChange
Definition: usb200.h:167
BM_REQUEST_TYPE bmRequestType
Definition: usb200.h:72
union _USB_HUB_CHANGE * PUSB_HUB_CHANGE
union _USB_20_PORT_CHANGE * PUSB_20_PORT_CHANGE
union _USB_HUB_STATUS USB_HUB_STATUS
USHORT Reserved
Definition: usb200.h:252
USHORT OverCurrentIndicatorChange
Definition: usb200.h:210
USHORT ResetChange
Definition: usb200.h:211