mac80211: ath11k: sync with ath-next
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / ath11k / 0040-wifi-ath11k-move-HE-MCS-mapper-to-a-separate-functio.patch
1 From 8077c1bbbc28e527fb29143c46f32c6a9d6cadf0 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: move HE MCS mapper to a separate function
5
6 Move HE MCS mapper to a separate function and call new function
7 in ath11k_mac_copy_he_cap().
8
9 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00356-QCAHKSWPL_SILICONZ-1
10
11 Signed-off-by: Muna Sinada <quic_msinada@quicinc.com>
12 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
13 Link: https://lore.kernel.org/r/1666128501-12364-4-git-send-email-quic_msinada@quicinc.com
14 ---
15 drivers/net/wireless/ath/ath11k/mac.c | 34 +++++++++++++++++----------
16 1 file changed, 22 insertions(+), 12 deletions(-)
17
18 --- a/drivers/net/wireless/ath/ath11k/mac.c
19 +++ b/drivers/net/wireless/ath/ath11k/mac.c
20 @@ -5483,6 +5483,27 @@ static __le16 ath11k_mac_setup_he_6ghz_c
21 return cpu_to_le16(bcap->he_6ghz_capa);
22 }
23
24 +static void ath11k_mac_set_hemcsmap(struct ath11k *ar,
25 + struct ath11k_pdev_cap *cap,
26 + struct ieee80211_sta_he_cap *he_cap,
27 + int band)
28 +{
29 + struct ath11k_band_cap *band_cap = &cap->band[band];
30 +
31 + he_cap->he_mcs_nss_supp.rx_mcs_80 =
32 + cpu_to_le16(band_cap->he_mcs & 0xffff);
33 + he_cap->he_mcs_nss_supp.tx_mcs_80 =
34 + cpu_to_le16(band_cap->he_mcs & 0xffff);
35 + he_cap->he_mcs_nss_supp.rx_mcs_160 =
36 + cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
37 + he_cap->he_mcs_nss_supp.tx_mcs_160 =
38 + cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
39 + he_cap->he_mcs_nss_supp.rx_mcs_80p80 =
40 + cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
41 + he_cap->he_mcs_nss_supp.tx_mcs_80p80 =
42 + cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
43 +}
44 +
45 static int ath11k_mac_copy_he_cap(struct ath11k *ar,
46 struct ath11k_pdev_cap *cap,
47 struct ieee80211_sband_iftype_data *data,
48 @@ -5544,18 +5565,7 @@ static int ath11k_mac_copy_he_cap(struct
49 break;
50 }
51
52 - he_cap->he_mcs_nss_supp.rx_mcs_80 =
53 - cpu_to_le16(band_cap->he_mcs & 0xffff);
54 - he_cap->he_mcs_nss_supp.tx_mcs_80 =
55 - cpu_to_le16(band_cap->he_mcs & 0xffff);
56 - he_cap->he_mcs_nss_supp.rx_mcs_160 =
57 - cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
58 - he_cap->he_mcs_nss_supp.tx_mcs_160 =
59 - cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
60 - he_cap->he_mcs_nss_supp.rx_mcs_80p80 =
61 - cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
62 - he_cap->he_mcs_nss_supp.tx_mcs_80p80 =
63 - cpu_to_le16((band_cap->he_mcs >> 16) & 0xffff);
64 + ath11k_mac_set_hemcsmap(ar, cap, he_cap, band);
65
66 memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres));
67 if (he_cap_elem->phy_cap_info[6] &