diff options
Diffstat (limited to 'drivers/bluetooth/btusb.c')
-rw-r--r-- | drivers/bluetooth/btusb.c | 55 |
1 files changed, 40 insertions, 15 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index d22ce3cc611e..c2de8951e3fb 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
@@ -59,9 +59,21 @@ static struct usb_device_id btusb_table[] = { | |||
59 | /* Generic Bluetooth USB device */ | 59 | /* Generic Bluetooth USB device */ |
60 | { USB_DEVICE_INFO(0xe0, 0x01, 0x01) }, | 60 | { USB_DEVICE_INFO(0xe0, 0x01, 0x01) }, |
61 | 61 | ||
62 | /* Apple MacBookPro 7,1 */ | ||
63 | { USB_DEVICE(0x05ac, 0x8213) }, | ||
64 | |||
62 | /* Apple iMac11,1 */ | 65 | /* Apple iMac11,1 */ |
63 | { USB_DEVICE(0x05ac, 0x8215) }, | 66 | { USB_DEVICE(0x05ac, 0x8215) }, |
64 | 67 | ||
68 | /* Apple MacBookPro6,2 */ | ||
69 | { USB_DEVICE(0x05ac, 0x8218) }, | ||
70 | |||
71 | /* Apple MacBookAir3,1, MacBookAir3,2 */ | ||
72 | { USB_DEVICE(0x05ac, 0x821b) }, | ||
73 | |||
74 | /* Apple MacBookPro8,2 */ | ||
75 | { USB_DEVICE(0x05ac, 0x821a) }, | ||
76 | |||
65 | /* AVM BlueFRITZ! USB v2.0 */ | 77 | /* AVM BlueFRITZ! USB v2.0 */ |
66 | { USB_DEVICE(0x057c, 0x3800) }, | 78 | { USB_DEVICE(0x057c, 0x3800) }, |
67 | 79 | ||
@@ -90,6 +102,19 @@ static struct usb_device_id blacklist_table[] = { | |||
90 | /* Broadcom BCM2033 without firmware */ | 102 | /* Broadcom BCM2033 without firmware */ |
91 | { USB_DEVICE(0x0a5c, 0x2033), .driver_info = BTUSB_IGNORE }, | 103 | { USB_DEVICE(0x0a5c, 0x2033), .driver_info = BTUSB_IGNORE }, |
92 | 104 | ||
105 | /* Atheros 3011 with sflash firmware */ | ||
106 | { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE }, | ||
107 | { USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE }, | ||
108 | |||
109 | /* Atheros AR9285 Malbec with sflash firmware */ | ||
110 | { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE }, | ||
111 | |||
112 | /* Atheros 3012 with sflash firmware */ | ||
113 | { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_IGNORE }, | ||
114 | |||
115 | /* Atheros AR5BBU12 with sflash firmware */ | ||
116 | { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, | ||
117 | |||
93 | /* Broadcom BCM2035 */ | 118 | /* Broadcom BCM2035 */ |
94 | { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, | 119 | { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, |
95 | { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU }, | 120 | { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU }, |
@@ -230,7 +255,8 @@ static void btusb_intr_complete(struct urb *urb) | |||
230 | 255 | ||
231 | err = usb_submit_urb(urb, GFP_ATOMIC); | 256 | err = usb_submit_urb(urb, GFP_ATOMIC); |
232 | if (err < 0) { | 257 | if (err < 0) { |
233 | BT_ERR("%s urb %p failed to resubmit (%d)", | 258 | if (err != -EPERM) |
259 | BT_ERR("%s urb %p failed to resubmit (%d)", | ||
234 | hdev->name, urb, -err); | 260 | hdev->name, urb, -err); |
235 | usb_unanchor_urb(urb); | 261 | usb_unanchor_urb(urb); |
236 | } | 262 | } |
@@ -314,7 +340,8 @@ static void btusb_bulk_complete(struct urb *urb) | |||
314 | 340 | ||
315 | err = usb_submit_urb(urb, GFP_ATOMIC); | 341 | err = usb_submit_urb(urb, GFP_ATOMIC); |
316 | if (err < 0) { | 342 | if (err < 0) { |
317 | BT_ERR("%s urb %p failed to resubmit (%d)", | 343 | if (err != -EPERM) |
344 | BT_ERR("%s urb %p failed to resubmit (%d)", | ||
318 | hdev->name, urb, -err); | 345 | hdev->name, urb, -err); |
319 | usb_unanchor_urb(urb); | 346 | usb_unanchor_urb(urb); |
320 | } | 347 | } |
@@ -403,13 +430,14 @@ static void btusb_isoc_complete(struct urb *urb) | |||
403 | 430 | ||
404 | err = usb_submit_urb(urb, GFP_ATOMIC); | 431 | err = usb_submit_urb(urb, GFP_ATOMIC); |
405 | if (err < 0) { | 432 | if (err < 0) { |
406 | BT_ERR("%s urb %p failed to resubmit (%d)", | 433 | if (err != -EPERM) |
434 | BT_ERR("%s urb %p failed to resubmit (%d)", | ||
407 | hdev->name, urb, -err); | 435 | hdev->name, urb, -err); |
408 | usb_unanchor_urb(urb); | 436 | usb_unanchor_urb(urb); |
409 | } | 437 | } |
410 | } | 438 | } |
411 | 439 | ||
412 | static void inline __fill_isoc_descriptor(struct urb *urb, int len, int mtu) | 440 | static inline void __fill_isoc_descriptor(struct urb *urb, int len, int mtu) |
413 | { | 441 | { |
414 | int i, offset = 0; | 442 | int i, offset = 0; |
415 | 443 | ||
@@ -666,7 +694,8 @@ static int btusb_send_frame(struct sk_buff *skb) | |||
666 | break; | 694 | break; |
667 | 695 | ||
668 | case HCI_ACLDATA_PKT: | 696 | case HCI_ACLDATA_PKT: |
669 | if (!data->bulk_tx_ep || hdev->conn_hash.acl_num < 1) | 697 | if (!data->bulk_tx_ep || (hdev->conn_hash.acl_num < 1 && |
698 | hdev->conn_hash.le_num < 1)) | ||
670 | return -ENODEV; | 699 | return -ENODEV; |
671 | 700 | ||
672 | urb = usb_alloc_urb(0, GFP_ATOMIC); | 701 | urb = usb_alloc_urb(0, GFP_ATOMIC); |
@@ -693,15 +722,11 @@ static int btusb_send_frame(struct sk_buff *skb) | |||
693 | pipe = usb_sndisocpipe(data->udev, | 722 | pipe = usb_sndisocpipe(data->udev, |
694 | data->isoc_tx_ep->bEndpointAddress); | 723 | data->isoc_tx_ep->bEndpointAddress); |
695 | 724 | ||
696 | urb->dev = data->udev; | 725 | usb_fill_int_urb(urb, data->udev, pipe, |
697 | urb->pipe = pipe; | 726 | skb->data, skb->len, btusb_isoc_tx_complete, |
698 | urb->context = skb; | 727 | skb, data->isoc_tx_ep->bInterval); |
699 | urb->complete = btusb_isoc_tx_complete; | ||
700 | urb->interval = data->isoc_tx_ep->bInterval; | ||
701 | 728 | ||
702 | urb->transfer_flags = URB_ISO_ASAP; | 729 | urb->transfer_flags = URB_ISO_ASAP; |
703 | urb->transfer_buffer = skb->data; | ||
704 | urb->transfer_buffer_length = skb->len; | ||
705 | 730 | ||
706 | __fill_isoc_descriptor(urb, skb->len, | 731 | __fill_isoc_descriptor(urb, skb->len, |
707 | le16_to_cpu(data->isoc_tx_ep->wMaxPacketSize)); | 732 | le16_to_cpu(data->isoc_tx_ep->wMaxPacketSize)); |
@@ -760,7 +785,7 @@ static void btusb_notify(struct hci_dev *hdev, unsigned int evt) | |||
760 | } | 785 | } |
761 | } | 786 | } |
762 | 787 | ||
763 | static int inline __set_isoc_interface(struct hci_dev *hdev, int altsetting) | 788 | static inline int __set_isoc_interface(struct hci_dev *hdev, int altsetting) |
764 | { | 789 | { |
765 | struct btusb_data *data = hdev->driver_data; | 790 | struct btusb_data *data = hdev->driver_data; |
766 | struct usb_interface *intf = data->isoc; | 791 | struct usb_interface *intf = data->isoc; |
@@ -811,7 +836,7 @@ static void btusb_work(struct work_struct *work) | |||
811 | 836 | ||
812 | if (hdev->conn_hash.sco_num > 0) { | 837 | if (hdev->conn_hash.sco_num > 0) { |
813 | if (!test_bit(BTUSB_DID_ISO_RESUME, &data->flags)) { | 838 | if (!test_bit(BTUSB_DID_ISO_RESUME, &data->flags)) { |
814 | err = usb_autopm_get_interface(data->isoc); | 839 | err = usb_autopm_get_interface(data->isoc ? data->isoc : data->intf); |
815 | if (err < 0) { | 840 | if (err < 0) { |
816 | clear_bit(BTUSB_ISOC_RUNNING, &data->flags); | 841 | clear_bit(BTUSB_ISOC_RUNNING, &data->flags); |
817 | usb_kill_anchored_urbs(&data->isoc_anchor); | 842 | usb_kill_anchored_urbs(&data->isoc_anchor); |
@@ -840,7 +865,7 @@ static void btusb_work(struct work_struct *work) | |||
840 | 865 | ||
841 | __set_isoc_interface(hdev, 0); | 866 | __set_isoc_interface(hdev, 0); |
842 | if (test_and_clear_bit(BTUSB_DID_ISO_RESUME, &data->flags)) | 867 | if (test_and_clear_bit(BTUSB_DID_ISO_RESUME, &data->flags)) |
843 | usb_autopm_put_interface(data->isoc); | 868 | usb_autopm_put_interface(data->isoc ? data->isoc : data->intf); |
844 | } | 869 | } |
845 | } | 870 | } |
846 | 871 | ||