diff options
author | Helmut Schaa <helmut.schaa@googlemail.com> | 2009-07-23 12:13:48 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-27 15:24:16 -0400 |
commit | f502d09b750437a4ec9c63333acf1070fe7958af (patch) | |
tree | a15742067ed116f4404982159e3a05dc7899c28f /net/mac80211/scan.c | |
parent | 7d3be3cc489176bc7bd23e673b0b4aef597af2b3 (diff) | |
download | lwn-f502d09b750437a4ec9c63333acf1070fe7958af.tar.gz lwn-f502d09b750437a4ec9c63333acf1070fe7958af.zip |
mac80211: advance the state machine immediately if no delay is needed
Instead of queueing the scan work again without delay just process the
next state immediately.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/scan.c')
-rw-r--r-- | net/mac80211/scan.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 71500f1dddbc..db122e4e60e5 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -587,15 +587,21 @@ void ieee80211_scan_work(struct work_struct *work) return; } - switch (local->scan_state) { - case SCAN_SET_CHANNEL: - if (ieee80211_scan_state_set_channel(local, &next_delay)) - return; - break; - case SCAN_SEND_PROBE: - ieee80211_scan_state_send_probe(local, &next_delay); - break; - } + /* + * as long as no delay is required advance immediately + * without scheduling a new work + */ + do { + switch (local->scan_state) { + case SCAN_SET_CHANNEL: + if (ieee80211_scan_state_set_channel(local, &next_delay)) + return; + break; + case SCAN_SEND_PROBE: + ieee80211_scan_state_send_probe(local, &next_delay); + break; + } + } while (next_delay == 0); queue_delayed_work(local->hw.workqueue, &local->scan_work, next_delay); |