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
7 Relocate the function ath11k_mac_bitrate_mask_num_ht_rates() definition
8 to call this function from other functions which helps to avoid the
9 compilation error (function not defined).
11 ht_mcs[] is 1 byte array and it is enough to use hweight8() instead
12 of hweight16(). Hence, fixed the same.
14 Tested on: Compile tested only.
16 Signed-off-by: Maharaja Kennadyrajan <quic_mkenna@quicinc.com>
17 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
18 Link: https://lore.kernel.org/r/20230504092033.3542456-2-quic_mkenna@quicinc.com
20 drivers/net/wireless/ath/ath11k/mac.c | 30 +++++++++++++--------------
21 1 file changed, 15 insertions(+), 15 deletions(-)
23 --- a/drivers/net/wireless/ath/ath11k/mac.c
24 +++ b/drivers/net/wireless/ath/ath11k/mac.c
26 // SPDX-License-Identifier: BSD-3-Clause-Clear
28 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
29 - * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
30 + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
33 #include <net/mac80211.h>
34 @@ -4338,6 +4338,20 @@ exit:
38 +ath11k_mac_bitrate_mask_num_ht_rates(struct ath11k *ar,
39 + enum nl80211_band band,
40 + const struct cfg80211_bitrate_mask *mask)
45 + for (i = 0; i < ARRAY_SIZE(mask->control[band].ht_mcs); i++)
46 + num_rates += hweight8(mask->control[band].ht_mcs[i]);
52 ath11k_mac_bitrate_mask_num_vht_rates(struct ath11k *ar,
53 enum nl80211_band band,
54 const struct cfg80211_bitrate_mask *mask)
55 @@ -7791,20 +7805,6 @@ static void ath11k_mac_op_flush(struct i
56 ath11k_mac_flush_tx_complete(ar);
60 -ath11k_mac_bitrate_mask_num_ht_rates(struct ath11k *ar,
61 - enum nl80211_band band,
62 - const struct cfg80211_bitrate_mask *mask)
67 - for (i = 0; i < ARRAY_SIZE(mask->control[band].ht_mcs); i++)
68 - num_rates += hweight16(mask->control[band].ht_mcs[i]);
74 ath11k_mac_has_single_legacy_rate(struct ath11k *ar,
75 enum nl80211_band band,