0078-wifi-ath11k-Relocate-the-func-ath11k_mac_bitrate_mas.patch 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. From 570eec3d40505c30babbe3b8f85a38496c975ab2 Mon Sep 17 00:00:00 2001
  2. From: Maharaja Kennadyrajan <quic_mkenna@quicinc.com>
  3. Date: Tue, 9 May 2023 20:07:23 +0300
  4. Subject: [PATCH] wifi: ath11k: Relocate the func
  5. ath11k_mac_bitrate_mask_num_ht_rates() and change hweight16 to hweight8
  6. Relocate the function ath11k_mac_bitrate_mask_num_ht_rates() definition
  7. to call this function from other functions which helps to avoid the
  8. compilation error (function not defined).
  9. ht_mcs[] is 1 byte array and it is enough to use hweight8() instead
  10. of hweight16(). Hence, fixed the same.
  11. Tested on: Compile tested only.
  12. Signed-off-by: Maharaja Kennadyrajan <quic_mkenna@quicinc.com>
  13. Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
  14. Link: https://lore.kernel.org/r/20230504092033.3542456-2-quic_mkenna@quicinc.com
  15. ---
  16. drivers/net/wireless/ath/ath11k/mac.c | 30 +++++++++++++--------------
  17. 1 file changed, 15 insertions(+), 15 deletions(-)
  18. --- a/drivers/net/wireless/ath/ath11k/mac.c
  19. +++ b/drivers/net/wireless/ath/ath11k/mac.c
  20. @@ -1,7 +1,7 @@
  21. // SPDX-License-Identifier: BSD-3-Clause-Clear
  22. /*
  23. * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
  24. - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  25. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  26. */
  27. #include <net/mac80211.h>
  28. @@ -4338,6 +4338,20 @@ exit:
  29. }
  30. static int
  31. +ath11k_mac_bitrate_mask_num_ht_rates(struct ath11k *ar,
  32. + enum nl80211_band band,
  33. + const struct cfg80211_bitrate_mask *mask)
  34. +{
  35. + int num_rates = 0;
  36. + int i;
  37. +
  38. + for (i = 0; i < ARRAY_SIZE(mask->control[band].ht_mcs); i++)
  39. + num_rates += hweight8(mask->control[band].ht_mcs[i]);
  40. +
  41. + return num_rates;
  42. +}
  43. +
  44. +static int
  45. ath11k_mac_bitrate_mask_num_vht_rates(struct ath11k *ar,
  46. enum nl80211_band band,
  47. const struct cfg80211_bitrate_mask *mask)
  48. @@ -7791,20 +7805,6 @@ static void ath11k_mac_op_flush(struct i
  49. ath11k_mac_flush_tx_complete(ar);
  50. }
  51. -static int
  52. -ath11k_mac_bitrate_mask_num_ht_rates(struct ath11k *ar,
  53. - enum nl80211_band band,
  54. - const struct cfg80211_bitrate_mask *mask)
  55. -{
  56. - int num_rates = 0;
  57. - int i;
  58. -
  59. - for (i = 0; i < ARRAY_SIZE(mask->control[band].ht_mcs); i++)
  60. - num_rates += hweight16(mask->control[band].ht_mcs[i]);
  61. -
  62. - return num_rates;
  63. -}
  64. -
  65. static bool
  66. ath11k_mac_has_single_legacy_rate(struct ath11k *ar,
  67. enum nl80211_band band,