Sync with trunk (r48545)
[reactos.git] / include / psdk / usb200.h
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 {
37 Usb11Device = 0,
38 Usb20Device
39 } USB_DEVICE_TYPE;
40
41 typedef enum _USB_DEVICE_SPEED {
42 UsbLowSpeed = 0,
43 UsbFullSpeed,
44 UsbHighSpeed
45 } 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 struct _BM {
59 UCHAR Recipient:2;
60 UCHAR Reserved:3;
61 UCHAR Type:2;
62 UCHAR Dir:1;
63 } _BM;
64 UCHAR B;
65 } BM_REQUEST_TYPE, *PBM_REQUEST_TYPE;
66
67 typedef struct _USB_DEFAULT_PIPE_SETUP_PACKET {
68 BM_REQUEST_TYPE bmRequestType;
69 UCHAR bRequest;
70 union _wValue {
71 __GNU_EXTENSION struct {
72 UCHAR LowByte;
73 UCHAR HiByte;
74 };
75 USHORT W;
76 } wValue;
77 union _wIndex {
78 __GNU_EXTENSION struct {
79 UCHAR LowByte;
80 UCHAR HiByte;
81 };
82 USHORT W;
83 } wIndex;
84 USHORT wLength;
85 } USB_DEFAULT_PIPE_SETUP_PACKET, *PUSB_DEFAULT_PIPE_SETUP_PACKET;
86
87 C_ASSERT(sizeof(USB_DEFAULT_PIPE_SETUP_PACKET) == 8);
88
89 #define USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE 0x06
90 #define USB_OTHER_SPEED_CONFIGURATION_DESCRIPTOR_TYPE 0x07
91
92 typedef struct _USB_DEVICE_QUALIFIER_DESCRIPTOR {
93 UCHAR bLength;
94 UCHAR bDescriptorType;
95 USHORT bcdUSB;
96 UCHAR bDeviceClass;
97 UCHAR bDeviceSubClass;
98 UCHAR bDeviceProtocol;
99 UCHAR bMaxPacketSize0;
100 UCHAR bNumConfigurations;
101 UCHAR bReserved;
102 } USB_DEVICE_QUALIFIER_DESCRIPTOR, *PUSB_DEVICE_QUALIFIER_DESCRIPTOR;
103
104 typedef union _USB_HIGH_SPEED_MAXPACKET {
105 struct _MP {
106 USHORT MaxPacket:11;
107 USHORT HSmux:2;
108 USHORT Reserved:3;
109 } _MP;
110 USHORT us;
111 } USB_HIGH_SPEED_MAXPACKET, *PUSB_HIGH_SPEED_MAXPACKET;
112
113 #define USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE 0x0B
114
115 typedef struct _USB_INTERFACE_ASSOCIATION_DESCRIPTOR {
116 UCHAR bLength;
117 UCHAR bDescriptorType;
118 UCHAR bFirstInterface;
119 UCHAR bInterfaceCount;
120 UCHAR bFunctionClass;
121 UCHAR bFunctionSubClass;
122 UCHAR bFunctionProtocol;
123 UCHAR iFunction;
124 } USB_INTERFACE_ASSOCIATION_DESCRIPTOR, *PUSB_INTERFACE_ASSOCIATION_DESCRIPTOR;
125
126 #include <poppack.h>