1
0

0041-wifi-ath11k-generate-rx-and-tx-mcs-maps-for-supporte.patch 2.3 KB

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