From 16a22ef340479bbb0b1da70a67185add7cea40ea Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 26 Jan 2024 12:26:36 +0200 Subject: [PATCH] nl80211: Increase the hard scan timeout for initial attempt If both 6 GHz and S1G channels are included, the previously used timeout was not long enough at least with mac80211_hwsim. Increase the initial timeout to allow such a scan to be completed. Signed-off-by: Jouni Malinen --- src/drivers/driver_nl80211.h | 1 + src/drivers/driver_nl80211_capa.c | 2 ++ src/drivers/driver_nl80211_scan.c | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h index 845603256..8bb70ecfc 100644 --- a/src/drivers/driver_nl80211.h +++ b/src/drivers/driver_nl80211.h @@ -197,6 +197,7 @@ struct wpa_driver_nl80211_data { unsigned int qca_do_acs:1; unsigned int brcm_do_acs:1; unsigned int uses_6ghz:1; + unsigned int uses_s1g:1; unsigned int secure_ranging_ctx_vendor_cmd_avail:1; unsigned int puncturing:1; unsigned int qca_ap_allowed_freqs:1; diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index d223cc693..59f1414ac 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -2579,6 +2579,8 @@ static void nl80211_dump_chan_list(struct wpa_driver_nl80211_data *drv, if (is_6ghz_freq(chan->freq)) drv->uses_6ghz = true; + if (chan->freq >= 900 && chan->freq < 1000) + drv->uses_s1g = true; res = os_snprintf(pos, end - pos, " %d%s%s%s", chan->freq, (chan->flag & HOSTAPD_CHAN_DISABLED) ? diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c index b9c317d4d..68ae5799c 100644 --- a/src/drivers/driver_nl80211_scan.c +++ b/src/drivers/driver_nl80211_scan.c @@ -427,7 +427,9 @@ 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 = drv->uses_6ghz ? 15 : 10; + timeout = drv->uses_6ghz ? 20 : 10; + if (drv->uses_s1g) + timeout += 5; if (drv->scan_complete_events) { /* * The driver seems to deliver events to notify when scan is