Skip to content

Commit 7e2308d

Browse files
committed
vigor: major bt update
Change-Id: Ic8d0b292ed936282c3a815ab947a94792e0bbc8e
1 parent 01932ee commit 7e2308d

23 files changed

+375
-1125
lines changed

arch/arm/configs/vigor_aosp_defconfig

+2-2
Original file line numberDiff line numberDiff line change
@@ -1019,8 +1019,8 @@ CONFIG_BT_SCO=y
10191019
CONFIG_BT_RFCOMM=y
10201020
CONFIG_BT_RFCOMM_TTY=y
10211021
CONFIG_BT_BNEP=y
1022-
# CONFIG_BT_BNEP_MC_FILTER is not set
1023-
# CONFIG_BT_BNEP_PROTO_FILTER is not set
1022+
CONFIG_BT_BNEP_MC_FILTER=y
1023+
CONFIG_BT_BNEP_PROTO_FILTER=y
10241024
CONFIG_BT_HIDP=y
10251025

10261026
#

drivers/bluetooth/ath3k.c

+17
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,27 @@ static struct usb_device_id ath3k_table[] = {
6262

6363
/* Atheros AR3011 with sflash firmware*/
6464
{ USB_DEVICE(0x0CF3, 0x3002) },
65+
{ USB_DEVICE(0x0489, 0xE03D) },
66+
67+
{ USB_DEVICE(0x13d3, 0x3304) },
68+
{ USB_DEVICE(0x0930, 0x0215) },
69+
{ USB_DEVICE(0x0489, 0xE03D) },
6570

6671
/* Atheros AR9285 Malbec with sflash firmware */
6772
{ USB_DEVICE(0x03F0, 0x311D) },
6873

6974
/* Atheros AR3012 with sflash firmware*/
7075
{ USB_DEVICE(0x0CF3, 0x3004) },
76+
{ USB_DEVICE(0x0CF3, 0x311D) },
77+
{ USB_DEVICE(0x13d3, 0x3375) },
78+
{ USB_DEVICE(0x04CA, 0x3005) },
7179

7280
/* Atheros AR5BBU12 with sflash firmware */
7381
{ USB_DEVICE(0x0489, 0xE02C) },
7482

83+
/* Atheros AR5BBU22 with sflash firmware */
84+
{ USB_DEVICE(0x0489, 0xE03C) },
85+
7586
{ } /* Terminating entry */
7687
};
7788

@@ -84,6 +95,12 @@ static struct usb_device_id ath3k_blist_tbl[] = {
8495

8596
/* Atheros AR3012 with sflash firmware*/
8697
{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
98+
{ USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
99+
{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
100+
{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
101+
102+
/* Atheros AR5BBU22 with sflash firmware */
103+
{ USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 },
87104

88105
{ } /* Terminating entry */
89106
};

drivers/bluetooth/btusb.c

+27-7
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ static struct usb_device_id btusb_table[] = {
5959
/* Generic Bluetooth USB device */
6060
{ USB_DEVICE_INFO(0xe0, 0x01, 0x01) },
6161

62+
/* Broadcom SoftSailing reporting vendor specific */
63+
{ USB_DEVICE(0x0a5c, 0x21e1) },
64+
6265
/* Apple MacBookPro 7,1 */
6366
{ USB_DEVICE(0x05ac, 0x8213) },
6467

@@ -90,6 +93,17 @@ static struct usb_device_id btusb_table[] = {
9093
/* Canyon CN-BTU1 with HID interfaces */
9194
{ USB_DEVICE(0x0c10, 0x0000) },
9295

96+
/* Broadcom BCM20702A0 */
97+
{ USB_DEVICE(0x0489, 0xe042) },
98+
{ USB_DEVICE(0x0a5c, 0x21e3) },
99+
{ USB_DEVICE(0x0a5c, 0x21e6) },
100+
{ USB_DEVICE(0x0a5c, 0x21e8) },
101+
{ USB_DEVICE(0x0a5c, 0x21f3) },
102+
{ USB_DEVICE(0x413c, 0x8197) },
103+
104+
/* Foxconn - Hon Hai */
105+
{ USB_DEVICE(0x0489, 0xe033) },
106+
93107
{ } /* Terminating entry */
94108
};
95109

@@ -104,16 +118,27 @@ static struct usb_device_id blacklist_table[] = {
104118

105119
/* Atheros 3011 with sflash firmware */
106120
{ USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE },
121+
{ USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE },
122+
123+
{ USB_DEVICE(0x13d3, 0x3304), .driver_info = BTUSB_IGNORE },
124+
{ USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE },
125+
{ USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE },
107126

108127
/* Atheros AR9285 Malbec with sflash firmware */
109128
{ USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
110129

111130
/* Atheros 3012 with sflash firmware */
112131
{ USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_IGNORE },
132+
{ USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
133+
{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
134+
{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
113135

114136
/* Atheros AR5BBU12 with sflash firmware */
115137
{ USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
116138

139+
/* Atheros AR5BBU12 with sflash firmware */
140+
{ USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 },
141+
117142
/* Broadcom BCM2035 */
118143
{ USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU },
119144
{ USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU },
@@ -485,15 +510,10 @@ static int btusb_submit_isoc_urb(struct hci_dev *hdev, gfp_t mem_flags)
485510

486511
pipe = usb_rcvisocpipe(data->udev, data->isoc_rx_ep->bEndpointAddress);
487512

488-
urb->dev = data->udev;
489-
urb->pipe = pipe;
490-
urb->context = hdev;
491-
urb->complete = btusb_isoc_complete;
492-
urb->interval = data->isoc_rx_ep->bInterval;
513+
usb_fill_int_urb(urb, data->udev, pipe, buf, size, btusb_isoc_complete,
514+
hdev, data->isoc_rx_ep->bInterval);
493515

494516
urb->transfer_flags = URB_FREE_BUFFER | URB_ISO_ASAP;
495-
urb->transfer_buffer = buf;
496-
urb->transfer_buffer_length = size;
497517

498518
__fill_isoc_descriptor(urb, size,
499519
le16_to_cpu(data->isoc_rx_ep->wMaxPacketSize));

drivers/bluetooth/hci_ldisc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ static void hci_uart_destruct(struct hci_dev *hdev)
237237
return;
238238

239239
BT_DBG("%s", hdev->name);
240-
kfree(hdev->driver_data);
241240
}
242241

243242
/* ------ LDISC part ------ */
@@ -310,12 +309,13 @@ static void hci_uart_tty_close(struct tty_struct *tty)
310309
hci_uart_close(hdev);
311310

312311
if (test_and_clear_bit(HCI_UART_PROTO_SET, &hu->flags)) {
313-
hu->proto->close(hu);
314312
if (hdev) {
315313
hci_unregister_dev(hdev);
316314
hci_free_dev(hdev);
317315
}
316+
hu->proto->close(hu);
318317
}
318+
kfree(hu);
319319
}
320320
}
321321

drivers/bluetooth/hci_smd.c

+17-70
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <linux/kernel.h>
2323
#include <linux/init.h>
2424
#include <linux/errno.h>
25-
#include <linux/semaphore.h>
2625
#include <linux/string.h>
2726
#include <linux/skbuff.h>
2827
#include <linux/wakelock.h>
@@ -41,23 +40,19 @@
4140
*/
4241

4342
#define RX_Q_MONITOR (500) /* 500 milli second */
44-
#define HCI_REGISTER_SET 0
4543

4644

4745
static int hcismd_set;
48-
static DEFINE_SEMAPHORE(hci_smd_enable);
49-
50-
static int restart_in_progress;
46+
static DEFINE_MUTEX(hci_smd_enable);
5147

5248
static int hcismd_set_enable(const char *val, struct kernel_param *kp);
5349
module_param_call(hcismd_set, hcismd_set_enable, NULL, &hcismd_set, 0644);
5450

55-
static void hci_dev_smd_open(struct work_struct *worker);
5651
static void hci_dev_restart(struct work_struct *worker);
5752

5853
struct hci_smd_data {
5954
struct hci_dev *hdev;
60-
unsigned long flags;
55+
6156
struct smd_channel *event_channel;
6257
struct smd_channel *data_channel;
6358
struct wake_lock wake_lock_tx;
@@ -320,8 +315,6 @@ static void hci_smd_notify_event(void *data, unsigned int event)
320315
struct hci_dev *hdev = hs.hdev;
321316
struct hci_smd_data *hsmd = &hs;
322317
struct work_struct *reset_worker;
323-
struct work_struct *open_worker;
324-
325318
int len = 0;
326319

327320
if (!hdev) {
@@ -341,13 +334,6 @@ static void hci_smd_notify_event(void *data, unsigned int event)
341334
case SMD_EVENT_OPEN:
342335
BT_INFO("opening HCI-SMD channel :%s", EVENT_CHANNEL);
343336
hci_smd_open(hdev);
344-
open_worker = kzalloc(sizeof(*open_worker), GFP_ATOMIC);
345-
if (!open_worker) {
346-
BT_ERR("Out of memory");
347-
break;
348-
}
349-
INIT_WORK(open_worker, hci_dev_smd_open);
350-
schedule_work(open_worker);
351337
break;
352338
case SMD_EVENT_CLOSE:
353339
BT_INFO("Closing HCI-SMD channel :%s", EVENT_CHANNEL);
@@ -398,29 +384,9 @@ static void hci_smd_notify_data(void *data, unsigned int event)
398384

399385
}
400386

401-
static int hci_smd_hci_register_dev(struct hci_smd_data *hsmd)
402-
{
403-
struct hci_dev *hdev;
404-
405-
hdev = hsmd->hdev;
406-
if (test_and_set_bit(HCI_REGISTER_SET, &hsmd->flags)) {
407-
BT_ERR("HCI device registered already");
408-
return 0;
409-
} else
410-
BT_INFO("HCI device registration is starting");
411-
if (hci_register_dev(hdev) < 0) {
412-
BT_ERR("Can't register HCI device");
413-
hci_free_dev(hdev);
414-
hsmd->hdev = NULL;
415-
clear_bit(HCI_REGISTER_SET, &hsmd->flags);
416-
return -ENODEV;
417-
}
418-
return 0;
419-
}
420-
421-
static int hci_smd_register_smd(struct hci_smd_data *hsmd)
387+
static int hci_smd_register_dev(struct hci_smd_data *hsmd)
422388
{
423-
struct hci_dev *hdev;
389+
static struct hci_dev *hdev;
424390
int rc;
425391

426392
/* Initialize and register HCI device */
@@ -455,7 +421,7 @@ static int hci_smd_register_smd(struct hci_smd_data *hsmd)
455421
if (rc < 0) {
456422
BT_ERR("Cannot open the command channel");
457423
hci_free_dev(hdev);
458-
hsmd->hdev = NULL;
424+
hdev = NULL;
459425
return -ENODEV;
460426
}
461427

@@ -464,25 +430,25 @@ static int hci_smd_register_smd(struct hci_smd_data *hsmd)
464430
if (rc < 0) {
465431
BT_ERR("Failed to open the Data channel");
466432
hci_free_dev(hdev);
467-
hsmd->hdev = NULL;
433+
hdev = NULL;
468434
return -ENODEV;
469435
}
470436

471437
/* Disable the read interrupts on the channel */
472438
smd_disable_read_intr(hsmd->event_channel);
473439
smd_disable_read_intr(hsmd->data_channel);
440+
if (hci_register_dev(hdev) < 0) {
441+
BT_ERR("Can't register HCI device");
442+
hci_free_dev(hdev);
443+
return -ENODEV;
444+
}
474445
return 0;
475446
}
476447

477448
static void hci_smd_deregister_dev(struct hci_smd_data *hsmd)
478449
{
479450
tasklet_kill(&hs.rx_task);
480451

481-
if (!test_and_clear_bit(HCI_REGISTER_SET, &hsmd->flags)) {
482-
BT_ERR("HCI device un-registered already");
483-
return;
484-
} else
485-
BT_INFO("HCI device un-registration going on");
486452
if (hsmd->hdev) {
487453
if (hci_unregister_dev(hsmd->hdev) < 0)
488454
BT_ERR("Can't unregister HCI device %s",
@@ -510,34 +476,18 @@ static void hci_smd_deregister_dev(struct hci_smd_data *hsmd)
510476

511477
static void hci_dev_restart(struct work_struct *worker)
512478
{
513-
down(&hci_smd_enable);
514-
restart_in_progress = 1;
479+
mutex_lock(&hci_smd_enable);
515480
hci_smd_deregister_dev(&hs);
516-
hci_smd_register_smd(&hs);
517-
up(&hci_smd_enable);
518-
kfree(worker);
519-
}
520-
521-
static void hci_dev_smd_open(struct work_struct *worker)
522-
{
523-
down(&hci_smd_enable);
524-
if (restart_in_progress == 1) {
525-
/* Allow wcnss to initialize */
526-
restart_in_progress = 0;
527-
msleep(10000);
528-
}
529-
hci_smd_hci_register_dev(&hs);
530-
up(&hci_smd_enable);
481+
hci_smd_register_dev(&hs);
482+
mutex_unlock(&hci_smd_enable);
531483
kfree(worker);
532484
}
533485

534486
static int hcismd_set_enable(const char *val, struct kernel_param *kp)
535487
{
536488
int ret = 0;
537489

538-
pr_err("hcismd_set_enable %d", hcismd_set);
539-
540-
down(&hci_smd_enable);
490+
mutex_lock(&hci_smd_enable);
541491

542492
ret = param_set_int(val, kp);
543493

@@ -547,8 +497,7 @@ static int hcismd_set_enable(const char *val, struct kernel_param *kp)
547497
switch (hcismd_set) {
548498

549499
case 1:
550-
if (hs.hdev == NULL)
551-
hci_smd_register_smd(&hs);
500+
hci_smd_register_dev(&hs);
552501
break;
553502
case 0:
554503
hci_smd_deregister_dev(&hs);
@@ -558,7 +507,7 @@ static int hcismd_set_enable(const char *val, struct kernel_param *kp)
558507
}
559508

560509
done:
561-
up(&hci_smd_enable);
510+
mutex_unlock(&hci_smd_enable);
562511
return ret;
563512
}
564513
static int __init hci_smd_init(void)
@@ -567,8 +516,6 @@ static int __init hci_smd_init(void)
567516
"msm_smd_Rx");
568517
wake_lock_init(&hs.wake_lock_tx, WAKE_LOCK_SUSPEND,
569518
"msm_smd_Tx");
570-
restart_in_progress = 0;
571-
hs.hdev = NULL;
572519
return 0;
573520
}
574521
module_init(hci_smd_init);

include/net/bluetooth/amp.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2010-2012 Code Aurora Forum. All rights reserved.
2+
Copyright (c) 2010-2011 Code Aurora Forum. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License version 2 and
@@ -115,7 +115,7 @@ int amp_init(void);
115115
void amp_exit(void);
116116

117117
/* L2CAP-AMP fixed channel interface */
118-
void amp_conn_ind(struct hci_conn *hcon, struct sk_buff *skb);
118+
void amp_conn_ind(struct l2cap_conn *conn, struct sk_buff *skb);
119119

120120
/* L2CAP-AMP link interface */
121121
void amp_create_physical(struct l2cap_conn *conn, struct sock *sk);
@@ -256,7 +256,7 @@ struct amp_work_state_change {
256256
};
257257
struct amp_work_conn_ind {
258258
struct work_struct work;
259-
struct hci_conn *hcon;
259+
struct l2cap_conn *conn;
260260
struct sk_buff *skb;
261261
};
262262
struct amp_work_create_physical {

0 commit comments

Comments
 (0)