summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c
diff options
context:
space:
mode:
authorIgor Mitsyanko <igor.mitsyanko.os@quantenna.com>2017-12-19 14:28:54 +0300
committerKalle Valo <kvalo@codeaurora.org>2018-01-09 14:11:22 +0200
commit4d2a7a1cfa68e37235e53a06c1afe0df1673e8dd (patch)
tree91d30fd0826f149f1fec24b96f3353b9f34d5f24 /drivers/net/wireless/quantenna/qtnfmac/qlink_util.c
parent9cbd599966d85b72b8c7388549a87d559d8fb2b9 (diff)
downloadblackbird-op-linux-4d2a7a1cfa68e37235e53a06c1afe0df1673e8dd.tar.gz
blackbird-op-linux-4d2a7a1cfa68e37235e53a06c1afe0df1673e8dd.zip
qtnfmac: modify GET_STA_STATS cmd format for back/forward compatibility
A set of per-STA statistics can potentially change quite often. To ensure backwards and forward compatibility, modify GET_STA_STATS command format: - introduce two TLV types - first TLV is a variable-sized bitmap of statistics values that are filled by firmware - second TLV is a structure with statistics itself Only values specified in first TLV are valid. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/quantenna/qtnfmac/qlink_util.c')
-rw-r--r--drivers/net/wireless/quantenna/qtnfmac/qlink_util.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c
index 37b78f00e8e5..19981d6440b6 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c
@@ -164,3 +164,15 @@ enum qlink_hidden_ssid qlink_hidden_ssid_nl2q(enum nl80211_hidden_ssid nl_val)
return QLINK_HIDDEN_SSID_NOT_IN_USE;
}
}
+
+bool qtnf_utils_is_bit_set(const u8 *arr, unsigned int bit,
+ unsigned int arr_max_len)
+{
+ unsigned int idx = bit / BITS_PER_BYTE;
+ u8 mask = 1 << (bit - (idx * BITS_PER_BYTE));
+
+ if (idx >= arr_max_len)
+ return false;
+
+ return arr[idx] & mask;
+}
OpenPOWER on IntegriCloud