ReactOS  0.4.14-dev-49-gfb4591c
usb100.h
Go to the documentation of this file.
1 /*
2  * usb100.h
3  *
4  * USB 1.0 support
5  *
6  * This file is part of the ReactOS PSDK package.
7  *
8  * Contributors:
9  * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
10  *
11  * THIS SOFTWARE IS NOT COPYRIGHTED
12  *
13  * This source code is offered for use in the public domain. You may
14  * use, modify or distribute it freely.
15  *
16  * This code is distributed in the hope that it will be useful but
17  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18  * DISCLAIMED. This includes but is not limited to warranties of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20  *
21  */
22 
23 #pragma once
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #include <pshpack1.h>
30 
31 #define BMREQUEST_HOST_TO_DEVICE 0
32 #define BMREQUEST_DEVICE_TO_HOST 1
33 
34 #define BMREQUEST_STANDARD 0
35 #define BMREQUEST_CLASS 1
36 #define BMREQUEST_VENDOR 2
37 
38 #define BMREQUEST_TO_DEVICE 0
39 #define BMREQUEST_TO_INTERFACE 1
40 #define BMREQUEST_TO_ENDPOINT 2
41 #define BMREQUEST_TO_OTHER 3
42 
43 #define MAXIMUM_USB_STRING_LENGTH 255
44 
45 #define USB_GETSTATUS_SELF_POWERED 0x01
46 #define USB_GETSTATUS_REMOTE_WAKEUP_ENABLED 0x02
47 
48 /* USB_COMMON_DESCRIPTOR.bDescriptorType constants */
49 #define USB_DEVICE_DESCRIPTOR_TYPE 0x01
50 #define USB_CONFIGURATION_DESCRIPTOR_TYPE 0x02
51 #define USB_STRING_DESCRIPTOR_TYPE 0x03
52 #define USB_INTERFACE_DESCRIPTOR_TYPE 0x04
53 #define USB_ENDPOINT_DESCRIPTOR_TYPE 0x05
54 #define USB_RESERVED_DESCRIPTOR_TYPE 0x06
55 #define USB_CONFIG_POWER_DESCRIPTOR_TYPE 0x07
56 #define USB_INTERFACE_POWER_DESCRIPTOR_TYPE 0x08
57 
58 #define USB_DESCRIPTOR_MAKE_TYPE_AND_INDEX(d, i) ((USHORT)((USHORT)d << 8 | i))
59 
60 /* USB_ENDPOINT_DESCRIPTOR.bmAttributes constants */
61 #define USB_ENDPOINT_TYPE_MASK 0x03
62 #define USB_ENDPOINT_TYPE_CONTROL 0x00
63 #define USB_ENDPOINT_TYPE_ISOCHRONOUS 0x01
64 #define USB_ENDPOINT_TYPE_BULK 0x02
65 #define USB_ENDPOINT_TYPE_INTERRUPT 0x03
66 
67 /* USB_CONFIGURATION_DESCRIPTOR.bmAttributes constants */
68 #define USB_CONFIG_POWERED_MASK 0xc0
69 #define USB_CONFIG_BUS_POWERED 0x80
70 #define USB_CONFIG_SELF_POWERED 0x40
71 #define USB_CONFIG_REMOTE_WAKEUP 0x20
72 
73 #define USB_ENDPOINT_DIRECTION_MASK 0x80
74 
75 #define USB_ENDPOINT_DIRECTION_OUT(x) (!((x) & USB_ENDPOINT_DIRECTION_MASK))
76 #define USB_ENDPOINT_DIRECTION_IN(x) ((x) & USB_ENDPOINT_DIRECTION_MASK)
77 
78 #define USB_REQUEST_GET_STATUS 0x00
79 #define USB_REQUEST_CLEAR_FEATURE 0x01
80 #define USB_REQUEST_SET_FEATURE 0x03
81 #define USB_REQUEST_SET_ADDRESS 0x05
82 #define USB_REQUEST_GET_DESCRIPTOR 0x06
83 #define USB_REQUEST_SET_DESCRIPTOR 0x07
84 #define USB_REQUEST_GET_CONFIGURATION 0x08
85 #define USB_REQUEST_SET_CONFIGURATION 0x09
86 #define USB_REQUEST_GET_INTERFACE 0x0A
87 #define USB_REQUEST_SET_INTERFACE 0x0B
88 #define USB_REQUEST_SYNC_FRAME 0x0C
89 
90 #define USB_DEVICE_CLASS_RESERVED 0x00
91 #define USB_DEVICE_CLASS_AUDIO 0x01
92 #define USB_DEVICE_CLASS_COMMUNICATIONS 0x02
93 #define USB_DEVICE_CLASS_HUMAN_INTERFACE 0x03
94 #define USB_DEVICE_CLASS_MONITOR 0x04
95 #define USB_DEVICE_CLASS_PHYSICAL_INTERFACE 0x05
96 #define USB_DEVICE_CLASS_POWER 0x06
97 #define USB_DEVICE_CLASS_PRINTER 0x07
98 #define USB_DEVICE_CLASS_STORAGE 0x08
99 #define USB_DEVICE_CLASS_HUB 0x09
100 #define USB_DEVICE_CLASS_VENDOR_SPECIFIC 0xFF
101 
102 #define USB_FEATURE_ENDPOINT_STALL 0x0000
103 #define USB_FEATURE_REMOTE_WAKEUP 0x0001
104 
105 #define USB_FEATURE_INTERFACE_POWER_D0 0x0002
106 #define USB_FEATURE_INTERFACE_POWER_D1 0x0003
107 #define USB_FEATURE_INTERFACE_POWER_D2 0x0004
108 #define USB_FEATURE_INTERFACE_POWER_D3 0x0005
109 
110 typedef struct _USB_DEVICE_DESCRIPTOR {
126 
127 typedef struct _USB_ENDPOINT_DESCRIPTOR {
135 
146 
158 
159 typedef struct _USB_STRING_DESCRIPTOR {
164 
165 typedef struct _USB_COMMON_DESCRIPTOR {
169 
170 typedef struct _USB_HUB_DESCRIPTOR {
179 
180 #define USB_SUPPORT_D0_COMMAND 0x01
181 #define USB_SUPPORT_D1_COMMAND 0x02
182 #define USB_SUPPORT_D2_COMMAND 0x04
183 #define USB_SUPPORT_D3_COMMAND 0x08
184 
185 #define USB_SUPPORT_D1_WAKEUP 0x10
186 #define USB_SUPPORT_D2_WAKEUP 0x20
187 
203 
218 
219 #include <poppack.h>
220 
221 #ifdef __cplusplus
222 }
223 #endif
struct _USB_DEVICE_DESCRIPTOR USB_DEVICE_DESCRIPTOR
UCHAR bDescriptorLength
Definition: usb100.h:171
struct _USB_COMMON_DESCRIPTOR USB_COMMON_DESCRIPTOR
struct _USB_CONFIGURATION_POWER_DESCRIPTOR * PUSB_CONFIGURATION_POWER_DESCRIPTOR
struct _USB_INTERFACE_DESCRIPTOR * PUSB_INTERFACE_DESCRIPTOR
struct _USB_HUB_DESCRIPTOR USB_HUB_DESCRIPTOR
struct _USB_CONFIGURATION_DESCRIPTOR * PUSB_CONFIGURATION_DESCRIPTOR
struct _USB_DEVICE_DESCRIPTOR * PUSB_DEVICE_DESCRIPTOR
struct _USB_HUB_DESCRIPTOR * PUSB_HUB_DESCRIPTOR
USHORT wHubCharacteristics
Definition: usb100.h:174
struct _USB_STRING_DESCRIPTOR USB_STRING_DESCRIPTOR
struct _USB_INTERFACE_DESCRIPTOR USB_INTERFACE_DESCRIPTOR
UCHAR bPowerOnToPowerGood
Definition: usb100.h:175
struct _USB_ENDPOINT_DESCRIPTOR * PUSB_ENDPOINT_DESCRIPTOR
struct _USB_CONFIGURATION_POWER_DESCRIPTOR USB_CONFIGURATION_POWER_DESCRIPTOR
UCHAR bNumConfigurations
Definition: usb100.h:124
UCHAR bNumberOfPorts
Definition: usb100.h:173
__wchar_t WCHAR
Definition: xmlstorage.h:180
UCHAR bRemoveAndPowerMask[64]
Definition: usb100.h:177
struct _USB_COMMON_DESCRIPTOR * PUSB_COMMON_DESCRIPTOR
struct _USB_ENDPOINT_DESCRIPTOR USB_ENDPOINT_DESCRIPTOR
UCHAR bHubControlCurrent
Definition: usb100.h:176
unsigned char UCHAR
Definition: xmlstorage.h:181
struct _USB_INTERFACE_POWER_DESCRIPTOR * PUSB_INTERFACE_POWER_DESCRIPTOR
struct _USB_CONFIGURATION_DESCRIPTOR USB_CONFIGURATION_DESCRIPTOR
struct _USB_STRING_DESCRIPTOR * PUSB_STRING_DESCRIPTOR
unsigned short USHORT
Definition: pedump.c:61
struct _USB_INTERFACE_POWER_DESCRIPTOR USB_INTERFACE_POWER_DESCRIPTOR
UCHAR bDescriptorType
Definition: usb100.h:172