Date: Sat, 29 Sep 2012 18:36:21 -0300 From: =?ISO-8859-1?Q?Otac=EDlio?= <otacilio.neto@bsd.com.br> To: freebsd-hackers@freebsd.org Subject: Re: How to claim only some of USB interfaces of a composite USB device Message-ID: <506769D5.7040706@bsd.com.br> In-Reply-To: <1348910721.385146900@f89.mail.ru> References: <1348410653.373800982@f180.mail.ru> <201209241820.07558.hselasky@c2i.net> <1348910721.385146900@f89.mail.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?506769D5.7040706>