On 3/29/2024 2:34 PM, Jeff Johnson wrote:
On 3/27/2024 10:09 AM, Pradeep Kumar Chitrapu wrote:
Add support to set fixed HE rate/GI/LTF values using nl80211.
Reuse parts of the existing code path already used for HT/VHT
to implement the new helpers symmetrically, similar to how
HT/VHT is handled.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Co-developed-by: Muna Sinada <quic_msinada@xxxxxxxxxxx>
Signed-off-by: Muna Sinada <quic_msinada@xxxxxxxxxxx>
Signed-off-by: Pradeep Kumar Chitrapu <quic_pradeepc@xxxxxxxxxxx>
---
drivers/net/wireless/ath/ath12k/mac.c | 588 ++++++++++++++++++++++++--
drivers/net/wireless/ath/ath12k/wmi.h | 18 +
2 files changed, 562 insertions(+), 44 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 46ef2d63a3de..72232285d2b1 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
[...]
@@ -3888,8 +4130,9 @@ static void ath12k_sta_rc_update_wk(struct work_struct *wk)
mutex_lock(&ar->conf_mutex);
nss = max_t(u32, 1, nss);
- nss = min(nss, max(ath12k_mac_max_ht_nss(ht_mcs_mask),
- ath12k_mac_max_vht_nss(vht_mcs_mask)));
+ nss = min(nss, max3(ath12k_mac_max_ht_nss(ht_mcs_mask),
+ ath12k_mac_max_vht_nss(vht_mcs_mask),
+ ath12k_mac_max_he_nss(he_mcs_mask)));
When I run this entire series through ath12k-check I'm getting the following
issue here:
drivers/net/wireless/ath/ath12k/mac.c:4170:15: error: too long token expansion
drivers/net/wireless/ath/ath12k/mac.c:4170:15: error: too long token expansion
caeed0eb7fb4d (Pradeep Kumar Chitrapu 2024-03-27 10:09:07 -0700 4170) nss = min(nss, max3(ath12k_mac_max_ht_nss(ht_mcs_mask),
I don't see anything wrong with the code.
Even stranger is that when this series is in place, I see this same issue at
another place:
drivers/net/wireless/ath/ath12k/mac.c:7903:23: error: too long token expansion
drivers/net/wireless/ath/ath12k/mac.c:7903:23: error: too long token expansion
But that is actually pre-existing code from the original ath12k driver drop:
d889913205cf7 (Kalle Valo 2022-11-28 17:09:53 +0200 7903) nss = min_t(u32, ar->num_tx_chains,
And the issue is not flagged when this series is not present.
However that same logic also caused the same issue in ath11k, and Kalle fixed
it there with:
https://lore.kernel.org/all/20231214161740.1582340-1-kvalo@xxxxxxxxxx/
And one of the MediaTek drivers encountered a similar issue here:
https://lore.kernel.org/all/5457b92e41909dd75ab3db7a0e9ec372b917a386.1710858172.git.lorenzo@xxxxxxxxxx/
So there is definitely a tooling issue here.
As a local test I added an intermediate step and now I don't see the issue
here:
- u32 changed, bw, nss, smps, bw_prev;
+ u32 changed, bw, nss, mac_nss, smps, bw_prev;
...
- nss = min(nss, max3(ath12k_mac_max_ht_nss(ht_mcs_mask),
- ath12k_mac_max_vht_nss(vht_mcs_mask),
- ath12k_mac_max_he_nss(he_mcs_mask)));
+ mac_nss = max3(ath12k_mac_max_ht_nss(ht_mcs_mask),
+ ath12k_mac_max_vht_nss(vht_mcs_mask),
+ ath12k_mac_max_he_nss(he_mcs_mask));
+ nss = min(nss, mac_nss);
So let's add something like that in v3 (perhaps pick a better name)
(Even with this I still see the other issue from the original driver drop so
we may need to separately propagate the ath11k driver change to ath12k).
/jeff
Sure Jeff, thanks for the details..will address in next revision