blob: 1ad01a80ce2218fc4a9f6291aef059fa69d70d7d [file] [log] [blame]
From 7d98801b7316b08f29d6dac3f2459ae45196850e Mon Sep 17 00:00:00 2001
From: "sujuan.chen" <sujuan.chen@mediatek.com>
Date: Wed, 19 Apr 2023 17:13:41 +0800
Subject: [PATCH 2002/2032] mtk: wifi: mt76: wed: change wed token init size to
adapt wed3.0
Signed-off-by: sujuan.chen <sujuan.chen@mediatek.com>
---
tx.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/tx.c b/tx.c
index e0c3e854..1420ff71 100644
--- a/tx.c
+++ b/tx.c
@@ -827,12 +827,16 @@ EXPORT_SYMBOL_GPL(__mt76_set_tx_blocked);
int mt76_token_consume(struct mt76_dev *dev, struct mt76_txwi_cache **ptxwi)
{
- int token;
+ int token, start = 0;
+
+ if (mtk_wed_device_active(&dev->mmio.wed))
+ start = dev->mmio.wed.wlan.nbuf;
spin_lock_bh(&dev->token_lock);
- token = idr_alloc(&dev->token, *ptxwi, 0, dev->token_size, GFP_ATOMIC);
- if (token >= 0)
+ token = idr_alloc(&dev->token, *ptxwi, start, start + dev->token_size,
+ GFP_ATOMIC);
+ if (token >= start)
dev->token_count++;
#ifdef CONFIG_NET_MEDIATEK_SOC_WED
--
2.18.0