On Wed, 23 Feb 2005, Glenn Maynard wrote:

> On Wed, Feb 23, 2005 at 05:11:16PM -0500, Alan Stern wrote:
> > lsusb does make the queries (going through usbfs).  lsusb _has_ to use
> > libusb; sysfs only includes information for active configurations whereas
> > lsusb wants to print out information for all configurations.
> 
> Is there a design reason for this, or is "expose information about
> inactive configurations in sysfs" a reasonable wishlist item, too?

Speaking on behalf of the people who designed sysfs, the intention is that 
sysfs provides a filesystem-based view of all the devices currently on the 
system.  An inactive configuration represents something that _isn't_ 
currently on the system, hence it doesn't belong in sysfs.

Anyway there's no reason to put the extra information about inactive
configurations or altsettings in sysfs, since it's already available in
usbfs.

> It might be useful, for example, for my trawl-sysfs-looking-for-pen-drives
> code to be able to include (in diagnostic output) descriptions of
> alternative configurations that the kernel didn't choose.  For example,
> my Shuffle appears to have a 100mA configuration and a 500mA one; the
> kernel always chooses the 500mA one, even though it's attached to a
> bus-powered hub.  If somebody is reporting problems with a device, the
> existance of the other configuration might be important.

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.

> (I'm not sure what the difference is between the configurations--perhaps
> the 100mA configuration doesn't charge the device while it's plugged in.)
> 
> By the way, would it be likely to cause problems (self-inflicted bugs
> aside) if I hacked up the configuration selection code to prefer lower-
> power configurations?  hub.c:choose_configuration has a comment, "this
> should interact with hub power budgeting"; my case is specifically "two
> USB pen drives attached to a bus-powered hub".

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.

Alan Stern



-------------------------------------------------------
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