610bf725149221a039b46b45edbc15b8cf2b4cb4
[openwrt/staging/wigyori.git] /
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
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).
10
11 ht_mcs[] is 1 byte array and it is enough to use hweight8() instead
12 of hweight16(). Hence, fixed the same.
13
14 Tested on: Compile tested only.
15
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
19 ---
20 drivers/net/wireless/ath/ath11k/mac.c | 30 +++++++++++++--------------
21 1 file changed, 15 insertions(+), 15 deletions(-)
22
23 --- a/drivers/net/wireless/ath/ath11k/mac.c
24 +++ b/drivers/net/wireless/ath/ath11k/mac.c
25 @@ -1,7 +1,7 @@
26 // SPDX-License-Identifier: BSD-3-Clause-Clear
27 /*
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.
31 */
32
33 #include <net/mac80211.h>
34 @@ -4338,6 +4338,20 @@ exit:
35 }
36
37 static int
38 +ath11k_mac_bitrate_mask_num_ht_rates(struct ath11k *ar,
39 + enum nl80211_band band,
40 + const struct cfg80211_bitrate_mask *mask)
41 +{
42 + int num_rates = 0;
43 + int i;
44 +
45 + for (i = 0; i < ARRAY_SIZE(mask->control[band].ht_mcs); i++)
46 + num_rates += hweight8(mask->control[band].ht_mcs[i]);
47 +
48 + return num_rates;
49 +}
50 +
51 +static int
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);
57 }
58
59 -static int
60 -ath11k_mac_bitrate_mask_num_ht_rates(struct ath11k *ar,
61 - enum nl80211_band band,
62 - const struct cfg80211_bitrate_mask *mask)
63 -{
64 - int num_rates = 0;
65 - int i;
66 -
67 - for (i = 0; i < ARRAY_SIZE(mask->control[band].ht_mcs); i++)
68 - num_rates += hweight16(mask->control[band].ht_mcs[i]);
69 -
70 - return num_rates;
71 -}
72 -
73 static bool
74 ath11k_mac_has_single_legacy_rate(struct ath11k *ar,
75 enum nl80211_band band,