developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 1 | From 2ced3e3d33ef919332226f09a214ef2b04555a6d Mon Sep 17 00:00:00 2001 |
| 2 | From: "sujuan.chen" <sujuan.chen@mediatek.com> |
| 3 | Date: Wed, 19 Apr 2023 17:13:41 +0800 |
| 4 | Subject: [PATCH 2002/2008] wifi: mt76: wed: change wed token init size to |
| 5 | adapt wed3.0 |
| 6 | |
| 7 | Signed-off-by: sujuan.chen <sujuan.chen@mediatek.com> |
| 8 | --- |
| 9 | tx.c | 10 +++++++--- |
| 10 | 1 file changed, 7 insertions(+), 3 deletions(-) |
| 11 | |
| 12 | diff --git a/tx.c b/tx.c |
| 13 | index 6cb71f34..618c99a1 100644 |
| 14 | --- a/tx.c |
| 15 | +++ b/tx.c |
| 16 | @@ -737,12 +737,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 | -- |
| 37 | 2.39.2 |
| 38 | |