2 * Copyright (C) 2016 Felix Fietkau <nbd@nbd.name>
3 * Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2
7 * as published by the Free Software Foundation
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
18 #include <linux/skbuff.h>
19 #include <linux/bitops.h>
20 #include <linux/bitfield.h>
22 #define MT76_INCR(_var, _size) \
23 _var = (((_var) + 1) % _size)
25 int mt76_wcid_alloc(unsigned long *mask
, int size
);
28 mt76_wcid_free(unsigned long *mask
, int idx
)
30 mask
[idx
/ BITS_PER_LONG
] &= ~BIT(idx
% BITS_PER_LONG
);
34 mt76_skb_set_moredata(struct sk_buff
*skb
, bool enable
)
36 struct ieee80211_hdr
*hdr
= (struct ieee80211_hdr
*) skb
->data
;
39 hdr
->frame_control
|= cpu_to_le16(IEEE80211_FCTL_MOREDATA
);
41 hdr
->frame_control
&= ~cpu_to_le16(IEEE80211_FCTL_MOREDATA
);