mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: make number of tokens configurable dynamically
Preparation for adding Wireless Ethernet Dispatch support Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -722,12 +722,11 @@ int mt76_token_consume(struct mt76_dev *dev, struct mt76_txwi_cache **ptxwi)
|
||||
|
||||
spin_lock_bh(&dev->token_lock);
|
||||
|
||||
token = idr_alloc(&dev->token, *ptxwi, 0, dev->drv->token_size,
|
||||
GFP_ATOMIC);
|
||||
token = idr_alloc(&dev->token, *ptxwi, 0, dev->token_size, GFP_ATOMIC);
|
||||
if (token >= 0)
|
||||
dev->token_count++;
|
||||
|
||||
if (dev->token_count >= dev->drv->token_size - MT76_TOKEN_FREE_THR)
|
||||
if (dev->token_count >= dev->token_size - MT76_TOKEN_FREE_THR)
|
||||
__mt76_set_tx_blocked(dev, true);
|
||||
|
||||
spin_unlock_bh(&dev->token_lock);
|
||||
@@ -747,7 +746,7 @@ mt76_token_release(struct mt76_dev *dev, int token, bool *wake)
|
||||
if (txwi)
|
||||
dev->token_count--;
|
||||
|
||||
if (dev->token_count < dev->drv->token_size - MT76_TOKEN_FREE_THR &&
|
||||
if (dev->token_count < dev->token_size - MT76_TOKEN_FREE_THR &&
|
||||
dev->phy.q_tx[0]->blocked)
|
||||
*wake = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user