How to claim only some of USB interfaces of a composite USB
device
Otacílio
otacilio.neto at bsd.com.br
Sat Sep 29 21:36:28 UTC 2012
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.
More information about the freebsd-hackers
mailing list