]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mt76: mt7921: assert sniffer on chanctx change
authorDevin Wittmayer <lucid_duck@justthetip.ca>
Fri, 15 May 2026 18:39:21 +0000 (11:39 -0700)
committerFelix Fietkau <nbd@nbd.name>
Tue, 9 Jun 2026 10:30:59 +0000 (10:30 +0000)
mt7921_change_chanctx() configures the channel for monitor vifs but
does not re-assert sniffer mode. mt7925_change_chanctx() does. Match
mt7925 by adding the missing mt7921_mcu_set_sniffer(true) call,
completing the architectural pattern from commit 914189af23b8 ("wifi:
mt76: mt7921: fix channel switch fail in monitor mode").

The user-visible regression this asymmetry produced on v6.17 and v6.18
was addressed by commit cdb2941a516c ("Revert "wifi: mt76: mt792x:
improve monitor interface handling"") in v6.19 and backported to the
6.17.y and 6.18.y stable trees. This patch is defense in depth in
case the NO_VIRTUAL_MONITOR change is reintroduced in a future series.

Tested-by: Nick Morrow <morrownr@gmail.com>
Tested-on: RasPi4B, RasPiOS 64 bit, Alfa AWUS036AXML mt7921u
Tested-on: RasPi4B, RasPiOS 64 bit, Netgear A9000 mt7925u
Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
Link: https://patch.msgid.link/20260515183921.23484-1-lucid_duck@justthetip.ca
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7921/main.c

index 0e19ba2b094deff624b66c2bfd008ad6a159e619..3480205d5fb91be510e6c6bacd36b6cabee68da1 100644 (file)
@@ -1417,10 +1417,12 @@ mt7921_change_chanctx(struct ieee80211_hw *hw,
        vif = container_of((void *)mvif, struct ieee80211_vif, drv_priv);
 
        mt792x_mutex_acquire(phy->dev);
-       if (vif->type == NL80211_IFTYPE_MONITOR)
+       if (vif->type == NL80211_IFTYPE_MONITOR) {
+               mt7921_mcu_set_sniffer(mvif->phy->dev, vif, true);
                mt7921_mcu_config_sniffer(mvif, ctx);
-       else
+       } else {
                mt76_connac_mcu_uni_set_chctx(mvif->phy->mt76, &mvif->bss_conf.mt76, ctx);
+       }
        mt792x_mutex_release(phy->dev);
 }