| From 2ced3e3d33ef919332226f09a214ef2b04555a6d 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/2008] 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 6cb71f34..618c99a1 100644 |
| --- a/tx.c |
| +++ b/tx.c |
| @@ -737,12 +737,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 |
| |