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: 4ad65a5461
("mt76: mt7921: toggle runtime-pm adding a monitor vif")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Родитель
32bfd77462
Коммит
1f12fa34e5
|
@ -485,9 +485,17 @@ mt7921_sniffer_interface_iter(void *priv, u8 *mac, struct ieee80211_vif *vif)
|
|||
{
|
||||
struct mt7921_dev *dev = priv;
|
||||
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, enabled);
|
||||
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);
|
||||
|
||||
if (monitor)
|
||||
mt7921_mcu_set_beacon_filter(dev, vif, false);
|
||||
}
|
||||
|
||||
void mt7921_set_runtime_pm(struct mt7921_dev *dev)
|
||||
|
@ -531,7 +539,6 @@ static int mt7921_config(struct ieee80211_hw *hw, u32 changed)
|
|||
IEEE80211_IFACE_ITER_RESUME_ALL,
|
||||
mt7921_sniffer_interface_iter, dev);
|
||||
dev->mt76.rxfilter = mt76_rr(dev, MT_WF_RFCR(0));
|
||||
mt7921_set_runtime_pm(dev);
|
||||
}
|
||||
|
||||
out:
|
||||
|
|
Загрузка…
Ссылка в новой задаче