Skip to content

Commit b5f185f

Browse files
committed
Merge tag 'master-2014-12-08' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
John W. Linville says: ==================== pull request: wireless-next 2014-12-08 Please pull this last batch of pending wireless updates for the 3.19 tree... For the wireless bits, Johannes says: "This time I have Felix's no-status rate control work, which will allow drivers to work better with rate control even if they don't have perfect status reporting. In addition to this, a small hwsim fix from Patrik, one of the regulatory patches from Arik, and a number of cleanups and fixes I did myself. Of note is a patch where I disable CFG80211_WEXT so that compatibility is no longer selectable - this is intended as a wake-up call for anyone who's still using it, and is still easily worked around (it's a one-line patch) before we fully remove the code as well in the future." For the Bluetooth bits, Johan says: "Here's one more bluetooth-next pull request for 3.19: - Minor cleanups for ieee802154 & mac802154 - Fix for the kernel warning with !TASK_RUNNING reported by Kirill A. Shutemov - Support for another ath3k device - Fix for tracking link key based security level - Device tree bindings for btmrvl + a state update fix - Fix for wrong ACL flags on LE links" And... "In addition to the previous one this contains two more cleanups to mac802154 as well as support for some new HCI features from the Bluetooth 4.2 specification. From the original request: 'Here's what should be the last bluetooth-next pull request for 3.19. It's rather large but the majority of it is the Low Energy Secure Connections feature that's part of the Bluetooth 4.2 specification. The specification went public only this week so we couldn't publish the corresponding code before that. The code itself can nevertheless be considered fairly mature as it's been in development for over 6 months and gone through several interoperability test events. Besides LE SC the pull request contains an important fix for command complete events for mgmt sockets which also fixes some leaks of hci_conn objects when powering off or unplugging Bluetooth adapters. A smaller feature that's part of the pull request is service discovery support. This is like normal device discovery except that devices not matching specific UUIDs or strong enough RSSI are filtered out. Other changes that the pull request contains are firmware dump support to the btmrvl driver, firmware download support for Broadcom BCM20702A0 variants, as well as some coding style cleanups in 6lowpan & ieee802154/mac802154 code.'" For the NFC bits, Samuel says: "With this one we get: - NFC digital improvements for DEP support: Chaining, NACK and ATN support added. - NCI improvements: Support for p2p target, SE IO operand addition, SE operands extensions to support proprietary implementations, and a few fixes. - NFC HCI improvements: OPEN_PIPE and NOTIFY_ALL_CLEARED support, and SE IO operand addition. - A bunch of minor improvements and fixes for STMicro st21nfcb and st21nfca" For the iwlwifi bits, Emmanuel says: "Major works are CSA and TDLS. On top of that I have a new firmware API for scan and a few rate control improvements. Johannes find a few tricks to improve our CPU utilization and adds support for a new spin of 7265 called 7265D. Along with this a few random things that don't stand out." And... "I deprecate here -8.ucode since -9 has been published long ago. Along with that I have a new activity, we have now better a infrastructure for firmware debugging. This will allow to have configurable probes insides the firmware. Luca continues his work on NetDetect, this feature is now complete. All the rest is minor fixes here and there." For the Atheros bits, Kalle says: "Only ath10k changes this time and no major changes. Most visible are: o new debugfs interface for runtime firmware debugging (Yanbo) o fix shared WEP (Sujith) o don't rebuild whenever kernel version changes (Johannes) o lots of refactoring to make it easier to add new hw support (Michal) There's also smaller fixes and improvements with no point of listing here." In addition, there are a few last minute updates to ath5k, ath9k, brcmfmac, brcmsmac, mwifiex, rt2x00, rtlwifi, and wil6210. Also included is a pull of the wireless tree to pick-up the fixes originally included in "pull request: wireless 2014-12-03"... Please let me know if there are problems! ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 450fa21 + 81c4126 commit b5f185f

File tree

228 files changed

+12428
-3574
lines changed

Some content is hidden

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

228 files changed

+12428
-3574
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
btmrvl
2+
------
3+
4+
Required properties:
5+
6+
- compatible : must be "btmrvl,cfgdata"
7+
8+
Optional properties:
9+
10+
- btmrvl,cal-data : Calibration data downloaded to the device during
11+
initialization. This is an array of 28 values(u8).
12+
13+
- btmrvl,gpio-gap : gpio and gap (in msecs) combination to be
14+
configured.
15+
16+
Example:
17+
18+
GPIO pin 13 is configured as a wakeup source and GAP is set to 100 msecs
19+
in below example.
20+
21+
btmrvl {
22+
compatible = "btmrvl,cfgdata";
23+
24+
btmrvl,cal-data = /bits/ 8 <
25+
0x37 0x01 0x1c 0x00 0xff 0xff 0xff 0xff 0x01 0x7f 0x04 0x02
26+
0x00 0x00 0xba 0xce 0xc0 0xc6 0x2d 0x00 0x00 0x00 0x00 0x00
27+
0x00 0x00 0xf0 0x00>;
28+
btmrvl,gpio-gap = <0x0d64>;
29+
};

MAINTAINERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7919,11 +7919,10 @@ S: Maintained
79197919
F: drivers/media/dvb-frontends/rtl2832_sdr*
79207920

79217921
RTL8180 WIRELESS DRIVER
7922-
M: "John W. Linville" <linville@tuxdriver.com>
79237922
L: linux-wireless@vger.kernel.org
79247923
W: http://wireless.kernel.org/
79257924
T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
7926-
S: Maintained
7925+
S: Orphan
79277926
F: drivers/net/wireless/rtl818x/rtl8180/
79287927

79297928
RTL8187 WIRELESS DRIVER

drivers/bluetooth/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ config BT_MRVL_SDIO
210210
tristate "Marvell BT-over-SDIO driver"
211211
depends on BT_MRVL && MMC
212212
select FW_LOADER
213+
select WANT_DEV_COREDUMP
213214
help
214215
The driver for Marvell Bluetooth chipsets with SDIO interface.
215216

drivers/bluetooth/ath3k.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ static const struct usb_device_id ath3k_table[] = {
106106
{ USB_DEVICE(0x13d3, 0x3375) },
107107
{ USB_DEVICE(0x13d3, 0x3393) },
108108
{ USB_DEVICE(0x13d3, 0x3402) },
109+
{ USB_DEVICE(0x13d3, 0x3408) },
109110
{ USB_DEVICE(0x13d3, 0x3432) },
110111

111112
/* Atheros AR5BBU12 with sflash firmware */
@@ -158,6 +159,7 @@ static const struct usb_device_id ath3k_blist_tbl[] = {
158159
{ USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
159160
{ USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
160161
{ USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 },
162+
{ USB_DEVICE(0x13d3, 0x3408), .driver_info = BTUSB_ATH3012 },
161163
{ USB_DEVICE(0x13d3, 0x3432), .driver_info = BTUSB_ATH3012 },
162164

163165
/* Atheros AR5BBU22 with sflash firmware */

drivers/bluetooth/btmrvl_debugfs.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,35 @@ static const struct file_operations btmrvl_hscmd_fops = {
167167
.llseek = default_llseek,
168168
};
169169

170+
static ssize_t btmrvl_fwdump_write(struct file *file, const char __user *ubuf,
171+
size_t count, loff_t *ppos)
172+
{
173+
struct btmrvl_private *priv = file->private_data;
174+
char buf[16];
175+
bool result;
176+
177+
memset(buf, 0, sizeof(buf));
178+
179+
if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
180+
return -EFAULT;
181+
182+
if (strtobool(buf, &result))
183+
return -EINVAL;
184+
185+
if (!result)
186+
return -EINVAL;
187+
188+
btmrvl_firmware_dump(priv);
189+
190+
return count;
191+
}
192+
193+
static const struct file_operations btmrvl_fwdump_fops = {
194+
.write = btmrvl_fwdump_write,
195+
.open = simple_open,
196+
.llseek = default_llseek,
197+
};
198+
170199
void btmrvl_debugfs_init(struct hci_dev *hdev)
171200
{
172201
struct btmrvl_private *priv = hci_get_drvdata(hdev);
@@ -197,6 +226,8 @@ void btmrvl_debugfs_init(struct hci_dev *hdev)
197226
priv, &btmrvl_hscmd_fops);
198227
debugfs_create_file("hscfgcmd", 0644, dbg->config_dir,
199228
priv, &btmrvl_hscfgcmd_fops);
229+
debugfs_create_file("fw_dump", 0200, dbg->config_dir,
230+
priv, &btmrvl_fwdump_fops);
200231

201232
dbg->status_dir = debugfs_create_dir("status", hdev->debugfs);
202233
debugfs_create_u8("curpsmode", 0444, dbg->status_dir,

drivers/bluetooth/btmrvl_drv.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,24 @@
3232
/* Time to wait for command response in millisecond */
3333
#define WAIT_UNTIL_CMD_RESP 5000
3434

35+
enum rdwr_status {
36+
RDWR_STATUS_SUCCESS = 0,
37+
RDWR_STATUS_FAILURE = 1,
38+
RDWR_STATUS_DONE = 2
39+
};
40+
41+
#define FW_DUMP_MAX_NAME_LEN 8
42+
#define FW_DUMP_HOST_READY 0xEE
43+
#define FW_DUMP_DONE 0xFF
44+
#define FW_DUMP_READ_DONE 0xFE
45+
46+
struct memory_type_mapping {
47+
u8 mem_name[FW_DUMP_MAX_NAME_LEN];
48+
u8 *mem_ptr;
49+
u32 mem_size;
50+
u8 done_flag;
51+
};
52+
3553
struct btmrvl_thread {
3654
struct task_struct *task;
3755
wait_queue_head_t wait_q;
@@ -81,6 +99,7 @@ struct btmrvl_private {
8199
u8 *payload, u16 nb);
82100
int (*hw_wakeup_firmware) (struct btmrvl_private *priv);
83101
int (*hw_process_int_status) (struct btmrvl_private *priv);
102+
void (*firmware_dump)(struct btmrvl_private *priv);
84103
spinlock_t driver_lock; /* spinlock used by driver */
85104
#ifdef CONFIG_DEBUG_FS
86105
void *debugfs_data;
@@ -151,6 +170,7 @@ int btmrvl_send_hscfg_cmd(struct btmrvl_private *priv);
151170
int btmrvl_enable_ps(struct btmrvl_private *priv);
152171
int btmrvl_prepare_command(struct btmrvl_private *priv);
153172
int btmrvl_enable_hs(struct btmrvl_private *priv);
173+
void btmrvl_firmware_dump(struct btmrvl_private *priv);
154174

155175
#ifdef CONFIG_DEBUG_FS
156176
void btmrvl_debugfs_init(struct hci_dev *hdev);

drivers/bluetooth/btmrvl_main.c

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <linux/of.h>
2323
#include <net/bluetooth/bluetooth.h>
2424
#include <net/bluetooth/hci_core.h>
25+
#include <linux/mmc/sdio_func.h>
2526

2627
#include "btmrvl_drv.h"
2728
#include "btmrvl_sdio.h"
@@ -41,6 +42,11 @@ void btmrvl_interrupt(struct btmrvl_private *priv)
4142

4243
priv->adapter->int_count++;
4344

45+
if (priv->adapter->hs_state == HS_ACTIVATED) {
46+
BT_DBG("BT: HS DEACTIVATED in ISR!");
47+
priv->adapter->hs_state = HS_DEACTIVATED;
48+
}
49+
4450
wake_up_interruptible(&priv->main_thread.wait_q);
4551
}
4652
EXPORT_SYMBOL_GPL(btmrvl_interrupt);
@@ -209,7 +215,7 @@ int btmrvl_send_module_cfg_cmd(struct btmrvl_private *priv, u8 subcmd)
209215

210216
ret = btmrvl_send_sync_cmd(priv, BT_CMD_MODULE_CFG_REQ, &subcmd, 1);
211217
if (ret)
212-
BT_ERR("module_cfg_cmd(%x) failed\n", subcmd);
218+
BT_ERR("module_cfg_cmd(%x) failed", subcmd);
213219

214220
return ret;
215221
}
@@ -245,7 +251,7 @@ int btmrvl_send_hscfg_cmd(struct btmrvl_private *priv)
245251

246252
ret = btmrvl_send_sync_cmd(priv, BT_CMD_HOST_SLEEP_CONFIG, param, 2);
247253
if (ret)
248-
BT_ERR("HSCFG command failed\n");
254+
BT_ERR("HSCFG command failed");
249255

250256
return ret;
251257
}
@@ -263,7 +269,7 @@ int btmrvl_enable_ps(struct btmrvl_private *priv)
263269

264270
ret = btmrvl_send_sync_cmd(priv, BT_CMD_AUTO_SLEEP_MODE, &param, 1);
265271
if (ret)
266-
BT_ERR("PSMODE command failed\n");
272+
BT_ERR("PSMODE command failed");
267273

268274
return 0;
269275
}
@@ -276,7 +282,7 @@ int btmrvl_enable_hs(struct btmrvl_private *priv)
276282

277283
ret = btmrvl_send_sync_cmd(priv, BT_CMD_HOST_SLEEP_ENABLE, NULL, 0);
278284
if (ret) {
279-
BT_ERR("Host sleep enable command failed\n");
285+
BT_ERR("Host sleep enable command failed");
280286
return ret;
281287
}
282288

@@ -323,12 +329,19 @@ int btmrvl_prepare_command(struct btmrvl_private *priv)
323329
} else {
324330
ret = priv->hw_wakeup_firmware(priv);
325331
priv->adapter->hs_state = HS_DEACTIVATED;
332+
BT_DBG("BT: HS DEACTIVATED due to host activity!");
326333
}
327334
}
328335

329336
return ret;
330337
}
331338

339+
void btmrvl_firmware_dump(struct btmrvl_private *priv)
340+
{
341+
if (priv->firmware_dump)
342+
priv->firmware_dump(priv);
343+
}
344+
332345
static int btmrvl_tx_pkt(struct btmrvl_private *priv, struct sk_buff *skb)
333346
{
334347
int ret = 0;
@@ -487,34 +500,36 @@ static int btmrvl_download_cal_data(struct btmrvl_private *priv,
487500
ret = btmrvl_send_sync_cmd(priv, BT_CMD_LOAD_CONFIG_DATA, data,
488501
BT_CAL_HDR_LEN + len);
489502
if (ret)
490-
BT_ERR("Failed to download caibration data\n");
503+
BT_ERR("Failed to download caibration data");
491504

492505
return 0;
493506
}
494507

495-
static int btmrvl_cal_data_dt(struct btmrvl_private *priv)
508+
static int btmrvl_check_device_tree(struct btmrvl_private *priv)
496509
{
497510
struct device_node *dt_node;
498511
u8 cal_data[BT_CAL_HDR_LEN + BT_CAL_DATA_SIZE];
499-
const char name[] = "btmrvl_caldata";
500-
const char property[] = "btmrvl,caldata";
501512
int ret;
502-
503-
dt_node = of_find_node_by_name(NULL, name);
504-
if (!dt_node)
505-
return -ENODEV;
506-
507-
ret = of_property_read_u8_array(dt_node, property,
508-
cal_data + BT_CAL_HDR_LEN,
509-
BT_CAL_DATA_SIZE);
510-
if (ret)
511-
return ret;
512-
513-
BT_DBG("Use cal data from device tree");
514-
ret = btmrvl_download_cal_data(priv, cal_data, BT_CAL_DATA_SIZE);
515-
if (ret) {
516-
BT_ERR("Fail to download calibrate data");
517-
return ret;
513+
u32 val;
514+
515+
for_each_compatible_node(dt_node, NULL, "btmrvl,cfgdata") {
516+
ret = of_property_read_u32(dt_node, "btmrvl,gpio-gap", &val);
517+
if (!ret)
518+
priv->btmrvl_dev.gpio_gap = val;
519+
520+
ret = of_property_read_u8_array(dt_node, "btmrvl,cal-data",
521+
cal_data + BT_CAL_HDR_LEN,
522+
BT_CAL_DATA_SIZE);
523+
if (ret)
524+
return ret;
525+
526+
BT_DBG("Use cal data from device tree");
527+
ret = btmrvl_download_cal_data(priv, cal_data,
528+
BT_CAL_DATA_SIZE);
529+
if (ret) {
530+
BT_ERR("Fail to download calibrate data");
531+
return ret;
532+
}
518533
}
519534

520535
return 0;
@@ -526,14 +541,15 @@ static int btmrvl_setup(struct hci_dev *hdev)
526541

527542
btmrvl_send_module_cfg_cmd(priv, MODULE_BRINGUP_REQ);
528543

529-
btmrvl_cal_data_dt(priv);
544+
priv->btmrvl_dev.gpio_gap = 0xffff;
545+
546+
btmrvl_check_device_tree(priv);
530547

531548
btmrvl_pscan_window_reporting(priv, 0x01);
532549

533550
priv->btmrvl_dev.psmode = 1;
534551
btmrvl_enable_ps(priv);
535552

536-
priv->btmrvl_dev.gpio_gap = 0xffff;
537553
btmrvl_send_hscfg_cmd(priv);
538554

539555
return 0;

0 commit comments

Comments
 (0)