summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/util.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2019-10-12 17:42:00 +0200
committerFelix Fietkau <nbd@nbd.name>2020-02-14 10:03:08 +0100
commit426e8e413ce856825b43c7340bfd9f8d250e799b (patch)
tree6db290aae81a20697c373b14911beebadec49861 /drivers/net/wireless/mediatek/mt76/util.h
parente394b5757badea65c578d0ece59e800c7bb19aa5 (diff)
downloadlinux-426e8e413ce856825b43c7340bfd9f8d250e799b.tar.gz
mt76: add support for an extra wiphy in mt76_sta_state()
This is preparation for supporting multiple wiphys per device to support the concurrent dual-band feature of MT7615D Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/util.h')
-rw-r--r--drivers/net/wireless/mediatek/mt76/util.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/util.h b/drivers/net/wireless/mediatek/mt76/util.h
index fe3479c8e561..48a71e7479e5 100644
--- a/drivers/net/wireless/mediatek/mt76/util.h
+++ b/drivers/net/wireless/mediatek/mt76/util.h
@@ -16,8 +16,20 @@
int mt76_wcid_alloc(unsigned long *mask, int size);
+static inline bool
+mt76_wcid_mask_test(unsigned long *mask, int idx)
+{
+ return mask[idx / BITS_PER_LONG] & BIT(idx % BITS_PER_LONG);
+}
+
+static inline void
+mt76_wcid_mask_set(unsigned long *mask, int idx)
+{
+ mask[idx / BITS_PER_LONG] |= BIT(idx % BITS_PER_LONG);
+}
+
static inline void
-mt76_wcid_free(unsigned long *mask, int idx)
+mt76_wcid_mask_clear(unsigned long *mask, int idx)
{
mask[idx / BITS_PER_LONG] &= ~BIT(idx % BITS_PER_LONG);
}