aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/tx.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2021-12-06 13:45:54 +0100
committerFelix Fietkau <nbd@nbd.name>2022-05-13 09:39:35 +0200
commitf68d67623dec9445960b52a0e9e8e60297596b4b (patch)
treee649144377b94fdf812516926a1686c01bb6ca09 /drivers/net/wireless/mediatek/mt76/tx.c
parentmt76: make number of tokens configurable dynamically (diff)
downloadlinux-dev-f68d67623dec9445960b52a0e9e8e60297596b4b.tar.xz
linux-dev-f68d67623dec9445960b52a0e9e8e60297596b4b.zip
mt76: mt7915: add Wireless Ethernet Dispatch support
This is used to support hardware flow offloading from Ethernet to WLAN Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to '')
-rw-r--r--drivers/net/wireless/mediatek/mt76/tx.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c
index 84fa922c977a..02067edca95e 100644
--- a/drivers/net/wireless/mediatek/mt76/tx.c
+++ b/drivers/net/wireless/mediatek/mt76/tx.c
@@ -726,6 +726,12 @@ int mt76_token_consume(struct mt76_dev *dev, struct mt76_txwi_cache **ptxwi)
if (token >= 0)
dev->token_count++;
+#ifdef CONFIG_NET_MEDIATEK_SOC_WED
+ if (mtk_wed_device_active(&dev->mmio.wed) &&
+ token >= dev->mmio.wed.wlan.token_start)
+ dev->wed_token_count++;
+#endif
+
if (dev->token_count >= dev->token_size - MT76_TOKEN_FREE_THR)
__mt76_set_tx_blocked(dev, true);
@@ -743,9 +749,17 @@ mt76_token_release(struct mt76_dev *dev, int token, bool *wake)
spin_lock_bh(&dev->token_lock);
txwi = idr_remove(&dev->token, token);
- if (txwi)
+ if (txwi) {
dev->token_count--;
+#ifdef CONFIG_NET_MEDIATEK_SOC_WED
+ if (mtk_wed_device_active(&dev->mmio.wed) &&
+ token >= dev->mmio.wed.wlan.token_start &&
+ --dev->wed_token_count == 0)
+ wake_up(&dev->tx_wait);
+#endif
+ }
+
if (dev->token_count < dev->token_size - MT76_TOKEN_FREE_THR &&
dev->phy.q_tx[0]->blocked)
*wake = true;