aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-04-23 10:01:47 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-06 15:14:31 -0400
commitf3b85252f081581a8f257545ed748062dce7798b (patch)
tree899a804545850c7e1b1e3eea5c743df2c8cddf3d /net/mac80211/main.c
parent2d72289095e9621158acf1d59a830cfe920fa93b (diff)
mac80211: fix scan races and rework scanning
There are some places marked /* XXX maybe racy? */ and they really are racy because there's no locking. This patch reworks much of the scan code, and introduces proper locking for the scan request as well as the internal scanning (which is necessary for IBSS/managed modes). Helper functions are added to call the scanning code whenever necessary. The scan deferring is changed to simply queue the scanning work instead of trying to start the scan in place, the scanning work will then take care of the rest. Also, currently when internal scans are requested for an interface that is trying to associate, we reject such scans. This was not intended, the mlme code has provisions to scan twice when it can't find the BSS to associate with right away; this has never worked properly. Fix this by not rejecting internal scan requests for an interface that is associating. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 5ca62ea15079..e00d124e4ef7 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -783,6 +783,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
783 783
784 INIT_LIST_HEAD(&local->interfaces); 784 INIT_LIST_HEAD(&local->interfaces);
785 mutex_init(&local->iflist_mtx); 785 mutex_init(&local->iflist_mtx);
786 mutex_init(&local->scan_mtx);
786 787
787 spin_lock_init(&local->key_lock); 788 spin_lock_init(&local->key_lock);
788 789
@@ -1126,6 +1127,7 @@ void ieee80211_free_hw(struct ieee80211_hw *hw)
1126 struct ieee80211_local *local = hw_to_local(hw); 1127 struct ieee80211_local *local = hw_to_local(hw);
1127 1128
1128 mutex_destroy(&local->iflist_mtx); 1129 mutex_destroy(&local->iflist_mtx);
1130 mutex_destroy(&local->scan_mtx);
1129 1131
1130 wiphy_free(local->hw.wiphy); 1132 wiphy_free(local->hw.wiphy);
1131} 1133}