You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When there is an interface association descriptor IAD, where multiple interface descriptors belonging to a single function are added to the configuration descriptor bundle using one stuct usb_interface element, the bNumInterfaces is incorrect.
In the current usb_standard.c code, it is assumed that each struct usb_interface adds just one logical interface (one interface having multiple altsettings still counts as one). This assumption is incorrect for the above situation.
An example of such a device class is cdc_acm, which has a 'COMM' interface and a 'DATA' interface, which are bundled using IAD. It still makes sense to have bNumInterfaces act as a nr_elements (array_size) for the interface member of the usb_config_descriptor, but the value needs to be adjusted on output (in build_config_descriptor, just like is done with wTotalLength) when such IAD is encountered.
A workaround is currently to add the COMM and the DATA interface in separate struct usb_interface's, where the first one has the IAD and the second one doesn't. This seems counter-intuitive.
The text was updated successfully, but these errors were encountered:
When there is an interface association descriptor IAD, where multiple interface descriptors belonging to a single function are added to the configuration descriptor bundle using one stuct usb_interface element, the bNumInterfaces is incorrect.
In the current usb_standard.c code, it is assumed that each struct usb_interface adds just one logical interface (one interface having multiple altsettings still counts as one). This assumption is incorrect for the above situation.
An example of such a device class is cdc_acm, which has a 'COMM' interface and a 'DATA' interface, which are bundled using IAD. It still makes sense to have bNumInterfaces act as a nr_elements (array_size) for the interface member of the usb_config_descriptor, but the value needs to be adjusted on output (in build_config_descriptor, just like is done with wTotalLength) when such IAD is encountered.
A workaround is currently to add the COMM and the DATA interface in separate struct usb_interface's, where the first one has the IAD and the second one doesn't. This seems counter-intuitive.
The text was updated successfully, but these errors were encountered: