Commit 99c84cb0 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

mac80211: improve scan timing

The call to ieee80211_hw_config() is supposed to apply changes
synchronously, so once it returns the parameters are applied to
the hardware. Thus, there really is no need to delay the probing
by the channel switch time again since the channel switch has
already happened once we get to this code.

Additionally, there is no need to wait for a NAV update (probe
delay) when the channel is passively scanned. Remove that extra
time too.

This cuts scanning time from over 7 seconds to under 4 on ar9170,
which is due to the number of channels scanned and ar9170's switch
time being advertised as 135ms (my test now indicates it is about
77ms with the current driver, but the difference might also be due
to using a different machine with different USB controllers).
Signed-off-by: default avatarJohannes Berg <>
Signed-off-by: default avatarJohn W. Linville <>
parent f2ca3ea4
......@@ -559,24 +559,39 @@ void ieee80211_scan_work(struct work_struct *work)
if (skip)
next_delay = IEEE80211_PROBE_DELAY +
* Probe delay is used to update the NAV, cf.
* (which unfortunately doesn't say _why_ step a) is done,
* but it waits for the probe delay or until a frame is
* received - and the received frame would update the NAV).
* For now, we do not support waiting until a frame is
* received.
* In any case, it is not necessary for a passive scan.
if (chan->flags & IEEE80211_CHAN_PASSIVE_SCAN ||
!local->scan_req->n_ssids) {
next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
next_delay = IEEE80211_PROBE_DELAY;
local->scan_state = SCAN_SEND_PROBE;
next_delay = IEEE80211_PASSIVE_CHANNEL_TIME;
local->scan_state = SCAN_SET_CHANNEL;
if (local->scan_channel->flags & IEEE80211_CHAN_PASSIVE_SCAN ||
for (i = 0; i < local->scan_req->n_ssids; i++)
sdata, NULL,
local->scan_req->ie, local->scan_req->ie_len);
* After sending probe requests, wait for probe responses
* on the channel.
next_delay = IEEE80211_CHANNEL_TIME;
local->scan_state = SCAN_SET_CHANNEL;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment