mac80211: ath11k: sync with ath-next
[openwrt/staging/jow.git] / package / kernel / mac80211 / patches / ath11k / 0054-wifi-ath11k-Send-11d-scan-start-before-WMI_START_SCA.patch
1 From e89a51aedf380bc60219dc9afa96c36507060fb3 Mon Sep 17 00:00:00 2001
2 From: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>
3 Date: Wed, 15 Mar 2023 21:48:17 +0530
4 Subject: [PATCH] wifi: ath11k: Send 11d scan start before WMI_START_SCAN_CMDID
5
6 Firmwares advertising the support of triggering 11d algorithm on the
7 scan results of a regular scan expects driver to send
8 WMI_11D_SCAN_START_CMDID before sending WMI_START_SCAN_CMDID.
9 Triggering 11d algorithm on the scan results of a normal scan helps
10 in completely avoiding a separate 11d scan for determining regdomain.
11 This indirectly helps in speeding up connections on station
12 interfaces on the chipsets supporting 11D scan.
13
14 To enable this feature, send WMI_11D_SCAN_START_CMDID just before
15 sending WMI_START_SCAN_CMDID if the firmware advertises
16 WMI_TLV_SERVICE_SUPPORT_11D_FOR_HOST_SCAN service flag.
17
18 WCN6750 & WCN6855 supports this feature.
19
20 Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-01160-QCAMSLSWPLZ-1
21 Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
22
23 Signed-off-by: Manikanta Pubbisetty <quic_mpubbise@quicinc.com>
24 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
25 Link: https://lore.kernel.org/r/20230315161817.29627-1-quic_mpubbise@quicinc.com
26 ---
27 drivers/net/wireless/ath/ath11k/mac.c | 12 ++++++++++++
28 drivers/net/wireless/ath/ath11k/wmi.h | 1 +
29 2 files changed, 13 insertions(+)
30
31 --- a/drivers/net/wireless/ath/ath11k/mac.c
32 +++ b/drivers/net/wireless/ath/ath11k/mac.c
33 @@ -3755,6 +3755,18 @@ static int ath11k_mac_op_hw_scan(struct
34 int i;
35 u32 scan_timeout;
36
37 + /* Firmwares advertising the support of triggering 11D algorithm
38 + * on the scan results of a regular scan expects driver to send
39 + * WMI_11D_SCAN_START_CMDID before sending WMI_START_SCAN_CMDID.
40 + * With this feature, separate 11D scan can be avoided since
41 + * regdomain can be determined with the scan results of the
42 + * regular scan.
43 + */
44 + if (ar->state_11d == ATH11K_11D_PREPARING &&
45 + test_bit(WMI_TLV_SERVICE_SUPPORT_11D_FOR_HOST_SCAN,
46 + ar->ab->wmi_ab.svc_map))
47 + ath11k_mac_11d_scan_start(ar, arvif->vdev_id);
48 +
49 mutex_lock(&ar->conf_mutex);
50
51 spin_lock_bh(&ar->data_lock);
52 --- a/drivers/net/wireless/ath/ath11k/wmi.h
53 +++ b/drivers/net/wireless/ath/ath11k/wmi.h
54 @@ -2103,6 +2103,7 @@ enum wmi_tlv_service {
55 WMI_TLV_SERVICE_SCAN_CONFIG_PER_CHANNEL = 265,
56 WMI_TLV_SERVICE_REG_CC_EXT_EVENT_SUPPORT = 281,
57 WMI_TLV_SERVICE_BIOS_SAR_SUPPORT = 326,
58 + WMI_TLV_SERVICE_SUPPORT_11D_FOR_HOST_SCAN = 357,
59
60 /* The third 128 bits */
61 WMI_MAX_EXT2_SERVICE = 384