Bluetooth: Handle Intel USB bootloader with buggy interrupt
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 6 Jul 2014 12:53:54 +0000 (14:53 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Sun, 6 Jul 2014 13:16:05 +0000 (16:16 +0300)
The interrupt interface for the Intel USB bootloader devices is only
enabled after receiving SetInterface(0, AltSetting=0). When this USB
command is not send, then no HCI events will be received.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
drivers/bluetooth/btusb.c

index 14314a1..fe24f60 100644 (file)
@@ -1807,6 +1807,18 @@ static int btusb_probe(struct usb_interface *intf,
                data->isoc = NULL;
        }
 
+       if (id->driver_info & BTUSB_INTEL_BOOT) {
+               /* A bug in the bootloader causes that interrupt interface is
+                * only enabled after receiving SetInterface(0, AltSetting=0).
+                */
+               err = usb_set_interface(data->udev, 0, 0);
+               if (err < 0) {
+                       BT_ERR("failed to set interface 0, alt 0 %d", err);
+                       hci_free_dev(hdev);
+                       return err;
+               }
+       }
+
        if (data->isoc) {
                err = usb_driver_claim_interface(&btusb_driver,
                                                        data->isoc, data);