Skip to content

Commit

Permalink
mac80211: advance the state machine immediately if no delay is needed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Helmut Schaa authored and John W. Linville committed Jul 27, 2009
1 parent 7d3be3c commit f502d09
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions net/mac80211/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f502d09

Please sign in to comment.