18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * This file holds Hub protocol constants and data structures that are
48c2ecf20Sopenharmony_ci * defined in chapter 11 (Hub Specification) of the USB 2.0 specification.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * It is used/shared between the USB core, the HCDs and couple of other USB
78c2ecf20Sopenharmony_ci * drivers.
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef __LINUX_CH11_H
118c2ecf20Sopenharmony_ci#define __LINUX_CH11_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <linux/types.h>	/* __u8 etc */
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci/* This is arbitrary.
168c2ecf20Sopenharmony_ci * From USB 2.0 spec Table 11-13, offset 7, a hub can
178c2ecf20Sopenharmony_ci * have up to 255 ports. The most yet reported is 10.
188c2ecf20Sopenharmony_ci *
198c2ecf20Sopenharmony_ci * Current Wireless USB host hardware (Intel i1480 for example) allows
208c2ecf20Sopenharmony_ci * up to 22 devices to connect. Upcoming hardware might raise that
218c2ecf20Sopenharmony_ci * limit. Because the arrays need to add a bit for hub status data, we
228c2ecf20Sopenharmony_ci * use 31, so plus one evens out to four bytes.
238c2ecf20Sopenharmony_ci */
248c2ecf20Sopenharmony_ci#define USB_MAXCHILDREN		31
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci/* See USB 3.1 spec Table 10-5 */
278c2ecf20Sopenharmony_ci#define USB_SS_MAXPORTS		15
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci/*
308c2ecf20Sopenharmony_ci * Hub request types
318c2ecf20Sopenharmony_ci */
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#define USB_RT_HUB	(USB_TYPE_CLASS | USB_RECIP_DEVICE)
348c2ecf20Sopenharmony_ci#define USB_RT_PORT	(USB_TYPE_CLASS | USB_RECIP_OTHER)
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci/*
378c2ecf20Sopenharmony_ci * Port status type for GetPortStatus requests added in USB 3.1
388c2ecf20Sopenharmony_ci * See USB 3.1 spec Table 10-12
398c2ecf20Sopenharmony_ci */
408c2ecf20Sopenharmony_ci#define HUB_PORT_STATUS		0
418c2ecf20Sopenharmony_ci#define HUB_PORT_PD_STATUS	1
428c2ecf20Sopenharmony_ci#define HUB_EXT_PORT_STATUS	2
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci/*
458c2ecf20Sopenharmony_ci * Hub class requests
468c2ecf20Sopenharmony_ci * See USB 2.0 spec Table 11-16
478c2ecf20Sopenharmony_ci */
488c2ecf20Sopenharmony_ci#define HUB_CLEAR_TT_BUFFER	8
498c2ecf20Sopenharmony_ci#define HUB_RESET_TT		9
508c2ecf20Sopenharmony_ci#define HUB_GET_TT_STATE	10
518c2ecf20Sopenharmony_ci#define HUB_STOP_TT		11
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci/*
548c2ecf20Sopenharmony_ci * Hub class additional requests defined by USB 3.0 spec
558c2ecf20Sopenharmony_ci * See USB 3.0 spec Table 10-6
568c2ecf20Sopenharmony_ci */
578c2ecf20Sopenharmony_ci#define HUB_SET_DEPTH		12
588c2ecf20Sopenharmony_ci#define HUB_GET_PORT_ERR_COUNT	13
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci/*
618c2ecf20Sopenharmony_ci * Hub Class feature numbers
628c2ecf20Sopenharmony_ci * See USB 2.0 spec Table 11-17
638c2ecf20Sopenharmony_ci */
648c2ecf20Sopenharmony_ci#define C_HUB_LOCAL_POWER	0
658c2ecf20Sopenharmony_ci#define C_HUB_OVER_CURRENT	1
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci/*
688c2ecf20Sopenharmony_ci * Port feature numbers
698c2ecf20Sopenharmony_ci * See USB 2.0 spec Table 11-17
708c2ecf20Sopenharmony_ci */
718c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_CONNECTION	0
728c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_ENABLE		1
738c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_SUSPEND		2	/* L2 suspend */
748c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_OVER_CURRENT	3
758c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_RESET		4
768c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_L1		5	/* L1 suspend */
778c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_POWER		8
788c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_LOWSPEED		9	/* Should never be used */
798c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_C_CONNECTION	16
808c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_C_ENABLE		17
818c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_C_SUSPEND		18
828c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_C_OVER_CURRENT	19
838c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_C_RESET		20
848c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_TEST              21
858c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_INDICATOR         22
868c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_C_PORT_L1         23
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci/*
898c2ecf20Sopenharmony_ci * Port feature selectors added by USB 3.0 spec.
908c2ecf20Sopenharmony_ci * See USB 3.0 spec Table 10-7
918c2ecf20Sopenharmony_ci */
928c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_LINK_STATE		5
938c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_U1_TIMEOUT		23
948c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_U2_TIMEOUT		24
958c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_C_PORT_LINK_STATE		25
968c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_C_PORT_CONFIG_ERROR	26
978c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_REMOTE_WAKE_MASK		27
988c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_BH_PORT_RESET		28
998c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_C_BH_PORT_RESET		29
1008c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_FORCE_LINKPM_ACCEPT	30
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci#define USB_PORT_LPM_TIMEOUT(p)			(((p) & 0xff) << 8)
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci/* USB 3.0 hub remote wake mask bits, see table 10-14 */
1058c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_REMOTE_WAKE_CONNECT	(1 << 8)
1068c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_REMOTE_WAKE_DISCONNECT	(1 << 9)
1078c2ecf20Sopenharmony_ci#define USB_PORT_FEAT_REMOTE_WAKE_OVER_CURRENT	(1 << 10)
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci/*
1108c2ecf20Sopenharmony_ci * Hub Status and Hub Change results
1118c2ecf20Sopenharmony_ci * See USB 2.0 spec Table 11-19 and Table 11-20
1128c2ecf20Sopenharmony_ci * USB 3.1 extends the port status request and may return 4 additional bytes.
1138c2ecf20Sopenharmony_ci * See USB 3.1 spec section 10.16.2.6 Table 10-12 and 10-15
1148c2ecf20Sopenharmony_ci */
1158c2ecf20Sopenharmony_cistruct usb_port_status {
1168c2ecf20Sopenharmony_ci	__le16 wPortStatus;
1178c2ecf20Sopenharmony_ci	__le16 wPortChange;
1188c2ecf20Sopenharmony_ci	__le32 dwExtPortStatus;
1198c2ecf20Sopenharmony_ci} __attribute__ ((packed));
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci/*
1228c2ecf20Sopenharmony_ci * wPortStatus bit field
1238c2ecf20Sopenharmony_ci * See USB 2.0 spec Table 11-21
1248c2ecf20Sopenharmony_ci */
1258c2ecf20Sopenharmony_ci#define USB_PORT_STAT_CONNECTION	0x0001
1268c2ecf20Sopenharmony_ci#define USB_PORT_STAT_ENABLE		0x0002
1278c2ecf20Sopenharmony_ci#define USB_PORT_STAT_SUSPEND		0x0004
1288c2ecf20Sopenharmony_ci#define USB_PORT_STAT_OVERCURRENT	0x0008
1298c2ecf20Sopenharmony_ci#define USB_PORT_STAT_RESET		0x0010
1308c2ecf20Sopenharmony_ci#define USB_PORT_STAT_L1		0x0020
1318c2ecf20Sopenharmony_ci/* bits 6 to 7 are reserved */
1328c2ecf20Sopenharmony_ci#define USB_PORT_STAT_POWER		0x0100
1338c2ecf20Sopenharmony_ci#define USB_PORT_STAT_LOW_SPEED		0x0200
1348c2ecf20Sopenharmony_ci#define USB_PORT_STAT_HIGH_SPEED        0x0400
1358c2ecf20Sopenharmony_ci#define USB_PORT_STAT_TEST              0x0800
1368c2ecf20Sopenharmony_ci#define USB_PORT_STAT_INDICATOR         0x1000
1378c2ecf20Sopenharmony_ci/* bits 13 to 15 are reserved */
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci/*
1408c2ecf20Sopenharmony_ci * Additions to wPortStatus bit field from USB 3.0
1418c2ecf20Sopenharmony_ci * See USB 3.0 spec Table 10-10
1428c2ecf20Sopenharmony_ci */
1438c2ecf20Sopenharmony_ci#define USB_PORT_STAT_LINK_STATE	0x01e0
1448c2ecf20Sopenharmony_ci#define USB_SS_PORT_STAT_POWER		0x0200
1458c2ecf20Sopenharmony_ci#define USB_SS_PORT_STAT_SPEED		0x1c00
1468c2ecf20Sopenharmony_ci#define USB_PORT_STAT_SPEED_5GBPS	0x0000
1478c2ecf20Sopenharmony_ci/* Valid only if port is enabled */
1488c2ecf20Sopenharmony_ci/* Bits that are the same from USB 2.0 */
1498c2ecf20Sopenharmony_ci#define USB_SS_PORT_STAT_MASK (USB_PORT_STAT_CONNECTION |	    \
1508c2ecf20Sopenharmony_ci				USB_PORT_STAT_ENABLE |	    \
1518c2ecf20Sopenharmony_ci				USB_PORT_STAT_OVERCURRENT | \
1528c2ecf20Sopenharmony_ci				USB_PORT_STAT_RESET)
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ci/*
1558c2ecf20Sopenharmony_ci * Definitions for PORT_LINK_STATE values
1568c2ecf20Sopenharmony_ci * (bits 5-8) in wPortStatus
1578c2ecf20Sopenharmony_ci */
1588c2ecf20Sopenharmony_ci#define USB_SS_PORT_LS_U0		0x0000
1598c2ecf20Sopenharmony_ci#define USB_SS_PORT_LS_U1		0x0020
1608c2ecf20Sopenharmony_ci#define USB_SS_PORT_LS_U2		0x0040
1618c2ecf20Sopenharmony_ci#define USB_SS_PORT_LS_U3		0x0060
1628c2ecf20Sopenharmony_ci#define USB_SS_PORT_LS_SS_DISABLED	0x0080
1638c2ecf20Sopenharmony_ci#define USB_SS_PORT_LS_RX_DETECT	0x00a0
1648c2ecf20Sopenharmony_ci#define USB_SS_PORT_LS_SS_INACTIVE	0x00c0
1658c2ecf20Sopenharmony_ci#define USB_SS_PORT_LS_POLLING		0x00e0
1668c2ecf20Sopenharmony_ci#define USB_SS_PORT_LS_RECOVERY		0x0100
1678c2ecf20Sopenharmony_ci#define USB_SS_PORT_LS_HOT_RESET	0x0120
1688c2ecf20Sopenharmony_ci#define USB_SS_PORT_LS_COMP_MOD		0x0140
1698c2ecf20Sopenharmony_ci#define USB_SS_PORT_LS_LOOPBACK		0x0160
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci/*
1728c2ecf20Sopenharmony_ci * wPortChange bit field
1738c2ecf20Sopenharmony_ci * See USB 2.0 spec Table 11-22 and USB 2.0 LPM ECN Table-4.10
1748c2ecf20Sopenharmony_ci * Bits 0 to 5 shown, bits 6 to 15 are reserved
1758c2ecf20Sopenharmony_ci */
1768c2ecf20Sopenharmony_ci#define USB_PORT_STAT_C_CONNECTION	0x0001
1778c2ecf20Sopenharmony_ci#define USB_PORT_STAT_C_ENABLE		0x0002
1788c2ecf20Sopenharmony_ci#define USB_PORT_STAT_C_SUSPEND		0x0004
1798c2ecf20Sopenharmony_ci#define USB_PORT_STAT_C_OVERCURRENT	0x0008
1808c2ecf20Sopenharmony_ci#define USB_PORT_STAT_C_RESET		0x0010
1818c2ecf20Sopenharmony_ci#define USB_PORT_STAT_C_L1		0x0020
1828c2ecf20Sopenharmony_ci/*
1838c2ecf20Sopenharmony_ci * USB 3.0 wPortChange bit fields
1848c2ecf20Sopenharmony_ci * See USB 3.0 spec Table 10-11
1858c2ecf20Sopenharmony_ci */
1868c2ecf20Sopenharmony_ci#define USB_PORT_STAT_C_BH_RESET	0x0020
1878c2ecf20Sopenharmony_ci#define USB_PORT_STAT_C_LINK_STATE	0x0040
1888c2ecf20Sopenharmony_ci#define USB_PORT_STAT_C_CONFIG_ERROR	0x0080
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci/*
1918c2ecf20Sopenharmony_ci * USB 3.1 dwExtPortStatus field masks
1928c2ecf20Sopenharmony_ci * See USB 3.1 spec 10.16.2.6.3 Table 10-15
1938c2ecf20Sopenharmony_ci */
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci#define USB_EXT_PORT_STAT_RX_SPEED_ID	0x0000000f
1968c2ecf20Sopenharmony_ci#define USB_EXT_PORT_STAT_TX_SPEED_ID	0x000000f0
1978c2ecf20Sopenharmony_ci#define USB_EXT_PORT_STAT_RX_LANES	0x00000f00
1988c2ecf20Sopenharmony_ci#define USB_EXT_PORT_STAT_TX_LANES	0x0000f000
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci#define USB_EXT_PORT_RX_LANES(p) \
2018c2ecf20Sopenharmony_ci			(((p) & USB_EXT_PORT_STAT_RX_LANES) >> 8)
2028c2ecf20Sopenharmony_ci#define USB_EXT_PORT_TX_LANES(p) \
2038c2ecf20Sopenharmony_ci			(((p) & USB_EXT_PORT_STAT_TX_LANES) >> 12)
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ci/*
2068c2ecf20Sopenharmony_ci * wHubCharacteristics (masks)
2078c2ecf20Sopenharmony_ci * See USB 2.0 spec Table 11-13, offset 3
2088c2ecf20Sopenharmony_ci */
2098c2ecf20Sopenharmony_ci#define HUB_CHAR_LPSM		0x0003 /* Logical Power Switching Mode mask */
2108c2ecf20Sopenharmony_ci#define HUB_CHAR_COMMON_LPSM	0x0000 /* All ports power control at once */
2118c2ecf20Sopenharmony_ci#define HUB_CHAR_INDV_PORT_LPSM	0x0001 /* per-port power control */
2128c2ecf20Sopenharmony_ci#define HUB_CHAR_NO_LPSM	0x0002 /* no power switching */
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci#define HUB_CHAR_COMPOUND	0x0004 /* hub is part of a compound device */
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci#define HUB_CHAR_OCPM		0x0018 /* Over-Current Protection Mode mask */
2178c2ecf20Sopenharmony_ci#define HUB_CHAR_COMMON_OCPM	0x0000 /* All ports Over-Current reporting */
2188c2ecf20Sopenharmony_ci#define HUB_CHAR_INDV_PORT_OCPM	0x0008 /* per-port Over-current reporting */
2198c2ecf20Sopenharmony_ci#define HUB_CHAR_NO_OCPM	0x0010 /* No Over-current Protection support */
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_ci#define HUB_CHAR_TTTT		0x0060 /* TT Think Time mask */
2228c2ecf20Sopenharmony_ci#define HUB_CHAR_PORTIND	0x0080 /* per-port indicators (LEDs) */
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_cistruct usb_hub_status {
2258c2ecf20Sopenharmony_ci	__le16 wHubStatus;
2268c2ecf20Sopenharmony_ci	__le16 wHubChange;
2278c2ecf20Sopenharmony_ci} __attribute__ ((packed));
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci/*
2308c2ecf20Sopenharmony_ci * Hub Status & Hub Change bit masks
2318c2ecf20Sopenharmony_ci * See USB 2.0 spec Table 11-19 and Table 11-20
2328c2ecf20Sopenharmony_ci * Bits 0 and 1 for wHubStatus and wHubChange
2338c2ecf20Sopenharmony_ci * Bits 2 to 15 are reserved for both
2348c2ecf20Sopenharmony_ci */
2358c2ecf20Sopenharmony_ci#define HUB_STATUS_LOCAL_POWER	0x0001
2368c2ecf20Sopenharmony_ci#define HUB_STATUS_OVERCURRENT	0x0002
2378c2ecf20Sopenharmony_ci#define HUB_CHANGE_LOCAL_POWER	0x0001
2388c2ecf20Sopenharmony_ci#define HUB_CHANGE_OVERCURRENT	0x0002
2398c2ecf20Sopenharmony_ci
2408c2ecf20Sopenharmony_ci
2418c2ecf20Sopenharmony_ci/*
2428c2ecf20Sopenharmony_ci * Hub descriptor
2438c2ecf20Sopenharmony_ci * See USB 2.0 spec Table 11-13
2448c2ecf20Sopenharmony_ci */
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_ci#define USB_DT_HUB			(USB_TYPE_CLASS | 0x09)
2478c2ecf20Sopenharmony_ci#define USB_DT_SS_HUB			(USB_TYPE_CLASS | 0x0a)
2488c2ecf20Sopenharmony_ci#define USB_DT_HUB_NONVAR_SIZE		7
2498c2ecf20Sopenharmony_ci#define USB_DT_SS_HUB_SIZE              12
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_ci/*
2528c2ecf20Sopenharmony_ci * Hub Device descriptor
2538c2ecf20Sopenharmony_ci * USB Hub class device protocols
2548c2ecf20Sopenharmony_ci */
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_ci#define USB_HUB_PR_FS		0 /* Full speed hub */
2578c2ecf20Sopenharmony_ci#define USB_HUB_PR_HS_NO_TT	0 /* Hi-speed hub without TT */
2588c2ecf20Sopenharmony_ci#define USB_HUB_PR_HS_SINGLE_TT	1 /* Hi-speed hub with single TT */
2598c2ecf20Sopenharmony_ci#define USB_HUB_PR_HS_MULTI_TT	2 /* Hi-speed hub with multiple TT */
2608c2ecf20Sopenharmony_ci#define USB_HUB_PR_SS		3 /* Super speed hub */
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_cistruct usb_hub_descriptor {
2638c2ecf20Sopenharmony_ci	__u8  bDescLength;
2648c2ecf20Sopenharmony_ci	__u8  bDescriptorType;
2658c2ecf20Sopenharmony_ci	__u8  bNbrPorts;
2668c2ecf20Sopenharmony_ci	__le16 wHubCharacteristics;
2678c2ecf20Sopenharmony_ci	__u8  bPwrOn2PwrGood;
2688c2ecf20Sopenharmony_ci	__u8  bHubContrCurrent;
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_ci	/* 2.0 and 3.0 hubs differ here */
2718c2ecf20Sopenharmony_ci	union {
2728c2ecf20Sopenharmony_ci		struct {
2738c2ecf20Sopenharmony_ci			/* add 1 bit for hub status change; round to bytes */
2748c2ecf20Sopenharmony_ci			__u8  DeviceRemovable[(USB_MAXCHILDREN + 1 + 7) / 8];
2758c2ecf20Sopenharmony_ci			__u8  PortPwrCtrlMask[(USB_MAXCHILDREN + 1 + 7) / 8];
2768c2ecf20Sopenharmony_ci		}  __attribute__ ((packed)) hs;
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_ci		struct {
2798c2ecf20Sopenharmony_ci			__u8 bHubHdrDecLat;
2808c2ecf20Sopenharmony_ci			__le16 wHubDelay;
2818c2ecf20Sopenharmony_ci			__le16 DeviceRemovable;
2828c2ecf20Sopenharmony_ci		}  __attribute__ ((packed)) ss;
2838c2ecf20Sopenharmony_ci	} u;
2848c2ecf20Sopenharmony_ci} __attribute__ ((packed));
2858c2ecf20Sopenharmony_ci
2868c2ecf20Sopenharmony_ci/* port indicator status selectors, tables 11-7 and 11-25 */
2878c2ecf20Sopenharmony_ci#define HUB_LED_AUTO	0
2888c2ecf20Sopenharmony_ci#define HUB_LED_AMBER	1
2898c2ecf20Sopenharmony_ci#define HUB_LED_GREEN	2
2908c2ecf20Sopenharmony_ci#define HUB_LED_OFF	3
2918c2ecf20Sopenharmony_ci
2928c2ecf20Sopenharmony_cienum hub_led_mode {
2938c2ecf20Sopenharmony_ci	INDICATOR_AUTO = 0,
2948c2ecf20Sopenharmony_ci	INDICATOR_CYCLE,
2958c2ecf20Sopenharmony_ci	/* software blinks for attention:  software, hardware, reserved */
2968c2ecf20Sopenharmony_ci	INDICATOR_GREEN_BLINK, INDICATOR_GREEN_BLINK_OFF,
2978c2ecf20Sopenharmony_ci	INDICATOR_AMBER_BLINK, INDICATOR_AMBER_BLINK_OFF,
2988c2ecf20Sopenharmony_ci	INDICATOR_ALT_BLINK, INDICATOR_ALT_BLINK_OFF
2998c2ecf20Sopenharmony_ci} __attribute__ ((packed));
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_ci/* Transaction Translator Think Times, in bits */
3028c2ecf20Sopenharmony_ci#define HUB_TTTT_8_BITS		0x00
3038c2ecf20Sopenharmony_ci#define HUB_TTTT_16_BITS	0x20
3048c2ecf20Sopenharmony_ci#define HUB_TTTT_24_BITS	0x40
3058c2ecf20Sopenharmony_ci#define HUB_TTTT_32_BITS	0x60
3068c2ecf20Sopenharmony_ci
3078c2ecf20Sopenharmony_ci#endif /* __LINUX_CH11_H */
308