blob: 0cd732206851050e5d37685388c3f76cb99ee17b [file] [log] [blame]
From 522991328e51d164645d002c0b51d010a31a05df 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/2012] 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 74bf0de12..3857c2af6 100644
--- a/tx.c
+++ b/tx.c
@@ -819,12 +819,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.39.2