From 133cf7fa27a4190856b21aa14c72f40569306957 Mon Sep 17 00:00:00 2001 From: Gokul Sivakumar Date: Wed, 3 Jan 2024 09:01:30 -0600 Subject: [PATCH 201/296] brcmfmac: enable support for split scan to optimize triband scan duration When the chip supports 2GHz, 5GHz and 6GHz bands, let cfg80211 trigger scan on the legacy band 2GHz, 5GHz channels first, followed up with a second scan dedicated for 6GHz channels. This would help cfg80211 to parse the RNR IE in the scan results from legacy bands and find the colocted 6GHz AP channels even before triggering the scan on 6GHz band. Now if userspace triggers a SCAN request to cfg80211, with the nl80211 flag NL80211_SCAN_FLAG_COLOCATED_6GHZ, cfg80211 triggers the second 6GHz scan only with 15 PSC channels + non-PSC channels from legacy band scan results. So cfg80211 doesn't have to scan all the non-PSC 6GHz channels except the colocated 6GHz AP channels, effectively reducing the overall triband scan duration. A Standalone 6GHz AP can operate in a non-PSC channel while not colocated with a 2GHz or 5GHz AP, even though this is not recommended. But the STA doing the split scan + colocated scan may not discover it. If userspace triggers a scan request to cfg80211, without the nl80211 flag NL80211_SCAN_FLAG_COLOCATED_6GHZ, cfg80211 triggers the seconds 6Ghz scan with all PSC + non-PSC channels. So the effective triband scan duration is more than the other case. But Standalone 6GHz APs operating in a non-PSC channel could be discovered by the STA. Signed-off-by: Gokul Sivakumar --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 2a048fe28b26..044894c9045e 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -9592,7 +9592,9 @@ static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) WIPHY_FLAG_PS_ON_BY_DEFAULT | WIPHY_FLAG_HAVE_AP_SME | WIPHY_FLAG_OFFCHAN_TX | - WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; + WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL | + WIPHY_FLAG_SPLIT_SCAN_6GHZ; + if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_TDLS)) wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS; if (!ifp->drvr->settings->roamoff) -- 2.25.1