developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 1 | From 1c0cb4fc09293006efdf8d1a9e92715a5705c29e Mon Sep 17 00:00:00 2001 |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 2 | From: "sujuan.chen" <sujuan.chen@mediatek.com> |
| 3 | Date: Wed, 19 Apr 2023 17:13:41 +0800 |
developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 4 | Subject: [PATCH 66/98] wifi: mt76: wed: change wed token init size to adapt |
| 5 | wed3.0 |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 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 |
developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 13 | index 74bf0de..3857c2a 100644 |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 14 | --- a/tx.c |
| 15 | +++ b/tx.c |
developer | c2cfe0f | 2023-09-22 04:11:09 +0800 | [diff] [blame] | 16 | @@ -819,12 +819,16 @@ EXPORT_SYMBOL_GPL(__mt76_set_tx_blocked); |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 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 | -- |
developer | 7e2761e | 2023-10-12 08:11:13 +0800 | [diff] [blame] | 37 | 2.18.0 |
developer | 064da3c | 2023-06-13 15:57:26 +0800 | [diff] [blame] | 38 | |