mt7996_mcu_set_sniffer_mode() makes the firmware clear the upper bits of MT_WF_RFCR1, MT_WF_RFCR1_DROP_NO2ME_TF among them, so the band passes on trigger frames for other stations. With MT_WF_RFCR_DROP_FCSFAIL also clear, the band stops receiving after some FCS-failed frames: rx_fifo_full_cnt rises, rx_mpdu_cnt freezes and the host gets no more frames from that band. Deleting the monitor does not recover it, and neither does a SER L3 RX abort or L4 MDP recovery; only a reboot does. Reachable through a monitor interface with the fcsfail flag. Drop the trigger frames for other stations again while the band accepts FCS-failed frames. A monitor that drops FCS-failed frames still gets the trigger frames for other stations, as the firmware leaves the bit. Send the sniffer command before the filter write, so that the firmware does not overwrite the bit. Fixes: e48da5c9ca29 ("wifi: mt76: mt7996: fix monitor mode") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7996/main.c | 13 ++++++++++++- drivers/net/wireless/mediatek/mt76/mt7996/regs.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/main.c b/drivers/net/wireless/mediatek/mt76/mt7996/main.c index ba7a0553e34a..e6b81aa890f4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c @@ -610,6 +610,17 @@ static void mt7996_phy_set_rxfilter(struct mt7996_phy *phy) mt76_set(dev, MT_WF_RFCR1(phy->mt76->band_idx), ctl_flags); else mt76_clear(dev, MT_WF_RFCR1(phy->mt76->band_idx), ctl_flags); + + /* Firmware sniffer mode clears the drop of trigger frames for other + * stations, and the band's RX stops where it accepts FCS-failed + * frames without it. + */ + if (!(filter & MT_WF_RFCR_DROP_FCSFAIL)) + mt76_set(dev, MT_WF_RFCR1(phy->mt76->band_idx), + MT_WF_RFCR1_DROP_NO2ME_TF); + else if (!(filter & MT_WF_RFCR_DROP_OTHER_UC)) + mt76_clear(dev, MT_WF_RFCR1(phy->mt76->band_idx), + MT_WF_RFCR1_DROP_NO2ME_TF); } static bool mt7996_monitor_active(struct mt7996_dev *dev) @@ -644,8 +655,8 @@ static void mt7996_set_monitor(struct mt7996_phy *phy, bool enabled) MT_DMA_DCR0_RXD_G5_EN, enabled); mt76_rmw_field(dev, MT_MDP_DCR0, MT_MDP_DCR0_RX_HDR_TRANS_EN, !mt7996_monitor_active(dev)); - mt7996_phy_set_rxfilter(phy); mt7996_mcu_set_sniffer_mode(phy, enabled); + mt7996_phy_set_rxfilter(phy); } static int mt7996_add_interface(struct ieee80211_hw *hw, diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/regs.h b/drivers/net/wireless/mediatek/mt76/mt7996/regs.h index e82a281a773a..b89ac39ad7af 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/regs.h +++ b/drivers/net/wireless/mediatek/mt76/mt7996/regs.h @@ -426,6 +426,7 @@ enum offs_rev { #define MT_WF_RFCR1_DROP_BA BIT(6) #define MT_WF_RFCR1_DROP_CFEND BIT(7) #define MT_WF_RFCR1_DROP_CFACK BIT(8) +#define MT_WF_RFCR1_DROP_NO2ME_TF BIT(22) #define MT_WF_RMAC_MIB_AIRTIME0(_band) MT_WF_RMAC(_band, 0x0380) #define MT_WF_RMAC_MIB_RXTIME_CLR BIT(31) -- 2.47.3