diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2021-06-04 13:48:15 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2021-06-04 13:51:01 +0000 |
commit | dab84426a68d43efaede62ccf86ca3ef852f8ae3 (patch) | |
tree | 7a1fa24ba4d582d5059057e1ad478ec3469ba51a | |
parent | 24ea1dbf257aa6757f469bcd859f90e9ad851e59 (diff) |
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
-rw-r--r-- | sys/dev/usb/net/if_ure.c | 7 | ||||
-rw-r--r-- | sys/dev/usb/usb.h | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/usb/net/if_ure.c b/sys/dev/usb/net/if_ure.c index 2e4053a0e0c6..6439a0bfd71d 100644 --- a/sys/dev/usb/net/if_ure.c +++ b/sys/dev/usb/net/if_ure.c @@ -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); diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h index dcdb62114d63..ad0381366f98 100644 --- a/sys/dev/usb/usb.h +++ b/sys/dev/usb/usb.h @@ -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 { |