diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-04-23 10:01:47 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-05-06 15:14:31 -0400 |
commit | f3b85252f081581a8f257545ed748062dce7798b (patch) | |
tree | 899a804545850c7e1b1e3eea5c743df2c8cddf3d /net/mac80211/ieee80211_i.h | |
parent | 2d72289095e9621158acf1d59a830cfe920fa93b (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/ieee80211_i.h')
-rw-r--r-- | net/mac80211/ieee80211_i.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 1579bc92c88d..e6fd4bcf1c3c 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -659,6 +659,7 @@ struct ieee80211_local { | |||
659 | 659 | ||
660 | 660 | ||
661 | /* Scanning and BSS list */ | 661 | /* Scanning and BSS list */ |
662 | struct mutex scan_mtx; | ||
662 | bool sw_scanning, hw_scanning; | 663 | bool sw_scanning, hw_scanning; |
663 | struct cfg80211_ssid scan_ssid; | 664 | struct cfg80211_ssid scan_ssid; |
664 | struct cfg80211_scan_request int_scan_req; | 665 | struct cfg80211_scan_request int_scan_req; |
@@ -947,6 +948,8 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata); | |||
947 | 948 | ||
948 | /* scan/BSS handling */ | 949 | /* scan/BSS handling */ |
949 | void ieee80211_scan_work(struct work_struct *work); | 950 | void ieee80211_scan_work(struct work_struct *work); |
951 | int ieee80211_request_internal_scan(struct ieee80211_sub_if_data *sdata, | ||
952 | const u8 *ssid, u8 ssid_len); | ||
950 | int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata, | 953 | int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata, |
951 | struct cfg80211_scan_request *req); | 954 | struct cfg80211_scan_request *req); |
952 | int ieee80211_scan_results(struct ieee80211_local *local, | 955 | int ieee80211_scan_results(struct ieee80211_local *local, |
@@ -960,9 +963,6 @@ int ieee80211_sta_set_extra_ie(struct ieee80211_sub_if_data *sdata, | |||
960 | const char *ie, size_t len); | 963 | const char *ie, size_t len); |
961 | 964 | ||
962 | void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local); | 965 | void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local); |
963 | void ieee80211_scan_failed(struct ieee80211_local *local); | ||
964 | int ieee80211_start_scan(struct ieee80211_sub_if_data *scan_sdata, | ||
965 | struct cfg80211_scan_request *req); | ||
966 | struct ieee80211_bss * | 966 | struct ieee80211_bss * |
967 | ieee80211_bss_info_update(struct ieee80211_local *local, | 967 | ieee80211_bss_info_update(struct ieee80211_local *local, |
968 | struct ieee80211_rx_status *rx_status, | 968 | struct ieee80211_rx_status *rx_status, |