From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 29 21:36:28 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A76D106566B for ; Sat, 29 Sep 2012 21:36:28 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id C199B8FC14 for ; Sat, 29 Sep 2012 21:36:27 +0000 (UTC) Received: by yenl8 with SMTP id l8so818060yen.13 for ; Sat, 29 Sep 2012 14:36:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding:x-gm-message-state; bh=rfiPvHezk/OY91xxHBlLYYfeMFso/g1p+6qNvmIKYmo=; b=LUkXSOlUXV8dzayjlmEh/a6QFkLA6he4eBh+h/ODJ0QCFg217rJDqIJJ/iRqJncWWO M65ZEcI+U+TIUaZ2xDzRZZlmK6219enLw1qVzR4PfFk/2vaDJ8o9U6LqvUqI7+iFx8Tw aXVT8Sv4v6dvUZ5pI+3jRlp333z1jYG4NwQ5Ime3vxMFdFMDhFXS0lVSTQKXODO76Qt1 6v5Ql/97C1U2mdI1rhEOq/2oTJK0+xxqDi1i14HTM3n1S2YOHy/Zl8DjHWhNrdp2hTfu H/xRlcEFrK/YhQO+k60gXDcklP53vBD/lh1hZZecYn9kMrj2vVqW+NJGlDM4PzFPrS3J Blyw== Received: by 10.236.76.234 with SMTP id b70mr11742025yhe.31.1348954586977; Sat, 29 Sep 2012 14:36:26 -0700 (PDT) Received: from [192.168.2.101] ([187.114.192.144]) by mx.google.com with ESMTPS id x4sm19253185yhh.2.2012.09.29.14.36.24 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 29 Sep 2012 14:36:26 -0700 (PDT) Message-ID: <506769D5.7040706@bsd.com.br> Date: Sat, 29 Sep 2012 18:36:21 -0300 From: =?ISO-8859-1?Q?Otac=EDlio?= User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:15.0) Gecko/20120919 Thunderbird/15.0.1 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <1348410653.373800982@f180.mail.ru> <201209241820.07558.hselasky@c2i.net> <1348910721.385146900@f89.mail.ru> In-Reply-To: <1348910721.385146900@f89.mail.ru> X-Enigmail-Version: 1.4.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnUX/5gVSzpNmc+nZK9vMD4po5d2no8+ypOwsL8+uMQPhbGSku8ThOj+iwcCgpbeI2FMeu9 Subject: Re: How to claim only some of USB interfaces of a composite USB device X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Sep 2012 21:36:28 -0000 On 29/09/2012 06:25, geoffrey levand wrote: > Hi, > > thanks for the info, it helped me to find a solution but not sure if it's a proper one. > Here is the patch i used to fix the problem on FreeBSD 9.1. > > Index: sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c > =================================================================== > --- sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c (revision 240846) > +++ sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c (working copy) > @@ -439,6 +439,7 @@ > 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 }; > @@ -555,9 +556,16 @@ > } > > /* 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); > + for (i = 1; (iface = usbd_get_iface(uaa->device, i)) != NULL; i ++) { > + id = usbd_get_interface_descriptor(iface); > > + if (id && (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: > ============================= EOF ======================================= > > > regards > > This looks like ok to apply to 8.3 also.