nl80211: Allow more time for the initial scan with 6 GHz

The initial timeout of 10 seconds for the first scan before knowing
whether the driver reports scan completion events may not be sufficient
in cases where the driver ends up scanning a large number of channels.
In particular, this could be hit with 6 GHz support. Increase this
timeout when the driver indicates support for 6 GHz channels.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
Jouni Malinen 2022-07-28 16:40:05 +03:00 committed by Jouni Malinen
parent ac9e6a2ab3
commit 1d08b238cb
3 changed files with 8 additions and 3 deletions

View file

@ -180,6 +180,7 @@ struct wpa_driver_nl80211_data {
unsigned int unsol_bcast_probe_resp:1;
unsigned int qca_do_acs:1;
unsigned int brcm_do_acs:1;
unsigned int uses_6ghz:1;
u64 vendor_scan_cookie;
u64 remain_on_chan_cookie;

View file

@ -2475,7 +2475,8 @@ static const char * modestr(enum hostapd_hw_mode mode)
}
static void nl80211_dump_chan_list(struct hostapd_hw_modes *modes,
static void nl80211_dump_chan_list(struct wpa_driver_nl80211_data *drv,
struct hostapd_hw_modes *modes,
u16 num_modes)
{
int i;
@ -2493,6 +2494,9 @@ static void nl80211_dump_chan_list(struct hostapd_hw_modes *modes,
for (j = 0; j < mode->num_channels; j++) {
struct hostapd_channel_data *chan = &mode->channels[j];
if (chan->freq >= 5925 && chan->freq <= 7125 &&
!(chan->flag & HOSTAPD_CHAN_DISABLED))
drv->uses_6ghz = true;
res = os_snprintf(pos, end - pos, " %d%s%s%s",
chan->freq,
(chan->flag & HOSTAPD_CHAN_DISABLED) ?
@ -2564,7 +2568,7 @@ nl80211_get_hw_feature_data(void *priv, u16 *num_modes, u16 *flags,
modes = wpa_driver_nl80211_postprocess_modes(result.modes,
num_modes);
nl80211_dump_chan_list(modes, *num_modes);
nl80211_dump_chan_list(drv, modes, *num_modes);
return modes;
}

View file

@ -412,7 +412,7 @@ int wpa_driver_nl80211_scan(struct i802_bss *bss,
drv->scan_state = SCAN_REQUESTED;
/* Not all drivers generate "scan completed" wireless event, so try to
* read results after a timeout. */
timeout = 10;
timeout = drv->uses_6ghz ? 15 : 10;
if (drv->scan_complete_events) {
/*
* The driver seems to deliver events to notify when scan is