aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MAINTAINERS2
-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/cw1200/sta.c7
-rw-r--r--drivers/net/wireless/iwlegacy/4965-mac.c16
-rw-r--r--drivers/net/wireless/iwlegacy/common.c1
-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/mlme.c54
-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/core.c1
-rw-r--r--net/wireless/nl80211.c6
-rw-r--r--net/wireless/reg.c5
38 files changed, 246 insertions, 148 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 2a3faf5b8301..1ea2d043bf58 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8272,7 +8272,7 @@ S: Maintained
8272F: sound/soc/codecs/twl4030* 8272F: sound/soc/codecs/twl4030*
8273 8273
8274TI WILINK WIRELESS DRIVERS 8274TI WILINK WIRELESS DRIVERS
8275M: Luciano Coelho <coelho@ti.com> 8275M: Luciano Coelho <luca@coelho.fi>
8276L: linux-wireless@vger.kernel.org 8276L: linux-wireless@vger.kernel.org
8277W: http://wireless.kernel.org/en/users/Drivers/wl12xx 8277W: http://wireless.kernel.org/en/users/Drivers/wl12xx
8278W: http://wireless.kernel.org/en/users/Drivers/wl1251 8278W: 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/cw1200/sta.c b/drivers/net/wireless/cw1200/sta.c
index 7365674366f4..010b252be584 100644
--- a/drivers/net/wireless/cw1200/sta.c
+++ b/drivers/net/wireless/cw1200/sta.c
@@ -1406,11 +1406,8 @@ static void cw1200_do_unjoin(struct cw1200_common *priv)
1406 if (!priv->join_status) 1406 if (!priv->join_status)
1407 goto done; 1407 goto done;
1408 1408
1409 if (priv->join_status > CW1200_JOIN_STATUS_IBSS) { 1409 if (priv->join_status == CW1200_JOIN_STATUS_AP)
1410 wiphy_err(priv->hw->wiphy, "Unexpected: join status: %d\n", 1410 goto done;
1411 priv->join_status);
1412 BUG_ON(1);
1413 }
1414 1411
1415 cancel_work_sync(&priv->update_filtering_work); 1412 cancel_work_sync(&priv->update_filtering_work);
1416 cancel_work_sync(&priv->set_beacon_wakeup_period_work); 1413 cancel_work_sync(&priv->set_beacon_wakeup_period_work);
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index c4b22e190a54..b411ab905284 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -4466,12 +4466,12 @@ il4965_irq_tasklet(struct il_priv *il)
4466 * is killed. Hence update the killswitch state here. The 4466 * is killed. Hence update the killswitch state here. The
4467 * rfkill handler will care about restarting if needed. 4467 * rfkill handler will care about restarting if needed.
4468 */ 4468 */
4469 if (!test_bit(S_ALIVE, &il->status)) { 4469 if (hw_rf_kill) {
4470 if (hw_rf_kill) 4470 set_bit(S_RFKILL, &il->status);
4471 set_bit(S_RFKILL, &il->status); 4471 } else {
4472 else 4472 clear_bit(S_RFKILL, &il->status);
4473 clear_bit(S_RFKILL, &il->status);
4474 wiphy_rfkill_set_hw_state(il->hw->wiphy, hw_rf_kill); 4473 wiphy_rfkill_set_hw_state(il->hw->wiphy, hw_rf_kill);
4474 il_force_reset(il, true);
4475 } 4475 }
4476 4476
4477 handled |= CSR_INT_BIT_RF_KILL; 4477 handled |= CSR_INT_BIT_RF_KILL;
@@ -5340,6 +5340,9 @@ il4965_alive_start(struct il_priv *il)
5340 5340
5341 il->active_rate = RATES_MASK; 5341 il->active_rate = RATES_MASK;
5342 5342
5343 il_power_update_mode(il, true);
5344 D_INFO("Updated power mode\n");
5345
5343 if (il_is_associated(il)) { 5346 if (il_is_associated(il)) {
5344 struct il_rxon_cmd *active_rxon = 5347 struct il_rxon_cmd *active_rxon =
5345 (struct il_rxon_cmd *)&il->active; 5348 (struct il_rxon_cmd *)&il->active;
@@ -5370,9 +5373,6 @@ il4965_alive_start(struct il_priv *il)
5370 D_INFO("ALIVE processing complete.\n"); 5373 D_INFO("ALIVE processing complete.\n");
5371 wake_up(&il->wait_command_queue); 5374 wake_up(&il->wait_command_queue);
5372 5375
5373 il_power_update_mode(il, true);
5374 D_INFO("Updated power mode\n");
5375
5376 return; 5376 return;
5377 5377
5378restart: 5378restart:
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 3195aad440dd..b03e22ef5462 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -4660,6 +4660,7 @@ il_force_reset(struct il_priv *il, bool external)
4660 4660
4661 return 0; 4661 return 0;
4662} 4662}
4663EXPORT_SYMBOL(il_force_reset);
4663 4664
4664int 4665int
4665il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 4666il_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
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 ebf7f9468926..d0d7a20266e6 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 c33ff8e61f4f..83cb9b992ea4 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 fc61b274780c..785c782b166f 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -514,6 +514,27 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
514 goto out_unlock; 514 goto out_unlock;
515 515
516 /* 516 /*
517 * TODO: remove this temporary code.
518 * Currently MVM FW supports power management only on single MAC.
519 * If new interface added, disable PM on existing interface.
520 * P2P device is a special case, since it is handled by FW similary to
521 * scan. If P2P deviced is added, PM remains enabled on existing
522 * interface.
523 * Note: the method below does not count the new interface being added
524 * at this moment.
525 */
526 if (vif->type != NL80211_IFTYPE_P2P_DEVICE)
527 mvm->vif_count++;
528 if (mvm->vif_count > 1) {
529 IWL_DEBUG_MAC80211(mvm,
530 "Disable power on existing interfaces\n");
531 ieee80211_iterate_active_interfaces_atomic(
532 mvm->hw,
533 IEEE80211_IFACE_ITER_NORMAL,
534 iwl_mvm_pm_disable_iterator, mvm);
535 }
536
537 /*
517 * The AP binding flow can be done only after the beacon 538 * The AP binding flow can be done only after the beacon
518 * template is configured (which happens only in the mac80211 539 * template is configured (which happens only in the mac80211
519 * start_ap() flow), and adding the broadcast station can happen 540 * start_ap() flow), and adding the broadcast station can happen
@@ -537,27 +558,6 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
537 goto out_unlock; 558 goto out_unlock;
538 } 559 }
539 560
540 /*
541 * TODO: remove this temporary code.
542 * Currently MVM FW supports power management only on single MAC.
543 * If new interface added, disable PM on existing interface.
544 * P2P device is a special case, since it is handled by FW similary to
545 * scan. If P2P deviced is added, PM remains enabled on existing
546 * interface.
547 * Note: the method below does not count the new interface being added
548 * at this moment.
549 */
550 if (vif->type != NL80211_IFTYPE_P2P_DEVICE)
551 mvm->vif_count++;
552 if (mvm->vif_count > 1) {
553 IWL_DEBUG_MAC80211(mvm,
554 "Disable power on existing interfaces\n");
555 ieee80211_iterate_active_interfaces_atomic(
556 mvm->hw,
557 IEEE80211_IFACE_ITER_NORMAL,
558 iwl_mvm_pm_disable_iterator, mvm);
559 }
560
561 ret = iwl_mvm_mac_ctxt_add(mvm, vif); 561 ret = iwl_mvm_mac_ctxt_add(mvm, vif);
562 if (ret) 562 if (ret)
563 goto out_release; 563 goto out_release;
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
index 14c1b457ca50..9a7ab8495300 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 8b302774b70c..44add291531b 100644
--- a/drivers/net/wireless/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/iwlwifi/mvm/sta.c
@@ -914,6 +914,7 @@ int iwl_mvm_sta_tx_agg_flush(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
914 struct iwl_mvm_sta *mvmsta = (void *)sta->drv_priv; 914 struct iwl_mvm_sta *mvmsta = (void *)sta->drv_priv;
915 struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid]; 915 struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid];
916 u16 txq_id; 916 u16 txq_id;
917 enum iwl_mvm_agg_state old_state;
917 918
918 /* 919 /*
919 * First set the agg state to OFF to avoid calling 920 * First set the agg state to OFF to avoid calling
@@ -923,13 +924,17 @@ int iwl_mvm_sta_tx_agg_flush(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
923 txq_id = tid_data->txq_id; 924 txq_id = tid_data->txq_id;
924 IWL_DEBUG_TX_QUEUES(mvm, "Flush AGG: sta %d tid %d q %d state %d\n", 925 IWL_DEBUG_TX_QUEUES(mvm, "Flush AGG: sta %d tid %d q %d state %d\n",
925 mvmsta->sta_id, tid, txq_id, tid_data->state); 926 mvmsta->sta_id, tid, txq_id, tid_data->state);
927 old_state = tid_data->state;
926 tid_data->state = IWL_AGG_OFF; 928 tid_data->state = IWL_AGG_OFF;
927 spin_unlock_bh(&mvmsta->lock); 929 spin_unlock_bh(&mvmsta->lock);
928 930
929 if (iwl_mvm_flush_tx_path(mvm, BIT(txq_id), true)) 931 if (old_state >= IWL_AGG_ON) {
930 IWL_ERR(mvm, "Couldn't flush the AGG queue\n"); 932 if (iwl_mvm_flush_tx_path(mvm, BIT(txq_id), true))
933 IWL_ERR(mvm, "Couldn't flush the AGG queue\n");
934
935 iwl_trans_txq_disable(mvm->trans, tid_data->txq_id);
936 }
931 937
932 iwl_trans_txq_disable(mvm->trans, tid_data->txq_id);
933 mvm->queue_to_mac80211[tid_data->txq_id] = 938 mvm->queue_to_mac80211[tid_data->txq_id] =
934 IWL_INVALID_MAC80211_QUEUE; 939 IWL_INVALID_MAC80211_QUEUE;
935 940
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c
index db6be2491d7c..c96070fa93e4 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 5fdb4eea146d..68837d4e9fa0 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 cec0c8991285..805e303dc4d9 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 8a752637f0ce..c5e21ede60f2 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1727,9 +1727,9 @@ mwifiex_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
1727 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); 1727 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
1728 int ret; 1728 int ret;
1729 1729
1730 if (priv->bss_mode != NL80211_IFTYPE_STATION) { 1730 if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_STA) {
1731 wiphy_err(wiphy, 1731 wiphy_err(wiphy,
1732 "%s: reject infra assoc request in non-STA mode\n", 1732 "%s: reject infra assoc request in non-STA role\n",
1733 dev->name); 1733 dev->name);
1734 return -EINVAL; 1734 return -EINVAL;
1735 } 1735 }
diff --git a/drivers/net/wireless/mwifiex/cfp.c b/drivers/net/wireless/mwifiex/cfp.c
index 913bb63fd0ad..9eefacbc844b 100644
--- a/drivers/net/wireless/mwifiex/cfp.c
+++ b/drivers/net/wireless/mwifiex/cfp.c
@@ -447,7 +447,8 @@ u32 mwifiex_get_supported_rates(struct mwifiex_private *priv, u8 *rates)
447 u32 k = 0; 447 u32 k = 0;
448 struct mwifiex_adapter *adapter = priv->adapter; 448 struct mwifiex_adapter *adapter = priv->adapter;
449 449
450 if (priv->bss_mode == NL80211_IFTYPE_STATION) { 450 if (priv->bss_mode == NL80211_IFTYPE_STATION ||
451 priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) {
451 switch (adapter->config_bands) { 452 switch (adapter->config_bands) {
452 case BAND_B: 453 case BAND_B:
453 dev_dbg(adapter->dev, "info: infra band=%d " 454 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 ba043ca2a34a..9d7c0e6c4fc7 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 1eb5efa1bce2..0e2070f72fed 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -1636,8 +1636,8 @@ static int mwifiex_sdio_host_to_card(struct mwifiex_adapter *adapter,
1636 /* Allocate buffer and copy payload */ 1636 /* Allocate buffer and copy payload */
1637 blk_size = MWIFIEX_SDIO_BLOCK_SIZE; 1637 blk_size = MWIFIEX_SDIO_BLOCK_SIZE;
1638 buf_block_len = (pkt_len + blk_size - 1) / blk_size; 1638 buf_block_len = (pkt_len + blk_size - 1) / blk_size;
1639 *(u16 *) &payload[0] = (u16) pkt_len; 1639 *(__le16 *)&payload[0] = cpu_to_le16((u16)pkt_len);
1640 *(u16 *) &payload[2] = type; 1640 *(__le16 *)&payload[2] = cpu_to_le16(type);
1641 1641
1642 /* 1642 /*
1643 * This is SDIO specific header 1643 * This is SDIO specific header
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index c071ce91c8b2..f084412eee0b 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/mlme.c b/net/mac80211/mlme.c
index 211246b46819..21bccd849b3f 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -31,10 +31,12 @@
31#include "led.h" 31#include "led.h"
32 32
33#define IEEE80211_AUTH_TIMEOUT (HZ / 5) 33#define IEEE80211_AUTH_TIMEOUT (HZ / 5)
34#define IEEE80211_AUTH_TIMEOUT_LONG (HZ / 2)
34#define IEEE80211_AUTH_TIMEOUT_SHORT (HZ / 10) 35#define IEEE80211_AUTH_TIMEOUT_SHORT (HZ / 10)
35#define IEEE80211_AUTH_MAX_TRIES 3 36#define IEEE80211_AUTH_MAX_TRIES 3
36#define IEEE80211_AUTH_WAIT_ASSOC (HZ * 5) 37#define IEEE80211_AUTH_WAIT_ASSOC (HZ * 5)
37#define IEEE80211_ASSOC_TIMEOUT (HZ / 5) 38#define IEEE80211_ASSOC_TIMEOUT (HZ / 5)
39#define IEEE80211_ASSOC_TIMEOUT_LONG (HZ / 2)
38#define IEEE80211_ASSOC_TIMEOUT_SHORT (HZ / 10) 40#define IEEE80211_ASSOC_TIMEOUT_SHORT (HZ / 10)
39#define IEEE80211_ASSOC_MAX_TRIES 3 41#define IEEE80211_ASSOC_MAX_TRIES 3
40 42
@@ -209,8 +211,9 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata,
209 struct ieee80211_channel *channel, 211 struct ieee80211_channel *channel,
210 const struct ieee80211_ht_operation *ht_oper, 212 const struct ieee80211_ht_operation *ht_oper,
211 const struct ieee80211_vht_operation *vht_oper, 213 const struct ieee80211_vht_operation *vht_oper,
212 struct cfg80211_chan_def *chandef, bool verbose) 214 struct cfg80211_chan_def *chandef, bool tracking)
213{ 215{
216 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
214 struct cfg80211_chan_def vht_chandef; 217 struct cfg80211_chan_def vht_chandef;
215 u32 ht_cfreq, ret; 218 u32 ht_cfreq, ret;
216 219
@@ -229,7 +232,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata,
229 ht_cfreq = ieee80211_channel_to_frequency(ht_oper->primary_chan, 232 ht_cfreq = ieee80211_channel_to_frequency(ht_oper->primary_chan,
230 channel->band); 233 channel->band);
231 /* check that channel matches the right operating channel */ 234 /* check that channel matches the right operating channel */
232 if (channel->center_freq != ht_cfreq) { 235 if (!tracking && channel->center_freq != ht_cfreq) {
233 /* 236 /*
234 * It's possible that some APs are confused here; 237 * It's possible that some APs are confused here;
235 * Netgear WNDR3700 sometimes reports 4 higher than 238 * Netgear WNDR3700 sometimes reports 4 higher than
@@ -237,11 +240,10 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata,
237 * since we look at probe response/beacon data here 240 * since we look at probe response/beacon data here
238 * it should be OK. 241 * it should be OK.
239 */ 242 */
240 if (verbose) 243 sdata_info(sdata,
241 sdata_info(sdata, 244 "Wrong control channel: center-freq: %d ht-cfreq: %d ht->primary_chan: %d band: %d - Disabling HT\n",
242 "Wrong control channel: center-freq: %d ht-cfreq: %d ht->primary_chan: %d band: %d - Disabling HT\n", 245 channel->center_freq, ht_cfreq,
243 channel->center_freq, ht_cfreq, 246 ht_oper->primary_chan, channel->band);
244 ht_oper->primary_chan, channel->band);
245 ret = IEEE80211_STA_DISABLE_HT | IEEE80211_STA_DISABLE_VHT; 247 ret = IEEE80211_STA_DISABLE_HT | IEEE80211_STA_DISABLE_VHT;
246 goto out; 248 goto out;
247 } 249 }
@@ -295,7 +297,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata,
295 channel->band); 297 channel->band);
296 break; 298 break;
297 default: 299 default:
298 if (verbose) 300 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
299 sdata_info(sdata, 301 sdata_info(sdata,
300 "AP VHT operation IE has invalid channel width (%d), disable VHT\n", 302 "AP VHT operation IE has invalid channel width (%d), disable VHT\n",
301 vht_oper->chan_width); 303 vht_oper->chan_width);
@@ -304,7 +306,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata,
304 } 306 }
305 307
306 if (!cfg80211_chandef_valid(&vht_chandef)) { 308 if (!cfg80211_chandef_valid(&vht_chandef)) {
307 if (verbose) 309 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
308 sdata_info(sdata, 310 sdata_info(sdata,
309 "AP VHT information is invalid, disable VHT\n"); 311 "AP VHT information is invalid, disable VHT\n");
310 ret = IEEE80211_STA_DISABLE_VHT; 312 ret = IEEE80211_STA_DISABLE_VHT;
@@ -317,7 +319,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata,
317 } 319 }
318 320
319 if (!cfg80211_chandef_compatible(chandef, &vht_chandef)) { 321 if (!cfg80211_chandef_compatible(chandef, &vht_chandef)) {
320 if (verbose) 322 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
321 sdata_info(sdata, 323 sdata_info(sdata,
322 "AP VHT information doesn't match HT, disable VHT\n"); 324 "AP VHT information doesn't match HT, disable VHT\n");
323 ret = IEEE80211_STA_DISABLE_VHT; 325 ret = IEEE80211_STA_DISABLE_VHT;
@@ -333,18 +335,27 @@ out:
333 if (ret & IEEE80211_STA_DISABLE_VHT) 335 if (ret & IEEE80211_STA_DISABLE_VHT)
334 vht_chandef = *chandef; 336 vht_chandef = *chandef;
335 337
338 /*
339 * Ignore the DISABLED flag when we're already connected and only
340 * tracking the APs beacon for bandwidth changes - otherwise we
341 * might get disconnected here if we connect to an AP, update our
342 * regulatory information based on the AP's country IE and the
343 * information we have is wrong/outdated and disables the channel
344 * that we're actually using for the connection to the AP.
345 */
336 while (!cfg80211_chandef_usable(sdata->local->hw.wiphy, chandef, 346 while (!cfg80211_chandef_usable(sdata->local->hw.wiphy, chandef,
337 IEEE80211_CHAN_DISABLED)) { 347 tracking ? 0 :
348 IEEE80211_CHAN_DISABLED)) {
338 if (WARN_ON(chandef->width == NL80211_CHAN_WIDTH_20_NOHT)) { 349 if (WARN_ON(chandef->width == NL80211_CHAN_WIDTH_20_NOHT)) {
339 ret = IEEE80211_STA_DISABLE_HT | 350 ret = IEEE80211_STA_DISABLE_HT |
340 IEEE80211_STA_DISABLE_VHT; 351 IEEE80211_STA_DISABLE_VHT;
341 goto out; 352 break;
342 } 353 }
343 354
344 ret |= chandef_downgrade(chandef); 355 ret |= chandef_downgrade(chandef);
345 } 356 }
346 357
347 if (chandef->width != vht_chandef.width && verbose) 358 if (chandef->width != vht_chandef.width && !tracking)
348 sdata_info(sdata, 359 sdata_info(sdata,
349 "capabilities/regulatory prevented using AP HT/VHT configuration, downgraded\n"); 360 "capabilities/regulatory prevented using AP HT/VHT configuration, downgraded\n");
350 361
@@ -384,7 +395,7 @@ static int ieee80211_config_bw(struct ieee80211_sub_if_data *sdata,
384 395
385 /* calculate new channel (type) based on HT/VHT operation IEs */ 396 /* calculate new channel (type) based on HT/VHT operation IEs */
386 flags = ieee80211_determine_chantype(sdata, sband, chan, ht_oper, 397 flags = ieee80211_determine_chantype(sdata, sband, chan, ht_oper,
387 vht_oper, &chandef, false); 398 vht_oper, &chandef, true);
388 399
389 /* 400 /*
390 * Downgrade the new channel if we associated with restricted 401 * Downgrade the new channel if we associated with restricted
@@ -3395,10 +3406,13 @@ static int ieee80211_probe_auth(struct ieee80211_sub_if_data *sdata)
3395 3406
3396 if (tx_flags == 0) { 3407 if (tx_flags == 0) {
3397 auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT; 3408 auth_data->timeout = jiffies + IEEE80211_AUTH_TIMEOUT;
3398 ifmgd->auth_data->timeout_started = true; 3409 auth_data->timeout_started = true;
3399 run_again(sdata, auth_data->timeout); 3410 run_again(sdata, auth_data->timeout);
3400 } else { 3411 } else {
3401 auth_data->timeout_started = false; 3412 auth_data->timeout =
3413 round_jiffies_up(jiffies + IEEE80211_AUTH_TIMEOUT_LONG);
3414 auth_data->timeout_started = true;
3415 run_again(sdata, auth_data->timeout);
3402 } 3416 }
3403 3417
3404 return 0; 3418 return 0;
@@ -3435,7 +3449,11 @@ static int ieee80211_do_assoc(struct ieee80211_sub_if_data *sdata)
3435 assoc_data->timeout_started = true; 3449 assoc_data->timeout_started = true;
3436 run_again(sdata, assoc_data->timeout); 3450 run_again(sdata, assoc_data->timeout);
3437 } else { 3451 } else {
3438 assoc_data->timeout_started = false; 3452 assoc_data->timeout =
3453 round_jiffies_up(jiffies +
3454 IEEE80211_ASSOC_TIMEOUT_LONG);
3455 assoc_data->timeout_started = true;
3456 run_again(sdata, assoc_data->timeout);
3439 } 3457 }
3440 3458
3441 return 0; 3459 return 0;
@@ -3830,7 +3848,7 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
3830 ifmgd->flags |= ieee80211_determine_chantype(sdata, sband, 3848 ifmgd->flags |= ieee80211_determine_chantype(sdata, sband,
3831 cbss->channel, 3849 cbss->channel,
3832 ht_oper, vht_oper, 3850 ht_oper, vht_oper,
3833 &chandef, true); 3851 &chandef, false);
3834 3852
3835 sdata->needed_rx_chains = min(ieee80211_ht_vht_rx_chains(sdata, cbss), 3853 sdata->needed_rx_chains = min(ieee80211_ht_vht_rx_chains(sdata, cbss),
3836 local->rx_chains); 3854 local->rx_chains);
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/core.c b/net/wireless/core.c
index 389a3f2ee464..67153964aad2 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -774,6 +774,7 @@ void cfg80211_leave(struct cfg80211_registered_device *rdev,
774 cfg80211_leave_mesh(rdev, dev); 774 cfg80211_leave_mesh(rdev, dev);
775 break; 775 break;
776 case NL80211_IFTYPE_AP: 776 case NL80211_IFTYPE_AP:
777 case NL80211_IFTYPE_P2P_GO:
777 cfg80211_stop_ap(rdev, dev); 778 cfg80211_stop_ap(rdev, dev);
778 break; 779 break;
779 default: 780 default:
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 160c1f7c6091..587ff843cf94 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -449,10 +449,12 @@ static int nl80211_prepare_wdev_dump(struct sk_buff *skb,
449 goto out_unlock; 449 goto out_unlock;
450 } 450 }
451 *rdev = wiphy_to_dev((*wdev)->wiphy); 451 *rdev = wiphy_to_dev((*wdev)->wiphy);
452 cb->args[0] = (*rdev)->wiphy_idx; 452 /* 0 is the first index - add 1 to parse only once */
453 cb->args[0] = (*rdev)->wiphy_idx + 1;
453 cb->args[1] = (*wdev)->identifier; 454 cb->args[1] = (*wdev)->identifier;
454 } else { 455 } else {
455 struct wiphy *wiphy = wiphy_idx_to_wiphy(cb->args[0]); 456 /* subtract the 1 again here */
457 struct wiphy *wiphy = wiphy_idx_to_wiphy(cb->args[0] - 1);
456 struct wireless_dev *tmp; 458 struct wireless_dev *tmp;
457 459
458 if (!wiphy) { 460 if (!wiphy) {
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)