]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: mt76: mt7921: fix wrong command to set STA channel
authorDeren Wu <deren.wu@mediatek.com>
Sat, 11 Feb 2023 01:01:58 +0000 (09:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:11:15 +0000 (23:11 +0900)
[ Upstream commit fcc51acfebb85dbc3ab1bea3ce4997d7c0a3a38d ]

Should not use AND operator to check vif type NL80211_IFTYPE_MONITOR, and
that will cause we go into sniffer command for both STA and MONITOR
mode. However, the sniffer command would set channel properly (with some
extra options), the STA mode still works even if using the wrong
command.

Fix vif type check to make sure we using the right command to update
channel.

Fixes: 914189af23b8 ("wifi: mt76: mt7921: fix channel switch fail in monitor mode")
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mediatek/mt76/mt7921/main.c

index 744382be36f8bf48b2f425624c18e501c8ef36c0..b2366efd74ea592fadd65b21eabe2ddb3f57c0fa 100644 (file)
@@ -1705,7 +1705,7 @@ static void mt7921_ctx_iter(void *priv, u8 *mac,
        if (ctx != mvif->ctx)
                return;
 
-       if (vif->type & NL80211_IFTYPE_MONITOR)
+       if (vif->type == NL80211_IFTYPE_MONITOR)
                mt7921_mcu_config_sniffer(mvif, ctx);
        else
                mt76_connac_mcu_uni_set_chctx(mvif->phy->mt76, &mvif->mt76, ctx);