1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

usb: hub: Send correct wValue to get hub descriptor of a USB 3.0 hub

Testing a USB 3.0 hub by connecting it to the xHCI port on Intel
MinnowMax, when issuing 'get hub descriptor' to the hub, xHCI
reports a transfer event TRB with a completion code 6 which means
'Stall Error'.

In fact super speed USB hub descriptor type is 0x2a, not 0x29.
Sending correct SETUP packet to the hub makes it not stall anymore.

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>
This commit is contained in:
Bin Meng
2017-07-19 21:49:58 +08:00
committed by Marek Vasut
parent f7a9e5dd03
commit f342119602
3 changed files with 13 additions and 1 deletions

View File

@@ -65,11 +65,21 @@ __weak void usb_hub_reset_devices(int port)
return;
}
static inline bool usb_hub_is_superspeed(struct usb_device *hdev)
{
return hdev->descriptor.bDeviceProtocol == 3;
}
static int usb_get_hub_descriptor(struct usb_device *dev, void *data, int size)
{
unsigned short dtype = USB_DT_HUB;
if (usb_hub_is_superspeed(dev))
dtype = USB_DT_SS_HUB;
return usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
USB_REQ_GET_DESCRIPTOR, USB_DIR_IN | USB_RT_HUB,
USB_DT_HUB << 8, 0, data, size, USB_CNTL_TIMEOUT);
dtype << 8, 0, data, size, USB_CNTL_TIMEOUT);
}
static int usb_clear_port_feature(struct usb_device *dev, int port, int feature)