Thanks.
There were some changes going in that area recently.
I think we need to try reverting some of them, and see which fixes it.
Lets start with the most obvious one. Does this change anything?
Index: dev/usb/usbdi.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/usbdi.c,v
retrieving revision 1.109
diff -u -p -u -p -r1.109 usbdi.c
--- dev/usb/usbdi.c 1 Feb 2021 09:21:51 -0000 1.109
+++ dev/usb/usbdi.c 1 Feb 2021 21:11:45 -0000
@@ -638,23 +638,12 @@ usbd_status
usbd_device2interface_handle(struct usbd_device *dev, u_int8_t ifaceno,
struct usbd_interface **iface)
{
- u_int8_t idx;
-
if (dev->cdesc == NULL)
return (USBD_NOT_CONFIGURED);
- /*
- * The correct interface should be at dev->ifaces[ifaceno], but we've
- * seen non-compliant devices in the wild which present non-contiguous
- * interface numbers and this skews the indices. For this reason we
- * linearly search the interface array.
- */
- for (idx = 0; idx < dev->cdesc->bNumInterfaces; idx++) {
- if (dev->ifaces[idx].idesc->bInterfaceNumber == ifaceno) {
- *iface = &dev->ifaces[idx];
- return (USBD_NORMAL_COMPLETION);
- }
- }
- return (USBD_INVAL);
+ if (ifaceno >= dev->cdesc->bNumInterfaces)
+ return (USBD_INVAL);
+ *iface = &dev->ifaces[ifaceno];
+ return (USBD_NORMAL_COMPLETION);
}
/* XXXX use altno */