From: Jui-Peng Tsai Date: Tue, 21 Oct 2025 13:34:02 +0000 (+0800) Subject: wifi: rtw89: improve scan time on 6 GHz band X-Git-Tag: v6.19-rc1~170^2~33^2~10^2~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a62b654125068a69b7c459ba59526ebd9882f405;p=thirdparty%2Flinux.git wifi: rtw89: improve scan time on 6 GHz band 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 Signed-off-by: Ping-Ke Shih Link: https://patch.msgid.link/20251021133402.15467-9-pkshih@realtek.com --- diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c index 9a926bb2cf000..cb431c8a65acd 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.c +++ b/drivers/net/wireless/realtek/rtw89/fw.c @@ -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;