On Thu, Feb 24, 2005 at 10:30:17AM -0500, Alan Stern wrote:
> Anyway there's no reason to put the extra information about inactive
> configurations or altsettings in sysfs, since it's already available in
> usbfs.

> Your program can always use the information in /proc/bus/usb/devices, or 
> it can read the descriptors directly from the device's file in usbfs.  It 
> could even parse the output from lsusb.

It's very clean to pull data out of sysfs, since everything is nice and
cleanly cross-linked (with symlinks); to connect to the usbfs device file,
I need to find it (given a sysfs path).  The data in usbfs and lsusb
isn't broken out: sysfs splits each piece of data into a separate file,
so it can all be accessed without substantial parsing, which is
inherently more reliable.

Also, reading /proc/bus/usb/devices or lsusb -v will (currently) query
string descriptors, even if I don't want them at all (and usb/devices
will do so for all devices, not just the ones I'm interested in).

I suppose that the cross-referencing problems could be fixed, at least,
by having a file with the relative usbfs path of the device: "usbfs" =
"001/002".  (The information still wouldn't be as easily available,
though.)

> It's probably not a good idea to prefer the lower-power configuration by
> default.  A better heuristic might be to prefer the highest-power
> configuration that fits within the parent hub's power budget.

A quick look suggests that doing this against the 100mA per-port cap
should be fairly easy, but I don't know how to do this for the power
limit of the whole hub: when the first device is inserted, it needs to
choose a low-enough power config that we have enough for the second card
that's not inserted yet (and, presumably, without having to second-guess
and change the configuration later).  Since the power limit of the whole
hub appears to also be 100mA, that seems to be--for this particular
case--"prefer the highest-power configuration <= 50mA" (100mA over 2
devices).  Is there a better approach?

-- 
Glenn Maynard


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to