Skip to content

Commit a72c951

Browse files
committed
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
Johan Hedberg says: ==================== pull request: bluetooth-next 2015-10-22 Here's probably the last bluetooth-next pull request for 4.4. Among several other changes it contains the rest of the fixes & cleanups from the Bluetooth UnplugFest (that didn't need to be hurried to 4.3). - Refactoring & cleanups to 6lowpan code - New USB ids for two Atheros controllers and BCM43142A0 from Broadcom - Fix (quirk) for broken Broadcom BCM2045 controllers - Support for latest Apple controllers - Improvements to the vendor diagnostic message support Please let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 379a80a + 13972ad commit a72c951

36 files changed

+1533
-797
lines changed

drivers/bluetooth/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ config BT_HCIBCM203X
183183

184184
config BT_HCIBPA10X
185185
tristate "HCI BPA10x USB driver"
186-
depends on USB
186+
depends on USB && BT_HCIUART
187187
select BT_HCIUART_H4
188188
help
189189
Bluetooth HCI BPA10x USB driver.

drivers/bluetooth/ath3k.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ static const struct usb_device_id ath3k_table[] = {
9393
{ USB_DEVICE(0x04CA, 0x300f) },
9494
{ USB_DEVICE(0x04CA, 0x3010) },
9595
{ USB_DEVICE(0x0930, 0x0219) },
96+
{ USB_DEVICE(0x0930, 0x021c) },
9697
{ USB_DEVICE(0x0930, 0x0220) },
9798
{ USB_DEVICE(0x0930, 0x0227) },
9899
{ USB_DEVICE(0x0b05, 0x17d0) },
@@ -104,6 +105,7 @@ static const struct usb_device_id ath3k_table[] = {
104105
{ USB_DEVICE(0x0CF3, 0x311F) },
105106
{ USB_DEVICE(0x0cf3, 0x3121) },
106107
{ USB_DEVICE(0x0CF3, 0x817a) },
108+
{ USB_DEVICE(0x0CF3, 0x817b) },
107109
{ USB_DEVICE(0x0cf3, 0xe003) },
108110
{ USB_DEVICE(0x0CF3, 0xE004) },
109111
{ USB_DEVICE(0x0CF3, 0xE005) },
@@ -153,6 +155,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
153155
{ USB_DEVICE(0x04ca, 0x300f), .driver_info = BTUSB_ATH3012 },
154156
{ USB_DEVICE(0x04ca, 0x3010), .driver_info = BTUSB_ATH3012 },
155157
{ USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 },
158+
{ USB_DEVICE(0x0930, 0x021c), .driver_info = BTUSB_ATH3012 },
156159
{ USB_DEVICE(0x0930, 0x0220), .driver_info = BTUSB_ATH3012 },
157160
{ USB_DEVICE(0x0930, 0x0227), .driver_info = BTUSB_ATH3012 },
158161
{ USB_DEVICE(0x0b05, 0x17d0), .driver_info = BTUSB_ATH3012 },
@@ -164,6 +167,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
164167
{ USB_DEVICE(0x0cf3, 0x311F), .driver_info = BTUSB_ATH3012 },
165168
{ USB_DEVICE(0x0cf3, 0x3121), .driver_info = BTUSB_ATH3012 },
166169
{ USB_DEVICE(0x0CF3, 0x817a), .driver_info = BTUSB_ATH3012 },
170+
{ USB_DEVICE(0x0CF3, 0x817b), .driver_info = BTUSB_ATH3012 },
167171
{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
168172
{ USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 },
169173
{ USB_DEVICE(0x0cf3, 0xe006), .driver_info = BTUSB_ATH3012 },

drivers/bluetooth/btbcm.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ int btbcm_initialize(struct hci_dev *hdev, char *fw_name, size_t len)
323323
}
324324

325325
BT_INFO("%s: %s (%3.3u.%3.3u.%3.3u) build %4.4u", hdev->name,
326-
hw_name ? : "BCM", (subver & 0x7000) >> 13,
326+
hw_name ? : "BCM", (subver & 0xe000) >> 13,
327327
(subver & 0x1f00) >> 8, (subver & 0x00ff), rev & 0x0fff);
328328

329329
return 0;
@@ -353,7 +353,7 @@ int btbcm_finalize(struct hci_dev *hdev)
353353
kfree_skb(skb);
354354

355355
BT_INFO("%s: BCM (%3.3u.%3.3u.%3.3u) build %4.4u", hdev->name,
356-
(subver & 0x7000) >> 13, (subver & 0x1f00) >> 8,
356+
(subver & 0xe000) >> 13, (subver & 0x1f00) >> 8,
357357
(subver & 0x00ff), rev & 0x0fff);
358358

359359
btbcm_check_bdaddr(hdev);
@@ -461,7 +461,7 @@ int btbcm_setup_patchram(struct hci_dev *hdev)
461461
}
462462

463463
BT_INFO("%s: %s (%3.3u.%3.3u.%3.3u) build %4.4u", hdev->name,
464-
hw_name ? : "BCM", (subver & 0x7000) >> 13,
464+
hw_name ? : "BCM", (subver & 0xe000) >> 13,
465465
(subver & 0x1f00) >> 8, (subver & 0x00ff), rev & 0x0fff);
466466

467467
err = request_firmware(&fw, fw_name, &hdev->dev);
@@ -490,7 +490,7 @@ int btbcm_setup_patchram(struct hci_dev *hdev)
490490
kfree_skb(skb);
491491

492492
BT_INFO("%s: %s (%3.3u.%3.3u.%3.3u) build %4.4u", hdev->name,
493-
hw_name ? : "BCM", (subver & 0x7000) >> 13,
493+
hw_name ? : "BCM", (subver & 0xe000) >> 13,
494494
(subver & 0x1f00) >> 8, (subver & 0x00ff), rev & 0x0fff);
495495

496496
/* Read Local Name */
@@ -527,6 +527,15 @@ int btbcm_setup_apple(struct hci_dev *hdev)
527527
kfree_skb(skb);
528528
}
529529

530+
/* Read USB Product Info */
531+
skb = btbcm_read_usb_product(hdev);
532+
if (!IS_ERR(skb)) {
533+
BT_INFO("%s: BCM: product %4.4x:%4.4x", hdev->name,
534+
get_unaligned_le16(skb->data + 1),
535+
get_unaligned_le16(skb->data + 3));
536+
kfree_skb(skb);
537+
}
538+
530539
/* Read Local Name */
531540
skb = btbcm_read_local_name(hdev);
532541
if (!IS_ERR(skb)) {

drivers/bluetooth/btintel.c

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,75 @@ int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
9191
}
9292
EXPORT_SYMBOL_GPL(btintel_set_bdaddr);
9393

94+
int btintel_set_diag(struct hci_dev *hdev, bool enable)
95+
{
96+
struct sk_buff *skb;
97+
u8 param[3];
98+
int err;
99+
100+
if (enable) {
101+
param[0] = 0x03;
102+
param[1] = 0x03;
103+
param[2] = 0x03;
104+
} else {
105+
param[0] = 0x00;
106+
param[1] = 0x00;
107+
param[2] = 0x00;
108+
}
109+
110+
skb = __hci_cmd_sync(hdev, 0xfc43, 3, param, HCI_INIT_TIMEOUT);
111+
if (IS_ERR(skb)) {
112+
err = PTR_ERR(skb);
113+
if (err == -ENODATA)
114+
goto done;
115+
BT_ERR("%s: Changing Intel diagnostic mode failed (%d)",
116+
hdev->name, err);
117+
return err;
118+
}
119+
kfree_skb(skb);
120+
121+
done:
122+
btintel_set_event_mask(hdev, enable);
123+
return 0;
124+
}
125+
EXPORT_SYMBOL_GPL(btintel_set_diag);
126+
127+
int btintel_set_diag_mfg(struct hci_dev *hdev, bool enable)
128+
{
129+
struct sk_buff *skb;
130+
u8 param[2];
131+
int err;
132+
133+
param[0] = 0x01;
134+
param[1] = 0x00;
135+
136+
skb = __hci_cmd_sync(hdev, 0xfc11, 2, param, HCI_INIT_TIMEOUT);
137+
if (IS_ERR(skb)) {
138+
err = PTR_ERR(skb);
139+
BT_ERR("%s: Entering Intel manufacturer mode failed (%d)",
140+
hdev->name, err);
141+
return PTR_ERR(skb);
142+
}
143+
kfree_skb(skb);
144+
145+
err = btintel_set_diag(hdev, enable);
146+
147+
param[0] = 0x00;
148+
param[1] = 0x00;
149+
150+
skb = __hci_cmd_sync(hdev, 0xfc11, 2, param, HCI_INIT_TIMEOUT);
151+
if (IS_ERR(skb)) {
152+
err = PTR_ERR(skb);
153+
BT_ERR("%s: Leaving Intel manufacturer mode failed (%d)",
154+
hdev->name, err);
155+
return PTR_ERR(skb);
156+
}
157+
kfree_skb(skb);
158+
159+
return err;
160+
}
161+
EXPORT_SYMBOL_GPL(btintel_set_diag_mfg);
162+
94163
void btintel_hw_error(struct hci_dev *hdev, u8 code)
95164
{
96165
struct sk_buff *skb;
@@ -216,6 +285,64 @@ int btintel_load_ddc_config(struct hci_dev *hdev, const char *ddc_name)
216285
}
217286
EXPORT_SYMBOL_GPL(btintel_load_ddc_config);
218287

288+
int btintel_set_event_mask(struct hci_dev *hdev, bool debug)
289+
{
290+
u8 mask[8] = { 0x87, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
291+
struct sk_buff *skb;
292+
int err;
293+
294+
if (debug)
295+
mask[1] |= 0x62;
296+
297+
skb = __hci_cmd_sync(hdev, 0xfc52, 8, mask, HCI_INIT_TIMEOUT);
298+
if (IS_ERR(skb)) {
299+
err = PTR_ERR(skb);
300+
BT_ERR("%s: Setting Intel event mask failed (%d)",
301+
hdev->name, err);
302+
return err;
303+
}
304+
kfree_skb(skb);
305+
306+
return 0;
307+
}
308+
EXPORT_SYMBOL_GPL(btintel_set_event_mask);
309+
310+
int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug)
311+
{
312+
struct sk_buff *skb;
313+
u8 param[2];
314+
int err;
315+
316+
param[0] = 0x01;
317+
param[1] = 0x00;
318+
319+
skb = __hci_cmd_sync(hdev, 0xfc11, 2, param, HCI_INIT_TIMEOUT);
320+
if (IS_ERR(skb)) {
321+
err = PTR_ERR(skb);
322+
BT_ERR("%s: Entering Intel manufacturer mode failed (%d)",
323+
hdev->name, err);
324+
return PTR_ERR(skb);
325+
}
326+
kfree_skb(skb);
327+
328+
err = btintel_set_event_mask(hdev, debug);
329+
330+
param[0] = 0x00;
331+
param[1] = 0x00;
332+
333+
skb = __hci_cmd_sync(hdev, 0xfc11, 2, param, HCI_INIT_TIMEOUT);
334+
if (IS_ERR(skb)) {
335+
err = PTR_ERR(skb);
336+
BT_ERR("%s: Leaving Intel manufacturer mode failed (%d)",
337+
hdev->name, err);
338+
return PTR_ERR(skb);
339+
}
340+
kfree_skb(skb);
341+
342+
return err;
343+
}
344+
EXPORT_SYMBOL_GPL(btintel_set_event_mask_mfg);
345+
219346
/* ------- REGMAP IBT SUPPORT ------- */
220347

221348
#define IBT_REG_MODE_8BIT 0x00

drivers/bluetooth/btintel.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,16 @@ struct intel_secure_send_result {
7373

7474
int btintel_check_bdaddr(struct hci_dev *hdev);
7575
int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
76+
int btintel_set_diag(struct hci_dev *hdev, bool enable);
77+
int btintel_set_diag_mfg(struct hci_dev *hdev, bool enable);
7678
void btintel_hw_error(struct hci_dev *hdev, u8 code);
7779

7880
void btintel_version_info(struct hci_dev *hdev, struct intel_version *ver);
7981
int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type, u32 plen,
8082
const void *param);
8183
int btintel_load_ddc_config(struct hci_dev *hdev, const char *ddc_name);
84+
int btintel_set_event_mask(struct hci_dev *hdev, bool debug);
85+
int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug);
8286

8387
struct regmap *btintel_regmap_init(struct hci_dev *hdev, u16 opcode_read,
8488
u16 opcode_write);
@@ -95,6 +99,16 @@ static inline int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdadd
9599
return -EOPNOTSUPP;
96100
}
97101

102+
static inline int btintel_set_diag(struct hci_dev *hdev, bool enable)
103+
{
104+
return -EOPNOTSUPP;
105+
}
106+
107+
static inline int btintel_set_diag_mfg(struct hci_dev *hdev, bool enable)
108+
{
109+
return -EOPNOTSUPP;
110+
}
111+
98112
static inline void btintel_hw_error(struct hci_dev *hdev, u8 code)
99113
{
100114
}
@@ -116,6 +130,16 @@ static inline int btintel_load_ddc_config(struct hci_dev *hdev,
116130
return -EOPNOTSUPP;
117131
}
118132

133+
static inline int btintel_set_event_mask(struct hci_dev *hdev, bool debug)
134+
{
135+
return -EOPNOTSUPP;
136+
}
137+
138+
static inline int btintel_set_event_mask_mfg(struct hci_dev *hdev, bool debug)
139+
{
140+
return -EOPNOTSUPP;
141+
}
142+
119143
static inline struct regmap *btintel_regmap_init(struct hci_dev *hdev,
120144
u16 opcode_read,
121145
u16 opcode_write)

0 commit comments

Comments
 (0)