aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/btusb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/bluetooth/btusb.c')
-rw-r--r--drivers/bluetooth/btusb.c99
1 files changed, 47 insertions, 52 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 0cd4a55dd5c..5d97bedb83e 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -41,25 +41,25 @@
41#define BT_DBG(D...) 41#define BT_DBG(D...)
42#endif 42#endif
43 43
44#define VERSION "0.3" 44#define VERSION "0.4"
45 45
46static int ignore_dga; 46static int ignore_dga;
47static int ignore_csr; 47static int ignore_csr;
48static int ignore_sniffer; 48static int ignore_sniffer;
49static int disable_scofix; 49static int disable_scofix;
50static int force_scofix; 50static int force_scofix;
51static int reset; 51
52static int reset = 1;
52 53
53static struct usb_driver btusb_driver; 54static struct usb_driver btusb_driver;
54 55
55#define BTUSB_IGNORE 0x01 56#define BTUSB_IGNORE 0x01
56#define BTUSB_RESET 0x02 57#define BTUSB_DIGIANSWER 0x02
57#define BTUSB_DIGIANSWER 0x04 58#define BTUSB_CSR 0x04
58#define BTUSB_CSR 0x08 59#define BTUSB_SNIFFER 0x08
59#define BTUSB_SNIFFER 0x10 60#define BTUSB_BCM92035 0x10
60#define BTUSB_BCM92035 0x20 61#define BTUSB_BROKEN_ISOC 0x20
61#define BTUSB_BROKEN_ISOC 0x40 62#define BTUSB_WRONG_SCO_MTU 0x40
62#define BTUSB_WRONG_SCO_MTU 0x80
63 63
64static struct usb_device_id btusb_table[] = { 64static struct usb_device_id btusb_table[] = {
65 /* Generic Bluetooth USB device */ 65 /* Generic Bluetooth USB device */
@@ -79,7 +79,7 @@ static struct usb_device_id btusb_table[] = {
79 { USB_DEVICE(0x0bdb, 0x1002) }, 79 { USB_DEVICE(0x0bdb, 0x1002) },
80 80
81 /* Canyon CN-BTU1 with HID interfaces */ 81 /* Canyon CN-BTU1 with HID interfaces */
82 { USB_DEVICE(0x0c10, 0x0000), .driver_info = BTUSB_RESET }, 82 { USB_DEVICE(0x0c10, 0x0000) },
83 83
84 { } /* Terminating entry */ 84 { } /* Terminating entry */
85}; 85};
@@ -94,52 +94,36 @@ static struct usb_device_id blacklist_table[] = {
94 { USB_DEVICE(0x0a5c, 0x2033), .driver_info = BTUSB_IGNORE }, 94 { USB_DEVICE(0x0a5c, 0x2033), .driver_info = BTUSB_IGNORE },
95 95
96 /* Broadcom BCM2035 */ 96 /* Broadcom BCM2035 */
97 { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU }, 97 { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU },
98 { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU }, 98 { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU },
99 { USB_DEVICE(0x0a5c, 0x2009), .driver_info = BTUSB_BCM92035 },
99 100
100 /* Broadcom BCM2045 */ 101 /* Broadcom BCM2045 */
101 { USB_DEVICE(0x0a5c, 0x2039), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU }, 102 { USB_DEVICE(0x0a5c, 0x2039), .driver_info = BTUSB_WRONG_SCO_MTU },
102 { USB_DEVICE(0x0a5c, 0x2101), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU }, 103 { USB_DEVICE(0x0a5c, 0x2101), .driver_info = BTUSB_WRONG_SCO_MTU },
103
104 /* Broadcom BCM2046 */
105 { USB_DEVICE(0x0a5c, 0x2146), .driver_info = BTUSB_RESET },
106 { USB_DEVICE(0x0a5c, 0x2151), .driver_info = BTUSB_RESET },
107
108 /* Apple MacBook Pro with Broadcom chip */
109 { USB_DEVICE(0x05ac, 0x820f), .driver_info = BTUSB_RESET },
110 104
111 /* IBM/Lenovo ThinkPad with Broadcom chip */ 105 /* IBM/Lenovo ThinkPad with Broadcom chip */
112 { USB_DEVICE(0x0a5c, 0x201e), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU }, 106 { USB_DEVICE(0x0a5c, 0x201e), .driver_info = BTUSB_WRONG_SCO_MTU },
113 { USB_DEVICE(0x0a5c, 0x2110), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU }, 107 { USB_DEVICE(0x0a5c, 0x2110), .driver_info = BTUSB_WRONG_SCO_MTU },
114
115 /* Targus ACB10US */
116 { USB_DEVICE(0x0a5c, 0x2100), .driver_info = BTUSB_RESET },
117 { USB_DEVICE(0x0a5c, 0x2154), .driver_info = BTUSB_RESET },
118
119 /* ANYCOM Bluetooth USB-200 and USB-250 */
120 { USB_DEVICE(0x0a5c, 0x2111), .driver_info = BTUSB_RESET },
121 108
122 /* HP laptop with Broadcom chip */ 109 /* HP laptop with Broadcom chip */
123 { USB_DEVICE(0x03f0, 0x171d), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU }, 110 { USB_DEVICE(0x03f0, 0x171d), .driver_info = BTUSB_WRONG_SCO_MTU },
124 111
125 /* Dell laptop with Broadcom chip */ 112 /* Dell laptop with Broadcom chip */
126 { USB_DEVICE(0x413c, 0x8126), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU }, 113 { USB_DEVICE(0x413c, 0x8126), .driver_info = BTUSB_WRONG_SCO_MTU },
127 114
128 /* Dell Wireless 370 */ 115 /* Dell Wireless 370 */
129 { USB_DEVICE(0x413c, 0x8156), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU }, 116 { USB_DEVICE(0x413c, 0x8156), .driver_info = BTUSB_WRONG_SCO_MTU },
130 117
131 /* Dell Wireless 410 */ 118 /* Dell Wireless 410 */
132 { USB_DEVICE(0x413c, 0x8152), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU }, 119 { USB_DEVICE(0x413c, 0x8152), .driver_info = BTUSB_WRONG_SCO_MTU },
133
134 /* Microsoft Wireless Transceiver for Bluetooth 2.0 */
135 { USB_DEVICE(0x045e, 0x009c), .driver_info = BTUSB_RESET },
136 120
137 /* Kensington Bluetooth USB adapter */ 121 /* Kensington Bluetooth USB adapter */
138 { USB_DEVICE(0x047d, 0x105d), .driver_info = BTUSB_RESET }, 122 { USB_DEVICE(0x047d, 0x105e), .driver_info = BTUSB_WRONG_SCO_MTU },
139 { USB_DEVICE(0x047d, 0x105e), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
140 123
141 /* ISSC Bluetooth Adapter v3.1 */ 124 /* Belkin F8T012 and F8T013 devices */
142 { USB_DEVICE(0x1131, 0x1001), .driver_info = BTUSB_RESET }, 125 { USB_DEVICE(0x050d, 0x0012), .driver_info = BTUSB_WRONG_SCO_MTU },
126 { USB_DEVICE(0x050d, 0x0013), .driver_info = BTUSB_WRONG_SCO_MTU },
143 127
144 /* RTX Telecom based adapters with buggy SCO support */ 128 /* RTX Telecom based adapters with buggy SCO support */
145 { USB_DEVICE(0x0400, 0x0807), .driver_info = BTUSB_BROKEN_ISOC }, 129 { USB_DEVICE(0x0400, 0x0807), .driver_info = BTUSB_BROKEN_ISOC },
@@ -148,13 +132,6 @@ static struct usb_device_id blacklist_table[] = {
148 /* CONWISE Technology based adapters with buggy SCO support */ 132 /* CONWISE Technology based adapters with buggy SCO support */
149 { USB_DEVICE(0x0e5e, 0x6622), .driver_info = BTUSB_BROKEN_ISOC }, 133 { USB_DEVICE(0x0e5e, 0x6622), .driver_info = BTUSB_BROKEN_ISOC },
150 134
151 /* Belkin F8T012 and F8T013 devices */
152 { USB_DEVICE(0x050d, 0x0012), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
153 { USB_DEVICE(0x050d, 0x0013), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
154
155 /* Belkin F8T016 device */
156 { USB_DEVICE(0x050d, 0x016a), .driver_info = BTUSB_RESET },
157
158 /* Digianswer devices */ 135 /* Digianswer devices */
159 { USB_DEVICE(0x08fd, 0x0001), .driver_info = BTUSB_DIGIANSWER }, 136 { USB_DEVICE(0x08fd, 0x0001), .driver_info = BTUSB_DIGIANSWER },
160 { USB_DEVICE(0x08fd, 0x0002), .driver_info = BTUSB_IGNORE }, 137 { USB_DEVICE(0x08fd, 0x0002), .driver_info = BTUSB_IGNORE },
@@ -197,6 +174,8 @@ struct btusb_data {
197 struct usb_endpoint_descriptor *isoc_tx_ep; 174 struct usb_endpoint_descriptor *isoc_tx_ep;
198 struct usb_endpoint_descriptor *isoc_rx_ep; 175 struct usb_endpoint_descriptor *isoc_rx_ep;
199 176
177 __u8 cmdreq_type;
178
200 int isoc_altsetting; 179 int isoc_altsetting;
201 int suspend_count; 180 int suspend_count;
202}; 181};
@@ -590,7 +569,7 @@ static int btusb_send_frame(struct sk_buff *skb)
590 return -ENOMEM; 569 return -ENOMEM;
591 } 570 }
592 571
593 dr->bRequestType = USB_TYPE_CLASS; 572 dr->bRequestType = data->cmdreq_type;
594 dr->bRequest = 0; 573 dr->bRequest = 0;
595 dr->wIndex = 0; 574 dr->wIndex = 0;
596 dr->wValue = 0; 575 dr->wValue = 0;
@@ -828,6 +807,8 @@ static int btusb_probe(struct usb_interface *intf,
828 return -ENODEV; 807 return -ENODEV;
829 } 808 }
830 809
810 data->cmdreq_type = USB_TYPE_CLASS;
811
831 data->udev = interface_to_usbdev(intf); 812 data->udev = interface_to_usbdev(intf);
832 data->intf = intf; 813 data->intf = intf;
833 814
@@ -862,11 +843,11 @@ static int btusb_probe(struct usb_interface *intf,
862 843
863 hdev->owner = THIS_MODULE; 844 hdev->owner = THIS_MODULE;
864 845
865 /* interface numbers are hardcoded in the spec */ 846 /* Interface numbers are hardcoded in the specification */
866 data->isoc = usb_ifnum_to_if(data->udev, 1); 847 data->isoc = usb_ifnum_to_if(data->udev, 1);
867 848
868 if (reset || id->driver_info & BTUSB_RESET) 849 if (!reset)
869 set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks); 850 set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
870 851
871 if (force_scofix || id->driver_info & BTUSB_WRONG_SCO_MTU) { 852 if (force_scofix || id->driver_info & BTUSB_WRONG_SCO_MTU) {
872 if (!disable_scofix) 853 if (!disable_scofix)
@@ -876,9 +857,23 @@ static int btusb_probe(struct usb_interface *intf,
876 if (id->driver_info & BTUSB_BROKEN_ISOC) 857 if (id->driver_info & BTUSB_BROKEN_ISOC)
877 data->isoc = NULL; 858 data->isoc = NULL;
878 859
860 if (id->driver_info & BTUSB_DIGIANSWER) {
861 data->cmdreq_type = USB_TYPE_VENDOR;
862 set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
863 }
864
865 if (id->driver_info & BTUSB_CSR) {
866 struct usb_device *udev = data->udev;
867
868 /* Old firmware would otherwise execute USB reset */
869 if (le16_to_cpu(udev->descriptor.bcdDevice) < 0x117)
870 set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
871 }
872
879 if (id->driver_info & BTUSB_SNIFFER) { 873 if (id->driver_info & BTUSB_SNIFFER) {
880 struct usb_device *udev = data->udev; 874 struct usb_device *udev = data->udev;
881 875
876 /* New sniffer firmware has crippled HCI interface */
882 if (le16_to_cpu(udev->descriptor.bcdDevice) > 0x997) 877 if (le16_to_cpu(udev->descriptor.bcdDevice) > 0x997)
883 set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks); 878 set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
884 879