Greg KH wrote:
On Mon, Dec 03, 2007 at 06:19:53PM +0000, Phil Endecott wrote:
Dear Experts,

Can anyone suggest the best way to determine the speed (low/full/high) at which a device is operating from user-space?

usbdevice_fs has 'connectinfo', which seems to return a flag for low-speed operation. But it doesn't seem to distinguish between full and high-speed. A usbdevicefs method would be ideal as I'm already using that, but maybe there is something in /sys?

Yes, there's a "speed" file there, try it out, I think it's exactly what
you are looking for :)

Thanks Greg. I should have spotted that; I must have been lost in /sys's maze of twisty symlinks.

Now I just need to work out how to convert from e.g. /proc/bus/usb/001/010 to e.g. /sys/devices/pci0000:00/0000:00:10.3/usb1/1-4/1-4.6/1-4.6.3. Any ideas?

(Sometimes I already have the /sys path; my app listens for uevents on a netlink socket, and these include both pathnames. But when it starts it looks for already-attached devices by iterating through /proc/bus/usb, and in this case it doesn't have the /sys path conveniently available. Maybe I should instead do this initial search in some other way, e.g. through /sys/bus/usb/devices?)


Phil.




-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to