blob: e27457e0993e23298f2767573d622b6ff8e2a40b [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 __LINUX_CH11_H
20#define __LINUX_CH11_H
21#include <linux/types.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070022#define USB_RT_HUB (USB_TYPE_CLASS | USB_RECIP_DEVICE)
Elliott Hughes8cb52b02013-11-21 13:43:23 -080023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070024#define USB_RT_PORT (USB_TYPE_CLASS | USB_RECIP_OTHER)
25#define HUB_CLEAR_TT_BUFFER 8
26#define HUB_RESET_TT 9
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define HUB_GET_TT_STATE 10
Elliott Hughes8cb52b02013-11-21 13:43:23 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070029#define HUB_STOP_TT 11
30#define HUB_SET_DEPTH 12
31#define HUB_GET_PORT_ERR_COUNT 13
Ben Cheng655a7c02013-10-16 16:09:24 -070032#define C_HUB_LOCAL_POWER 0
Elliott Hughes8cb52b02013-11-21 13:43:23 -080033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070034#define C_HUB_OVER_CURRENT 1
35#define USB_PORT_FEAT_CONNECTION 0
36#define USB_PORT_FEAT_ENABLE 1
Ben Cheng655a7c02013-10-16 16:09:24 -070037#define USB_PORT_FEAT_SUSPEND 2
Elliott Hughes8cb52b02013-11-21 13:43:23 -080038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define USB_PORT_FEAT_OVER_CURRENT 3
40#define USB_PORT_FEAT_RESET 4
41#define USB_PORT_FEAT_L1 5
Ben Cheng655a7c02013-10-16 16:09:24 -070042#define USB_PORT_FEAT_POWER 8
Elliott Hughes8cb52b02013-11-21 13:43:23 -080043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070044#define USB_PORT_FEAT_LOWSPEED 9
45#define USB_PORT_FEAT_C_CONNECTION 16
46#define USB_PORT_FEAT_C_ENABLE 17
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define USB_PORT_FEAT_C_SUSPEND 18
Elliott Hughes8cb52b02013-11-21 13:43:23 -080048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070049#define USB_PORT_FEAT_C_OVER_CURRENT 19
50#define USB_PORT_FEAT_C_RESET 20
51#define USB_PORT_FEAT_TEST 21
Ben Cheng655a7c02013-10-16 16:09:24 -070052#define USB_PORT_FEAT_INDICATOR 22
Elliott Hughes8cb52b02013-11-21 13:43:23 -080053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070054#define USB_PORT_FEAT_C_PORT_L1 23
55#define USB_PORT_FEAT_LINK_STATE 5
56#define USB_PORT_FEAT_U1_TIMEOUT 23
Ben Cheng655a7c02013-10-16 16:09:24 -070057#define USB_PORT_FEAT_U2_TIMEOUT 24
Elliott Hughes8cb52b02013-11-21 13:43:23 -080058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define USB_PORT_FEAT_C_PORT_LINK_STATE 25
60#define USB_PORT_FEAT_C_PORT_CONFIG_ERROR 26
61#define USB_PORT_FEAT_REMOTE_WAKE_MASK 27
Ben Cheng655a7c02013-10-16 16:09:24 -070062#define USB_PORT_FEAT_BH_PORT_RESET 28
Elliott Hughes8cb52b02013-11-21 13:43:23 -080063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070064#define USB_PORT_FEAT_C_BH_PORT_RESET 29
65#define USB_PORT_FEAT_FORCE_LINKPM_ACCEPT 30
66#define USB_PORT_LPM_TIMEOUT(p) (((p) & 0xff) << 8)
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define USB_PORT_FEAT_REMOTE_WAKE_CONNECT (1 << 8)
Elliott Hughes8cb52b02013-11-21 13:43:23 -080068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070069#define USB_PORT_FEAT_REMOTE_WAKE_DISCONNECT (1 << 9)
70#define USB_PORT_FEAT_REMOTE_WAKE_OVER_CURRENT (1 << 10)
71struct usb_port_status {
Ben Cheng655a7c02013-10-16 16:09:24 -070072 __le16 wPortStatus;
Elliott Hughes8cb52b02013-11-21 13:43:23 -080073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070074 __le16 wPortChange;
75} __attribute__ ((packed));
76#define USB_PORT_STAT_CONNECTION 0x0001
Ben Cheng655a7c02013-10-16 16:09:24 -070077#define USB_PORT_STAT_ENABLE 0x0002
Elliott Hughes8cb52b02013-11-21 13:43:23 -080078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define USB_PORT_STAT_SUSPEND 0x0004
80#define USB_PORT_STAT_OVERCURRENT 0x0008
81#define USB_PORT_STAT_RESET 0x0010
Ben Cheng655a7c02013-10-16 16:09:24 -070082#define USB_PORT_STAT_L1 0x0020
Elliott Hughes8cb52b02013-11-21 13:43:23 -080083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070084#define USB_PORT_STAT_POWER 0x0100
85#define USB_PORT_STAT_LOW_SPEED 0x0200
86#define USB_PORT_STAT_HIGH_SPEED 0x0400
Ben Cheng655a7c02013-10-16 16:09:24 -070087#define USB_PORT_STAT_TEST 0x0800
Elliott Hughes8cb52b02013-11-21 13:43:23 -080088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070089#define USB_PORT_STAT_INDICATOR 0x1000
90#define USB_PORT_STAT_LINK_STATE 0x01e0
91#define USB_SS_PORT_STAT_POWER 0x0200
Ben Cheng655a7c02013-10-16 16:09:24 -070092#define USB_SS_PORT_STAT_SPEED 0x1c00
Elliott Hughes8cb52b02013-11-21 13:43:23 -080093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070094#define USB_PORT_STAT_SPEED_5GBPS 0x0000
95#define USB_SS_PORT_STAT_MASK (USB_PORT_STAT_CONNECTION | USB_PORT_STAT_ENABLE | USB_PORT_STAT_OVERCURRENT | USB_PORT_STAT_RESET)
96#define USB_SS_PORT_LS_U0 0x0000
Ben Cheng655a7c02013-10-16 16:09:24 -070097#define USB_SS_PORT_LS_U1 0x0020
Elliott Hughes8cb52b02013-11-21 13:43:23 -080098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070099#define USB_SS_PORT_LS_U2 0x0040
100#define USB_SS_PORT_LS_U3 0x0060
101#define USB_SS_PORT_LS_SS_DISABLED 0x0080
Ben Cheng655a7c02013-10-16 16:09:24 -0700102#define USB_SS_PORT_LS_RX_DETECT 0x00a0
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700104#define USB_SS_PORT_LS_SS_INACTIVE 0x00c0
105#define USB_SS_PORT_LS_POLLING 0x00e0
106#define USB_SS_PORT_LS_RECOVERY 0x0100
Ben Cheng655a7c02013-10-16 16:09:24 -0700107#define USB_SS_PORT_LS_HOT_RESET 0x0120
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700109#define USB_SS_PORT_LS_COMP_MOD 0x0140
110#define USB_SS_PORT_LS_LOOPBACK 0x0160
111#define USB_PORT_STAT_C_CONNECTION 0x0001
Ben Cheng655a7c02013-10-16 16:09:24 -0700112#define USB_PORT_STAT_C_ENABLE 0x0002
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700114#define USB_PORT_STAT_C_SUSPEND 0x0004
115#define USB_PORT_STAT_C_OVERCURRENT 0x0008
116#define USB_PORT_STAT_C_RESET 0x0010
Ben Cheng655a7c02013-10-16 16:09:24 -0700117#define USB_PORT_STAT_C_L1 0x0020
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700119#define USB_PORT_STAT_C_BH_RESET 0x0020
120#define USB_PORT_STAT_C_LINK_STATE 0x0040
121#define USB_PORT_STAT_C_CONFIG_ERROR 0x0080
Ben Cheng655a7c02013-10-16 16:09:24 -0700122#define HUB_CHAR_LPSM 0x0003
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700124#define HUB_CHAR_COMMON_LPSM 0x0000
125#define HUB_CHAR_INDV_PORT_LPSM 0x0001
126#define HUB_CHAR_NO_LPSM 0x0002
Ben Cheng655a7c02013-10-16 16:09:24 -0700127#define HUB_CHAR_COMPOUND 0x0004
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700129#define HUB_CHAR_OCPM 0x0018
130#define HUB_CHAR_COMMON_OCPM 0x0000
131#define HUB_CHAR_INDV_PORT_OCPM 0x0008
Ben Cheng655a7c02013-10-16 16:09:24 -0700132#define HUB_CHAR_NO_OCPM 0x0010
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700134#define HUB_CHAR_TTTT 0x0060
135#define HUB_CHAR_PORTIND 0x0080
136struct usb_hub_status {
Ben Cheng655a7c02013-10-16 16:09:24 -0700137 __le16 wHubStatus;
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700139 __le16 wHubChange;
140} __attribute__ ((packed));
141#define HUB_STATUS_LOCAL_POWER 0x0001
Ben Cheng655a7c02013-10-16 16:09:24 -0700142#define HUB_STATUS_OVERCURRENT 0x0002
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700144#define HUB_CHANGE_LOCAL_POWER 0x0001
145#define HUB_CHANGE_OVERCURRENT 0x0002
146#define USB_DT_HUB (USB_TYPE_CLASS | 0x09)
Ben Cheng655a7c02013-10-16 16:09:24 -0700147#define USB_DT_SS_HUB (USB_TYPE_CLASS | 0x0a)
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700149#define USB_DT_HUB_NONVAR_SIZE 7
150#define USB_DT_SS_HUB_SIZE 12
151#define USB_HUB_PR_FS 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700152#define USB_HUB_PR_HS_NO_TT 0
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700154#define USB_HUB_PR_HS_SINGLE_TT 1
155#define USB_HUB_PR_HS_MULTI_TT 2
156#define USB_HUB_PR_SS 3
Ben Cheng655a7c02013-10-16 16:09:24 -0700157struct usb_hub_descriptor {
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700159 __u8 bDescLength;
160 __u8 bDescriptorType;
161 __u8 bNbrPorts;
Ben Cheng655a7c02013-10-16 16:09:24 -0700162 __le16 wHubCharacteristics;
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700164 __u8 bPwrOn2PwrGood;
165 __u8 bHubContrCurrent;
166 union {
Ben Cheng655a7c02013-10-16 16:09:24 -0700167 struct {
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700169 __u8 DeviceRemovable[(USB_MAXCHILDREN + 1 + 7) / 8];
170 __u8 PortPwrCtrlMask[(USB_MAXCHILDREN + 1 + 7) / 8];
171 } __attribute__ ((packed)) hs;
Ben Cheng655a7c02013-10-16 16:09:24 -0700172 struct {
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700174 __u8 bHubHdrDecLat;
175 __le16 wHubDelay;
176 __le16 DeviceRemovable;
Ben Cheng655a7c02013-10-16 16:09:24 -0700177 } __attribute__ ((packed)) ss;
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700179 } u;
180} __attribute__ ((packed));
181#define HUB_LED_AUTO 0
Ben Cheng655a7c02013-10-16 16:09:24 -0700182#define HUB_LED_AMBER 1
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700184#define HUB_LED_GREEN 2
185#define HUB_LED_OFF 3
186enum hub_led_mode {
Ben Cheng655a7c02013-10-16 16:09:24 -0700187 INDICATOR_AUTO = 0,
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700189 INDICATOR_CYCLE,
190 INDICATOR_GREEN_BLINK, INDICATOR_GREEN_BLINK_OFF,
191 INDICATOR_AMBER_BLINK, INDICATOR_AMBER_BLINK_OFF,
Ben Cheng655a7c02013-10-16 16:09:24 -0700192 INDICATOR_ALT_BLINK, INDICATOR_ALT_BLINK_OFF
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700194} __attribute__ ((packed));
195#define HUB_TTTT_8_BITS 0x00
196#define HUB_TTTT_16_BITS 0x20
Ben Cheng655a7c02013-10-16 16:09:24 -0700197#define HUB_TTTT_24_BITS 0x40
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700199#define HUB_TTTT_32_BITS 0x60
200#endif