blob: f427d57a9d03f03ddb010652d55a0c97d81a2844 [file] [log] [blame]
From 25c868b6bd01c5881e26f7ee485c283396395d0c Mon Sep 17 00:00:00 2001
From: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>
Date: Thu, 3 Nov 2022 19:01:52 +0530
Subject: [PATCH] CHROMIUM: wifi: ath11k: Enable split scan functionality on
WCN6750
Currently, time taken to scan all supported channels on WCN6750
is ~8 seconds and connection time is almost 10 seconds. Such long
scan times on WCN6750 is attributed to the fact that WCN6750 supports
all three WiFi bands (i.e, 2.4/5/6 GHz) and the numbers of channels
for a default scan come around ~100 channels. Since the chip doesn't
have support for DBS (Dual Band Simultaneous), scans cannot be
parallelized ending up in longer scan times.
Enable split scan functionality on WCN6750 in order to improve the
overall scan time. Split scan feature helps in splitting the tri-band
scan (2.4/5/6 GHz) into two scans, one scan for legacy 2.4/5 GHz and
another scan for 6 GHz. This along with NL80211_SCAN_FLAG_COLOCATED_6GHZ
flag helps drastically improve the scan times because the 6 GHz scan will
happen only on PSC channels and on the channels where RNR IE is found
in the first 2.4/5 GHz scan.
If NL80211_SCAN_FLAG_COLOCATED_6GHZ is not set in the scan flags,
then scan will happen on all supported channels(default behaviour).
With the split scan feature enabled, scan time got improved by ~2
seconds.
Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
Signed-off-by: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>
BUG=b:243706684, b:236281081
TEST=test_that $DUT suite:wifi_matfunc; # with subsequent dts changes,
saw test failures reduced from 9 to 3 on one DUT.
TEST=test manually that hoglin can still connect to 6GHz channels.
TEST=minijail0 -u wpa -g wpa -c 3000 -n `which wpa_cli` -i wlan0 \
In wpa_cli, run scan; scan passive=1; and scan legacy bands \
scan time is reduced by more than 2 seconds.
UPSTREAM-TASK=b:256181359
Signed-off-by: Jun Yu <junyuu@chromium.org>
Change-Id: I847ace5ffe90102cc2ca8748a8f43966e0b0eb36
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/3989050
Reviewed-by: Abhishek Kumar <kuabhs@chromium.org>
Reviewed-by: Matthew Wang <matthewmwang@chromium.org>
---
drivers/net/wireless/ath/ath11k/core.c | 7 +++++++
drivers/net/wireless/ath/ath11k/hw.h | 1 +
drivers/net/wireless/ath/ath11k/mac.c | 16 ++++++++++++++--
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index 4d3c1e44c5a816d80426ade21a79861a4cc28a5d..fb2f443a6a9b6fed39be7769e261a22e03b53c2c 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -117,6 +117,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.tx_ring_size = DP_TCL_DATA_RING_SIZE,
.smp2p_wow_exit = false,
.ftm_responder = true,
+ .split_scan = false,
},
{
.hw_rev = ATH11K_HW_IPQ6018_HW10,
@@ -200,6 +201,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.smp2p_wow_exit = false,
.support_fw_mac_sequence = false,
.ftm_responder = true,
+ .split_scan = false,
},
{
.name = "qca6390 hw2.0",
@@ -285,6 +287,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.smp2p_wow_exit = false,
.support_fw_mac_sequence = true,
.ftm_responder = false,
+ .split_scan = false,
},
{
.name = "qcn9074 hw1.0",
@@ -367,6 +370,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.smp2p_wow_exit = false,
.support_fw_mac_sequence = false,
.ftm_responder = true,
+ .split_scan = false,
},
{
.name = "wcn6855 hw2.0",
@@ -452,6 +456,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.smp2p_wow_exit = false,
.support_fw_mac_sequence = true,
.ftm_responder = false,
+ .split_scan = false,
},
{
.name = "wcn6855 hw2.1",
@@ -535,6 +540,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.smp2p_wow_exit = false,
.support_fw_mac_sequence = true,
.ftm_responder = false,
+ .split_scan = false,
},
{
.name = "wcn6750 hw1.0",
@@ -616,6 +622,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.smp2p_wow_exit = true,
.support_fw_mac_sequence = true,
.ftm_responder = false,
+ .split_scan = false,
},
{
.hw_rev = ATH11K_HW_IPQ5018_HW10,
diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h
index 0be4e12323842b7d4f9f5aa11545c553594e72a6..86dac632c4b27669ecbaef761a91496a06a73cd6 100644
--- a/drivers/net/wireless/ath/ath11k/hw.h
+++ b/drivers/net/wireless/ath/ath11k/hw.h
@@ -225,6 +225,7 @@ struct ath11k_hw_params {
bool smp2p_wow_exit;
bool support_fw_mac_sequence;
bool ftm_responder;
+ bool split_scan;
};
struct ath11k_hw_ops {
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 183590983abcab902edb182fd73a2ea171c35292..13c757ed66cbe2c6317d0a268e13e9df7c0e9d49 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -3749,8 +3749,17 @@ static int ath11k_mac_op_hw_scan(struct ieee80211_hw *hw,
mutex_unlock(&ar->conf_mutex);
- if (ar->state_11d == ATH11K_11D_PREPARING)
+ if (ar->state_11d == ATH11K_11D_PREPARING) {
+ /* When split scan feature is enabled, start 11d scan only after
+ * the 6 GHz scan. Otherwise, the second scan with 6 GHz channels
+ * will get delayed and there is a chance of scan timing out due
+ * to ongoing 11d scan.
+ */
+ if (ar->hw->wiphy->flags & WIPHY_FLAG_SPLIT_SCAN_6GHZ && !req->scan_6ghz)
+ return ret;
+
ath11k_mac_11d_scan_start(ar, arvif->vdev_id);
+ }
return ret;
}
@@ -8994,8 +9003,11 @@ static int __ath11k_mac_register(struct ath11k *ar)
ar->hw->wiphy->interface_modes = ab->hw_params.interface_modes;
- if (ab->hw_params.single_pdev_only && ar->supports_6ghz)
+ if (ab->hw_params.single_pdev_only && ar->supports_6ghz) {
ieee80211_hw_set(ar->hw, SINGLE_SCAN_ON_ALL_BANDS);
+ if (ab->hw_params.split_scan)
+ ar->hw->wiphy->flags |= WIPHY_FLAG_SPLIT_SCAN_6GHZ;
+ }
if (ab->hw_params.supports_multi_bssid) {
ieee80211_hw_set(ar->hw, SUPPORTS_MULTI_BSSID);
--
2.34.1