xhci: Return a USB 3.0 hub descriptor for USB3 roothub.
commit4bbb0ace9a3de8392527e3c87926309d541d3b00
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Tue, 30 Nov 2010 00:14:37 +0000 (29 16:14 -0800)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Mon, 14 Mar 2011 01:23:41 +0000 (13 18:23 -0700)
tree0b71bcd26cd66b4924c2e8997139a965e9b4304f
parentf6ff0ac878eb420011fa2448851dd48c3a7e7b31
xhci: Return a USB 3.0 hub descriptor for USB3 roothub.

Return the correct xHCI roothub descriptor, based on whether the roothub
is marked as USB 3.0 or USB 2.0 in usb_hcd->bcdUSB.  Fill in
DeviceRemovable for the USB 2.0 and USB 3.0 roothub descriptors, using the
Device Removable bit in the port status and control registers.  xHCI is
the first host controller to actually properly set these bits (other hosts
say all devices are removable).

When userspace asks for a USB 2.0-style hub descriptor for the USB 3.0
roothub, stall the endpoint.  This is what real external USB 3.0 hubs do,
and we don't want to return a descriptor that userspace didn't ask for.

The USB core is already fixed to always ask for USB 3.0-style hub
descriptors.  Only usbfs (typically lsusb) will ask for the USB 2.0-style
hub descriptors.  This has already been fixed in usbutils version 0.91,
but the kernel needs to deal with older usbutils versions.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/host/xhci-hub.c