Narrow down the probe range for if_ure(4) compatible devices

to only match the first vendor specific interface, if any.

PR:		253374
MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
This commit is contained in:
Hans Petter Selasky 2021-06-04 15:48:15 +02:00
parent 24ea1dbf25
commit dab84426a6
2 changed files with 5 additions and 3 deletions

View File

@ -95,7 +95,10 @@ SYSCTL_INT(_hw_usb_ure, OID_AUTO, debug, CTLFLAG_RWTUN, &ure_debug, 0,
* Various supported device vendors/products.
*/
static const STRUCT_USB_HOST_ID ure_devs[] = {
#define URE_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) }
#define URE_DEV(v,p,i) { \
USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i), \
USB_IFACE_CLASS(UICLASS_VENDOR), \
USB_IFACE_SUBCLASS(UISUBCLASS_VENDOR) }
URE_DEV(LENOVO, RTL8153, URE_FLAG_8153),
URE_DEV(LENOVO, TBT3LAN, 0),
URE_DEV(LENOVO, TBT3LANGEN2, 0),
@ -488,8 +491,6 @@ ure_probe(device_t dev)
uaa = device_get_ivars(dev);
if (uaa->usb_mode != USB_MODE_HOST)
return (ENXIO);
if (uaa->info.bConfigIndex != URE_CONFIG_IDX)
return (ENXIO);
if (uaa->info.bIfaceIndex != URE_IFACE_IDX)
return (ENXIO);

View File

@ -520,6 +520,7 @@ typedef struct usb_interface_assoc_descriptor usb_interface_assoc_descriptor_t;
#define UICLASS_VENDOR 0xff
#define UISUBCLASS_XBOX360_CONTROLLER 0x5d
#define UISUBCLASS_VENDOR 0xff
#define UIPROTO_XBOX360_GAMEPAD 0x01
struct usb_endpoint_descriptor {