]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Increase the hard scan timeout for initial attempt
authorJouni Malinen <quic_jouni@quicinc.com>
Fri, 26 Jan 2024 10:26:36 +0000 (12:26 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 26 Jan 2024 10:26:36 +0000 (12:26 +0200)
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 <quic_jouni@quicinc.com>
src/drivers/driver_nl80211.h
src/drivers/driver_nl80211_capa.c
src/drivers/driver_nl80211_scan.c

index 845603256ebfc169baa069f609a9d229525170ac..8bb70ecfc620701cdd22b540be85b15647a70bf9 100644 (file)
@@ -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;
index d223cc69397f974e093b4a8e7ec2d09e410a92e7..59f1414acf6f6765011e37bcf7247365b5253742 100644 (file)
@@ -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) ?
index b9c317d4d94125ee10886e7aab01bdbfcdb5c5ab..68ae5799c60846a8c05bfae34ad9b630b71447ee 100644 (file)
@@ -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