]> git.baikalelectronics.ru Git - kernel.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)
commit09050f1a49da0e97597ceb41f1de4112397f0585
tree03c7721d241f1db39671546db123b57def296b1d
parent913bf7dda448d203855173c87ad61a88751e9c48
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