aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/iface.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-07-06 15:39:28 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-07-12 06:10:43 -0400
commite2fd5dbc1c7031be5b5de043bcc0a18c7a59a68a (patch)
treef9febb7e331ff24efec9289e2a13be9e146f9cd5 /net/mac80211/iface.c
parentd811b3d5566f1441b321a1219c260124b209e0bd (diff)
mac80211: make scan_sdata pointer usable with RCU
Making the scan_sdata pointer usable with RCU makes it possible to dereference it in the RX path to see if a received frame actually matches the interface that is scanning. This is just preparations, making the pointer __rcu. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r--net/mac80211/iface.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index b1edf60fbba7..e3c49748ce8f 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -112,10 +112,11 @@ static u32 __ieee80211_recalc_idle(struct ieee80211_local *local)
112 } 112 }
113 } 113 }
114 114
115 if (local->scan_sdata && 115 sdata = rcu_dereference_protected(local->scan_sdata,
116 !(local->hw.flags & IEEE80211_HW_SCAN_WHILE_IDLE)) { 116 lockdep_is_held(&local->mtx));
117 if (sdata && !(local->hw.flags & IEEE80211_HW_SCAN_WHILE_IDLE)) {
117 scanning = true; 118 scanning = true;
118 local->scan_sdata->vif.bss_conf.idle = false; 119 sdata->vif.bss_conf.idle = false;
119 } 120 }
120 121
121 list_for_each_entry(sdata, &local->interfaces, list) { 122 list_for_each_entry(sdata, &local->interfaces, list) {
@@ -628,7 +629,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
628 629
629 clear_bit(SDATA_STATE_RUNNING, &sdata->state); 630 clear_bit(SDATA_STATE_RUNNING, &sdata->state);
630 631
631 if (local->scan_sdata == sdata) 632 if (rcu_access_pointer(local->scan_sdata) == sdata)
632 ieee80211_scan_cancel(local); 633 ieee80211_scan_cancel(local);
633 634
634 /* 635 /*