aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-08-25 10:44:28 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-28 14:40:46 -0400
commit5bf6fcc2bbfb90d997f88c969f1ceee35d064a24 (patch)
treed73447bb71015d4b82a2a6b9073bef2c09503488 /net/mac80211/mlme.c
parent15db0b7fd872b0312033666d3a82e1214a227ec0 (diff)
mac80211: Check pending scan request after having processed mgd work
When the queued management work items are processed in ieee80211_sta_work() an item could be removed. This could change the anybusy from true to false, so we better check whether we can start a new scan only after having processed the pending work first. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index c374d2d73fa4..97a278a2f48e 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2123,25 +2123,9 @@ static void ieee80211_sta_work(struct work_struct *work)
2123 } 2123 }
2124 } 2124 }
2125 2125
2126 list_for_each_entry(wk, &ifmgd->work_list, list) {
2127 if (wk->state != IEEE80211_MGD_STATE_IDLE) {
2128 anybusy = true;
2129 break;
2130 }
2131 }
2132 2126
2133 ieee80211_recalc_idle(local); 2127 ieee80211_recalc_idle(local);
2134 2128
2135 if (!anybusy) {
2136 mutex_unlock(&ifmgd->mtx);
2137
2138 if (test_and_clear_bit(IEEE80211_STA_REQ_SCAN, &ifmgd->request))
2139 ieee80211_queue_delayed_work(&local->hw,
2140 &local->scan_work,
2141 round_jiffies_relative(0));
2142 return;
2143 }
2144
2145 list_for_each_entry_safe(wk, tmp, &ifmgd->work_list, list) { 2129 list_for_each_entry_safe(wk, tmp, &ifmgd->work_list, list) {
2146 if (time_is_after_jiffies(wk->timeout)) { 2130 if (time_is_after_jiffies(wk->timeout)) {
2147 /* 2131 /*
@@ -2187,6 +2171,18 @@ static void ieee80211_sta_work(struct work_struct *work)
2187 } 2171 }
2188 } 2172 }
2189 2173
2174 list_for_each_entry(wk, &ifmgd->work_list, list) {
2175 if (wk->state != IEEE80211_MGD_STATE_IDLE) {
2176 anybusy = true;
2177 break;
2178 }
2179 }
2180 if (!anybusy &&
2181 test_and_clear_bit(IEEE80211_STA_REQ_SCAN, &ifmgd->request))
2182 ieee80211_queue_delayed_work(&local->hw,
2183 &local->scan_work,
2184 round_jiffies_relative(0));
2185
2190 mutex_unlock(&ifmgd->mtx); 2186 mutex_unlock(&ifmgd->mtx);
2191 2187
2192 list_for_each_entry_safe(wk, tmp, &free_work, list) { 2188 list_for_each_entry_safe(wk, tmp, &free_work, list) {