]> git.openfabrics.org - ~emulex/infiniband.git/commit
USB: add "descriptors" binary sysfs attribute
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 12 Jul 2007 21:06:23 +0000 (17:06 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 20 Jul 2007 00:46:04 +0000 (17:46 -0700)
commit69d42a78f935d19384d1f6e4f94b65bb162b36df
tree03c7721d241f1db39671546db123b57def296b1d
parent1b4cd43bd3f9aa7a794e29b80b0d984a8e144df4
USB: add "descriptors" binary sysfs attribute

This patch (as934) adds a new readonly binary sysfs attribute file
called "descriptors" for each USB device.  The attribute contains the
device descriptor followed by the raw descriptor entry (config plug
subsidiary descriptors) for the current configuration.

Having this information available in fixed-format binary makes life a
lot easier for user programs by avoiding the need to open, read, and
parse multiple sysfs text files.

The information in this attribute file is much like that in usbfs's
device file, but there are some significant differences:

The 2-byte fields in the device descriptor are left in
little-endian byte order, as they appear on the bus and
in the kernel.

Only one raw descriptor set is presented, that of the
current configuration.

Opening this file will not cause a suspended device to be
autoresumed.

The last item in particular should be a big selling point for libusb,
which currently forces all USB devices to be resumed as it scans the
device tree.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Dave Mielke <dave@mielke.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/sysfs.c