blob: 13cfd63cc3352ed2e5267c27d50e661d457fb4de [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI__LINUX_USB_CH9_H
20#define _UAPI__LINUX_USB_CH9_H
21#include <linux/types.h>
22#include <asm/byteorder.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#define USB_DIR_OUT 0
25#define USB_DIR_IN 0x80
26#define USB_TYPE_MASK (0x03 << 5)
27#define USB_TYPE_STANDARD (0x00 << 5)
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29#define USB_TYPE_CLASS (0x01 << 5)
30#define USB_TYPE_VENDOR (0x02 << 5)
31#define USB_TYPE_RESERVED (0x03 << 5)
32#define USB_RECIP_MASK 0x1f
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34#define USB_RECIP_DEVICE 0x00
35#define USB_RECIP_INTERFACE 0x01
36#define USB_RECIP_ENDPOINT 0x02
37#define USB_RECIP_OTHER 0x03
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39#define USB_RECIP_PORT 0x04
40#define USB_RECIP_RPIPE 0x05
41#define USB_REQ_GET_STATUS 0x00
42#define USB_REQ_CLEAR_FEATURE 0x01
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44#define USB_REQ_SET_FEATURE 0x03
45#define USB_REQ_SET_ADDRESS 0x05
46#define USB_REQ_GET_DESCRIPTOR 0x06
47#define USB_REQ_SET_DESCRIPTOR 0x07
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49#define USB_REQ_GET_CONFIGURATION 0x08
50#define USB_REQ_SET_CONFIGURATION 0x09
51#define USB_REQ_GET_INTERFACE 0x0A
52#define USB_REQ_SET_INTERFACE 0x0B
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54#define USB_REQ_SYNCH_FRAME 0x0C
55#define USB_REQ_SET_SEL 0x30
56#define USB_REQ_SET_ISOCH_DELAY 0x31
57#define USB_REQ_SET_ENCRYPTION 0x0D
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59#define USB_REQ_GET_ENCRYPTION 0x0E
60#define USB_REQ_RPIPE_ABORT 0x0E
61#define USB_REQ_SET_HANDSHAKE 0x0F
62#define USB_REQ_RPIPE_RESET 0x0F
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64#define USB_REQ_GET_HANDSHAKE 0x10
65#define USB_REQ_SET_CONNECTION 0x11
66#define USB_REQ_SET_SECURITY_DATA 0x12
67#define USB_REQ_GET_SECURITY_DATA 0x13
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69#define USB_REQ_SET_WUSB_DATA 0x14
70#define USB_REQ_LOOPBACK_DATA_WRITE 0x15
71#define USB_REQ_LOOPBACK_DATA_READ 0x16
72#define USB_REQ_SET_INTERFACE_DS 0x17
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070074#define USB_REQ_GET_PARTNER_PDO 20
75#define USB_REQ_GET_BATTERY_STATUS 21
76#define USB_REQ_SET_PDO 22
77#define USB_REQ_GET_VDM 23
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79#define USB_REQ_SEND_VDM 24
Ben Cheng655a7c02013-10-16 16:09:24 -070080#define USB_DEVICE_SELF_POWERED 0
81#define USB_DEVICE_REMOTE_WAKEUP 1
82#define USB_DEVICE_TEST_MODE 2
Ben Cheng655a7c02013-10-16 16:09:24 -070083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070084#define USB_DEVICE_BATTERY 2
Ben Cheng655a7c02013-10-16 16:09:24 -070085#define USB_DEVICE_B_HNP_ENABLE 3
86#define USB_DEVICE_WUSB_DEVICE 3
87#define USB_DEVICE_A_HNP_SUPPORT 4
Ben Cheng655a7c02013-10-16 16:09:24 -070088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070089#define USB_DEVICE_A_ALT_HNP_SUPPORT 5
Ben Cheng655a7c02013-10-16 16:09:24 -070090#define USB_DEVICE_DEBUG_MODE 6
91#define TEST_J 1
92#define TEST_K 2
Ben Cheng655a7c02013-10-16 16:09:24 -070093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070094#define TEST_SE0_NAK 3
Ben Cheng655a7c02013-10-16 16:09:24 -070095#define TEST_PACKET 4
96#define TEST_FORCE_EN 5
97#define USB_DEVICE_U1_ENABLE 48
Ben Cheng655a7c02013-10-16 16:09:24 -070098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -070099#define USB_DEVICE_U2_ENABLE 49
Ben Cheng655a7c02013-10-16 16:09:24 -0700100#define USB_DEVICE_LTM_ENABLE 50
101#define USB_INTRF_FUNC_SUSPEND 0
102#define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00
Ben Cheng655a7c02013-10-16 16:09:24 -0700103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700104#define USB_INTRF_FUNC_SUSPEND_LP (1 << (8 + 0))
Ben Cheng655a7c02013-10-16 16:09:24 -0700105#define USB_INTRF_FUNC_SUSPEND_RW (1 << (8 + 1))
106#define USB_INTRF_STAT_FUNC_RW_CAP 1
107#define USB_INTRF_STAT_FUNC_RW 2
Ben Cheng655a7c02013-10-16 16:09:24 -0700108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700109#define USB_ENDPOINT_HALT 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700110#define USB_DEV_STAT_U1_ENABLED 2
111#define USB_DEV_STAT_U2_ENABLED 3
112#define USB_DEV_STAT_LTM_ENABLED 4
Ben Cheng655a7c02013-10-16 16:09:24 -0700113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700114#define USB_DEVICE_BATTERY_WAKE_MASK 40
115#define USB_DEVICE_OS_IS_PD_AWARE 41
116#define USB_DEVICE_POLICY_MODE 42
117#define USB_PORT_PR_SWAP 43
118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119#define USB_PORT_GOTO_MIN 44
120#define USB_PORT_RETURN_POWER 45
121#define USB_PORT_ACCEPT_PD_REQUEST 46
122#define USB_PORT_REJECT_PD_REQUEST 47
123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124#define USB_PORT_PORT_PD_RESET 48
125#define USB_PORT_C_PORT_PD_CHANGE 49
126#define USB_PORT_CABLE_PD_RESET 50
127#define USB_DEVICE_CHARGING_POLICY 54
128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129struct usb_ctrlrequest {
Tao Baod7db5942015-01-28 10:07:51 -0800130 __u8 bRequestType;
131 __u8 bRequest;
132 __le16 wValue;
Ben Cheng655a7c02013-10-16 16:09:24 -0700133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700134 __le16 wIndex;
Tao Baod7db5942015-01-28 10:07:51 -0800135 __le16 wLength;
136} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700137#define USB_DT_DEVICE 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -0700138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700139#define USB_DT_CONFIG 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700140#define USB_DT_STRING 0x03
141#define USB_DT_INTERFACE 0x04
142#define USB_DT_ENDPOINT 0x05
Ben Cheng655a7c02013-10-16 16:09:24 -0700143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700144#define USB_DT_DEVICE_QUALIFIER 0x06
Ben Cheng655a7c02013-10-16 16:09:24 -0700145#define USB_DT_OTHER_SPEED_CONFIG 0x07
146#define USB_DT_INTERFACE_POWER 0x08
147#define USB_DT_OTG 0x09
Ben Cheng655a7c02013-10-16 16:09:24 -0700148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700149#define USB_DT_DEBUG 0x0a
Ben Cheng655a7c02013-10-16 16:09:24 -0700150#define USB_DT_INTERFACE_ASSOCIATION 0x0b
151#define USB_DT_SECURITY 0x0c
152#define USB_DT_KEY 0x0d
Ben Cheng655a7c02013-10-16 16:09:24 -0700153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700154#define USB_DT_ENCRYPTION_TYPE 0x0e
Ben Cheng655a7c02013-10-16 16:09:24 -0700155#define USB_DT_BOS 0x0f
156#define USB_DT_DEVICE_CAPABILITY 0x10
157#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11
Ben Cheng655a7c02013-10-16 16:09:24 -0700158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700159#define USB_DT_WIRE_ADAPTER 0x21
Ben Cheng655a7c02013-10-16 16:09:24 -0700160#define USB_DT_RPIPE 0x22
161#define USB_DT_CS_RADIO_CONTROL 0x23
162#define USB_DT_PIPE_USAGE 0x24
Ben Cheng655a7c02013-10-16 16:09:24 -0700163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700164#define USB_DT_SS_ENDPOINT_COMP 0x30
165#define USB_DT_SSP_ISOC_ENDPOINT_COMP 0x31
Ben Cheng655a7c02013-10-16 16:09:24 -0700166#define USB_DT_CS_DEVICE (USB_TYPE_CLASS | USB_DT_DEVICE)
167#define USB_DT_CS_CONFIG (USB_TYPE_CLASS | USB_DT_CONFIG)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700169#define USB_DT_CS_STRING (USB_TYPE_CLASS | USB_DT_STRING)
170#define USB_DT_CS_INTERFACE (USB_TYPE_CLASS | USB_DT_INTERFACE)
Ben Cheng655a7c02013-10-16 16:09:24 -0700171#define USB_DT_CS_ENDPOINT (USB_TYPE_CLASS | USB_DT_ENDPOINT)
172struct usb_descriptor_header {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800174 __u8 bLength;
175 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800176} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700177struct usb_device_descriptor {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800179 __u8 bLength;
180 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800181 __le16 bcdUSB;
182 __u8 bDeviceClass;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800184 __u8 bDeviceSubClass;
185 __u8 bDeviceProtocol;
Tao Baod7db5942015-01-28 10:07:51 -0800186 __u8 bMaxPacketSize0;
187 __le16 idVendor;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800189 __le16 idProduct;
190 __le16 bcdDevice;
Tao Baod7db5942015-01-28 10:07:51 -0800191 __u8 iManufacturer;
192 __u8 iProduct;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800194 __u8 iSerialNumber;
195 __u8 bNumConfigurations;
Tao Baod7db5942015-01-28 10:07:51 -0800196} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700197#define USB_DT_DEVICE_SIZE 18
Christopher Ferris106b3a82016-08-24 12:15:38 -0700198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700199#define USB_CLASS_PER_INTERFACE 0
200#define USB_CLASS_AUDIO 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700201#define USB_CLASS_COMM 2
202#define USB_CLASS_HID 3
Christopher Ferris106b3a82016-08-24 12:15:38 -0700203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700204#define USB_CLASS_PHYSICAL 5
205#define USB_CLASS_STILL_IMAGE 6
Ben Cheng655a7c02013-10-16 16:09:24 -0700206#define USB_CLASS_PRINTER 7
207#define USB_CLASS_MASS_STORAGE 8
Christopher Ferris106b3a82016-08-24 12:15:38 -0700208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700209#define USB_CLASS_HUB 9
210#define USB_CLASS_CDC_DATA 0x0a
Ben Cheng655a7c02013-10-16 16:09:24 -0700211#define USB_CLASS_CSCID 0x0b
212#define USB_CLASS_CONTENT_SEC 0x0d
Christopher Ferris106b3a82016-08-24 12:15:38 -0700213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700214#define USB_CLASS_VIDEO 0x0e
215#define USB_CLASS_WIRELESS_CONTROLLER 0xe0
Ben Cheng655a7c02013-10-16 16:09:24 -0700216#define USB_CLASS_MISC 0xef
217#define USB_CLASS_APP_SPEC 0xfe
Christopher Ferris106b3a82016-08-24 12:15:38 -0700218/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700219#define USB_CLASS_VENDOR_SPEC 0xff
220#define USB_SUBCLASS_VENDOR_SPEC 0xff
Ben Cheng655a7c02013-10-16 16:09:24 -0700221struct usb_config_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800222 __u8 bLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800224 __u8 bDescriptorType;
225 __le16 wTotalLength;
Tao Baod7db5942015-01-28 10:07:51 -0800226 __u8 bNumInterfaces;
227 __u8 bConfigurationValue;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800229 __u8 iConfiguration;
230 __u8 bmAttributes;
Tao Baod7db5942015-01-28 10:07:51 -0800231 __u8 bMaxPower;
232} __attribute__((packed));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700233/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700234#define USB_DT_CONFIG_SIZE 9
235#define USB_CONFIG_ATT_ONE (1 << 7)
Ben Cheng655a7c02013-10-16 16:09:24 -0700236#define USB_CONFIG_ATT_SELFPOWER (1 << 6)
237#define USB_CONFIG_ATT_WAKEUP (1 << 5)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700238/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700239#define USB_CONFIG_ATT_BATTERY (1 << 4)
240struct usb_string_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800241 __u8 bLength;
242 __u8 bDescriptorType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700243/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800244 __le16 wData[1];
245} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700246struct usb_interface_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800247 __u8 bLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700248/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800249 __u8 bDescriptorType;
250 __u8 bInterfaceNumber;
Tao Baod7db5942015-01-28 10:07:51 -0800251 __u8 bAlternateSetting;
252 __u8 bNumEndpoints;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700253/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800254 __u8 bInterfaceClass;
255 __u8 bInterfaceSubClass;
Tao Baod7db5942015-01-28 10:07:51 -0800256 __u8 bInterfaceProtocol;
257 __u8 iInterface;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700258/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800259} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700260#define USB_DT_INTERFACE_SIZE 9
Ben Cheng655a7c02013-10-16 16:09:24 -0700261struct usb_endpoint_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800262 __u8 bLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700263/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800264 __u8 bDescriptorType;
265 __u8 bEndpointAddress;
Tao Baod7db5942015-01-28 10:07:51 -0800266 __u8 bmAttributes;
267 __le16 wMaxPacketSize;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700268/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800269 __u8 bInterval;
270 __u8 bRefresh;
Tao Baod7db5942015-01-28 10:07:51 -0800271 __u8 bSynchAddress;
272} __attribute__((packed));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700273/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700274#define USB_DT_ENDPOINT_SIZE 7
275#define USB_DT_ENDPOINT_AUDIO_SIZE 9
Ben Cheng655a7c02013-10-16 16:09:24 -0700276#define USB_ENDPOINT_NUMBER_MASK 0x0f
277#define USB_ENDPOINT_DIR_MASK 0x80
Christopher Ferris106b3a82016-08-24 12:15:38 -0700278/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700279#define USB_ENDPOINT_XFERTYPE_MASK 0x03
280#define USB_ENDPOINT_XFER_CONTROL 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700281#define USB_ENDPOINT_XFER_ISOC 1
282#define USB_ENDPOINT_XFER_BULK 2
Christopher Ferris106b3a82016-08-24 12:15:38 -0700283/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700284#define USB_ENDPOINT_XFER_INT 3
285#define USB_ENDPOINT_MAX_ADJUSTABLE 0x80
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800286#define USB_ENDPOINT_MAXP_MASK 0x07ff
287#define USB_EP_MAXP_MULT_SHIFT 11
288/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
289#define USB_EP_MAXP_MULT_MASK (3 << USB_EP_MAXP_MULT_SHIFT)
290#define USB_EP_MAXP_MULT(m) (((m) & USB_EP_MAXP_MULT_MASK) >> USB_EP_MAXP_MULT_SHIFT)
Ben Cheng655a7c02013-10-16 16:09:24 -0700291#define USB_ENDPOINT_INTRTYPE 0x30
292#define USB_ENDPOINT_INTR_PERIODIC (0 << 4)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700293/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700294#define USB_ENDPOINT_INTR_NOTIFICATION (1 << 4)
295#define USB_ENDPOINT_SYNCTYPE 0x0c
Ben Cheng655a7c02013-10-16 16:09:24 -0700296#define USB_ENDPOINT_SYNC_NONE (0 << 2)
297#define USB_ENDPOINT_SYNC_ASYNC (1 << 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700298/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700299#define USB_ENDPOINT_SYNC_ADAPTIVE (2 << 2)
300#define USB_ENDPOINT_SYNC_SYNC (3 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700301#define USB_ENDPOINT_USAGE_MASK 0x30
302#define USB_ENDPOINT_USAGE_DATA 0x00
Christopher Ferris106b3a82016-08-24 12:15:38 -0700303/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700304#define USB_ENDPOINT_USAGE_FEEDBACK 0x10
305#define USB_ENDPOINT_USAGE_IMPLICIT_FB 0x20
Christopher Ferris106b3a82016-08-24 12:15:38 -0700306struct usb_ssp_isoc_ep_comp_descriptor {
307 __u8 bLength;
Ben Cheng655a7c02013-10-16 16:09:24 -0700308/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700309 __u8 bDescriptorType;
310 __le16 wReseved;
311 __le32 dwBytesPerInterval;
312} __attribute__((packed));
313/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
314#define USB_DT_SSP_ISOC_EP_COMP_SIZE 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700315struct usb_ss_ep_comp_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800316 __u8 bLength;
317 __u8 bDescriptorType;
Ben Cheng655a7c02013-10-16 16:09:24 -0700318/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700319 __u8 bMaxBurst;
Tao Baod7db5942015-01-28 10:07:51 -0800320 __u8 bmAttributes;
321 __le16 wBytesPerInterval;
322} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700323/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700324#define USB_DT_SS_EP_COMP_SIZE 6
Ben Cheng655a7c02013-10-16 16:09:24 -0700325#define USB_SS_MULT(p) (1 + ((p) & 0x3))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700326#define USB_SS_SSP_ISOC_COMP(p) ((p) & (1 << 7))
Ben Cheng655a7c02013-10-16 16:09:24 -0700327struct usb_qualifier_descriptor {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700328/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800329 __u8 bLength;
330 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800331 __le16 bcdUSB;
332 __u8 bDeviceClass;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700333/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800334 __u8 bDeviceSubClass;
335 __u8 bDeviceProtocol;
Tao Baod7db5942015-01-28 10:07:51 -0800336 __u8 bMaxPacketSize0;
337 __u8 bNumConfigurations;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700338/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800339 __u8 bRESERVED;
340} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700341struct usb_otg_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800342 __u8 bLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700343/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800344 __u8 bDescriptorType;
345 __u8 bmAttributes;
Tao Baod7db5942015-01-28 10:07:51 -0800346} __attribute__((packed));
Christopher Ferris05d08e92016-02-04 13:16:38 -0800347struct usb_otg20_descriptor {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700348/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800349 __u8 bLength;
350 __u8 bDescriptorType;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800351 __u8 bmAttributes;
352 __le16 bcdOTG;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700353/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800354} __attribute__((packed));
355#define USB_OTG_SRP (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800356#define USB_OTG_HNP (1 << 1)
357#define USB_OTG_ADP (1 << 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700358/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
359#define OTG_STS_SELECTOR 0xF000
Christopher Ferris05d08e92016-02-04 13:16:38 -0800360struct usb_debug_descriptor {
361 __u8 bLength;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800362 __u8 bDescriptorType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700363/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800364 __u8 bDebugInEndpoint;
365 __u8 bDebugOutEndpoint;
Ben Cheng655a7c02013-10-16 16:09:24 -0700366} __attribute__((packed));
367struct usb_interface_assoc_descriptor {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700368/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800369 __u8 bLength;
370 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800371 __u8 bFirstInterface;
372 __u8 bInterfaceCount;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700373/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800374 __u8 bFunctionClass;
375 __u8 bFunctionSubClass;
Tao Baod7db5942015-01-28 10:07:51 -0800376 __u8 bFunctionProtocol;
377 __u8 iFunction;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700378/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800379} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700380struct usb_security_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800381 __u8 bLength;
382 __u8 bDescriptorType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700383/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800384 __le16 wTotalLength;
385 __u8 bNumEncryptionTypes;
Ben Cheng655a7c02013-10-16 16:09:24 -0700386} __attribute__((packed));
387struct usb_key_descriptor {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700388/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800389 __u8 bLength;
390 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800391 __u8 tTKID[3];
392 __u8 bReserved;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700393/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800394 __u8 bKeyData[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700395} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700396struct usb_encryption_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800397 __u8 bLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700398/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800399 __u8 bDescriptorType;
400 __u8 bEncryptionType;
Ben Cheng655a7c02013-10-16 16:09:24 -0700401#define USB_ENC_TYPE_UNSECURE 0
402#define USB_ENC_TYPE_WIRED 1
Christopher Ferris106b3a82016-08-24 12:15:38 -0700403/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700404#define USB_ENC_TYPE_CCM_1 2
405#define USB_ENC_TYPE_RSA_1 3
Tao Baod7db5942015-01-28 10:07:51 -0800406 __u8 bEncryptionValue;
407 __u8 bAuthKeyIndex;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700408/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700409} __attribute__((packed));
410struct usb_bos_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800411 __u8 bLength;
412 __u8 bDescriptorType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700413/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800414 __le16 wTotalLength;
415 __u8 bNumDeviceCaps;
Ben Cheng655a7c02013-10-16 16:09:24 -0700416} __attribute__((packed));
417#define USB_DT_BOS_SIZE 5
Christopher Ferris106b3a82016-08-24 12:15:38 -0700418/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700419struct usb_dev_cap_header {
Tao Baod7db5942015-01-28 10:07:51 -0800420 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -0800421 __u8 bDescriptorType;
422 __u8 bDevCapabilityType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700423/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700424} __attribute__((packed));
425#define USB_CAP_TYPE_WIRELESS_USB 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700426struct usb_wireless_cap_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800427 __u8 bLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700428/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800429 __u8 bDescriptorType;
430 __u8 bDevCapabilityType;
Tao Baod7db5942015-01-28 10:07:51 -0800431 __u8 bmAttributes;
Ben Cheng655a7c02013-10-16 16:09:24 -0700432#define USB_WIRELESS_P2P_DRD (1 << 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700433/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700434#define USB_WIRELESS_BEACON_MASK (3 << 2)
435#define USB_WIRELESS_BEACON_SELF (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700436#define USB_WIRELESS_BEACON_DIRECTED (2 << 2)
437#define USB_WIRELESS_BEACON_NONE (3 << 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700438/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800439 __le16 wPHYRates;
Ben Cheng655a7c02013-10-16 16:09:24 -0700440#define USB_WIRELESS_PHY_53 (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700441#define USB_WIRELESS_PHY_80 (1 << 1)
442#define USB_WIRELESS_PHY_107 (1 << 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700443/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700444#define USB_WIRELESS_PHY_160 (1 << 3)
445#define USB_WIRELESS_PHY_200 (1 << 4)
Ben Cheng655a7c02013-10-16 16:09:24 -0700446#define USB_WIRELESS_PHY_320 (1 << 5)
447#define USB_WIRELESS_PHY_400 (1 << 6)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700448/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700449#define USB_WIRELESS_PHY_480 (1 << 7)
Tao Baod7db5942015-01-28 10:07:51 -0800450 __u8 bmTFITXPowerInfo;
Tao Baod7db5942015-01-28 10:07:51 -0800451 __u8 bmFFITXPowerInfo;
452 __le16 bmBandGroup;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700453/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800454 __u8 bReserved;
Ben Cheng655a7c02013-10-16 16:09:24 -0700455} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700456#define USB_CAP_TYPE_EXT 2
457struct usb_ext_cap_descriptor {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700458/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800459 __u8 bLength;
460 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800461 __u8 bDevCapabilityType;
462 __le32 bmAttributes;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700463/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700464#define USB_LPM_SUPPORT (1 << 1)
465#define USB_BESL_SUPPORT (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700466#define USB_BESL_BASELINE_VALID (1 << 3)
467#define USB_BESL_DEEP_VALID (1 << 4)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700468/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700469#define USB_GET_BESL_BASELINE(p) (((p) & (0xf << 8)) >> 8)
470#define USB_GET_BESL_DEEP(p) (((p) & (0xf << 12)) >> 12)
Ben Cheng655a7c02013-10-16 16:09:24 -0700471} __attribute__((packed));
472#define USB_DT_USB_EXT_CAP_SIZE 7
Christopher Ferris106b3a82016-08-24 12:15:38 -0700473/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700474#define USB_SS_CAP_TYPE 3
475struct usb_ss_cap_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800476 __u8 bLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700477 __u8 bDescriptorType;
478/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
479 __u8 bDevCapabilityType;
480 __u8 bmAttributes;
481#define USB_LTM_SUPPORT (1 << 1)
482 __le16 wSpeedSupported;
483/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
484#define USB_LOW_SPEED_OPERATION (1)
485#define USB_FULL_SPEED_OPERATION (1 << 1)
486#define USB_HIGH_SPEED_OPERATION (1 << 2)
487#define USB_5GBPS_OPERATION (1 << 3)
488/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
489 __u8 bFunctionalitySupport;
490 __u8 bU1devExitLat;
491 __le16 bU2DevExitLat;
492} __attribute__((packed));
493/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
494#define USB_DT_USB_SS_CAP_SIZE 10
495#define CONTAINER_ID_TYPE 4
496struct usb_ss_container_id_descriptor {
497 __u8 bLength;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800498/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800499 __u8 bDescriptorType;
500 __u8 bDevCapabilityType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700501 __u8 bReserved;
502 __u8 ContainerID[16];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800503/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700504} __attribute__((packed));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700505#define USB_DT_USB_SS_CONTN_ID_SIZE 20
506#define USB_SSP_CAP_TYPE 0xa
507struct usb_ssp_cap_descriptor {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800508/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
509 __u8 bLength;
510 __u8 bDescriptorType;
511 __u8 bDevCapabilityType;
512 __u8 bReserved;
513/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700514 __le32 bmAttributes;
515#define USB_SSP_SUBLINK_SPEED_ATTRIBS (0x1f << 0)
516#define USB_SSP_SUBLINK_SPEED_IDS (0xf << 5)
517 __le16 wFunctionalitySupport;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800518/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700519#define USB_SSP_MIN_SUBLINK_SPEED_ATTRIBUTE_ID (0xf)
520#define USB_SSP_MIN_RX_LANE_COUNT (0xf << 8)
521#define USB_SSP_MIN_TX_LANE_COUNT (0xf << 12)
522 __le16 wReserved;
523/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
524 __le32 bmSublinkSpeedAttr[1];
525#define USB_SSP_SUBLINK_SPEED_SSID (0xf)
526#define USB_SSP_SUBLINK_SPEED_LSE (0x3 << 4)
527#define USB_SSP_SUBLINK_SPEED_ST (0x3 << 6)
528/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
529#define USB_SSP_SUBLINK_SPEED_RSVD (0x3f << 8)
530#define USB_SSP_SUBLINK_SPEED_LP (0x3 << 14)
531#define USB_SSP_SUBLINK_SPEED_LSM (0xff << 16)
532} __attribute__((packed));
533/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
534#define USB_PD_POWER_DELIVERY_CAPABILITY 0x06
535#define USB_PD_BATTERY_INFO_CAPABILITY 0x07
536#define USB_PD_PD_CONSUMER_PORT_CAPABILITY 0x08
537#define USB_PD_PD_PROVIDER_PORT_CAPABILITY 0x09
538/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
539struct usb_pd_cap_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800540 __u8 bLength;
541 __u8 bDescriptorType;
542 __u8 bDevCapabilityType;
Ben Cheng655a7c02013-10-16 16:09:24 -0700543/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800544 __u8 bReserved;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800545 __le32 bmAttributes;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700546#define USB_PD_CAP_BATTERY_CHARGING (1 << 1)
547#define USB_PD_CAP_USB_PD (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700548/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700549#define USB_PD_CAP_PROVIDER (1 << 3)
550#define USB_PD_CAP_CONSUMER (1 << 4)
551#define USB_PD_CAP_CHARGING_POLICY (1 << 5)
552#define USB_PD_CAP_TYPE_C_CURRENT (1 << 6)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800553/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700554#define USB_PD_CAP_PWR_AC (1 << 8)
555#define USB_PD_CAP_PWR_BAT (1 << 9)
556#define USB_PD_CAP_PWR_USE_V_BUS (1 << 14)
557 __le16 bmProviderPorts;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800558/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700559 __le16 bmConsumerPorts;
560 __le16 bcdBCVersion;
561 __le16 bcdPDVersion;
562 __le16 bcdUSBTypeCVersion;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800563/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
564} __attribute__((packed));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700565struct usb_pd_cap_battery_info_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800566 __u8 bLength;
567 __u8 bDescriptorType;
Ben Cheng655a7c02013-10-16 16:09:24 -0700568/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris106b3a82016-08-24 12:15:38 -0700569 __u8 bDevCapabilityType;
570 __u8 iBattery;
571 __u8 iSerial;
572 __u8 iManufacturer;
573/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
574 __u8 bBatteryId;
575 __u8 bReserved;
576 __le32 dwChargedThreshold;
577 __le32 dwWeakThreshold;
578/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
579 __le32 dwBatteryDesignCapacity;
580 __le32 dwBatteryLastFullchargeCapacity;
581} __attribute__((packed));
582struct usb_pd_cap_consumer_port_descriptor {
583/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
584 __u8 bLength;
585 __u8 bDescriptorType;
586 __u8 bDevCapabilityType;
587 __u8 bReserved;
588/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
589 __u8 bmCapabilities;
590#define USB_PD_CAP_CONSUMER_BC (1 << 0)
591#define USB_PD_CAP_CONSUMER_PD (1 << 1)
592#define USB_PD_CAP_CONSUMER_TYPE_C (1 << 2)
593/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
594 __le16 wMinVoltage;
595 __le16 wMaxVoltage;
596 __u16 wReserved;
597 __le32 dwMaxOperatingPower;
598/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
599 __le32 dwMaxPeakPower;
600 __le32 dwMaxPeakPowerTime;
601#define USB_PD_CAP_CONSUMER_UNKNOWN_PEAK_POWER_TIME 0xffff
602} __attribute__((packed));
603/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
604struct usb_pd_cap_provider_port_descriptor {
605 __u8 bLength;
606 __u8 bDescriptorType;
607 __u8 bDevCapabilityType;
608/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
609 __u8 bReserved1;
610 __u8 bmCapabilities;
611#define USB_PD_CAP_PROVIDER_BC (1 << 0)
612#define USB_PD_CAP_PROVIDER_PD (1 << 1)
613/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
614#define USB_PD_CAP_PROVIDER_TYPE_C (1 << 2)
615 __u8 bNumOfPDObjects;
616 __u8 bReserved2;
617 __le32 wPowerDataObject[];
618/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
619} __attribute__((packed));
620#define USB_PTM_CAP_TYPE 0xb
621struct usb_ptm_cap_descriptor {
622 __u8 bLength;
623/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
624 __u8 bDescriptorType;
625 __u8 bDevCapabilityType;
626} __attribute__((packed));
627#define USB_DT_USB_SSP_CAP_SIZE(ssac) (16 + ssac * 4)
628/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
629struct usb_wireless_ep_comp_descriptor {
630 __u8 bLength;
631 __u8 bDescriptorType;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800632 __u8 bMaxBurst;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700633/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800634 __u8 bMaxSequence;
635 __le16 wMaxStreamDelay;
636 __le16 wOverTheAirPacketSize;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800637 __u8 bOverTheAirInterval;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700638/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800639 __u8 bmCompAttributes;
Ben Cheng655a7c02013-10-16 16:09:24 -0700640#define USB_ENDPOINT_SWITCH_MASK 0x03
641#define USB_ENDPOINT_SWITCH_NO 0
Christopher Ferris05d08e92016-02-04 13:16:38 -0800642#define USB_ENDPOINT_SWITCH_SWITCH 1
Christopher Ferris106b3a82016-08-24 12:15:38 -0700643/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700644#define USB_ENDPOINT_SWITCH_SCALE 2
645} __attribute__((packed));
646struct usb_handshake {
Christopher Ferris05d08e92016-02-04 13:16:38 -0800647 __u8 bMessageNumber;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700648/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800649 __u8 bStatus;
650 __u8 tTKID[3];
651 __u8 bReserved;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800652 __u8 CDID[16];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700653/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800654 __u8 nonce[16];
655 __u8 MIC[8];
Ben Cheng655a7c02013-10-16 16:09:24 -0700656} __attribute__((packed));
Christopher Ferris05d08e92016-02-04 13:16:38 -0800657struct usb_connection_context {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700658/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800659 __u8 CHID[16];
660 __u8 CDID[16];
661 __u8 CK[16];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800662} __attribute__((packed));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700663/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700664enum usb_device_speed {
Tao Baod7db5942015-01-28 10:07:51 -0800665 USB_SPEED_UNKNOWN = 0,
666 USB_SPEED_LOW,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800667 USB_SPEED_FULL,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700668/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800669 USB_SPEED_HIGH,
670 USB_SPEED_WIRELESS,
671 USB_SPEED_SUPER,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700672 USB_SPEED_SUPER_PLUS,
Tao Baod7db5942015-01-28 10:07:51 -0800673/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800674};
Ben Cheng655a7c02013-10-16 16:09:24 -0700675enum usb_device_state {
Tao Baod7db5942015-01-28 10:07:51 -0800676 USB_STATE_NOTATTACHED = 0,
677 USB_STATE_ATTACHED,
Ben Cheng655a7c02013-10-16 16:09:24 -0700678/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800679 USB_STATE_POWERED,
Tao Baod7db5942015-01-28 10:07:51 -0800680 USB_STATE_RECONNECTING,
681 USB_STATE_UNAUTHENTICATED,
682 USB_STATE_DEFAULT,
Ben Cheng655a7c02013-10-16 16:09:24 -0700683/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800684 USB_STATE_ADDRESS,
Tao Baod7db5942015-01-28 10:07:51 -0800685 USB_STATE_CONFIGURED,
686 USB_STATE_SUSPENDED
Ben Cheng655a7c02013-10-16 16:09:24 -0700687};
Ben Cheng655a7c02013-10-16 16:09:24 -0700688/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800689enum usb3_link_state {
Tao Baod7db5942015-01-28 10:07:51 -0800690 USB3_LPM_U0 = 0,
691 USB3_LPM_U1,
692 USB3_LPM_U2,
Tao Baod7db5942015-01-28 10:07:51 -0800693/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800694 USB3_LPM_U3
Ben Cheng655a7c02013-10-16 16:09:24 -0700695};
Ben Cheng655a7c02013-10-16 16:09:24 -0700696#define USB3_LPM_DISABLED 0x0
697#define USB3_LPM_U1_MAX_TIMEOUT 0x7F
Tao Baod7db5942015-01-28 10:07:51 -0800698/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800699#define USB3_LPM_U2_MAX_TIMEOUT 0xFE
Ben Cheng655a7c02013-10-16 16:09:24 -0700700#define USB3_LPM_DEVICE_INITIATED 0xFF
Ben Cheng655a7c02013-10-16 16:09:24 -0700701struct usb_set_sel_req {
Tao Baod7db5942015-01-28 10:07:51 -0800702 __u8 u1_sel;
Ben Cheng655a7c02013-10-16 16:09:24 -0700703/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800704 __u8 u1_pel;
Tao Baod7db5942015-01-28 10:07:51 -0800705 __le16 u2_sel;
706 __le16 u2_pel;
707} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700708/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800709#define USB3_LPM_MAX_U1_SEL_PEL 0xFF
Tao Baod7db5942015-01-28 10:07:51 -0800710#define USB3_LPM_MAX_U2_SEL_PEL 0xFFFF
Ben Cheng655a7c02013-10-16 16:09:24 -0700711#define USB_SELF_POWER_VBUS_MAX_DRAW 100
712#endif
Christopher Ferris05d08e92016-02-04 13:16:38 -0800713/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */