From 0731bba610715fd385c0d97237b9c4d00178ab36 Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Wed, 28 Dec 2011 21:04:36 +1300 Subject: usb: Added support for Interface Association descriptors. --- lib/usb/usb_standard.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/usb') diff --git a/lib/usb/usb_standard.c b/lib/usb/usb_standard.c index 1021fa8..455d3e7 100644 --- a/lib/usb/usb_standard.c +++ b/lib/usb/usb_standard.c @@ -41,10 +41,20 @@ static u16 build_config_descriptor(u8 index, u8 *buf, u16 len) /* For each interface... */ for (i = 0; i < cfg->bNumInterfaces; i++) { + /* Interface Association Descriptor, if any */ + if (cfg->interface[i].iface_assoc) { + const struct usb_iface_assoc_descriptor *assoc = + cfg->interface[i].iface_assoc; + memcpy(buf, assoc, count = MIN(len, assoc->bLength)); + buf += count; + len -= count; + total += count; + totallen += assoc->bLength; + } /* For each alternate setting... */ for (j = 0; j < cfg->interface[i].num_altsetting; j++) { const struct usb_interface_descriptor *iface = - &cfg->interface[i].altsetting[j]; + &cfg->interface[i].altsetting[j]; /* Copy interface descriptor. */ memcpy(buf, iface, count = MIN(len, iface->bLength)); buf += count; -- cgit v1.2.3