aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-08-09 15:06:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-08-09 15:06:28 -0400
commit4f0544489215fc78cccb96f8e3d0f078ae965297 (patch)
tree69e71db0cf005a68ab1b70f33ae0462fd94152fc /net
parent2952f6ef5195ea76279f7370f0a6571867e54438 (diff)
parent5a6e0cf70743f30c17ccb5f228db9a124b0e7477 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Diffstat (limited to 'net')
-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
12 files changed, 95 insertions, 55 deletions
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)