diff options
author | Craig W. Nadler <craig@nadler.us> | 2007-06-15 23:14:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-12 16:34:40 -0700 |
commit | 165fe97ed6107d3cde63592d5ac36400a5eb9f6f (patch) | |
tree | 824bb475b4f36af465989c5dac62f4097a1bd01c /drivers/usb/core/config.c | |
parent | 50d2dc7266573dfbdc84fc207494dd21315782ef (diff) | |
download | op-kernel-dev-165fe97ed6107d3cde63592d5ac36400a5eb9f6f.zip op-kernel-dev-165fe97ed6107d3cde63592d5ac36400a5eb9f6f.tar.gz |
USB: add IAD support to usbfs and sysfs
USB_IAD: Adds support for USB Interface Association Descriptors.
This patch adds support to the USB host stack for parsing, storing, and
displaying Interface Association Descriptors. In /proc/bus/usb/devices
lines starting with A: show the fields in an IAD. In sysfs if an
interface on a USB device is referenced by an IAD the following files
will be added to the sysfs directory for that interface:
iad_bFirstInterface, iad_bInterfaceCount, iad_bFunctionClass, and
iad_bFunctionSubClass, iad_bFunctionProtocol
Signed-off-by: Craig W. Nadler <craig@nadler.us>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/config.c')
-rw-r--r-- | drivers/usb/core/config.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 5e113db..cb69aa1 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c @@ -295,6 +295,7 @@ static int usb_parse_configuration(struct device *ddev, int cfgidx, struct usb_descriptor_header *header; int len, retval; u8 inums[USB_MAXINTERFACES], nalts[USB_MAXINTERFACES]; + unsigned iad_num = 0; memcpy(&config->desc, buffer, USB_DT_CONFIG_SIZE); if (config->desc.bDescriptorType != USB_DT_CONFIG || @@ -372,6 +373,20 @@ static int usb_parse_configuration(struct device *ddev, int cfgidx, ++n; } + } else if (header->bDescriptorType == + USB_DT_INTERFACE_ASSOCIATION) { + if (iad_num == USB_MAXIADS) { + dev_warn(ddev, "found more Interface " + "Association Descriptors " + "than allocated for in " + "configuration %d\n", cfgno); + } else { + config->intf_assoc[iad_num] = + (struct usb_interface_assoc_descriptor + *)header; + iad_num++; + } + } else if (header->bDescriptorType == USB_DT_DEVICE || header->bDescriptorType == USB_DT_CONFIG) dev_warn(ddev, "config %d contains an unexpected " |