wifi: mt76: mt7925: honour mac80211's FIF_FCSFAIL instead of hardcoding drop_err

mt7925_mcu_config_sniffer() hardcodes drop_err = 1, ignoring what
mac80211 actually requested via configure_filter(). FIF_FCSFAIL is
computed there but discarded instead of persisted.

Persist the FCSFAIL bit on the phy in mt7925_configure_filter() and
read it back in mt7925_mcu_config_sniffer() to derive drop_err, so the
firmware sniffer only passes through unfiltered/marginal frames when a
monitor listener actually requested them.

mt7925_mcu_config_sniffer() is only reached from mt7925_change_chanctx(),
which is itself only exercised on a monitor-mode chanctx, so this stays
scoped to monitor mode.

Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Tested-by: Devin Wittmayer <[email protected]>
Signed-off-by: Mark Anthony Agarro <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Mark Anthony Agarro
2026-09-01 13:25:05 +02:00
committed by Felix Fietkau
parent 0789c43c1a
commit bfb044bd24
4 changed files with 10 additions and 5 deletions
+3 -4
View File
@@ -856,11 +856,8 @@ static void mt7925_configure_filter(struct ieee80211_hw *hw,
unsigned int *total_flags,
u64 multicast)
{
#define MT7925_FILTER_FCSFAIL BIT(2)
#define MT7925_FILTER_CONTROL BIT(5)
#define MT7925_FILTER_OTHER_BSS BIT(6)
#define MT7925_FILTER_ENABLE BIT(31)
struct mt792x_dev *dev = mt792x_hw_dev(hw);
struct mt792x_phy *phy = mt792x_hw_phy(hw);
u32 flags = MT7925_FILTER_ENABLE;
#define MT7925_FILTER(_fif, _type) do { \
@@ -872,6 +869,8 @@ static void mt7925_configure_filter(struct ieee80211_hw *hw,
MT7925_FILTER(FIF_CONTROL, CONTROL);
MT7925_FILTER(FIF_OTHER_BSS, OTHER_BSS);
phy->rxfilter = flags;
mt792x_mutex_acquire(dev);
mt7925_mcu_set_rxfilter(dev, flags, 0, 0);
mt792x_mutex_release(dev);
+1 -1
View File
@@ -2356,7 +2356,7 @@ int mt7925_mcu_config_sniffer(struct mt792x_vif *vif,
.len = cpu_to_le16(sizeof(req.tlv)),
.control_ch = chandef->chan->hw_value,
.center_ch = ieee80211_frequency_to_channel(freq1),
.drop_err = 1,
.drop_err = !(vif->phy->rxfilter & MT7925_FILTER_FCSFAIL),
},
};
+5
View File
@@ -7,6 +7,11 @@
#include "../mt792x.h"
#include "regs.h"
#define MT7925_FILTER_FCSFAIL BIT(2)
#define MT7925_FILTER_CONTROL BIT(5)
#define MT7925_FILTER_OTHER_BSS BIT(6)
#define MT7925_FILTER_ENABLE BIT(31)
#define MT7925_BEACON_RATES_TBL 25
#define MT7925_TX_RING_SIZE 2048