aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/scan.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-06-18 06:32:20 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-18 15:11:14 -0400
commit543708be320d7df692d24b349ca01a947b340764 (patch)
tree7ca928290eb276ea25afbc6b12d8d8f63dfea167 /net/mac80211/scan.c
parent8223d2f540c96f46f762fbd93f59a08bb80601c1 (diff)
mac80211: fix sw scan bracketing
Currently, detection in hwsim and ath9k can detect that two sw scans are in flight at the same time, which isn't really true. It is caused by a race condition, because the scan complete callback is called too late, after the lock has been dropped, so that a new scan can be started before it is called. It is also called too early semantically, as it is currently called _after_ the return to the operating channel -- it should be before so that drivers know this is the operating channel again. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r--net/mac80211/scan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index e1b0be7a57b9..36eb6dd7c75e 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -286,6 +286,8 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
286 local->scanning = 0; 286 local->scanning = 0;
287 local->scan_channel = NULL; 287 local->scan_channel = NULL;
288 288
289 drv_sw_scan_complete(local);
290
289 /* we only have to protect scan_req and hw/sw scan */ 291 /* we only have to protect scan_req and hw/sw scan */
290 mutex_unlock(&local->scan_mtx); 292 mutex_unlock(&local->scan_mtx);
291 293
@@ -295,8 +297,6 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
295 297
296 ieee80211_configure_filter(local); 298 ieee80211_configure_filter(local);
297 299
298 drv_sw_scan_complete(local);
299
300 ieee80211_offchannel_return(local, true); 300 ieee80211_offchannel_return(local, true);
301 301
302 done: 302 done: