提交 ee8aa945 编写于 作者: L Lorenzo Bianconi 提交者: Kalle Valo

mt76: introduce mt76_{incr,decr} utility routines

Add mt76_{incr,decr} utility routines to increment/decrement a value
with wrap-around (they will be used by mt76x2 DFS sw detector)
Signed-off-by: NLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 f9cbaeb5
......@@ -390,6 +390,18 @@ struct dentry *mt76_register_debugfs(struct mt76_dev *dev);
int mt76_eeprom_init(struct mt76_dev *dev, int len);
void mt76_eeprom_override(struct mt76_dev *dev);
/* increment with wrap-around */
static inline int mt76_incr(int val, int size)
{
return (val + 1) & (size - 1);
}
/* decrement with wrap-around */
static inline int mt76_decr(int val, int size)
{
return (val - 1) & (size - 1);
}
static inline struct ieee80211_txq *
mtxq_to_txq(struct mt76_txq *mtxq)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册