[PATCH wireless] wifi: mt76: mt7921: let monitors see other stations' unicast

Devin Wittmayer lucid_duck at justthetip.ca
Mon Oct 26 15:03:46 PDT 2026


After an mt7921 has scanned or connected, its firmware drops unicast
frames meant for other stations even with the sniffer on. A monitor
then gets the AP's beacons but none of the unicast between the AP and
its clients, so it never catches a handshake.

Clear that filter whenever the sniffer is enabled.

Fixes: cbaa0a404f8d ("mt76: mt7921: fix up the monitor mode")
Link: https://github.com/WLAN-Pi/wlanpi-core/pull/364
Signed-off-by: Devin Wittmayer <lucid_duck at justthetip.ca>
---
Tested on wireless-next with an MT7921AU and an MT7922, the monitor
on channel 6 while clients joined a WPA2 AP:

	handshakes caught, of 3      before   after
	fresh driver load               3        3
	after a scan                    0        3
	after connecting                0        3
	scan while capturing            0        3
	connected while capturing       0        3

Same on 7.2.6 and on 5 GHz. Left up for a few hours with a scan every
few minutes, the monitor didn't miss a handshake. 6.18 also needs
a7d35545c2ce for the scan while capturing.

Once the monitor is gone the radio connects as normal, and the firmware
turns the filter back on by itself.

Doing this from the filter callback instead was only enough for default
monitors. A monitor created with only the fcsfail flag never asks for
other-BSS frames, so it still went blind after a scan.

An A9000 (mt7925) doesn't need it. Its firmware clears the filter by
itself when a monitor comes up, even after a scan.

 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
index a0caa77339ee..7ef870b2a37b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
@@ -1207,9 +1207,15 @@ int mt7921_mcu_set_sniffer(struct mt792x_dev *dev, struct ieee80211_vif *vif,
 			.enable = enable,
 		},
 	};
+	int err;
 
-	return mt76_mcu_send_msg(&dev->mt76, MCU_UNI_CMD(SNIFFER), &req, sizeof(req),
-				 true);
+	err = mt76_mcu_send_msg(&dev->mt76, MCU_UNI_CMD(SNIFFER), &req, sizeof(req),
+				true);
+	if (err || !enable)
+		return err;
+
+	return mt7921_mcu_set_rxfilter(dev, 0, MT7921_FIF_BIT_CLR,
+				       MT_WF_RFCR_DROP_OTHER_UC);
 }
 
 int mt7921_mcu_config_sniffer(struct mt792x_vif *vif,
-- 
2.56.0




More information about the Linux-mediatek mailing list