Skip to content

Commit

Permalink
mac80211: fix sw scan bracketing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jun 18, 2010
1 parent 8223d2f commit 543708b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/mac80211/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
local->scanning = 0;
local->scan_channel = NULL;

drv_sw_scan_complete(local);

/* we only have to protect scan_req and hw/sw scan */
mutex_unlock(&local->scan_mtx);

Expand All @@ -295,8 +297,6 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)

ieee80211_configure_filter(local);

drv_sw_scan_complete(local);

ieee80211_offchannel_return(local, true);

done:
Expand Down

0 comments on commit 543708b

Please sign in to comment.