From owner-dev-commits-src-all@freebsd.org Fri Jun 4 13:53:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FEA264F362; Fri, 4 Jun 2021 13:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FxPNy166bz3hmJ; Fri, 4 Jun 2021 13:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E8F71E68F; Fri, 4 Jun 2021 13:53:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 154DrLAg073015; Fri, 4 Jun 2021 13:53:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 154DrLOq073014; Fri, 4 Jun 2021 13:53:21 GMT (envelope-from git) Date: Fri, 4 Jun 2021 13:53:21 GMT Message-Id: <202106041353.154DrLOq073014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: dab84426a68d - main - Narrow down the probe range for if_ure(4) compatible devices to only match the first vendor specific interface, if any. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dab84426a68d43efaede62ccf86ca3ef852f8ae3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 13:53:22 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=dab84426a68d43efaede62ccf86ca3ef852f8ae3 commit dab84426a68d43efaede62ccf86ca3ef852f8ae3 Author: Hans Petter Selasky AuthorDate: 2021-06-04 13:48:15 +0000 Commit: Hans Petter Selasky CommitDate: 2021-06-04 13:51:01 +0000 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 --- 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 {