Skip to content
Snippets Groups Projects
Commit 2f9461df authored by David Bauer's avatar David Bauer
Browse files

openwrt: remove mt76 patch


From testing the previous behavior of ghost-acks could not be reproduced
anymore.

Signed-off-by: default avatarDavid Bauer <mail@david-bauer.net>
parent 937d25be
No related branches found
No related tags found
No related merge requests found
From: David Bauer <mail@david-bauer.net>
Date: Thu, 14 Mar 2024 09:39:22 +0100
Subject: mt76: include fixes for MT7603 / MT7612
diff --git a/package/kernel/mt76/patches/0002-mt76x02-avoid-action-ghost-ack.patch b/package/kernel/mt76/patches/0002-mt76x02-avoid-action-ghost-ack.patch
new file mode 100644
index 0000000000000000000000000000000000000000..0910ed99ef473db9cf4129f88017912b5d63267d
--- /dev/null
+++ b/package/kernel/mt76/patches/0002-mt76x02-avoid-action-ghost-ack.patch
@@ -0,0 +1,80 @@
+From 3c9ecc0c77e85d9ff91faddde59764fbc9316b7c Mon Sep 17 00:00:00 2001
+From: David Bauer <mail@david-bauer.net>
+Date: Sat, 2 Mar 2024 13:14:49 +0100
+Subject: [PATCH 2/2] mt76x02: avoid action ghost-ack
+
+On PMF enabled networks, chip reports ACTION frames always as acked.
+
+In case a roaming-assistant sens link-measurements periodically,
+this results in the station never becoming inactive and not being removed
+from the AP's station list.
+
+Avoid this from happening by marking action frames sent on a PMF enabled
+network as no-ack.
+
+Signed-off-by: David Bauer <mail@david-bauer.net>
+---
+ mt76x02_mac.c | 27 +++++++++++++++++++++++++++
+ mt76x02_mac.h | 1 +
+ 2 files changed, 28 insertions(+)
+
+diff --git a/mt76x02_mac.c b/mt76x02_mac.c
+index d5db6ffd..672e01ec 100644
+--- a/mt76x02_mac.c
++++ b/mt76x02_mac.c
+@@ -544,6 +544,7 @@ void mt76x02_send_tx_status(struct mt76x02_dev *dev,
+ struct ieee80211_tx_status status = {
+ .info = &info
+ };
++ struct ieee80211_hdr *hdr;
+ static const u8 ac_to_tid[4] = {
+ [IEEE80211_AC_BE] = 0,
+ [IEEE80211_AC_BK] = 1,
+@@ -619,6 +620,32 @@ void mt76x02_send_tx_status(struct mt76x02_dev *dev,
+ *update = 1;
+ }
+
++ if (msta && status.skb &&
++ (status.info->flags & IEEE80211_TX_STAT_ACK)) {
++ hdr = (struct ieee80211_hdr *)status.skb->data;
++
++ if (ieee80211_has_protected(hdr->frame_control) &&
++ ieee80211_is_robust_mgmt_frame(status.skb)) {
++ /**
++ * On PMF enabled networks, chip reports ACTION frames
++ * always as acked.
++ *
++ * In case a roaming-assistant sends link-measurements
++ * periodically, this results in the station never
++ * becoming inactive and not being removed from the
++ * AP's station list.
++ */
++
++ if (msta->n_enc_mgmt >= 25) {
++ status.info->flags &= ~IEEE80211_TX_STAT_ACK;
++ } else {
++ msta->n_enc_mgmt++;
++ }
++ } else {
++ msta->n_enc_mgmt = 0;
++ }
++ }
++
+ if (status.skb) {
+ info = *status.info;
+ len = status.skb->len;
+diff --git a/mt76x02_mac.h b/mt76x02_mac.h
+index 5dc6c834..1bd2288f 100644
+--- a/mt76x02_mac.h
++++ b/mt76x02_mac.h
+@@ -39,6 +39,7 @@ struct mt76x02_sta {
+ struct mt76x02_vif *vif;
+ struct mt76x02_tx_status status;
+ int n_frames;
++ u8 n_enc_mgmt;
+
+ struct ewma_pktlen pktlen;
+ };
+--
+2.43.0
+
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment