aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/scan.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-01-22 12:07:31 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 16:01:13 -0500
commit078e1e60dd6c6b0d4bc8d58ccb80c008e8efc9ff (patch)
tree7fa2580b76a5693a37449e9cc075eee2394bb0c3 /net/mac80211/scan.c
parent07c1e852514e862e246b9f2962ce8fc0d7ac8ed1 (diff)
mac80211: Add capability to enable/disable beaconing
This patch adds a flag to notify drivers to start and stop beaconing when needed, for example, during a scan run. Based on Sujith's first patch to do the same, but now disables beaconing for all virtual interfaces while scanning, has a separate change flag and tracks user-space requests. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r--net/mac80211/scan.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index a2caeed57f4e..8248d7b6ae82 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
@@ -472,8 +473,8 @@ 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) {
477 /* Tell AP we're back */ 478 /* Tell AP we're back */
478 if (sdata->vif.type == NL80211_IFTYPE_STATION) { 479 if (sdata->vif.type == NL80211_IFTYPE_STATION) {
479 if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) { 480 if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {
@@ -482,8 +483,10 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw)
482 } 483 }
483 } else 484 } else
484 netif_tx_wake_all_queues(sdata->dev); 485 netif_tx_wake_all_queues(sdata->dev);
486
487 ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON_ENABLED);
485 } 488 }
486 rcu_read_unlock(); 489 mutex_unlock(&local->iflist_mtx);
487 490
488 done: 491 done:
489 ieee80211_mlme_notify_scan_completed(local); 492 ieee80211_mlme_notify_scan_completed(local);
@@ -491,7 +494,6 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw)
491} 494}
492EXPORT_SYMBOL(ieee80211_scan_completed); 495EXPORT_SYMBOL(ieee80211_scan_completed);
493 496
494
495void ieee80211_scan_work(struct work_struct *work) 497void ieee80211_scan_work(struct work_struct *work)
496{ 498{
497 struct ieee80211_local *local = 499 struct ieee80211_local *local =
@@ -633,8 +635,10 @@ int ieee80211_start_scan(struct ieee80211_sub_if_data *scan_sdata,
633 635
634 local->sw_scanning = true; 636 local->sw_scanning = true;
635 637
636 rcu_read_lock(); 638 mutex_lock(&local->iflist_mtx);
637 list_for_each_entry_rcu(sdata, &local->interfaces, list) { 639 list_for_each_entry(sdata, &local->interfaces, list) {
640 ieee80211_if_config(sdata, IEEE80211_IFCC_BEACON_ENABLED);
641
638 if (sdata->vif.type == NL80211_IFTYPE_STATION) { 642 if (sdata->vif.type == NL80211_IFTYPE_STATION) {
639 if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) { 643 if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {
640 netif_tx_stop_all_queues(sdata->dev); 644 netif_tx_stop_all_queues(sdata->dev);
@@ -643,7 +647,7 @@ int ieee80211_start_scan(struct ieee80211_sub_if_data *scan_sdata,
643 } else 647 } else
644 netif_tx_stop_all_queues(sdata->dev); 648 netif_tx_stop_all_queues(sdata->dev);
645 } 649 }
646 rcu_read_unlock(); 650 mutex_unlock(&local->iflist_mtx);
647 651
648 if (ssid) { 652 if (ssid) {
649 local->scan_ssid_len = ssid_len; 653 local->scan_ssid_len = ssid_len;