summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/mt7921/main.c
diff options
context:
space:
mode:
authorNeil Chen <yn.chen@mediatek.com>2023-03-07 19:22:49 +0800
committerFelix Fietkau <nbd@nbd.name>2023-04-17 16:08:49 +0200
commita5af1481a85679a9812f728ee5cf64ee7edbe669 (patch)
tree4dda2d1a9405d76604c14245fc52fa91c5e55259 /drivers/net/wireless/mediatek/mt76/mt7921/main.c
parenta1ec7e6237c58c887e34ce4c02a9ec88ebe1c766 (diff)
wifi: mt76: mt7921: use driver flags rather than mac80211 flags to mcu
FIF_* flags from mac80211 is not ABI. mt7921 should not pass it into mcu directly. Remap FIF_* to driver defined flags as mcu command input. Fixes: c222f77fd421 ("wifi: mt76: mt7921: fix rx filter incorrect by drv/fw inconsistent") Signed-off-by: Neil Chen <yn.chen@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7921/main.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7921/main.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
index a72964e7a807..f1d537a7705a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
@@ -703,10 +703,25 @@ static void mt7921_configure_filter(struct ieee80211_hw *hw,
unsigned int *total_flags,
u64 multicast)
{
+#define MT7921_FILTER_FCSFAIL BIT(2)
+#define MT7921_FILTER_CONTROL BIT(5)
+#define MT7921_FILTER_OTHER_BSS BIT(6)
+#define MT7921_FILTER_ENABLE BIT(31)
+
struct mt7921_dev *dev = mt7921_hw_dev(hw);
+ u32 flags = MT7921_FILTER_ENABLE;
+
+#define MT7921_FILTER(_fif, _type) do { \
+ if (*total_flags & (_fif)) \
+ flags |= MT7921_FILTER_##_type; \
+ } while (0)
+
+ MT7921_FILTER(FIF_FCSFAIL, FCSFAIL);
+ MT7921_FILTER(FIF_CONTROL, CONTROL);
+ MT7921_FILTER(FIF_OTHER_BSS, OTHER_BSS);
mt7921_mutex_acquire(dev);
- mt7921_mcu_set_rxfilter(dev, *total_flags, 0, 0);
+ mt7921_mcu_set_rxfilter(dev, flags, 0, 0);
mt7921_mutex_release(dev);
*total_flags &= (FIF_OTHER_BSS | FIF_FCSFAIL | FIF_CONTROL);