More work on USB related definitions
[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 typedef union _BM_REQUEST_TYPE {
28 struct _BM {
29 UCHAR Recipient:2;
30 UCHAR Reserved:3;
31 UCHAR Type:2;
32 UCHAR Dir:1;
33 } _BM;
34 UCHAR B;
35 } BM_REQUEST_TYPE, *PBM_REQUEST_TYPE;
36
37 typedef struct _USB_DEFAULT_PIPE_SETUP_PACKET {
38 BM_REQUEST_TYPE bmRequestType;
39 UCHAR bRequest;
40 union _wValue {
41 __GNU_EXTENSION struct {
42 UCHAR LowByte;
43 UCHAR HiByte;
44 };
45 USHORT W;
46 } wValue;
47 union _wIndex {
48 __GNU_EXTENSION struct {
49 UCHAR LowByte;
50 UCHAR HiByte;
51 };
52 USHORT W;
53 } wIndex;
54 USHORT wLength;
55 } USB_DEFAULT_PIPE_SETUP_PACKET, *PUSB_DEFAULT_PIPE_SETUP_PACKET;
56
57 C_ASSERT(sizeof(USB_DEFAULT_PIPE_SETUP_PACKET) == 8);
58
59 typedef struct _USB_DEVICE_QUALIFIER_DESCRIPTOR {
60 UCHAR bLength;
61 UCHAR bDescriptorType;
62 USHORT bcdUSB;
63 UCHAR bDeviceClass;
64 UCHAR bDeviceSubClass;
65 UCHAR bDeviceProtocol;
66 UCHAR bMaxPacketSize0;
67 UCHAR bNumConfigurations;
68 UCHAR bReserved;
69 } USB_DEVICE_QUALIFIER_DESCRIPTOR, *PUSB_DEVICE_QUALIFIER_DESCRIPTOR;
70
71 typedef union _USB_HIGH_SPEED_MAXPACKET {
72 struct _MP {
73 USHORT MaxPacket:11;
74 USHORT HSmux:2;
75 USHORT Reserved:3;
76 } _MP;
77 USHORT us;
78 } USB_HIGH_SPEED_MAXPACKET, *PUSB_HIGH_SPEED_MAXPACKET;
79
80 typedef struct _USB_INTERFACE_ASSOCIATION_DESCRIPTOR {
81 UCHAR bLength;
82 UCHAR bDescriptorType;
83 UCHAR bFirstInterface;
84 UCHAR bInterfaceCount;
85 UCHAR bFunctionClass;
86 UCHAR bFunctionSubClass;
87 UCHAR bFunctionProtocol;
88 UCHAR iFunction;
89 } USB_INTERFACE_ASSOCIATION_DESCRIPTOR, *PUSB_INTERFACE_ASSOCIATION_DESCRIPTOR;
90
91 #define USB_PORT_STATUS_CONNECT 0x0001
92 #define USB_PORT_STATUS_ENABLE 0x0002
93 #define USB_PORT_STATUS_SUSPEND 0x0004
94 #define USB_PORT_STATUS_OVER_CURRENT 0x0008
95 #define USB_PORT_STATUS_RESET 0x0010
96 #define USB_PORT_STATUS_POWER 0x0100
97 #define USB_PORT_STATUS_LOW_SPEED 0x0200
98 #define USB_PORT_STATUS_HIGH_SPEED 0x0400
99 #define USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE 0x06
100 #define USB_OTHER_SPEED_CONFIGURATION_DESCRIPTOR_TYPE 0x07
101 #define USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE 0x0B
102
103 #include <poppack.h>