| From 1c0cb4fc09293006efdf8d1a9e92715a5705c29e 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 66/98] 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 74bf0de..3857c2a 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.18.0 |
| |