summaryrefslogtreecommitdiff
path: root/include/usb.h
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2017-07-19 21:50:00 +0800
committerMarek Vasut <marex@denx.de>2017-07-28 23:34:20 +0200
commit337fc7e665a20bd0c23da233ffb9e8469d999e72 (patch)
tree9a21fcf2f8404167d53118425b5df5f4aca0e339 /include/usb.h
parent53771a490e05e8be750a6ee50002e30df4776e9b (diff)
downloadu-boot-337fc7e665a20bd0c23da233ffb9e8469d999e72.tar.gz
u-boot-337fc7e665a20bd0c23da233ffb9e8469d999e72.tar.bz2
u-boot-337fc7e665a20bd0c23da233ffb9e8469d999e72.zip
usb: hub: Change USB hub descriptor to match USB 3.0 hubs
USB 3.0 hubs have a slightly different hub descriptor than USB 2.0 hubs, with a fixed (rather than variable length) size. Change the host controller drivers that access those last two fields (DeviceRemovable and PortPowerCtrlMask) to use the union. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de> Tested-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'include/usb.h')
-rw-r--r--include/usb.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/include/usb.h b/include/usb.h
index 62f051fe53..eb82cc23a8 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -546,10 +546,20 @@ struct usb_hub_descriptor {
unsigned short wHubCharacteristics;
unsigned char bPwrOn2PwrGood;
unsigned char bHubContrCurrent;
- unsigned char DeviceRemovable[(USB_MAXCHILDREN+1+7)/8];
- unsigned char PortPowerCtrlMask[(USB_MAXCHILDREN+1+7)/8];
- /* DeviceRemovable and PortPwrCtrlMask want to be variable-length
- bitmaps that hold max 255 entries. (bit0 is ignored) */
+ /* 2.0 and 3.0 hubs differ here */
+ union {
+ struct {
+ /* add 1 bit for hub status change; round to bytes */
+ __u8 DeviceRemovable[(USB_MAXCHILDREN + 1 + 7) / 8];
+ __u8 PortPowerCtrlMask[(USB_MAXCHILDREN + 1 + 7) / 8];
+ } __attribute__ ((packed)) hs;
+
+ struct {
+ __u8 bHubHdrDecLat;
+ __le16 wHubDelay;
+ __le16 DeviceRemovable;
+ } __attribute__ ((packed)) ss;
+ } u;
} __attribute__ ((packed));