« Return to Thread: USB 2.0 device through a USB 1.1 hub

Re: USB 2.0 device through a USB 1.1 hub

by Alan Stern :: Rate this Message:

Reply to Author | View in Thread

On Tue, 21 Oct 2008 rliou@... wrote:

> I need to detect if my USB 2.0 device is connected through a USB 1.1
> hub so I can handle the device accordingly. The value of bcdUSB in
> the descriptor and device qualifier always shows me 200H(USB 2.0)
> with or without the hub. How do I get the actual USB speed for a
> device with a low/full speed hub in the middle?

I don't think there's any direct way to do it with libusb.

You can use an indirect technique.  For example, if a device is running
at high speed then all Bulk endpoints must have a maxpacket size of
512, whereas at full speed all Bulk endpoints must have a maxpacket
size <= 64.

Or you could parse the contents of /proc/bus/usb/devices if you're
running on a Linux system.  That file contains the actual speed of
each USB device (among a lot of other information).  Or you can get the
speed through sysfs.

Alan Stern


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libusb-devel mailing list
Libusb-devel@...
https://lists.sourceforge.net/lists/listinfo/libusb-devel

 « Return to Thread: USB 2.0 device through a USB 1.1 hub