aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r--net/mac80211/scan.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index f5c7c3371929..282e6a0dec01 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -20,6 +20,7 @@
20 20
21#include <linux/wireless.h> 21#include <linux/wireless.h>
22#include <linux/if_arp.h> 22#include <linux/if_arp.h>
23#include <linux/rtnetlink.h>
23#include <net/mac80211.h> 24#include <net/mac80211.h>
24#include <net/iw_handler.h> 25#include <net/iw_handler.h>
25 26
@@ -395,7 +396,7 @@ ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb,
395 return RX_QUEUED; 396 return RX_QUEUED;
396} 397}
397 398
398static void ieee80211_send_nullfunc(struct ieee80211_local *local, 399void ieee80211_send_nullfunc(struct ieee80211_local *local,
399 struct ieee80211_sub_if_data *sdata, 400 struct ieee80211_sub_if_data *sdata,
400 int powersave) 401 int powersave)
401{ 402{
@@ -472,8 +473,11 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw)
472 netif_addr_unlock(local->mdev); 473 netif_addr_unlock(local->mdev);
473 netif_tx_unlock_bh(local->mdev); 474 netif_tx_unlock_bh(local->mdev);
474 475
475 rcu_read_lock(); 476 mutex_lock(&local->iflist_mtx);
476 list_for_each_entry_rcu(sdata, &local->interfaces, list) { 477 list_for_each_entry(sdata, &local->interfaces, list) {
478 if (!netif_running(sdata->dev))
479 continue;
480
477 /* Tell AP we're back */ 481 /* Tell AP we're back */
478 if (sdata->vif.type == NL80211_IFTYPE_STATION) { 482 if (sdata->vif.type == NL80211_IFTYPE_STATION) {
479 if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) { 483 if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {
@@ -482,8 +486,10 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw)
482 } 486 }
483 } else 487 } else
484 netif_tx_wake_all_queues(sdata->dev); 488 netif_tx_wake_all_queues(sdata->dev);
489
490 ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON_ENABLED);
485 } 491 }
486 rcu_read_unlock(); 492 mutex_unlock(&local->iflist_mtx);
487 493
488 done: 494 done:
489 ieee80211_mlme_notify_scan_completed(local); 495 ieee80211_mlme_notify_scan_completed(local);
@@ -491,7 +497,6 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw)
491} 497}
492EXPORT_SYMBOL(ieee80211_scan_completed); 498EXPORT_SYMBOL(ieee80211_scan_completed);
493 499
494
495void ieee80211_scan_work(struct work_struct *work) 500void ieee80211_scan_work(struct work_struct *work)
496{ 501{
497 struct ieee80211_local *local = 502 struct ieee80211_local *local =
@@ -633,8 +638,13 @@ int ieee80211_start_scan(struct ieee80211_sub_if_data *scan_sdata,
633 638
634 local->sw_scanning = true; 639 local->sw_scanning = true;
635 640
636 rcu_read_lock(); 641 mutex_lock(&local->iflist_mtx);
637 list_for_each_entry_rcu(sdata, &local->interfaces, list) { 642 list_for_each_entry(sdata, &local->interfaces, list) {
643 if (!netif_running(sdata->dev))
644 continue;
645
646 ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON_ENABLED);
647
638 if (sdata->vif.type == NL80211_IFTYPE_STATION) { 648 if (sdata->vif.type == NL80211_IFTYPE_STATION) {
639 if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) { 649 if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {
640 netif_tx_stop_all_queues(sdata->dev); 650 netif_tx_stop_all_queues(sdata->dev);
@@ -643,7 +653,7 @@ int ieee80211_start_scan(struct ieee80211_sub_if_data *scan_sdata,
643 } else 653 } else
644 netif_tx_stop_all_queues(sdata->dev); 654 netif_tx_stop_all_queues(sdata->dev);
645 } 655 }
646 rcu_read_unlock(); 656 mutex_unlock(&local->iflist_mtx);
647 657
648 if (ssid) { 658 if (ssid) {
649 local->scan_ssid_len = ssid_len; 659 local->scan_ssid_len = ssid_len;