Commit 1f12fa34 authored by Sean Wang's avatar Sean Wang Committed by Felix Fietkau

mt76: mt7921: don't enable beacon filter when IEEE80211_CONF_CHANGE_MONITOR is set

IEEE80211_CONF_CHANGE_MONITOR would be set every time even when vif runs as
sta mode.

If vif runs as sta mode, the beacon filter would be falsely enabled
earlier than the associated state.

That is not the behavior the firmware expects and also breaks the original
logic of sta mode. Thus, we only limit the operation to set the beacon
filter only for monitor mode when IEEE80211_CONF_CHANGE_MONITOR is set.

Fixes: 4ad65a54 ("mt76: mt7921: toggle runtime-pm adding a monitor vif")
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 32bfd774
...@@ -485,9 +485,17 @@ mt7921_sniffer_interface_iter(void *priv, u8 *mac, struct ieee80211_vif *vif) ...@@ -485,9 +485,17 @@ mt7921_sniffer_interface_iter(void *priv, u8 *mac, struct ieee80211_vif *vif)
{ {
struct mt7921_dev *dev = priv; struct mt7921_dev *dev = priv;
struct ieee80211_hw *hw = mt76_hw(dev); struct ieee80211_hw *hw = mt76_hw(dev);
bool enabled = !!(hw->conf.flags & IEEE80211_CONF_MONITOR); struct mt76_connac_pm *pm = &dev->pm;
bool monitor = !!(hw->conf.flags & IEEE80211_CONF_MONITOR);
mt7921_mcu_set_sniffer(dev, vif, monitor);
pm->enable = !monitor;
pm->ds_enable = !monitor;
mt76_connac_mcu_set_deep_sleep(&dev->mt76, pm->ds_enable);
mt7921_mcu_set_sniffer(dev, vif, enabled); if (monitor)
mt7921_mcu_set_beacon_filter(dev, vif, false);
} }
void mt7921_set_runtime_pm(struct mt7921_dev *dev) void mt7921_set_runtime_pm(struct mt7921_dev *dev)
...@@ -531,7 +539,6 @@ static int mt7921_config(struct ieee80211_hw *hw, u32 changed) ...@@ -531,7 +539,6 @@ static int mt7921_config(struct ieee80211_hw *hw, u32 changed)
IEEE80211_IFACE_ITER_RESUME_ALL, IEEE80211_IFACE_ITER_RESUME_ALL,
mt7921_sniffer_interface_iter, dev); mt7921_sniffer_interface_iter, dev);
dev->mt76.rxfilter = mt76_rr(dev, MT_WF_RFCR(0)); dev->mt76.rxfilter = mt76_rr(dev, MT_WF_RFCR(0));
mt7921_set_runtime_pm(dev);
} }
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment