bca08b177fd11cba594ee25108f08b843866014f
[librecmc/librecmc.git] /
1 From 813968c24126cc5c8320cd5db0e262069a535063 Mon Sep 17 00:00:00 2001
2 From: Ganesh Babu Jothiram <quic_gjothira@quicinc.com>
3 Date: Fri, 24 Mar 2023 16:57:00 +0200
4 Subject: [PATCH] wifi: ath11k: Configure the FTM responder role using firmware
5  capability flag
6
7 Fine Time Measurement(FTM) is offloaded feature to firmware.
8 Hence, the configuration of FTM responder role is done using
9 firmware capability flag instead of hw param.
10
11 Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
12
13 Signed-off-by: Ganesh Babu Jothiram <quic_gjothira@quicinc.com>
14 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
15 Link: https://lore.kernel.org/r/20230317072034.8217-1-quic_gjothira@quicinc.com
16 ---
17  drivers/net/wireless/ath/ath11k/core.c | 8 --------
18  drivers/net/wireless/ath/ath11k/hw.h   | 1 -
19  drivers/net/wireless/ath/ath11k/mac.c  | 4 ++--
20  3 files changed, 2 insertions(+), 11 deletions(-)
21
22 --- a/drivers/net/wireless/ath/ath11k/core.c
23 +++ b/drivers/net/wireless/ath/ath11k/core.c
24 @@ -116,7 +116,6 @@ static const struct ath11k_hw_params ath
25                 .tcl_ring_retry = true,
26                 .tx_ring_size = DP_TCL_DATA_RING_SIZE,
27                 .smp2p_wow_exit = false,
28 -               .ftm_responder = true,
29         },
30         {
31                 .hw_rev = ATH11K_HW_IPQ6018_HW10,
32 @@ -199,7 +198,6 @@ static const struct ath11k_hw_params ath
33                 .tx_ring_size = DP_TCL_DATA_RING_SIZE,
34                 .smp2p_wow_exit = false,
35                 .support_fw_mac_sequence = false,
36 -               .ftm_responder = true,
37         },
38         {
39                 .name = "qca6390 hw2.0",
40 @@ -284,7 +282,6 @@ static const struct ath11k_hw_params ath
41                 .tx_ring_size = DP_TCL_DATA_RING_SIZE,
42                 .smp2p_wow_exit = false,
43                 .support_fw_mac_sequence = true,
44 -               .ftm_responder = false,
45         },
46         {
47                 .name = "qcn9074 hw1.0",
48 @@ -366,7 +363,6 @@ static const struct ath11k_hw_params ath
49                 .tx_ring_size = DP_TCL_DATA_RING_SIZE,
50                 .smp2p_wow_exit = false,
51                 .support_fw_mac_sequence = false,
52 -               .ftm_responder = true,
53         },
54         {
55                 .name = "wcn6855 hw2.0",
56 @@ -451,7 +447,6 @@ static const struct ath11k_hw_params ath
57                 .tx_ring_size = DP_TCL_DATA_RING_SIZE,
58                 .smp2p_wow_exit = false,
59                 .support_fw_mac_sequence = true,
60 -               .ftm_responder = false,
61         },
62         {
63                 .name = "wcn6855 hw2.1",
64 @@ -534,7 +529,6 @@ static const struct ath11k_hw_params ath
65                 .tx_ring_size = DP_TCL_DATA_RING_SIZE,
66                 .smp2p_wow_exit = false,
67                 .support_fw_mac_sequence = true,
68 -               .ftm_responder = false,
69         },
70         {
71                 .name = "wcn6750 hw1.0",
72 @@ -615,7 +609,6 @@ static const struct ath11k_hw_params ath
73                 .tx_ring_size = DP_TCL_DATA_RING_SIZE_WCN6750,
74                 .smp2p_wow_exit = true,
75                 .support_fw_mac_sequence = true,
76 -               .ftm_responder = false,
77         },
78         {
79                 .hw_rev = ATH11K_HW_IPQ5018_HW10,
80 @@ -695,7 +688,6 @@ static const struct ath11k_hw_params ath
81                 .tx_ring_size = DP_TCL_DATA_RING_SIZE,
82                 .smp2p_wow_exit = false,
83                 .support_fw_mac_sequence = false,
84 -               .ftm_responder = true,
85         },
86  };
87  
88 --- a/drivers/net/wireless/ath/ath11k/hw.h
89 +++ b/drivers/net/wireless/ath/ath11k/hw.h
90 @@ -224,7 +224,6 @@ struct ath11k_hw_params {
91         u32 tx_ring_size;
92         bool smp2p_wow_exit;
93         bool support_fw_mac_sequence;
94 -       bool ftm_responder;
95  };
96  
97  struct ath11k_hw_ops {
98 --- a/drivers/net/wireless/ath/ath11k/mac.c
99 +++ b/drivers/net/wireless/ath/ath11k/mac.c
100 @@ -3538,7 +3538,7 @@ static void ath11k_mac_op_bss_info_chang
101  
102         if (changed & BSS_CHANGED_FTM_RESPONDER &&
103             arvif->ftm_responder != info->ftm_responder &&
104 -           ar->ab->hw_params.ftm_responder &&
105 +           test_bit(WMI_TLV_SERVICE_RTT, ar->ab->wmi_ab.svc_map) &&
106             (vif->type == NL80211_IFTYPE_AP ||
107              vif->type == NL80211_IFTYPE_MESH_POINT)) {
108                 arvif->ftm_responder = info->ftm_responder;
109 @@ -9234,7 +9234,7 @@ static int __ath11k_mac_register(struct
110         wiphy_ext_feature_set(ar->hw->wiphy,
111                               NL80211_EXT_FEATURE_SET_SCAN_DWELL);
112  
113 -       if (ab->hw_params.ftm_responder)
114 +       if (test_bit(WMI_TLV_SERVICE_RTT, ar->ab->wmi_ab.svc_map))
115                 wiphy_ext_feature_set(ar->hw->wiphy,
116                                       NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER);
117