diff options
author | John Youn <John.Youn@synopsys.com> | 2001-09-17 03:00:00 -0400 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2011-03-13 21:07:11 -0400 |
commit | dbe79bbe9dcb22cb3651c46f18943477141ca452 (patch) | |
tree | 86e2dd608fd6ae7902b4abfdfbcf1969980386e3 /include/linux/usb | |
parent | ad73dff32e04cad1ff2af89512bf489224b503cc (diff) |
USB 3.0 Hub Changes
Update the USB core to deal with USB 3.0 hubs. These hubs have a slightly
different hub descriptor than USB 2.0 hubs, with a fixed (rather than
variable length) size. Change the USB core's hub descriptor to have a
union for the last fields that differ. Change the host controller drivers
that access those last fields (DeviceRemovable and PortPowerCtrlMask) to
use the union.
Translate the new version of the hub port status field into the old
version that khubd understands. (Note: we need to fix it to translate the
roothub's port status once we stop converting it to USB 2.0 hub status
internally.)
Add new code to handle link state change status. Send out new control
messages that are needed for USB 3.0 hubs, like Set Hub Depth.
This patch is a modified version of the original patch submitted by John
Youn. It's updated to reflect the removal of the "bitmap" #define, and
change the hub descriptor accesses of a couple new host controller
drivers.
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Cc: Tony Olech <tony.olech@elandigitalsystems.com>
Cc: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: Max Vozeler <mvz@vozeler.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: Rodolfo Giometti <giometti@linux.it>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Anton Vorontsov <avorontsov@mvista.com>
Cc: Sebastian Siewior <bigeasy@linutronix.de>
Cc: Lothar Wassmann <LW@KARO-electronics.de>
Cc: Olav Kongas <ok@artecdesign.ee>
Cc: Martin Fuzzey <mfuzzey@gmail.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'include/linux/usb')
-rw-r--r-- | include/linux/usb/ch11.h | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h index 38c42b013641..22afcd37bc3f 100644 --- a/include/linux/usb/ch11.h +++ b/include/linux/usb/ch11.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #define HUB_RESET_TT 9 | 26 | #define HUB_RESET_TT 9 |
27 | #define HUB_GET_TT_STATE 10 | 27 | #define HUB_GET_TT_STATE 10 |
28 | #define HUB_STOP_TT 11 | 28 | #define HUB_STOP_TT 11 |
29 | #define HUB_SET_DEPTH 12 | ||
29 | 30 | ||
30 | /* | 31 | /* |
31 | * Hub class additional requests defined by USB 3.0 spec | 32 | * Hub class additional requests defined by USB 3.0 spec |
@@ -61,6 +62,12 @@ | |||
61 | #define USB_PORT_FEAT_TEST 21 | 62 | #define USB_PORT_FEAT_TEST 21 |
62 | #define USB_PORT_FEAT_INDICATOR 22 | 63 | #define USB_PORT_FEAT_INDICATOR 22 |
63 | #define USB_PORT_FEAT_C_PORT_L1 23 | 64 | #define USB_PORT_FEAT_C_PORT_L1 23 |
65 | #define USB_PORT_FEAT_C_PORT_LINK_STATE 25 | ||
66 | #define USB_PORT_FEAT_C_PORT_CONFIG_ERROR 26 | ||
67 | #define USB_PORT_FEAT_PORT_REMOTE_WAKE_MASK 27 | ||
68 | #define USB_PORT_FEAT_BH_PORT_RESET 28 | ||
69 | #define USB_PORT_FEAT_C_BH_PORT_RESET 29 | ||
70 | #define USB_PORT_FEAT_FORCE_LINKPM_ACCEPT 30 | ||
64 | 71 | ||
65 | /* | 72 | /* |
66 | * Port feature selectors added by USB 3.0 spec. | 73 | * Port feature selectors added by USB 3.0 spec. |
@@ -110,8 +117,14 @@ struct usb_port_status { | |||
110 | */ | 117 | */ |
111 | #define USB_PORT_STAT_LINK_STATE 0x01e0 | 118 | #define USB_PORT_STAT_LINK_STATE 0x01e0 |
112 | #define USB_SS_PORT_STAT_POWER 0x0200 | 119 | #define USB_SS_PORT_STAT_POWER 0x0200 |
120 | #define USB_SS_PORT_STAT_SPEED 0x1c00 | ||
113 | #define USB_PORT_STAT_SPEED_5GBPS 0x0000 | 121 | #define USB_PORT_STAT_SPEED_5GBPS 0x0000 |
114 | /* Valid only if port is enabled */ | 122 | /* Valid only if port is enabled */ |
123 | /* Bits that are the same from USB 2.0 */ | ||
124 | #define USB_SS_PORT_STAT_MASK (USB_PORT_STAT_CONNECTION | \ | ||
125 | USB_PORT_STAT_ENABLE | \ | ||
126 | USB_PORT_STAT_OVERCURRENT | \ | ||
127 | USB_PORT_STAT_RESET) | ||
115 | 128 | ||
116 | /* | 129 | /* |
117 | * Definitions for PORT_LINK_STATE values | 130 | * Definitions for PORT_LINK_STATE values |
@@ -141,6 +154,13 @@ struct usb_port_status { | |||
141 | #define USB_PORT_STAT_C_OVERCURRENT 0x0008 | 154 | #define USB_PORT_STAT_C_OVERCURRENT 0x0008 |
142 | #define USB_PORT_STAT_C_RESET 0x0010 | 155 | #define USB_PORT_STAT_C_RESET 0x0010 |
143 | #define USB_PORT_STAT_C_L1 0x0020 | 156 | #define USB_PORT_STAT_C_L1 0x0020 |
157 | /* | ||
158 | * USB 3.0 wPortChange bit fields | ||
159 | * See USB 3.0 spec Table 10-11 | ||
160 | */ | ||
161 | #define USB_PORT_STAT_C_BH_RESET 0x0020 | ||
162 | #define USB_PORT_STAT_C_LINK_STATE 0x0040 | ||
163 | #define USB_PORT_STAT_C_CONFIG_ERROR 0x0080 | ||
144 | 164 | ||
145 | /* | 165 | /* |
146 | * wHubCharacteristics (masks) | 166 | * wHubCharacteristics (masks) |
@@ -175,7 +195,9 @@ struct usb_hub_status { | |||
175 | */ | 195 | */ |
176 | 196 | ||
177 | #define USB_DT_HUB (USB_TYPE_CLASS | 0x09) | 197 | #define USB_DT_HUB (USB_TYPE_CLASS | 0x09) |
198 | #define USB_DT_SS_HUB (USB_TYPE_CLASS | 0x0a) | ||
178 | #define USB_DT_HUB_NONVAR_SIZE 7 | 199 | #define USB_DT_HUB_NONVAR_SIZE 7 |
200 | #define USB_DT_SS_HUB_SIZE 12 | ||
179 | 201 | ||
180 | struct usb_hub_descriptor { | 202 | struct usb_hub_descriptor { |
181 | __u8 bDescLength; | 203 | __u8 bDescLength; |
@@ -184,11 +206,22 @@ struct usb_hub_descriptor { | |||
184 | __le16 wHubCharacteristics; | 206 | __le16 wHubCharacteristics; |
185 | __u8 bPwrOn2PwrGood; | 207 | __u8 bPwrOn2PwrGood; |
186 | __u8 bHubContrCurrent; | 208 | __u8 bHubContrCurrent; |
187 | /* add 1 bit for hub status change; round to bytes */ | ||
188 | __u8 DeviceRemovable[(USB_MAXCHILDREN + 1 + 7) / 8]; | ||
189 | __u8 PortPwrCtrlMask[(USB_MAXCHILDREN + 1 + 7) / 8]; | ||
190 | } __attribute__ ((packed)); | ||
191 | 209 | ||
210 | /* 2.0 and 3.0 hubs differ here */ | ||
211 | union { | ||
212 | struct { | ||
213 | /* add 1 bit for hub status change; round to bytes */ | ||
214 | __u8 DeviceRemovable[(USB_MAXCHILDREN + 1 + 7) / 8]; | ||
215 | __u8 PortPwrCtrlMask[(USB_MAXCHILDREN + 1 + 7) / 8]; | ||
216 | } __attribute__ ((packed)) hs; | ||
217 | |||
218 | struct { | ||
219 | __u8 bHubHdrDecLat; | ||
220 | __u16 wHubDelay; | ||
221 | __u16 DeviceRemovable; | ||
222 | } __attribute__ ((packed)) ss; | ||
223 | } u; | ||
224 | } __attribute__ ((packed)); | ||
192 | 225 | ||
193 | /* port indicator status selectors, tables 11-7 and 11-25 */ | 226 | /* port indicator status selectors, tables 11-7 and 11-25 */ |
194 | #define HUB_LED_AUTO 0 | 227 | #define HUB_LED_AUTO 0 |