]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw89: improve scan time on 6 GHz band
authorJui-Peng Tsai <emma_tsai@realtek.com>
Tue, 21 Oct 2025 13:34:02 +0000 (21:34 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Tue, 28 Oct 2025 01:52:57 +0000 (09:52 +0800)
Reduce scan time for all supported channels from 4.4s to 3.5s.

If NL80211_SCAN_FLAG_COLOCATED_6GHZ is set in scan request, only scan PSC
channels and the channels from the RNR element found on the 2.4/5 GHz
channels. When firmware support parsing RNR element from received beacon
or probe response, offload the decision about non-PSC channels to firmware.
Driver do not need to fill non-PSC channels to scan list. If
NL80211_SCAN_FLAG_COLOCATED_6GHZ is not set, scan all supported channels.

Signed-off-by: Jui-Peng Tsai <emma_tsai@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20251021133402.15467-9-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/fw.c

index 9a926bb2cf0005dfbc029c99844256d38cab6437..cb431c8a65acdc153fe8f925d474fcd5463d9479 100644 (file)
@@ -7787,15 +7787,23 @@ int rtw89_hw_scan_prep_chan_list_be(struct rtw89_dev *rtwdev,
        struct ieee80211_channel *channel;
        struct list_head chan_list;
        enum rtw89_chan_type type;
+       bool chan_by_rnr;
        bool random_seq;
        int ret;
        u32 idx;
 
        random_seq = !!(req->flags & NL80211_SCAN_FLAG_RANDOM_SN);
+       chan_by_rnr = rtwdev->chip->support_rnr &&
+                     (req->flags & NL80211_SCAN_FLAG_COLOCATED_6GHZ);
        INIT_LIST_HEAD(&chan_list);
 
        for (idx = 0; idx < req->n_channels; idx++) {
                channel = req->channels[idx];
+
+               if (channel->band == NL80211_BAND_6GHZ &&
+                   !cfg80211_channel_is_psc(channel) && chan_by_rnr)
+                       continue;
+
                ch_info = kzalloc(sizeof(*ch_info), GFP_KERNEL);
                if (!ch_info) {
                        ret = -ENOMEM;