1
0

0040-wifi-ath11k-move-HE-MCS-mapper-to-a-separate-functio.patch 2.5 KB

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