]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Allow more time for the initial scan with 6 GHz
authorJouni Malinen <quic_jouni@quicinc.com>
Thu, 28 Jul 2022 13:40:05 +0000 (16:40 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 28 Jul 2022 13:40:05 +0000 (16:40 +0300)
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>
src/drivers/driver_nl80211.h
src/drivers/driver_nl80211_capa.c
src/drivers/driver_nl80211_scan.c

index 18da94a7609fc4de27bdb264de93cb209d2c1516..6e40d555673ae9af786fc2f8b44f0ea826b117d3 100644 (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;
index 739be32a9f0e991d96c0eb7c688a80dce6e3ed83..7ede0d030af8754f0ae65cc55092128f957a83a1 100644 (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;
        }
 
index c31ed6eb1248645b44ca9ed4836358a456caa39b..d54dd3a33e7980d16a1d36ee42ac3553a039cbd8 100644 (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