summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2017-12-14 18:39:17 +0300
committerKalle Valo <kvalo@codeaurora.org>2018-01-08 20:25:55 +0300
commite8be626d794bfcb898b582c11b447becc7c78d00 (patch)
tree6081cb548fb5fac38a5e875f88b041242583c1f2 /drivers/net/wireless/mediatek
parenteb46e5b7be0da1eee353998b27ae852f49e8e2a3 (diff)
downloadlinux-e8be626d794bfcb898b582c11b447becc7c78d00.tar.xz
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 <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/mediatek')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x2_main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_main.c b/drivers/net/wireless/mediatek/mt76/mt76x2_main.c
index f74b8195421a..963aea9e8801 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2_main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2_main.c
@@ -152,6 +152,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;