aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-08-01 15:57:52 -0400
committerDavid S. Miller <davem@davemloft.net>2013-08-01 15:57:52 -0400
commit1f1059fcf0b30deb1cf1e23af9ef4231c0bcc0bb (patch)
tree04630aa6452458c643a3af6fd2c296609beef2c6
parentb00589af3b04736376f24625ab0b394642e89e29 (diff)
parent22e02a0272e5291a40ca28d2b7aea5231c832077 (diff)
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
John W. Linville says: ==================== This pull request is intended for the 3.11 stream. It is a bit larger than usual, as it includes pulls from most of my feeder trees as well... For the Bluetooth bits, Gustavo says: "A few fixes and devices ID additions for 3.11: * There are 4 new ath3k device ids * Fixed stack memory usage in ath3k. * Fixed the init process of BlueFRITZ! devices, they were failing to init due to an unsupported command we sent. * Fixed wrong use of PTR_ERR in btusb code that was preventing intel devices to work properly. * Fixed race condition between hci_register_dev() and hci_dev_open() that could cause a NULL pointer dereference. * Fixed race condition that could call hci_req_cmd_complete() and make some devices to fail as showed in the log added to the commit message." Regarding the NFC bits, Samuel says: "We have: 1) A build failure fix for the NCI SPI transport layer due to a missing CRC_CCITT Kconfig dependency. 2) A netlink command rename: CMD_FW_UPLOAD was merged during the 3.11 merge window but the typical terminology for loading a firmware to a target is firmware download rather than upload. In order to avoid any confusion in a file exported to userspace, we rename this command to CMD_FW_DOWNLOAD." Samuel's item #2 isn't strictly a fix, but it seems safe and should avoid confusion in the future. As for the mac80211 bits, Johannes says: "I only have three fixes this time, a fix for a suspend regression, a patch correcting the initiator in regulatory code and one fix for mesh station powersave." With respect to the iwlwifi bits, Johannes says: "We have a scan fix for passive channels, a new PCI device ID for an old device, a NIC reset fix, an RF-Kill fix, a fix for powersave when GO interfaces are present as well as an aggregation session fix (for a corner case) and a workaround for a firmware design issue - it only supports a single GTK in D3." Bringing-up the rear with the Atheros trees, Kalle says: "Geert Uytterhoeven fixed an ath10k build problem when NO_DMA=y. I added a missing MAINTAINERS entry for ath10k and updated ath6kl git tree location." Along with the above... Arend van Spriel fixes a brcmfmac WARNING when unplugging the device. Avinash Patil proves a couple of minor mwifiex fixes relating to P2P mode. Luciano Coelho updates the MAINTAINERS entry for the wilink drivers. Stanislaw Gruszka brings an rt2x00 fix for a queue start/stop problem. Stone Piao fixes another mwifiex problem, a command timeout related to P2P mode. Tomasz Moń corrects an endian problem in mwifiex. I'll remind my feeder maintainers to slowdown the patchflow. Beyond that, please let me know if there are problems! ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--MAINTAINERS12
-rw-r--r--drivers/bluetooth/ath3k.c46
-rw-r--r--drivers/bluetooth/btusb.c18
-rw-r--r--drivers/net/wireless/ath/ath10k/Kconfig2
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-prph.h2
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/d3.c15
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h1
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mac80211.c42
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/scan.c11
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/sta.c11
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/drv.c1
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/rx.c8
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/trans.c5
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c4
-rw-r--r--drivers/net/wireless/mwifiex/cfp.c3
-rw-r--r--drivers/net/wireless/mwifiex/join.c6
-rw-r--r--drivers/net/wireless/mwifiex/sdio.c4
-rw-r--r--drivers/net/wireless/mwifiex/sta_ioctl.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c18
-rw-r--r--include/net/nfc/hci.h2
-rw-r--r--include/net/nfc/nfc.h4
-rw-r--r--include/uapi/linux/nfc.h6
-rw-r--r--net/bluetooth/hci_core.c26
-rw-r--r--net/mac80211/mesh_ps.c4
-rw-r--r--net/mac80211/pm.c7
-rw-r--r--net/nfc/core.c20
-rw-r--r--net/nfc/hci/core.c8
-rw-r--r--net/nfc/nci/Kconfig1
-rw-r--r--net/nfc/netlink.c12
-rw-r--r--net/nfc/nfc.h6
-rw-r--r--net/wireless/reg.c5
32 files changed, 203 insertions, 116 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index a26b10e52aea..77be3f4a0a65 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1406,7 +1406,7 @@ ATHEROS ATH6KL WIRELESS DRIVER
1406M: Kalle Valo <kvalo@qca.qualcomm.com> 1406M: Kalle Valo <kvalo@qca.qualcomm.com>
1407L: linux-wireless@vger.kernel.org 1407L: linux-wireless@vger.kernel.org
1408W: http://wireless.kernel.org/en/users/Drivers/ath6kl 1408W: http://wireless.kernel.org/en/users/Drivers/ath6kl
1409T: git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath6kl.git 1409T: git git://github.com/kvalo/ath.git
1410S: Supported 1410S: Supported
1411F: drivers/net/wireless/ath/ath6kl/ 1411F: drivers/net/wireless/ath/ath6kl/
1412 1412
@@ -6726,6 +6726,14 @@ T: git git://linuxtv.org/anttip/media_tree.git
6726S: Maintained 6726S: Maintained
6727F: drivers/media/tuners/qt1010* 6727F: drivers/media/tuners/qt1010*
6728 6728
6729QUALCOMM ATHEROS ATH10K WIRELESS DRIVER
6730M: Kalle Valo <kvalo@qca.qualcomm.com>
6731L: ath10k@lists.infradead.org
6732W: http://wireless.kernel.org/en/users/Drivers/ath10k
6733T: git git://github.com/kvalo/ath.git
6734S: Supported
6735F: drivers/net/wireless/ath/ath10k/
6736
6729QUALCOMM HEXAGON ARCHITECTURE 6737QUALCOMM HEXAGON ARCHITECTURE
6730M: Richard Kuo <rkuo@codeaurora.org> 6738M: Richard Kuo <rkuo@codeaurora.org>
6731L: linux-hexagon@vger.kernel.org 6739L: linux-hexagon@vger.kernel.org
@@ -8270,7 +8278,7 @@ S: Maintained
8270F: sound/soc/codecs/twl4030* 8278F: sound/soc/codecs/twl4030*
8271 8279
8272TI WILINK WIRELESS DRIVERS 8280TI WILINK WIRELESS DRIVERS
8273M: Luciano Coelho <coelho@ti.com> 8281M: Luciano Coelho <luca@coelho.fi>
8274L: linux-wireless@vger.kernel.org 8282L: linux-wireless@vger.kernel.org
8275W: http://wireless.kernel.org/en/users/Drivers/wl12xx 8283W: http://wireless.kernel.org/en/users/Drivers/wl12xx
8276W: http://wireless.kernel.org/en/users/Drivers/wl1251 8284W: http://wireless.kernel.org/en/users/Drivers/wl1251
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 11f467c00d0a..a12b923bbaca 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -91,6 +91,10 @@ static struct usb_device_id ath3k_table[] = {
91 { USB_DEVICE(0x0489, 0xe04e) }, 91 { USB_DEVICE(0x0489, 0xe04e) },
92 { USB_DEVICE(0x0489, 0xe056) }, 92 { USB_DEVICE(0x0489, 0xe056) },
93 { USB_DEVICE(0x0489, 0xe04d) }, 93 { USB_DEVICE(0x0489, 0xe04d) },
94 { USB_DEVICE(0x04c5, 0x1330) },
95 { USB_DEVICE(0x13d3, 0x3402) },
96 { USB_DEVICE(0x0cf3, 0x3121) },
97 { USB_DEVICE(0x0cf3, 0xe003) },
94 98
95 /* Atheros AR5BBU12 with sflash firmware */ 99 /* Atheros AR5BBU12 with sflash firmware */
96 { USB_DEVICE(0x0489, 0xE02C) }, 100 { USB_DEVICE(0x0489, 0xE02C) },
@@ -128,6 +132,10 @@ static struct usb_device_id ath3k_blist_tbl[] = {
128 { USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 }, 132 { USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },
129 { USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 }, 133 { USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
130 { USB_DEVICE(0x0489, 0xe04d), .driver_info = BTUSB_ATH3012 }, 134 { USB_DEVICE(0x0489, 0xe04d), .driver_info = BTUSB_ATH3012 },
135 { USB_DEVICE(0x04c5, 0x1330), .driver_info = BTUSB_ATH3012 },
136 { USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 },
137 { USB_DEVICE(0x0cf3, 0x3121), .driver_info = BTUSB_ATH3012 },
138 { USB_DEVICE(0x0cf3, 0xe003), .driver_info = BTUSB_ATH3012 },
131 139
132 /* Atheros AR5BBU22 with sflash firmware */ 140 /* Atheros AR5BBU22 with sflash firmware */
133 { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 }, 141 { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 },
@@ -193,24 +201,44 @@ error:
193 201
194static int ath3k_get_state(struct usb_device *udev, unsigned char *state) 202static int ath3k_get_state(struct usb_device *udev, unsigned char *state)
195{ 203{
196 int pipe = 0; 204 int ret, pipe = 0;
205 char *buf;
206
207 buf = kmalloc(sizeof(*buf), GFP_KERNEL);
208 if (!buf)
209 return -ENOMEM;
197 210
198 pipe = usb_rcvctrlpipe(udev, 0); 211 pipe = usb_rcvctrlpipe(udev, 0);
199 return usb_control_msg(udev, pipe, ATH3K_GETSTATE, 212 ret = usb_control_msg(udev, pipe, ATH3K_GETSTATE,
200 USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, 213 USB_TYPE_VENDOR | USB_DIR_IN, 0, 0,
201 state, 0x01, USB_CTRL_SET_TIMEOUT); 214 buf, sizeof(*buf), USB_CTRL_SET_TIMEOUT);
215
216 *state = *buf;
217 kfree(buf);
218
219 return ret;
202} 220}
203 221
204static int ath3k_get_version(struct usb_device *udev, 222static int ath3k_get_version(struct usb_device *udev,
205 struct ath3k_version *version) 223 struct ath3k_version *version)
206{ 224{
207 int pipe = 0; 225 int ret, pipe = 0;
226 struct ath3k_version *buf;
227 const int size = sizeof(*buf);
228
229 buf = kmalloc(size, GFP_KERNEL);
230 if (!buf)
231 return -ENOMEM;
208 232
209 pipe = usb_rcvctrlpipe(udev, 0); 233 pipe = usb_rcvctrlpipe(udev, 0);
210 return usb_control_msg(udev, pipe, ATH3K_GETVERSION, 234 ret = usb_control_msg(udev, pipe, ATH3K_GETVERSION,
211 USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, version, 235 USB_TYPE_VENDOR | USB_DIR_IN, 0, 0,
212 sizeof(struct ath3k_version), 236 buf, size, USB_CTRL_SET_TIMEOUT);
213 USB_CTRL_SET_TIMEOUT); 237
238 memcpy(version, buf, size);
239 kfree(buf);
240
241 return ret;
214} 242}
215 243
216static int ath3k_load_fwfile(struct usb_device *udev, 244static int ath3k_load_fwfile(struct usb_device *udev,
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index de4cf4daa2f4..8e16f0af6358 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -154,6 +154,10 @@ static struct usb_device_id blacklist_table[] = {
154 { USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 }, 154 { USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },
155 { USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 }, 155 { USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
156 { USB_DEVICE(0x0489, 0xe04d), .driver_info = BTUSB_ATH3012 }, 156 { USB_DEVICE(0x0489, 0xe04d), .driver_info = BTUSB_ATH3012 },
157 { USB_DEVICE(0x04c5, 0x1330), .driver_info = BTUSB_ATH3012 },
158 { USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 },
159 { USB_DEVICE(0x0cf3, 0x3121), .driver_info = BTUSB_ATH3012 },
160 { USB_DEVICE(0x0cf3, 0xe003), .driver_info = BTUSB_ATH3012 },
157 161
158 /* Atheros AR5BBU12 with sflash firmware */ 162 /* Atheros AR5BBU12 with sflash firmware */
159 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, 163 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
@@ -1095,7 +1099,7 @@ static int btusb_setup_intel_patching(struct hci_dev *hdev,
1095 if (IS_ERR(skb)) { 1099 if (IS_ERR(skb)) {
1096 BT_ERR("%s sending Intel patch command (0x%4.4x) failed (%ld)", 1100 BT_ERR("%s sending Intel patch command (0x%4.4x) failed (%ld)",
1097 hdev->name, cmd->opcode, PTR_ERR(skb)); 1101 hdev->name, cmd->opcode, PTR_ERR(skb));
1098 return -PTR_ERR(skb); 1102 return PTR_ERR(skb);
1099 } 1103 }
1100 1104
1101 /* It ensures that the returned event matches the event data read from 1105 /* It ensures that the returned event matches the event data read from
@@ -1147,7 +1151,7 @@ static int btusb_setup_intel(struct hci_dev *hdev)
1147 if (IS_ERR(skb)) { 1151 if (IS_ERR(skb)) {
1148 BT_ERR("%s sending initial HCI reset command failed (%ld)", 1152 BT_ERR("%s sending initial HCI reset command failed (%ld)",
1149 hdev->name, PTR_ERR(skb)); 1153 hdev->name, PTR_ERR(skb));
1150 return -PTR_ERR(skb); 1154 return PTR_ERR(skb);
1151 } 1155 }
1152 kfree_skb(skb); 1156 kfree_skb(skb);
1153 1157
@@ -1161,7 +1165,7 @@ static int btusb_setup_intel(struct hci_dev *hdev)
1161 if (IS_ERR(skb)) { 1165 if (IS_ERR(skb)) {
1162 BT_ERR("%s reading Intel fw version command failed (%ld)", 1166 BT_ERR("%s reading Intel fw version command failed (%ld)",
1163 hdev->name, PTR_ERR(skb)); 1167 hdev->name, PTR_ERR(skb));
1164 return -PTR_ERR(skb); 1168 return PTR_ERR(skb);
1165 } 1169 }
1166 1170
1167 if (skb->len != sizeof(*ver)) { 1171 if (skb->len != sizeof(*ver)) {
@@ -1219,7 +1223,7 @@ static int btusb_setup_intel(struct hci_dev *hdev)
1219 BT_ERR("%s entering Intel manufacturer mode failed (%ld)", 1223 BT_ERR("%s entering Intel manufacturer mode failed (%ld)",
1220 hdev->name, PTR_ERR(skb)); 1224 hdev->name, PTR_ERR(skb));
1221 release_firmware(fw); 1225 release_firmware(fw);
1222 return -PTR_ERR(skb); 1226 return PTR_ERR(skb);
1223 } 1227 }
1224 1228
1225 if (skb->data[0]) { 1229 if (skb->data[0]) {
@@ -1276,7 +1280,7 @@ static int btusb_setup_intel(struct hci_dev *hdev)
1276 if (IS_ERR(skb)) { 1280 if (IS_ERR(skb)) {
1277 BT_ERR("%s exiting Intel manufacturer mode failed (%ld)", 1281 BT_ERR("%s exiting Intel manufacturer mode failed (%ld)",
1278 hdev->name, PTR_ERR(skb)); 1282 hdev->name, PTR_ERR(skb));
1279 return -PTR_ERR(skb); 1283 return PTR_ERR(skb);
1280 } 1284 }
1281 kfree_skb(skb); 1285 kfree_skb(skb);
1282 1286
@@ -1292,7 +1296,7 @@ exit_mfg_disable:
1292 if (IS_ERR(skb)) { 1296 if (IS_ERR(skb)) {
1293 BT_ERR("%s exiting Intel manufacturer mode failed (%ld)", 1297 BT_ERR("%s exiting Intel manufacturer mode failed (%ld)",
1294 hdev->name, PTR_ERR(skb)); 1298 hdev->name, PTR_ERR(skb));
1295 return -PTR_ERR(skb); 1299 return PTR_ERR(skb);
1296 } 1300 }
1297 kfree_skb(skb); 1301 kfree_skb(skb);
1298 1302
@@ -1310,7 +1314,7 @@ exit_mfg_deactivate:
1310 if (IS_ERR(skb)) { 1314 if (IS_ERR(skb)) {
1311 BT_ERR("%s exiting Intel manufacturer mode failed (%ld)", 1315 BT_ERR("%s exiting Intel manufacturer mode failed (%ld)",
1312 hdev->name, PTR_ERR(skb)); 1316 hdev->name, PTR_ERR(skb));
1313 return -PTR_ERR(skb); 1317 return PTR_ERR(skb);
1314 } 1318 }
1315 kfree_skb(skb); 1319 kfree_skb(skb);
1316 1320
diff --git a/drivers/net/wireless/ath/ath10k/Kconfig b/drivers/net/wireless/ath/ath10k/Kconfig
index cde58fe96254..82e8088ca9b4 100644
--- a/drivers/net/wireless/ath/ath10k/Kconfig
+++ b/drivers/net/wireless/ath/ath10k/Kconfig
@@ -1,6 +1,6 @@
1config ATH10K 1config ATH10K
2 tristate "Atheros 802.11ac wireless cards support" 2 tristate "Atheros 802.11ac wireless cards support"
3 depends on MAC80211 3 depends on MAC80211 && HAS_DMA
4 select ATH_COMMON 4 select ATH_COMMON
5 ---help--- 5 ---help---
6 This module adds support for wireless adapters based on 6 This module adds support for wireless adapters based on
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 277b37ae7126..7fa71f73cfe8 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -1093,8 +1093,11 @@ static void brcmf_link_down(struct brcmf_cfg80211_vif *vif)
1093 brcmf_dbg(INFO, "Call WLC_DISASSOC to stop excess roaming\n "); 1093 brcmf_dbg(INFO, "Call WLC_DISASSOC to stop excess roaming\n ");
1094 err = brcmf_fil_cmd_data_set(vif->ifp, 1094 err = brcmf_fil_cmd_data_set(vif->ifp,
1095 BRCMF_C_DISASSOC, NULL, 0); 1095 BRCMF_C_DISASSOC, NULL, 0);
1096 if (err) 1096 if (err) {
1097 brcmf_err("WLC_DISASSOC failed (%d)\n", err); 1097 brcmf_err("WLC_DISASSOC failed (%d)\n", err);
1098 cfg80211_disconnected(vif->wdev.netdev, 0,
1099 NULL, 0, GFP_KERNEL);
1100 }
1098 clear_bit(BRCMF_VIF_STATUS_CONNECTED, &vif->sme_state); 1101 clear_bit(BRCMF_VIF_STATUS_CONNECTED, &vif->sme_state);
1099 } 1102 }
1100 clear_bit(BRCMF_VIF_STATUS_CONNECTING, &vif->sme_state); 1103 clear_bit(BRCMF_VIF_STATUS_CONNECTING, &vif->sme_state);
diff --git a/drivers/net/wireless/iwlwifi/iwl-prph.h b/drivers/net/wireless/iwlwifi/iwl-prph.h
index ff8cc75c189d..a70c7b9d9bad 100644
--- a/drivers/net/wireless/iwlwifi/iwl-prph.h
+++ b/drivers/net/wireless/iwlwifi/iwl-prph.h
@@ -97,6 +97,8 @@
97 97
98#define APMG_PCIDEV_STT_VAL_L1_ACT_DIS (0x00000800) 98#define APMG_PCIDEV_STT_VAL_L1_ACT_DIS (0x00000800)
99 99
100#define APMG_RTC_INT_STT_RFKILL (0x10000000)
101
100/* Device system time */ 102/* Device system time */
101#define DEVICE_SYSTEM_TIME_REG 0xA0206C 103#define DEVICE_SYSTEM_TIME_REG 0xA0206C
102 104
diff --git a/drivers/net/wireless/iwlwifi/mvm/d3.c b/drivers/net/wireless/iwlwifi/mvm/d3.c
index 7e5e5c2f9f87..83da884cf303 100644
--- a/drivers/net/wireless/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/iwlwifi/mvm/d3.c
@@ -134,7 +134,7 @@ struct wowlan_key_data {
134 struct iwl_wowlan_rsc_tsc_params_cmd *rsc_tsc; 134 struct iwl_wowlan_rsc_tsc_params_cmd *rsc_tsc;
135 struct iwl_wowlan_tkip_params_cmd *tkip; 135 struct iwl_wowlan_tkip_params_cmd *tkip;
136 bool error, use_rsc_tsc, use_tkip; 136 bool error, use_rsc_tsc, use_tkip;
137 int gtk_key_idx; 137 int wep_key_idx;
138}; 138};
139 139
140static void iwl_mvm_wowlan_program_keys(struct ieee80211_hw *hw, 140static void iwl_mvm_wowlan_program_keys(struct ieee80211_hw *hw,
@@ -188,8 +188,8 @@ static void iwl_mvm_wowlan_program_keys(struct ieee80211_hw *hw,
188 wkc.wep_key.key_offset = 0; 188 wkc.wep_key.key_offset = 0;
189 } else { 189 } else {
190 /* others start at 1 */ 190 /* others start at 1 */
191 data->gtk_key_idx++; 191 data->wep_key_idx++;
192 wkc.wep_key.key_offset = data->gtk_key_idx; 192 wkc.wep_key.key_offset = data->wep_key_idx;
193 } 193 }
194 194
195 ret = iwl_mvm_send_cmd_pdu(mvm, WEP_KEY, CMD_SYNC, 195 ret = iwl_mvm_send_cmd_pdu(mvm, WEP_KEY, CMD_SYNC,
@@ -316,8 +316,13 @@ static void iwl_mvm_wowlan_program_keys(struct ieee80211_hw *hw,
316 mvm->ptk_ivlen = key->iv_len; 316 mvm->ptk_ivlen = key->iv_len;
317 mvm->ptk_icvlen = key->icv_len; 317 mvm->ptk_icvlen = key->icv_len;
318 } else { 318 } else {
319 data->gtk_key_idx++; 319 /*
320 key->hw_key_idx = data->gtk_key_idx; 320 * firmware only supports TSC/RSC for a single key,
321 * so if there are multiple keep overwriting them
322 * with new ones -- this relies on mac80211 doing
323 * list_add_tail().
324 */
325 key->hw_key_idx = 1;
321 mvm->gtk_ivlen = key->iv_len; 326 mvm->gtk_ivlen = key->iv_len;
322 mvm->gtk_icvlen = key->icv_len; 327 mvm->gtk_icvlen = key->icv_len;
323 } 328 }
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
index b60d14151721..365095a0c3b3 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
@@ -69,7 +69,6 @@
69/* Scan Commands, Responses, Notifications */ 69/* Scan Commands, Responses, Notifications */
70 70
71/* Masks for iwl_scan_channel.type flags */ 71/* Masks for iwl_scan_channel.type flags */
72#define SCAN_CHANNEL_TYPE_PASSIVE 0
73#define SCAN_CHANNEL_TYPE_ACTIVE BIT(0) 72#define SCAN_CHANNEL_TYPE_ACTIVE BIT(0)
74#define SCAN_CHANNEL_NARROW_BAND BIT(22) 73#define SCAN_CHANNEL_NARROW_BAND BIT(22)
75 74
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index 1eedc424051c..f19baf0dea6b 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -512,6 +512,27 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
512 goto out_unlock; 512 goto out_unlock;
513 513
514 /* 514 /*
515 * TODO: remove this temporary code.
516 * Currently MVM FW supports power management only on single MAC.
517 * If new interface added, disable PM on existing interface.
518 * P2P device is a special case, since it is handled by FW similary to
519 * scan. If P2P deviced is added, PM remains enabled on existing
520 * interface.
521 * Note: the method below does not count the new interface being added
522 * at this moment.
523 */
524 if (vif->type != NL80211_IFTYPE_P2P_DEVICE)
525 mvm->vif_count++;
526 if (mvm->vif_count > 1) {
527 IWL_DEBUG_MAC80211(mvm,
528 "Disable power on existing interfaces\n");
529 ieee80211_iterate_active_interfaces_atomic(
530 mvm->hw,
531 IEEE80211_IFACE_ITER_NORMAL,
532 iwl_mvm_pm_disable_iterator, mvm);
533 }
534
535 /*
515 * The AP binding flow can be done only after the beacon 536 * The AP binding flow can be done only after the beacon
516 * template is configured (which happens only in the mac80211 537 * template is configured (which happens only in the mac80211
517 * start_ap() flow), and adding the broadcast station can happen 538 * start_ap() flow), and adding the broadcast station can happen
@@ -534,27 +555,6 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
534 goto out_unlock; 555 goto out_unlock;
535 } 556 }
536 557
537 /*
538 * TODO: remove this temporary code.
539 * Currently MVM FW supports power management only on single MAC.
540 * If new interface added, disable PM on existing interface.
541 * P2P device is a special case, since it is handled by FW similary to
542 * scan. If P2P deviced is added, PM remains enabled on existing
543 * interface.
544 * Note: the method below does not count the new interface being added
545 * at this moment.
546 */
547 if (vif->type != NL80211_IFTYPE_P2P_DEVICE)
548 mvm->vif_count++;
549 if (mvm->vif_count > 1) {
550 IWL_DEBUG_MAC80211(mvm,
551 "Disable power on existing interfaces\n");
552 ieee80211_iterate_active_interfaces_atomic(
553 mvm->hw,
554 IEEE80211_IFACE_ITER_NORMAL,
555 iwl_mvm_pm_disable_iterator, mvm);
556 }
557
558 ret = iwl_mvm_mac_ctxt_add(mvm, vif); 558 ret = iwl_mvm_mac_ctxt_add(mvm, vif);
559 if (ret) 559 if (ret)
560 goto out_release; 560 goto out_release;
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
index 268f027b45b0..acdff6b67e04 100644
--- a/drivers/net/wireless/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
@@ -178,19 +178,12 @@ static void iwl_mvm_scan_fill_channels(struct iwl_scan_cmd *cmd,
178 struct iwl_scan_channel *chan = (struct iwl_scan_channel *) 178 struct iwl_scan_channel *chan = (struct iwl_scan_channel *)
179 (cmd->data + le16_to_cpu(cmd->tx_cmd.len)); 179 (cmd->data + le16_to_cpu(cmd->tx_cmd.len));
180 int i; 180 int i;
181 __le32 chan_type_value;
182
183 if (req->n_ssids > 0)
184 chan_type_value = cpu_to_le32(BIT(req->n_ssids) - 1);
185 else
186 chan_type_value = SCAN_CHANNEL_TYPE_PASSIVE;
187 181
188 for (i = 0; i < cmd->channel_count; i++) { 182 for (i = 0; i < cmd->channel_count; i++) {
189 chan->channel = cpu_to_le16(req->channels[i]->hw_value); 183 chan->channel = cpu_to_le16(req->channels[i]->hw_value);
184 chan->type = cpu_to_le32(BIT(req->n_ssids) - 1);
190 if (req->channels[i]->flags & IEEE80211_CHAN_PASSIVE_SCAN) 185 if (req->channels[i]->flags & IEEE80211_CHAN_PASSIVE_SCAN)
191 chan->type = SCAN_CHANNEL_TYPE_PASSIVE; 186 chan->type &= cpu_to_le32(~SCAN_CHANNEL_TYPE_ACTIVE);
192 else
193 chan->type = chan_type_value;
194 chan->active_dwell = cpu_to_le16(active_dwell); 187 chan->active_dwell = cpu_to_le16(active_dwell);
195 chan->passive_dwell = cpu_to_le16(passive_dwell); 188 chan->passive_dwell = cpu_to_le16(passive_dwell);
196 chan->iteration_count = cpu_to_le16(1); 189 chan->iteration_count = cpu_to_le16(1);
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.c b/drivers/net/wireless/iwlwifi/mvm/sta.c
index 85d4bbe52157..563f559b902d 100644
--- a/drivers/net/wireless/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/iwlwifi/mvm/sta.c
@@ -915,6 +915,7 @@ int iwl_mvm_sta_tx_agg_flush(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
915 struct iwl_mvm_sta *mvmsta = (void *)sta->drv_priv; 915 struct iwl_mvm_sta *mvmsta = (void *)sta->drv_priv;
916 struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid]; 916 struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid];
917 u16 txq_id; 917 u16 txq_id;
918 enum iwl_mvm_agg_state old_state;
918 919
919 /* 920 /*
920 * First set the agg state to OFF to avoid calling 921 * First set the agg state to OFF to avoid calling
@@ -924,13 +925,17 @@ int iwl_mvm_sta_tx_agg_flush(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
924 txq_id = tid_data->txq_id; 925 txq_id = tid_data->txq_id;
925 IWL_DEBUG_TX_QUEUES(mvm, "Flush AGG: sta %d tid %d q %d state %d\n", 926 IWL_DEBUG_TX_QUEUES(mvm, "Flush AGG: sta %d tid %d q %d state %d\n",
926 mvmsta->sta_id, tid, txq_id, tid_data->state); 927 mvmsta->sta_id, tid, txq_id, tid_data->state);
928 old_state = tid_data->state;
927 tid_data->state = IWL_AGG_OFF; 929 tid_data->state = IWL_AGG_OFF;
928 spin_unlock_bh(&mvmsta->lock); 930 spin_unlock_bh(&mvmsta->lock);
929 931
930 if (iwl_mvm_flush_tx_path(mvm, BIT(txq_id), true)) 932 if (old_state >= IWL_AGG_ON) {
931 IWL_ERR(mvm, "Couldn't flush the AGG queue\n"); 933 if (iwl_mvm_flush_tx_path(mvm, BIT(txq_id), true))
934 IWL_ERR(mvm, "Couldn't flush the AGG queue\n");
935
936 iwl_trans_txq_disable(mvm->trans, tid_data->txq_id);
937 }
932 938
933 iwl_trans_txq_disable(mvm->trans, tid_data->txq_id);
934 mvm->queue_to_mac80211[tid_data->txq_id] = 939 mvm->queue_to_mac80211[tid_data->txq_id] =
935 IWL_INVALID_MAC80211_QUEUE; 940 IWL_INVALID_MAC80211_QUEUE;
936 941
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c
index 81f3ea5b09a4..ff13458efc27 100644
--- a/drivers/net/wireless/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/iwlwifi/pcie/drv.c
@@ -130,6 +130,7 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = {
130 {IWL_PCI_DEVICE(0x423C, 0x1306, iwl5150_abg_cfg)}, /* Half Mini Card */ 130 {IWL_PCI_DEVICE(0x423C, 0x1306, iwl5150_abg_cfg)}, /* Half Mini Card */
131 {IWL_PCI_DEVICE(0x423C, 0x1221, iwl5150_agn_cfg)}, /* Mini Card */ 131 {IWL_PCI_DEVICE(0x423C, 0x1221, iwl5150_agn_cfg)}, /* Mini Card */
132 {IWL_PCI_DEVICE(0x423C, 0x1321, iwl5150_agn_cfg)}, /* Half Mini Card */ 132 {IWL_PCI_DEVICE(0x423C, 0x1321, iwl5150_agn_cfg)}, /* Half Mini Card */
133 {IWL_PCI_DEVICE(0x423C, 0x1326, iwl5150_abg_cfg)}, /* Half Mini Card */
133 134
134 {IWL_PCI_DEVICE(0x423D, 0x1211, iwl5150_agn_cfg)}, /* Mini Card */ 135 {IWL_PCI_DEVICE(0x423D, 0x1211, iwl5150_agn_cfg)}, /* Mini Card */
135 {IWL_PCI_DEVICE(0x423D, 0x1311, iwl5150_agn_cfg)}, /* Half Mini Card */ 136 {IWL_PCI_DEVICE(0x423D, 0x1311, iwl5150_agn_cfg)}, /* Half Mini Card */
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c
index fd848cd1583e..f600e68a410a 100644
--- a/drivers/net/wireless/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/rx.c
@@ -888,6 +888,14 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id)
888 888
889 iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill); 889 iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill);
890 if (hw_rfkill) { 890 if (hw_rfkill) {
891 /*
892 * Clear the interrupt in APMG if the NIC is going down.
893 * Note that when the NIC exits RFkill (else branch), we
894 * can't access prph and the NIC will be reset in
895 * start_hw anyway.
896 */
897 iwl_write_prph(trans, APMG_RTC_INT_STT_REG,
898 APMG_RTC_INT_STT_RFKILL);
891 set_bit(STATUS_RFKILL, &trans_pcie->status); 899 set_bit(STATUS_RFKILL, &trans_pcie->status);
892 if (test_and_clear_bit(STATUS_HCMD_ACTIVE, 900 if (test_and_clear_bit(STATUS_HCMD_ACTIVE,
893 &trans_pcie->status)) 901 &trans_pcie->status))
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index 826c15602c46..96cfcdd39079 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -670,6 +670,11 @@ static int iwl_trans_pcie_start_hw(struct iwl_trans *trans)
670 return err; 670 return err;
671 } 671 }
672 672
673 /* Reset the entire device */
674 iwl_set_bit(trans, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
675
676 usleep_range(10, 15);
677
673 iwl_pcie_apm_init(trans); 678 iwl_pcie_apm_init(trans);
674 679
675 /* From now on, the op_mode will be kept updated about RF kill state */ 680 /* From now on, the op_mode will be kept updated about RF kill state */
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index ef5fa890a286..89459db4c53b 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1716,9 +1716,9 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
1716 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); 1716 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
1717 int ret; 1717 int ret;
1718 1718
1719 if (priv->bss_mode != NL80211_IFTYPE_STATION) { 1719 if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_STA) {
1720 wiphy_err(wiphy, 1720 wiphy_err(wiphy,
1721 "%s: reject infra assoc request in non-STA mode\n", 1721 "%s: reject infra assoc request in non-STA role\n",
1722 dev->name); 1722 dev->name);
1723 return -EINVAL; 1723 return -EINVAL;
1724 } 1724 }
diff --git a/drivers/net/wireless/mwifiex/cfp.c b/drivers/net/wireless/mwifiex/cfp.c
index 988552dece75..5178c4630d89 100644
--- a/drivers/net/wireless/mwifiex/cfp.c
+++ b/drivers/net/wireless/mwifiex/cfp.c
@@ -415,7 +415,8 @@ u32 mwifiex_get_supported_rates(struct mwifiex_private *priv, u8 *rates)
415 u32 k = 0; 415 u32 k = 0;
416 struct mwifiex_adapter *adapter = priv->adapter; 416 struct mwifiex_adapter *adapter = priv->adapter;
417 417
418 if (priv->bss_mode == NL80211_IFTYPE_STATION) { 418 if (priv->bss_mode == NL80211_IFTYPE_STATION ||
419 priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) {
419 switch (adapter->config_bands) { 420 switch (adapter->config_bands) {
420 case BAND_B: 421 case BAND_B:
421 dev_dbg(adapter->dev, "info: infra band=%d " 422 dev_dbg(adapter->dev, "info: infra band=%d "
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index 1c8a771e8e81..12e778159ec5 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -1291,8 +1291,10 @@ int mwifiex_associate(struct mwifiex_private *priv,
1291{ 1291{
1292 u8 current_bssid[ETH_ALEN]; 1292 u8 current_bssid[ETH_ALEN];
1293 1293
1294 /* Return error if the adapter or table entry is not marked as infra */ 1294 /* Return error if the adapter is not STA role or table entry
1295 if ((priv->bss_mode != NL80211_IFTYPE_STATION) || 1295 * is not marked as infra.
1296 */
1297 if ((GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_STA) ||
1296 (bss_desc->bss_mode != NL80211_IFTYPE_STATION)) 1298 (bss_desc->bss_mode != NL80211_IFTYPE_STATION))
1297 return -1; 1299 return -1;
1298 1300
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index 5ef49f2e375a..09185c963248 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -1639,8 +1639,8 @@ static int mwifiex_sdio_host_to_card(struct mwifiex_adapter *adapter,
1639 /* Allocate buffer and copy payload */ 1639 /* Allocate buffer and copy payload */
1640 blk_size = MWIFIEX_SDIO_BLOCK_SIZE; 1640 blk_size = MWIFIEX_SDIO_BLOCK_SIZE;
1641 buf_block_len = (pkt_len + blk_size - 1) / blk_size; 1641 buf_block_len = (pkt_len + blk_size - 1) / blk_size;
1642 *(u16 *) &payload[0] = (u16) pkt_len; 1642 *(__le16 *)&payload[0] = cpu_to_le16((u16)pkt_len);
1643 *(u16 *) &payload[2] = type; 1643 *(__le16 *)&payload[2] = cpu_to_le16(type);
1644 1644
1645 /* 1645 /*
1646 * This is SDIO specific header 1646 * This is SDIO specific header
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 206c3e038072..8af97abf7108 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -257,10 +257,10 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
257 goto done; 257 goto done;
258 } 258 }
259 259
260 if (priv->bss_mode == NL80211_IFTYPE_STATION) { 260 if (priv->bss_mode == NL80211_IFTYPE_STATION ||
261 priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) {
261 u8 config_bands; 262 u8 config_bands;
262 263
263 /* Infra mode */
264 ret = mwifiex_deauthenticate(priv, NULL); 264 ret = mwifiex_deauthenticate(priv, NULL);
265 if (ret) 265 if (ret)
266 goto done; 266 goto done;
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 6c0a91ff963c..aa95c6cf3545 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -936,13 +936,8 @@ void rt2x00queue_index_inc(struct queue_entry *entry, enum queue_index index)
936 spin_unlock_irqrestore(&queue->index_lock, irqflags); 936 spin_unlock_irqrestore(&queue->index_lock, irqflags);
937} 937}
938 938
939void rt2x00queue_pause_queue(struct data_queue *queue) 939void rt2x00queue_pause_queue_nocheck(struct data_queue *queue)
940{ 940{
941 if (!test_bit(DEVICE_STATE_PRESENT, &queue->rt2x00dev->flags) ||
942 !test_bit(QUEUE_STARTED, &queue->flags) ||
943 test_and_set_bit(QUEUE_PAUSED, &queue->flags))
944 return;
945
946 switch (queue->qid) { 941 switch (queue->qid) {
947 case QID_AC_VO: 942 case QID_AC_VO:
948 case QID_AC_VI: 943 case QID_AC_VI:
@@ -958,6 +953,15 @@ void rt2x00queue_pause_queue(struct data_queue *queue)
958 break; 953 break;
959 } 954 }
960} 955}
956void rt2x00queue_pause_queue(struct data_queue *queue)
957{
958 if (!test_bit(DEVICE_STATE_PRESENT, &queue->rt2x00dev->flags) ||
959 !test_bit(QUEUE_STARTED, &queue->flags) ||
960 test_and_set_bit(QUEUE_PAUSED, &queue->flags))
961 return;
962
963 rt2x00queue_pause_queue_nocheck(queue);
964}
961EXPORT_SYMBOL_GPL(rt2x00queue_pause_queue); 965EXPORT_SYMBOL_GPL(rt2x00queue_pause_queue);
962 966
963void rt2x00queue_unpause_queue(struct data_queue *queue) 967void rt2x00queue_unpause_queue(struct data_queue *queue)
@@ -1019,7 +1023,7 @@ void rt2x00queue_stop_queue(struct data_queue *queue)
1019 return; 1023 return;
1020 } 1024 }
1021 1025
1022 rt2x00queue_pause_queue(queue); 1026 rt2x00queue_pause_queue_nocheck(queue);
1023 1027
1024 queue->rt2x00dev->ops->lib->stop_queue(queue); 1028 queue->rt2x00dev->ops->lib->stop_queue(queue);
1025 1029
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h
index 0af851c3b038..b64b7bce4b94 100644
--- a/include/net/nfc/hci.h
+++ b/include/net/nfc/hci.h
@@ -59,7 +59,7 @@ struct nfc_hci_ops {
59 struct nfc_target *target); 59 struct nfc_target *target);
60 int (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event, 60 int (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event,
61 struct sk_buff *skb); 61 struct sk_buff *skb);
62 int (*fw_upload)(struct nfc_hci_dev *hdev, const char *firmware_name); 62 int (*fw_download)(struct nfc_hci_dev *hdev, const char *firmware_name);
63 int (*discover_se)(struct nfc_hci_dev *dev); 63 int (*discover_se)(struct nfc_hci_dev *dev);
64 int (*enable_se)(struct nfc_hci_dev *dev, u32 se_idx); 64 int (*enable_se)(struct nfc_hci_dev *dev, u32 se_idx);
65 int (*disable_se)(struct nfc_hci_dev *dev, u32 se_idx); 65 int (*disable_se)(struct nfc_hci_dev *dev, u32 se_idx);
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 0e353f1658bb..5f286b726bb6 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -68,7 +68,7 @@ struct nfc_ops {
68 void *cb_context); 68 void *cb_context);
69 int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb); 69 int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb);
70 int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target); 70 int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target);
71 int (*fw_upload)(struct nfc_dev *dev, const char *firmware_name); 71 int (*fw_download)(struct nfc_dev *dev, const char *firmware_name);
72 72
73 /* Secure Element API */ 73 /* Secure Element API */
74 int (*discover_se)(struct nfc_dev *dev); 74 int (*discover_se)(struct nfc_dev *dev);
@@ -127,7 +127,7 @@ struct nfc_dev {
127 int targets_generation; 127 int targets_generation;
128 struct device dev; 128 struct device dev;
129 bool dev_up; 129 bool dev_up;
130 bool fw_upload_in_progress; 130 bool fw_download_in_progress;
131 u8 rf_mode; 131 u8 rf_mode;
132 bool polling; 132 bool polling;
133 struct nfc_target *active_target; 133 struct nfc_target *active_target;
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
index caed0f324d5f..8137dd8d2adf 100644
--- a/include/uapi/linux/nfc.h
+++ b/include/uapi/linux/nfc.h
@@ -69,8 +69,8 @@
69 * starting a poll from a device which has a secure element enabled means 69 * starting a poll from a device which has a secure element enabled means
70 * we want to do SE based card emulation. 70 * we want to do SE based card emulation.
71 * @NFC_CMD_DISABLE_SE: Disable the physical link to a specific secure element. 71 * @NFC_CMD_DISABLE_SE: Disable the physical link to a specific secure element.
72 * @NFC_CMD_FW_UPLOAD: Request to Load/flash firmware, or event to inform that 72 * @NFC_CMD_FW_DOWNLOAD: Request to Load/flash firmware, or event to inform
73 * some firmware was loaded 73 * that some firmware was loaded
74 */ 74 */
75enum nfc_commands { 75enum nfc_commands {
76 NFC_CMD_UNSPEC, 76 NFC_CMD_UNSPEC,
@@ -94,7 +94,7 @@ enum nfc_commands {
94 NFC_CMD_DISABLE_SE, 94 NFC_CMD_DISABLE_SE,
95 NFC_CMD_LLC_SDREQ, 95 NFC_CMD_LLC_SDREQ,
96 NFC_EVENT_LLC_SDRES, 96 NFC_EVENT_LLC_SDRES,
97 NFC_CMD_FW_UPLOAD, 97 NFC_CMD_FW_DOWNLOAD,
98 NFC_EVENT_SE_ADDED, 98 NFC_EVENT_SE_ADDED,
99 NFC_EVENT_SE_REMOVED, 99 NFC_EVENT_SE_REMOVED,
100/* private: internal use only */ 100/* private: internal use only */
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index e3a349977595..cc27297da5a9 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -513,7 +513,10 @@ static void hci_init2_req(struct hci_request *req, unsigned long opt)
513 513
514 hci_setup_event_mask(req); 514 hci_setup_event_mask(req);
515 515
516 if (hdev->hci_ver > BLUETOOTH_VER_1_1) 516 /* AVM Berlin (31), aka "BlueFRITZ!", doesn't support the read
517 * local supported commands HCI command.
518 */
519 if (hdev->manufacturer != 31 && hdev->hci_ver > BLUETOOTH_VER_1_1)
517 hci_req_add(req, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL); 520 hci_req_add(req, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL);
518 521
519 if (lmp_ssp_capable(hdev)) { 522 if (lmp_ssp_capable(hdev)) {
@@ -2165,10 +2168,6 @@ int hci_register_dev(struct hci_dev *hdev)
2165 2168
2166 BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus); 2169 BT_DBG("%p name %s bus %d", hdev, hdev->name, hdev->bus);
2167 2170
2168 write_lock(&hci_dev_list_lock);
2169 list_add(&hdev->list, &hci_dev_list);
2170 write_unlock(&hci_dev_list_lock);
2171
2172 hdev->workqueue = alloc_workqueue("%s", WQ_HIGHPRI | WQ_UNBOUND | 2171 hdev->workqueue = alloc_workqueue("%s", WQ_HIGHPRI | WQ_UNBOUND |
2173 WQ_MEM_RECLAIM, 1, hdev->name); 2172 WQ_MEM_RECLAIM, 1, hdev->name);
2174 if (!hdev->workqueue) { 2173 if (!hdev->workqueue) {
@@ -2203,6 +2202,10 @@ int hci_register_dev(struct hci_dev *hdev)
2203 if (hdev->dev_type != HCI_AMP) 2202 if (hdev->dev_type != HCI_AMP)
2204 set_bit(HCI_AUTO_OFF, &hdev->dev_flags); 2203 set_bit(HCI_AUTO_OFF, &hdev->dev_flags);
2205 2204
2205 write_lock(&hci_dev_list_lock);
2206 list_add(&hdev->list, &hci_dev_list);
2207 write_unlock(&hci_dev_list_lock);
2208
2206 hci_notify(hdev, HCI_DEV_REG); 2209 hci_notify(hdev, HCI_DEV_REG);
2207 hci_dev_hold(hdev); 2210 hci_dev_hold(hdev);
2208 2211
@@ -2215,9 +2218,6 @@ err_wqueue:
2215 destroy_workqueue(hdev->req_workqueue); 2218 destroy_workqueue(hdev->req_workqueue);
2216err: 2219err:
2217 ida_simple_remove(&hci_index_ida, hdev->id); 2220 ida_simple_remove(&hci_index_ida, hdev->id);
2218 write_lock(&hci_dev_list_lock);
2219 list_del(&hdev->list);
2220 write_unlock(&hci_dev_list_lock);
2221 2221
2222 return error; 2222 return error;
2223} 2223}
@@ -3399,8 +3399,16 @@ void hci_req_cmd_complete(struct hci_dev *hdev, u16 opcode, u8 status)
3399 */ 3399 */
3400 if (hdev->sent_cmd) { 3400 if (hdev->sent_cmd) {
3401 req_complete = bt_cb(hdev->sent_cmd)->req.complete; 3401 req_complete = bt_cb(hdev->sent_cmd)->req.complete;
3402 if (req_complete) 3402
3403 if (req_complete) {
3404 /* We must set the complete callback to NULL to
3405 * avoid calling the callback more than once if
3406 * this function gets called again.
3407 */
3408 bt_cb(hdev->sent_cmd)->req.complete = NULL;
3409
3403 goto call_complete; 3410 goto call_complete;
3411 }
3404 } 3412 }
3405 3413
3406 /* Remove all pending commands belonging to this request */ 3414 /* Remove all pending commands belonging to this request */
diff --git a/net/mac80211/mesh_ps.c b/net/mac80211/mesh_ps.c
index 3b7bfc01ee36..22290a929b94 100644
--- a/net/mac80211/mesh_ps.c
+++ b/net/mac80211/mesh_ps.c
@@ -229,6 +229,10 @@ void ieee80211_mps_sta_status_update(struct sta_info *sta)
229 enum nl80211_mesh_power_mode pm; 229 enum nl80211_mesh_power_mode pm;
230 bool do_buffer; 230 bool do_buffer;
231 231
232 /* For non-assoc STA, prevent buffering or frame transmission */
233 if (sta->sta_state < IEEE80211_STA_ASSOC)
234 return;
235
232 /* 236 /*
233 * use peer-specific power mode if peering is established and the 237 * use peer-specific power mode if peering is established and the
234 * peer's power mode is known 238 * peer's power mode is known
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
index 7fc5d0d8149a..340126204343 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -99,10 +99,13 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
99 } 99 }
100 mutex_unlock(&local->sta_mtx); 100 mutex_unlock(&local->sta_mtx);
101 101
102 /* remove all interfaces */ 102 /* remove all interfaces that were created in the driver */
103 list_for_each_entry(sdata, &local->interfaces, list) { 103 list_for_each_entry(sdata, &local->interfaces, list) {
104 if (!ieee80211_sdata_running(sdata)) 104 if (!ieee80211_sdata_running(sdata) ||
105 sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
106 sdata->vif.type == NL80211_IFTYPE_MONITOR)
105 continue; 107 continue;
108
106 drv_remove_interface(local, sdata); 109 drv_remove_interface(local, sdata);
107 } 110 }
108 111
diff --git a/net/nfc/core.c b/net/nfc/core.c
index dc96a83aa6ab..1d074dd1650f 100644
--- a/net/nfc/core.c
+++ b/net/nfc/core.c
@@ -44,7 +44,7 @@ DEFINE_MUTEX(nfc_devlist_mutex);
44/* NFC device ID bitmap */ 44/* NFC device ID bitmap */
45static DEFINE_IDA(nfc_index_ida); 45static DEFINE_IDA(nfc_index_ida);
46 46
47int nfc_fw_upload(struct nfc_dev *dev, const char *firmware_name) 47int nfc_fw_download(struct nfc_dev *dev, const char *firmware_name)
48{ 48{
49 int rc = 0; 49 int rc = 0;
50 50
@@ -62,28 +62,28 @@ int nfc_fw_upload(struct nfc_dev *dev, const char *firmware_name)
62 goto error; 62 goto error;
63 } 63 }
64 64
65 if (!dev->ops->fw_upload) { 65 if (!dev->ops->fw_download) {
66 rc = -EOPNOTSUPP; 66 rc = -EOPNOTSUPP;
67 goto error; 67 goto error;
68 } 68 }
69 69
70 dev->fw_upload_in_progress = true; 70 dev->fw_download_in_progress = true;
71 rc = dev->ops->fw_upload(dev, firmware_name); 71 rc = dev->ops->fw_download(dev, firmware_name);
72 if (rc) 72 if (rc)
73 dev->fw_upload_in_progress = false; 73 dev->fw_download_in_progress = false;
74 74
75error: 75error:
76 device_unlock(&dev->dev); 76 device_unlock(&dev->dev);
77 return rc; 77 return rc;
78} 78}
79 79
80int nfc_fw_upload_done(struct nfc_dev *dev, const char *firmware_name) 80int nfc_fw_download_done(struct nfc_dev *dev, const char *firmware_name)
81{ 81{
82 dev->fw_upload_in_progress = false; 82 dev->fw_download_in_progress = false;
83 83
84 return nfc_genl_fw_upload_done(dev, firmware_name); 84 return nfc_genl_fw_download_done(dev, firmware_name);
85} 85}
86EXPORT_SYMBOL(nfc_fw_upload_done); 86EXPORT_SYMBOL(nfc_fw_download_done);
87 87
88/** 88/**
89 * nfc_dev_up - turn on the NFC device 89 * nfc_dev_up - turn on the NFC device
@@ -110,7 +110,7 @@ int nfc_dev_up(struct nfc_dev *dev)
110 goto error; 110 goto error;
111 } 111 }
112 112
113 if (dev->fw_upload_in_progress) { 113 if (dev->fw_download_in_progress) {
114 rc = -EBUSY; 114 rc = -EBUSY;
115 goto error; 115 goto error;
116 } 116 }
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c
index 7b1c186736eb..fe66908401f5 100644
--- a/net/nfc/hci/core.c
+++ b/net/nfc/hci/core.c
@@ -809,14 +809,14 @@ static void nfc_hci_recv_from_llc(struct nfc_hci_dev *hdev, struct sk_buff *skb)
809 } 809 }
810} 810}
811 811
812static int hci_fw_upload(struct nfc_dev *nfc_dev, const char *firmware_name) 812static int hci_fw_download(struct nfc_dev *nfc_dev, const char *firmware_name)
813{ 813{
814 struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev); 814 struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev);
815 815
816 if (!hdev->ops->fw_upload) 816 if (!hdev->ops->fw_download)
817 return -ENOTSUPP; 817 return -ENOTSUPP;
818 818
819 return hdev->ops->fw_upload(hdev, firmware_name); 819 return hdev->ops->fw_download(hdev, firmware_name);
820} 820}
821 821
822static struct nfc_ops hci_nfc_ops = { 822static struct nfc_ops hci_nfc_ops = {
@@ -831,7 +831,7 @@ static struct nfc_ops hci_nfc_ops = {
831 .im_transceive = hci_transceive, 831 .im_transceive = hci_transceive,
832 .tm_send = hci_tm_send, 832 .tm_send = hci_tm_send,
833 .check_presence = hci_check_presence, 833 .check_presence = hci_check_presence,
834 .fw_upload = hci_fw_upload, 834 .fw_download = hci_fw_download,
835 .discover_se = hci_discover_se, 835 .discover_se = hci_discover_se,
836 .enable_se = hci_enable_se, 836 .enable_se = hci_enable_se,
837 .disable_se = hci_disable_se, 837 .disable_se = hci_disable_se,
diff --git a/net/nfc/nci/Kconfig b/net/nfc/nci/Kconfig
index 2a2416080b4f..a4f1e42e3481 100644
--- a/net/nfc/nci/Kconfig
+++ b/net/nfc/nci/Kconfig
@@ -11,6 +11,7 @@ config NFC_NCI
11 11
12config NFC_NCI_SPI 12config NFC_NCI_SPI
13 depends on NFC_NCI && SPI 13 depends on NFC_NCI && SPI
14 select CRC_CCITT
14 bool "NCI over SPI protocol support" 15 bool "NCI over SPI protocol support"
15 default n 16 default n
16 help 17 help
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index b05ad909778f..f16fd59d4160 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -1089,7 +1089,7 @@ exit:
1089 return rc; 1089 return rc;
1090} 1090}
1091 1091
1092static int nfc_genl_fw_upload(struct sk_buff *skb, struct genl_info *info) 1092static int nfc_genl_fw_download(struct sk_buff *skb, struct genl_info *info)
1093{ 1093{
1094 struct nfc_dev *dev; 1094 struct nfc_dev *dev;
1095 int rc; 1095 int rc;
@@ -1108,13 +1108,13 @@ static int nfc_genl_fw_upload(struct sk_buff *skb, struct genl_info *info)
1108 nla_strlcpy(firmware_name, info->attrs[NFC_ATTR_FIRMWARE_NAME], 1108 nla_strlcpy(firmware_name, info->attrs[NFC_ATTR_FIRMWARE_NAME],
1109 sizeof(firmware_name)); 1109 sizeof(firmware_name));
1110 1110
1111 rc = nfc_fw_upload(dev, firmware_name); 1111 rc = nfc_fw_download(dev, firmware_name);
1112 1112
1113 nfc_put_device(dev); 1113 nfc_put_device(dev);
1114 return rc; 1114 return rc;
1115} 1115}
1116 1116
1117int nfc_genl_fw_upload_done(struct nfc_dev *dev, const char *firmware_name) 1117int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name)
1118{ 1118{
1119 struct sk_buff *msg; 1119 struct sk_buff *msg;
1120 void *hdr; 1120 void *hdr;
@@ -1124,7 +1124,7 @@ int nfc_genl_fw_upload_done(struct nfc_dev *dev, const char *firmware_name)
1124 return -ENOMEM; 1124 return -ENOMEM;
1125 1125
1126 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, 1126 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0,
1127 NFC_CMD_FW_UPLOAD); 1127 NFC_CMD_FW_DOWNLOAD);
1128 if (!hdr) 1128 if (!hdr)
1129 goto free_msg; 1129 goto free_msg;
1130 1130
@@ -1251,8 +1251,8 @@ static struct genl_ops nfc_genl_ops[] = {
1251 .policy = nfc_genl_policy, 1251 .policy = nfc_genl_policy,
1252 }, 1252 },
1253 { 1253 {
1254 .cmd = NFC_CMD_FW_UPLOAD, 1254 .cmd = NFC_CMD_FW_DOWNLOAD,
1255 .doit = nfc_genl_fw_upload, 1255 .doit = nfc_genl_fw_download,
1256 .policy = nfc_genl_policy, 1256 .policy = nfc_genl_policy,
1257 }, 1257 },
1258 { 1258 {
diff --git a/net/nfc/nfc.h b/net/nfc/nfc.h
index ee85a1fc1b24..820a7850c36a 100644
--- a/net/nfc/nfc.h
+++ b/net/nfc/nfc.h
@@ -123,10 +123,10 @@ static inline void nfc_device_iter_exit(struct class_dev_iter *iter)
123 class_dev_iter_exit(iter); 123 class_dev_iter_exit(iter);
124} 124}
125 125
126int nfc_fw_upload(struct nfc_dev *dev, const char *firmware_name); 126int nfc_fw_download(struct nfc_dev *dev, const char *firmware_name);
127int nfc_genl_fw_upload_done(struct nfc_dev *dev, const char *firmware_name); 127int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name);
128 128
129int nfc_fw_upload_done(struct nfc_dev *dev, const char *firmware_name); 129int nfc_fw_download_done(struct nfc_dev *dev, const char *firmware_name);
130 130
131int nfc_dev_up(struct nfc_dev *dev); 131int nfc_dev_up(struct nfc_dev *dev);
132 132
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 5a950f36bae4..de06d5d1287f 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2247,10 +2247,13 @@ int reg_device_uevent(struct device *dev, struct kobj_uevent_env *env)
2247 2247
2248void wiphy_regulatory_register(struct wiphy *wiphy) 2248void wiphy_regulatory_register(struct wiphy *wiphy)
2249{ 2249{
2250 struct regulatory_request *lr;
2251
2250 if (!reg_dev_ignore_cell_hint(wiphy)) 2252 if (!reg_dev_ignore_cell_hint(wiphy))
2251 reg_num_devs_support_basehint++; 2253 reg_num_devs_support_basehint++;
2252 2254
2253 wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE); 2255 lr = get_last_request();
2256 wiphy_update_regulatory(wiphy, lr->initiator);
2254} 2257}
2255 2258
2256void wiphy_regulatory_deregister(struct wiphy *wiphy) 2259void wiphy_regulatory_deregister(struct wiphy *wiphy)