aboutsummaryrefslogtreecommitdiff
path: root/sys/netgraph
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2012-09-30 19:31:20 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2012-09-30 19:31:20 +0000
commit12b16d85ae375f17edd5b90b67219fc6e47b0c52 (patch)
treee2505aad4ae2fb67680f3251d6124c62651ce545 /sys/netgraph
parentf9f20af9ed5e260707700768e66b9af9a5991a91 (diff)
Notes
Diffstat (limited to 'sys/netgraph')
-rw-r--r--sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
index a7fa2afb4719..44654d20555d 100644
--- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
+++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
@@ -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: