blob: 60fa62b922e1e96b3c99b28886b8faddbf2a83de [file] [log] [blame]
From 6f8a21b15ee4078ecf14c11a5cca0d8dee0bc474 Mon Sep 17 00:00:00 2001
From: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Date: Wed, 3 Apr 2024 14:23:51 +0800
Subject: [PATCH] mac80211: mtk: fix incorrect VIF assignment for IEEE 802.11
fragments
When in WDS mode (vif is AP_VLAN), only the first fragment would be dequeued from txq and go through some tx processing which includes the replacement of vif in CB(SKB) from the AP_VLAN one to the AP one. However, the rest of the fragments would be dequeued from txqi->frags and bypass this process which in turn results in different VIF assignment for softmac to fill in TXD. Therefore, we fix this by assigning the correct AP VIF to SKB_CB of the rest fragments.
Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
---
net/mac80211/tx.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 4085444..0577764 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3736,8 +3736,11 @@ begin:
skb = __skb_dequeue(&txqi->frags);
if (unlikely(skb)) {
if (!(IEEE80211_SKB_CB(skb)->control.flags &
- IEEE80211_TX_INTCFL_NEED_TXPROCESSING))
+ IEEE80211_TX_INTCFL_NEED_TXPROCESSING)) {
+ // TODO: report airtime of non-first fragments.
+ IEEE80211_SKB_CB(skb)->control.vif = vif;
goto out;
+ }
IEEE80211_SKB_CB(skb)->control.flags &=
~IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
} else {
--
2.18.0