Skip to content

Commit 6ea09d8

Browse files
committed
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
John W. Linville says: ==================== Please pull this batch of updates for the 3.14 stream... For the Bluetooth bits, Gustavo says: "This is the first batch of patches intended for 3.14. There is nothing big here. Most of the code are refactors, clean up, small fixes, plus some new device id support." And... "More patches to 3.14. Here we have the support for Low Energy Connection Oriented Channels (LE CoC). Basically, as the name says, this adds supports for connection oriented channels in the same way we already have them for BR/EDR connections so profiles/protocols that work on top of BR/EDR can now work on LE plus a plenty of new possibilities for LE." For the ath10k bits, Kalle says: "Janusz and Marek implemented DFS support to ath10k, but the code is not enabled yet due to missing cfg80211/mac80211 patches (it will be enabled in the next pull request). Michal did some device reset fixes and made it possible for ath10k to share an interrupt with another device. And lots of smaller fixes from different people." For the iwlwifi bits, Emmanuel says: "I have here a big rework of the rate control by Eyal. This is obviously the biggest part of this batch. I also have enhancement of protection flags by Avri and a few bits for WoWLAN by Eliad and Luca. Johannes cleans up the debugfs plus a few fixes. I provided a few things for Bluetooth coexistence. Besides this we have an implementation for low priority scan." Along with all that, there are big batches of updates to mwifiex and ath9k, Jeff Kirsher's FSF address fix patches, and a handful of other bits here and there. Please let me know if there are problems! ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents b80b376 + f647a52 commit 6ea09d8

222 files changed

Lines changed: 5029 additions & 4302 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎MAINTAINERS‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8563,12 +8563,11 @@ S: Maintained
85638563
F: sound/soc/codecs/twl4030*
85648564

85658565
TI WILINK WIRELESS DRIVERS
8566-
M: Luciano Coelho <luca@coelho.fi>
85678566
L: linux-wireless@vger.kernel.org
85688567
W: http://wireless.kernel.org/en/users/Drivers/wl12xx
85698568
W: http://wireless.kernel.org/en/users/Drivers/wl1251
85708569
T: git git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx.git
8571-
S: Maintained
8570+
S: Orphan
85728571
F: drivers/net/wireless/ti/
85738572
F: include/linux/wl12xx.h
85748573

‎drivers/bcma/host_pci.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ static SIMPLE_DEV_PM_OPS(bcma_pm_ops, bcma_host_pci_suspend,
269269

270270
#endif /* CONFIG_PM_SLEEP */
271271

272-
static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = {
272+
static const struct pci_device_id bcma_pci_bridge_tbl[] = {
273273
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x0576) },
274274
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4313) },
275275
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43224) },

‎drivers/bluetooth/ath3k.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ static const struct usb_device_id ath3k_table[] = {
8383
{ USB_DEVICE(0x04CA, 0x3005) },
8484
{ USB_DEVICE(0x04CA, 0x3006) },
8585
{ USB_DEVICE(0x04CA, 0x3008) },
86+
{ USB_DEVICE(0x04CA, 0x300b) },
8687
{ USB_DEVICE(0x13d3, 0x3362) },
8788
{ USB_DEVICE(0x0CF3, 0xE004) },
8889
{ USB_DEVICE(0x0CF3, 0xE005) },
@@ -96,6 +97,7 @@ static const struct usb_device_id ath3k_table[] = {
9697
{ USB_DEVICE(0x13d3, 0x3402) },
9798
{ USB_DEVICE(0x0cf3, 0x3121) },
9899
{ USB_DEVICE(0x0cf3, 0xe003) },
100+
{ USB_DEVICE(0x0489, 0xe05f) },
99101

100102
/* Atheros AR5BBU12 with sflash firmware */
101103
{ USB_DEVICE(0x0489, 0xE02C) },
@@ -125,6 +127,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
125127
{ USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
126128
{ USB_DEVICE(0x04ca, 0x3006), .driver_info = BTUSB_ATH3012 },
127129
{ USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 },
130+
{ USB_DEVICE(0x04ca, 0x300b), .driver_info = BTUSB_ATH3012 },
128131
{ USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
129132
{ USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
130133
{ USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 },
@@ -138,6 +141,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
138141
{ USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 },
139142
{ USB_DEVICE(0x0cf3, 0x3121), .driver_info = BTUSB_ATH3012 },
140143
{ USB_DEVICE(0x0cf3, 0xe003), .driver_info = BTUSB_ATH3012 },
144+
{ USB_DEVICE(0x0489, 0xe05f), .driver_info = BTUSB_ATH3012 },
141145

142146
/* Atheros AR5BBU22 with sflash firmware */
143147
{ USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 },

‎drivers/bluetooth/btmrvl_drv.h‎

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
#include <linux/bitops.h>
2424
#include <linux/slab.h>
2525
#include <net/bluetooth/bluetooth.h>
26-
#include <linux/ctype.h>
27-
#include <linux/firmware.h>
2826

2927
#define BTM_HEADER_LEN 4
3028
#define BTM_UPLD_SIZE 2312
@@ -43,8 +41,6 @@ struct btmrvl_thread {
4341
struct btmrvl_device {
4442
void *card;
4543
struct hci_dev *hcidev;
46-
struct device *dev;
47-
const char *cal_data;
4844

4945
u8 dev_type;
5046

@@ -90,12 +86,12 @@ struct btmrvl_private {
9086

9187
#define MRVL_VENDOR_PKT 0xFE
9288

93-
/* Bluetooth commands */
94-
#define BT_CMD_AUTO_SLEEP_MODE 0x23
95-
#define BT_CMD_HOST_SLEEP_CONFIG 0x59
96-
#define BT_CMD_HOST_SLEEP_ENABLE 0x5A
97-
#define BT_CMD_MODULE_CFG_REQ 0x5B
98-
#define BT_CMD_LOAD_CONFIG_DATA 0x61
89+
/* Vendor specific Bluetooth commands */
90+
#define BT_CMD_AUTO_SLEEP_MODE 0xFC23
91+
#define BT_CMD_HOST_SLEEP_CONFIG 0xFC59
92+
#define BT_CMD_HOST_SLEEP_ENABLE 0xFC5A
93+
#define BT_CMD_MODULE_CFG_REQ 0xFC5B
94+
#define BT_CMD_LOAD_CONFIG_DATA 0xFC61
9995

10096
/* Sub-commands: Module Bringup/Shutdown Request/Response */
10197
#define MODULE_BRINGUP_REQ 0xF1
@@ -104,15 +100,18 @@ struct btmrvl_private {
104100

105101
#define MODULE_SHUTDOWN_REQ 0xF2
106102

103+
/* Vendor specific Bluetooth events */
104+
#define BT_EVENT_AUTO_SLEEP_MODE 0x23
105+
#define BT_EVENT_HOST_SLEEP_CONFIG 0x59
106+
#define BT_EVENT_HOST_SLEEP_ENABLE 0x5A
107+
#define BT_EVENT_MODULE_CFG_REQ 0x5B
107108
#define BT_EVENT_POWER_STATE 0x20
108109

109110
/* Bluetooth Power States */
110111
#define BT_PS_ENABLE 0x02
111112
#define BT_PS_DISABLE 0x03
112113
#define BT_PS_SLEEP 0x01
113114

114-
#define OGF 0x3F
115-
116115
/* Host Sleep states */
117116
#define HS_ACTIVATED 0x01
118117
#define HS_DEACTIVATED 0x00
@@ -121,7 +120,7 @@ struct btmrvl_private {
121120
#define PS_SLEEP 0x01
122121
#define PS_AWAKE 0x00
123122

124-
#define BT_CMD_DATA_SIZE 32
123+
#define BT_CAL_HDR_LEN 4
125124
#define BT_CAL_DATA_SIZE 28
126125

127126
struct btmrvl_event {

‎drivers/bluetooth/btmrvl_main.c‎

Lines changed: 31 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
**/
2020

2121
#include <linux/module.h>
22-
22+
#include <linux/of.h>
2323
#include <net/bluetooth/bluetooth.h>
2424
#include <net/bluetooth/hci_core.h>
2525

@@ -50,22 +50,19 @@ bool btmrvl_check_evtpkt(struct btmrvl_private *priv, struct sk_buff *skb)
5050

5151
if (hdr->evt == HCI_EV_CMD_COMPLETE) {
5252
struct hci_ev_cmd_complete *ec;
53-
u16 opcode, ocf, ogf;
53+
u16 opcode;
5454

5555
ec = (void *) (skb->data + HCI_EVENT_HDR_SIZE);
5656
opcode = __le16_to_cpu(ec->opcode);
57-
ocf = hci_opcode_ocf(opcode);
58-
ogf = hci_opcode_ogf(opcode);
5957

6058
if (priv->btmrvl_dev.sendcmdflag) {
6159
priv->btmrvl_dev.sendcmdflag = false;
6260
priv->adapter->cmd_complete = true;
6361
wake_up_interruptible(&priv->adapter->cmd_wait_q);
6462
}
6563

66-
if (ogf == OGF) {
67-
BT_DBG("vendor event skipped: ogf 0x%4.4x ocf 0x%4.4x",
68-
ogf, ocf);
64+
if (hci_opcode_ogf(opcode) == 0x3F) {
65+
BT_DBG("vendor event skipped: opcode=%#4.4x", opcode);
6966
kfree_skb(skb);
7067
return false;
7168
}
@@ -89,7 +86,7 @@ int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb)
8986
}
9087

9188
switch (event->data[0]) {
92-
case BT_CMD_AUTO_SLEEP_MODE:
89+
case BT_EVENT_AUTO_SLEEP_MODE:
9390
if (!event->data[2]) {
9491
if (event->data[1] == BT_PS_ENABLE)
9592
adapter->psmode = 1;
@@ -102,15 +99,15 @@ int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb)
10299
}
103100
break;
104101

105-
case BT_CMD_HOST_SLEEP_CONFIG:
102+
case BT_EVENT_HOST_SLEEP_CONFIG:
106103
if (!event->data[3])
107104
BT_DBG("gpio=%x, gap=%x", event->data[1],
108105
event->data[2]);
109106
else
110107
BT_DBG("HSCFG command failed");
111108
break;
112109

113-
case BT_CMD_HOST_SLEEP_ENABLE:
110+
case BT_EVENT_HOST_SLEEP_ENABLE:
114111
if (!event->data[1]) {
115112
adapter->hs_state = HS_ACTIVATED;
116113
if (adapter->psmode)
@@ -121,7 +118,7 @@ int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb)
121118
}
122119
break;
123120

124-
case BT_CMD_MODULE_CFG_REQ:
121+
case BT_EVENT_MODULE_CFG_REQ:
125122
if (priv->btmrvl_dev.sendcmdflag &&
126123
event->data[1] == MODULE_BRINGUP_REQ) {
127124
BT_DBG("EVENT:%s",
@@ -166,7 +163,7 @@ int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb)
166163
}
167164
EXPORT_SYMBOL_GPL(btmrvl_process_event);
168165

169-
static int btmrvl_send_sync_cmd(struct btmrvl_private *priv, u16 cmd_no,
166+
static int btmrvl_send_sync_cmd(struct btmrvl_private *priv, u16 opcode,
170167
const void *param, u8 len)
171168
{
172169
struct sk_buff *skb;
@@ -179,7 +176,7 @@ static int btmrvl_send_sync_cmd(struct btmrvl_private *priv, u16 cmd_no,
179176
}
180177

181178
hdr = (struct hci_command_hdr *)skb_put(skb, HCI_COMMAND_HDR_SIZE);
182-
hdr->opcode = cpu_to_le16(hci_opcode_pack(OGF, cmd_no));
179+
hdr->opcode = cpu_to_le16(opcode);
183180
hdr->plen = len;
184181

185182
if (len)
@@ -417,127 +414,62 @@ static int btmrvl_open(struct hci_dev *hdev)
417414
return 0;
418415
}
419416

420-
/*
421-
* This function parses provided calibration data input. It should contain
422-
* hex bytes separated by space or new line character. Here is an example.
423-
* 00 1C 01 37 FF FF FF FF 02 04 7F 01
424-
* CE BA 00 00 00 2D C6 C0 00 00 00 00
425-
* 00 F0 00 00
426-
*/
427-
static int btmrvl_parse_cal_cfg(const u8 *src, u32 len, u8 *dst, u32 dst_size)
417+
static int btmrvl_download_cal_data(struct btmrvl_private *priv,
418+
u8 *data, int len)
428419
{
429-
const u8 *s = src;
430-
u8 *d = dst;
431420
int ret;
432-
u8 tmp[3];
433-
434-
tmp[2] = '\0';
435-
while ((s - src) <= len - 2) {
436-
if (isspace(*s)) {
437-
s++;
438-
continue;
439-
}
440-
441-
if (isxdigit(*s)) {
442-
if ((d - dst) >= dst_size) {
443-
BT_ERR("calibration data file too big!!!");
444-
return -EINVAL;
445-
}
446-
447-
memcpy(tmp, s, 2);
448-
449-
ret = kstrtou8(tmp, 16, d++);
450-
if (ret < 0)
451-
return ret;
452-
453-
s += 2;
454-
} else {
455-
return -EINVAL;
456-
}
457-
}
458-
if (d == dst)
459-
return -EINVAL;
460-
461-
return 0;
462-
}
463-
464-
static int btmrvl_load_cal_data(struct btmrvl_private *priv,
465-
u8 *config_data)
466-
{
467-
int i, ret;
468-
u8 data[BT_CMD_DATA_SIZE];
469421

470422
data[0] = 0x00;
471423
data[1] = 0x00;
472424
data[2] = 0x00;
473-
data[3] = BT_CMD_DATA_SIZE - 4;
474-
475-
/* Swap cal-data bytes. Each four bytes are swapped. Considering 4
476-
* byte SDIO header offset, mapping of input and output bytes will be
477-
* {3, 2, 1, 0} -> {0+4, 1+4, 2+4, 3+4},
478-
* {7, 6, 5, 4} -> {4+4, 5+4, 6+4, 7+4} */
479-
for (i = 4; i < BT_CMD_DATA_SIZE; i++)
480-
data[i] = config_data[(i / 4) * 8 - 1 - i];
425+
data[3] = len;
481426

482427
print_hex_dump_bytes("Calibration data: ",
483-
DUMP_PREFIX_OFFSET, data, BT_CMD_DATA_SIZE);
428+
DUMP_PREFIX_OFFSET, data, BT_CAL_HDR_LEN + len);
484429

485430
ret = btmrvl_send_sync_cmd(priv, BT_CMD_LOAD_CONFIG_DATA, data,
486-
BT_CMD_DATA_SIZE);
431+
BT_CAL_HDR_LEN + len);
487432
if (ret)
488433
BT_ERR("Failed to download caibration data\n");
489434

490435
return 0;
491436
}
492437

493-
static int
494-
btmrvl_process_cal_cfg(struct btmrvl_private *priv, u8 *data, u32 size)
438+
static int btmrvl_cal_data_dt(struct btmrvl_private *priv)
495439
{
496-
u8 cal_data[BT_CAL_DATA_SIZE];
440+
struct device_node *dt_node;
441+
u8 cal_data[BT_CAL_HDR_LEN + BT_CAL_DATA_SIZE];
442+
const char name[] = "btmrvl_caldata";
443+
const char property[] = "btmrvl,caldata";
497444
int ret;
498445

499-
ret = btmrvl_parse_cal_cfg(data, size, cal_data, sizeof(cal_data));
446+
dt_node = of_find_node_by_name(NULL, name);
447+
if (!dt_node)
448+
return -ENODEV;
449+
450+
ret = of_property_read_u8_array(dt_node, property,
451+
cal_data + BT_CAL_HDR_LEN,
452+
BT_CAL_DATA_SIZE);
500453
if (ret)
501454
return ret;
502455

503-
ret = btmrvl_load_cal_data(priv, cal_data);
456+
BT_DBG("Use cal data from device tree");
457+
ret = btmrvl_download_cal_data(priv, cal_data, BT_CAL_DATA_SIZE);
504458
if (ret) {
505-
BT_ERR("Fail to load calibrate data");
459+
BT_ERR("Fail to download calibrate data");
506460
return ret;
507461
}
508462

509463
return 0;
510464
}
511465

512-
static int btmrvl_cal_data_config(struct btmrvl_private *priv)
513-
{
514-
const struct firmware *cfg;
515-
int ret;
516-
const char *cal_data = priv->btmrvl_dev.cal_data;
517-
518-
if (!cal_data)
519-
return 0;
520-
521-
ret = request_firmware(&cfg, cal_data, priv->btmrvl_dev.dev);
522-
if (ret < 0) {
523-
BT_DBG("Failed to get %s file, skipping cal data download",
524-
cal_data);
525-
return 0;
526-
}
527-
528-
ret = btmrvl_process_cal_cfg(priv, (u8 *)cfg->data, cfg->size);
529-
release_firmware(cfg);
530-
return ret;
531-
}
532-
533466
static int btmrvl_setup(struct hci_dev *hdev)
534467
{
535468
struct btmrvl_private *priv = hci_get_drvdata(hdev);
536469

537470
btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ);
538471

539-
if (btmrvl_cal_data_config(priv))
540-
BT_ERR("Set cal data failed");
472+
btmrvl_cal_data_dt(priv);
541473

542474
priv->btmrvl_dev.psmode = 1;
543475
btmrvl_enable_ps(priv);

0 commit comments

Comments
 (0)