1 From ebf82988f844dd98e6b007cffcc5e95986056995 Mon Sep 17 00:00:00 2001
2 From: Muna Sinada <quic_msinada@quicinc.com>
3 Date: Fri, 24 Feb 2023 12:28:04 +0200
4 Subject: [PATCH] wifi: ath11k: generate rx and tx mcs maps for supported HE
7 Generate rx and tx mcs maps in ath11k_mac_set_hemcsmap() and set them
8 in supported mcs/nss for HE capabilities.
10 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1
12 Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
13 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
14 Link: https://lore.kernel.org/r/1666128501-12364-5-git-send-email-quic_msinada@quicinc.com
16 drivers/net/wireless/ath/ath11k/mac.c | 30 ++++++++++++++++++++-------
17 1 file changed, 23 insertions(+), 7 deletions(-)
19 --- a/drivers/net/wireless/ath/ath11k/mac.c
20 +++ b/drivers/net/wireless/ath/ath11k/mac.c
21 @@ -5488,20 +5488,36 @@ static void ath11k_mac_set_hemcsmap(stru
22 struct ieee80211_sta_he_cap *he_cap,
25 - struct ath11k_band_cap *band_cap = &cap->band[band];
26 + u16 txmcs_map, rxmcs_map;
31 + for (i = 0; i < 8; i++) {
32 + if (i < ar->num_tx_chains &&
33 + (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
34 + txmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
36 + txmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
38 + if (i < ar->num_rx_chains &&
39 + (ar->cfg_rx_chainmask >> cap->tx_chain_mask_shift) & BIT(i))
40 + rxmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2);
42 + rxmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2);
44 he_cap->he_mcs_nss_supp.rx_mcs_80 =
45 - cpu_to_le16(band_cap->he_mcs & 0xffff);
46 + cpu_to_le16(rxmcs_map & 0xffff);
47 he_cap->he_mcs_nss_supp.tx_mcs_80 =
48 - cpu_to_le16(band_cap->he_mcs & 0xffff);
49 + cpu_to_le16(txmcs_map & 0xffff);
50 he_cap->he_mcs_nss_supp.rx_mcs_160 =
51 - cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
52 + cpu_to_le16(rxmcs_map & 0xffff);
53 he_cap->he_mcs_nss_supp.tx_mcs_160 =
54 - cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
55 + cpu_to_le16(txmcs_map & 0xffff);
56 he_cap->he_mcs_nss_supp.rx_mcs_80p80 =
57 - cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
58 + cpu_to_le16(rxmcs_map & 0xffff);
59 he_cap->he_mcs_nss_supp.tx_mcs_80p80 =
60 - cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
61 + cpu_to_le16(txmcs_map & 0xffff);
64 static int ath11k_mac_copy_he_cap(struct ath11k *ar,