Merge trunk HEAD (46152)
[reactos.git] / include / psdk / usb200.h
1 #pragma once
2
3 /* Helper macro to enable gcc's extension. */
4 #ifndef __GNU_EXTENSION
5 #ifdef __GNUC__
6 #define __GNU_EXTENSION __extension__
7 #else
8 #define __GNU_EXTENSION
9 #endif
10 #endif
11
12 #include "usb100.h"
13
14 #include <pshpack1.h>
15
16 typedef enum _USB_DEVICE_TYPE {
17 Usb11Device = 0,
18 Usb20Device
19 } USB_DEVICE_TYPE;
20
21 typedef enum _USB_DEVICE_SPEED {
22 UsbLowSpeed = 0,
23 UsbFullSpeed,
24 UsbHighSpeed
25 } USB_DEVICE_SPEED;
26
27 #define USB_PORT_STATUS_CONNECT 0x0001
28 #define USB_PORT_STATUS_ENABLE 0x0002
29 #define USB_PORT_STATUS_SUSPEND 0x0004
30 #define USB_PORT_STATUS_OVER_CURRENT 0x0008
31 #define USB_PORT_STATUS_RESET 0x0010
32 #define USB_PORT_STATUS_POWER 0x0100
33 #define USB_PORT_STATUS_LOW_SPEED 0x0200
34 #define USB_PORT_STATUS_HIGH_SPEED 0x0400
35
36
37 typedef union _BM_REQUEST_TYPE {
38 struct _BM {
39 UCHAR Recipient:2;
40 UCHAR Reserved:3;
41 UCHAR Type:2;
42 UCHAR Dir:1;
43 } _BM;
44 UCHAR B;
45 } BM_REQUEST_TYPE, *PBM_REQUEST_TYPE;
46
47 typedef struct _USB_DEFAULT_PIPE_SETUP_PACKET {
48 BM_REQUEST_TYPE bmRequestType;
49 UCHAR bRequest;
50 union _wValue {
51 __GNU_EXTENSION struct {
52 UCHAR LowByte;
53 UCHAR HiByte;
54 };
55 USHORT W;
56 } wValue;
57 union _wIndex {
58 __GNU_EXTENSION struct {
59 UCHAR LowByte;
60 UCHAR HiByte;
61 };
62 USHORT W;
63 } wIndex;
64 USHORT wLength;
65 } USB_DEFAULT_PIPE_SETUP_PACKET, *PUSB_DEFAULT_PIPE_SETUP_PACKET;
66
67 C_ASSERT(sizeof(USB_DEFAULT_PIPE_SETUP_PACKET) == 8);
68
69 #define USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE 0x06
70 #define USB_OTHER_SPEED_CONFIGURATION_DESCRIPTOR_TYPE 0x07
71
72 typedef struct _USB_DEVICE_QUALIFIER_DESCRIPTOR {
73 UCHAR bLength;
74 UCHAR bDescriptorType;
75 USHORT bcdUSB;
76 UCHAR bDeviceClass;
77 UCHAR bDeviceSubClass;
78 UCHAR bDeviceProtocol;
79 UCHAR bMaxPacketSize0;
80 UCHAR bNumConfigurations;
81 UCHAR bReserved;
82 } USB_DEVICE_QUALIFIER_DESCRIPTOR, *PUSB_DEVICE_QUALIFIER_DESCRIPTOR;
83
84 typedef union _USB_HIGH_SPEED_MAXPACKET {
85 struct _MP {
86 USHORT MaxPacket:11;
87 USHORT HSmux:2;
88 USHORT Reserved:3;
89 } _MP;
90 USHORT us;
91 } USB_HIGH_SPEED_MAXPACKET, *PUSB_HIGH_SPEED_MAXPACKET;
92
93 #define USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE 0x0B
94
95 typedef struct _USB_INTERFACE_ASSOCIATION_DESCRIPTOR {
96 UCHAR bLength;
97 UCHAR bDescriptorType;
98 UCHAR bFirstInterface;
99 UCHAR bInterfaceCount;
100 UCHAR bFunctionClass;
101 UCHAR bFunctionSubClass;
102 UCHAR bFunctionProtocol;
103 UCHAR iFunction;
104 } USB_INTERFACE_ASSOCIATION_DESCRIPTOR, *PUSB_INTERFACE_ASSOCIATION_DESCRIPTOR;
105
106 #include <poppack.h>