1802d0beec
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 655 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070034.575739538@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
37 lines
833 B
C
37 lines
833 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (C) 2016 Felix Fietkau <nbd@nbd.name>
|
|
* Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
|
|
*/
|
|
|
|
#ifndef __MT76_UTIL_H
|
|
#define __MT76_UTIL_H
|
|
|
|
#include <linux/skbuff.h>
|
|
#include <linux/bitops.h>
|
|
#include <linux/bitfield.h>
|
|
|
|
#define MT76_INCR(_var, _size) \
|
|
_var = (((_var) + 1) % _size)
|
|
|
|
int mt76_wcid_alloc(unsigned long *mask, int size);
|
|
|
|
static inline void
|
|
mt76_wcid_free(unsigned long *mask, int idx)
|
|
{
|
|
mask[idx / BITS_PER_LONG] &= ~BIT(idx % BITS_PER_LONG);
|
|
}
|
|
|
|
static inline void
|
|
mt76_skb_set_moredata(struct sk_buff *skb, bool enable)
|
|
{
|
|
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
|
|
|
|
if (enable)
|
|
hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_MOREDATA);
|
|
else
|
|
hdr->frame_control &= ~cpu_to_le16(IEEE80211_FCTL_MOREDATA);
|
|
}
|
|
|
|
#endif
|