Signed-off-by: Mike Lockwood <lockwood@android.com>
dest = next;
while ((descriptor = *descriptors++) != NULL) {
intf = (struct usb_interface_descriptor *)dest;
- if (intf->bDescriptorType == USB_DT_INTERFACE)
- intf->bInterfaceNumber = interfaceCount++;
+ if (intf->bDescriptorType == USB_DT_INTERFACE) {
+ /* don't increment bInterfaceNumber for alternate settings */
+ if (intf->bAlternateSetting == 0)
+ intf->bInterfaceNumber = interfaceCount++;
+ else
+ intf->bInterfaceNumber = interfaceCount - 1;
+ }
dest += intf->bLength;
}