1 Star 0 Fork 0

hzjnet / mt76-openwrt官方

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
util.h 1001 Bytes
一键复制 编辑 原始数据 按行查看 历史
Felix Fietkau 提交于 2020-05-23 14:40 . mt76: fix wcid allocation issues
/* 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(u32 *mask, int size);
static inline bool
mt76_wcid_mask_test(u32 *mask, int idx)
{
return mask[idx / 32] & BIT(idx % 32);
}
static inline void
mt76_wcid_mask_set(u32 *mask, int idx)
{
mask[idx / 32] |= BIT(idx % 32);
}
static inline void
mt76_wcid_mask_clear(u32 *mask, int idx)
{
mask[idx / 32] &= ~BIT(idx % 32);
}
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
1
https://gitee.com/hzjnet/mt76.git
git@gitee.com:hzjnet/mt76.git
hzjnet
mt76
mt76-openwrt官方
master

搜索帮助