blob: 339387130f034474962f8e075c191d412aff2df1 [file] [log] [blame]
developer6bcdd6c2024-03-21 16:26:34 +08001From 39b7d46dcefc833d3cc565b353c3596462e3e5dc Mon Sep 17 00:00:00 2001
2From: "sujuan.chen" <sujuan.chen@mediatek.com>
3Date: Wed, 19 Apr 2023 17:13:41 +0800
4Subject: [PATCH 074/120] mtk: wifi: mt76: wed: change wed token init size to
5 adapt wed3.0
6
7Signed-off-by: sujuan.chen <sujuan.chen@mediatek.com>
8---
9 tx.c | 10 +++++++---
10 1 file changed, 7 insertions(+), 3 deletions(-)
11
12diff --git a/tx.c b/tx.c
13index 46dae6e0a..e2795067c 100644
14--- a/tx.c
15+++ b/tx.c
16@@ -827,12 +827,16 @@ EXPORT_SYMBOL_GPL(__mt76_set_tx_blocked);
17
18 int mt76_token_consume(struct mt76_dev *dev, struct mt76_txwi_cache **ptxwi)
19 {
20- int token;
21+ int token, start = 0;
22+
23+ if (mtk_wed_device_active(&dev->mmio.wed))
24+ start = dev->mmio.wed.wlan.nbuf;
25
26 spin_lock_bh(&dev->token_lock);
27
28- token = idr_alloc(&dev->token, *ptxwi, 0, dev->token_size, GFP_ATOMIC);
29- if (token >= 0)
30+ token = idr_alloc(&dev->token, *ptxwi, start, start + dev->token_size,
31+ GFP_ATOMIC);
32+ if (token >= start)
33 dev->token_count++;
34
35 #ifdef CONFIG_NET_MEDIATEK_SOC_WED
36--
372.39.2
38