From c64633e8574dbe98e6a8982692e095f265943835 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 8 Dec 2017 11:55:27 +0100 Subject: [PATCH] mt76x2: configure rx filter based on monitor mode setting Due to an unrelated issue, the MT_RX_FILTR_CFG_PROMISC flag is currently unset, which means that monitor mode is unconditionally enabled. Toggle this flag based on the mac80211 monitor mode setting instead Signed-off-by: Felix Fietkau --- mt76x2_main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mt76x2_main.c b/mt76x2_main.c index a9233a5e..2d6a48d8 100644 --- a/mt76x2_main.c +++ b/mt76x2_main.c @@ -147,6 +147,15 @@ mt76x2_config(struct ieee80211_hw *hw, u32 changed) mutex_lock(&dev->mutex); + if (changed & IEEE80211_CONF_CHANGE_MONITOR) { + if (!(hw->conf.flags & IEEE80211_CONF_MONITOR)) + dev->rxfilter |= MT_RX_FILTR_CFG_PROMISC; + else + dev->rxfilter &= ~MT_RX_FILTR_CFG_PROMISC; + + mt76_wr(dev, MT_RX_FILTR_CFG, dev->rxfilter); + } + if (changed & IEEE80211_CONF_CHANGE_POWER) { dev->txpower_conf = hw->conf.power_level * 2;