usbip: vhci-hcd: Add USB3 SuperSpeed support

This patch adds a USB3 HCD to an existing USB2 HCD and provides
the support of SuperSpeed, in case the device can only be enumerated
with SuperSpeed.

The bulk of the added code in usb3_bos_desc and hub_control to support
SuperSpeed is borrowed from the commit 1cd8fd2887 ("usb: gadget:
dummy_hcd: add SuperSpeed support").

With this patch, each vhci will have VHCI_HC_PORTS HighSpeed ports
and VHCI_HC_PORTS SuperSpeed ports.

Suggested-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: Yuyang Du <yuyang.du@intel.com>
Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Yuyang Du
2017-06-08 13:04:10 +08:00
committed by Greg Kroah-Hartman
parent 03cd00d538
commit 1c9de5bf42
6 changed files with 369 additions and 102 deletions

View File

@@ -72,6 +72,11 @@ struct vhci_unlink {
unsigned long unlink_seqnum;
};
enum hub_speed {
HUB_SPEED_HIGH = 0,
HUB_SPEED_SUPER,
};
/* Number of supported ports. Value has an upperbound of USB_MAXCHILDREN */
#ifdef CONFIG_USBIP_VHCI_HC_PORTS
#define VHCI_HC_PORTS CONFIG_USBIP_VHCI_HC_PORTS
@@ -140,7 +145,7 @@ static inline __u32 port_to_rhport(__u32 port)
static inline int port_to_pdev_nr(__u32 port)
{
return port / VHCI_HC_PORTS;
return port / (VHCI_HC_PORTS * 2);
}
static inline struct vhci_hcd *hcd_to_vhci_hcd(struct usb_hcd *hcd)