On Mon, Jan 09, 2012 at 03:24:06PM -0500, Alan Stern wrote: > On Mon, 9 Jan 2012, Felipe Balbi wrote: > > > > Actually it does help: In that situation, the uas driver can print a > > > warning message telling the user to plug the device into a different > > > controller. We already do something very much like that when a > > > high-speed-capable device is plugged into a full-speed controller; see > > > check_highspeed() in hub.c. Is there any way to do the same thing when > > > a SuperSpeed-capable device is plugged into a USB <= 2.0 controller? > > > > you should be able to implement something like that by checking your > > Device Capability Descriptor which comes with the BOS descriptor set. > > > > Then you can check wSpeedSuppoted field on that device, if it has the > > SuperSpeed bit enabled and you're attached to <=USB_SPEED_HIGH, then you > > can warn. > > Anybody have the time to do this? :-) Done, although untested. lsusb also needs to be fixed to fetch the BOS descriptor if it sees a USB 2.1 device. I'll send that patch shortly. Sarah Sharp
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index db6b751..1f92ce8 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -3164,6 +3164,16 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) kfree(qual); } +static void check_superspeed(struct usb_hub *hub, struct usb_device *udev, + int port1) +{ + if (le16_to_cpu(udev->descriptor.bcdUSB) < 0x0300 && + dev->bos->ss_cap) + /* BOS descriptor should have already been fetched by now. */ + dev_info(&udev->dev, "not running at top speed; " + "connect to a SuperSpeed hub or host\n"); +} + static unsigned hub_power_remaining (struct usb_hub *hub) { @@ -3383,6 +3393,7 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1, && udev->speed == USB_SPEED_FULL && highspeed_hubs != 0) check_highspeed (hub, udev, port1); + check_super_speed(hub, udev, port1); /* Store the parent's children[] pointer. At this point * udev becomes globally accessible, although presumably