From owner-svn-src-all@FreeBSD.ORG Sun Sep 30 19:31:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78D94106566B; Sun, 30 Sep 2012 19:31:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28CEC8FC08; Sun, 30 Sep 2012 19:31:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8UJVLoN099406; Sun, 30 Sep 2012 19:31:21 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8UJVKfD099403; Sun, 30 Sep 2012 19:31:20 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201209301931.q8UJVKfD099403@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 30 Sep 2012 19:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241078 - head/sys/netgraph/bluetooth/drivers/ubt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Sep 2012 19:31:21 -0000 Author: hselasky Date: Sun Sep 30 19:31:20 2012 New Revision: 241078 URL: http://svn.freebsd.org/changeset/base/241078 Log: The USB Bluetooth driver should only grab its own interfaces. This allows the USB bluetooth driver to co-exist with other USB device classes and drivers. Reported by: Geoffrey Levand MFC after: 1 week Modified: head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Modified: head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c ============================================================================== --- head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Sun Sep 30 17:33:30 2012 (r241077) +++ head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Sun Sep 30 19:31:20 2012 (r241078) @@ -439,6 +439,7 @@ ubt_attach(device_t dev) struct ubt_softc *sc = device_get_softc(dev); struct usb_endpoint_descriptor *ed; struct usb_interface_descriptor *id; + struct usb_interface *iface; uint16_t wMaxPacketSize; uint8_t alt_index, i, j; uint8_t iface_index[2] = { 0, 1 }; @@ -554,10 +555,21 @@ ubt_attach(device_t dev) goto detach; } - /* Claim all interfaces on the device */ - for (i = 1; usbd_get_iface(uaa->device, i) != NULL; i ++) - usbd_set_parent_iface(uaa->device, i, uaa->info.bIfaceIndex); + /* Claim all interfaces belonging to the Bluetooth part */ + for (i = 1;; i++) { + iface = usbd_get_iface(uaa->device, i); + if (iface == NULL) + break; + id = usbd_get_interface_descriptor(iface); + if ((id != NULL) && + (id->bInterfaceClass == UICLASS_WIRELESS) && + (id->bInterfaceSubClass == UISUBCLASS_RF) && + (id->bInterfaceProtocol == UIPROTO_BLUETOOTH)) { + usbd_set_parent_iface(uaa->device, i, + uaa->info.bIfaceIndex); + } + } return (0); /* success */ detach: