Re: Modified usb-devices.sh script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 20 Jul 2009, Steve Calfee wrote:

> Thanks, Alan,
> 
> I had not noticed any interface or config strings. In fact, only one
> of my webcam's has an "interface" string. It would have been easier
> for browsing if sysfs had a strings subdirectory per device, but I
> guess we are locked in to the current layout.

It can't because it doesn't know what strings the device has.  And the 
strings may be subject to change when the configuration changes.

> There are lots of other strings defined in the spec, especially in the
> class specs, which the .../devices file doesn't particularly cover.
> For example, video class (webcams) has descriptor type 36 in the
> configuration that contains possible strings for iProcessing,
> iTerminal, iExtension etc. I guess that is not relevant in a
> description of the device file as we currently have it.

None of that is in the USB 2.0 Specification document, though.  The 
class specs are other documents.  usbcore isn't aware of anything 
outside the core specs (basically just USB 2.0 plus OTG).

> >> 5) The output of this script could be expanded to display other
> >> configuration contained data, such as hid or audio or video etc
> >> descriptors, if desired. Additional descriptors that are driver
> >> requested (hid descriptors etc) are not part of sysfs. If they were
> >> they could also be displayed.
> >
> > I think this is not desirable.  A chief virtue of the devices file is
> > its brevity.  If anyone wants detailed information about other
> > descriptors, they can use lsusb -v.
> >
> 
> I guess you are right. I mainly wanted to display everything available
> without a bus access. lsusb is not so easy in an embedded system - It
> requires several library/executable things to be installed, must be
> run as root and needs /proc/bus/usb/devices to be installed to run.

Is that last part really true for the most recent version of lsusb?  I
don't think so.

In theory it is possible to rewrite lsusb so that it doesn't require 
libusb -- i.e., make it use the raw usbfs interface.  Nobody seems 
anxious to do this.

The requirement for root access is pretty much unavoidable, since lsusb 
has to query devices to retrieve the descriptors it displays.

> The nice thing about these scripts is all non-root info available can
> be presented to the user.
> 
> Did you try the gawk script and did it hang your system too?

I tried it and it worked with no problem.  But I didn't have any 
complicated devices plugged in at the time (no hubs, for example).

Alan Stern

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

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux