Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jul 2021 19:19:01 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 47c5e288eee9 - stable/13 - Narrow down the probe range for if_ure(4) compatible devices to only match the first vendor specific interface, if any.
Message-ID:  <202107101919.16AJJ1BN049148@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by hselasky:

URL: https://cgit.FreeBSD.org/src/commit/?id=47c5e288eee94c67369443d0ed7c2ab21235c924

commit 47c5e288eee94c67369443d0ed7c2ab21235c924
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2021-06-04 13:48:15 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2021-07-10 19:17:29 +0000

    Narrow down the probe range for if_ure(4) compatible devices
    to only match the first vendor specific interface, if any.
    
    PR:             253374
    Sponsored by:   Mellanox Technologies // NVIDIA Networking
    
    (cherry picked from commit dab84426a68d43efaede62ccf86ca3ef852f8ae3)
---
 sys/dev/usb/net/if_ure.c | 7 ++++---
 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 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107101919.16AJJ1BN049148>