mt76: mt7663: keep Rx filters as the default
authorSean Wang <sean.wang@mediatek.com>
Thu, 2 Apr 2020 13:06:37 +0000 (15:06 +0200)
committerFelix Fietkau <nbd@nbd.name>
Tue, 12 May 2020 17:52:28 +0000 (19:52 +0200)
Keep Rx filters default value if the firmware supports offload and
low power features.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/init.c

index 8b7d811..96b37f6 100644 (file)
@@ -22,7 +22,7 @@ static void mt7615_phy_init(struct mt7615_dev *dev)
 static void
 mt7615_init_mac_chain(struct mt7615_dev *dev, int chain)
 {
-       u32 val, mask, set;
+       u32 val;
 
        if (!chain)
                val = MT_CFG_CCR_MAC_D0_1X_GC_EN | MT_CFG_CCR_MAC_D0_2X_GC_EN;
@@ -62,15 +62,19 @@ mt7615_init_mac_chain(struct mt7615_dev *dev, int chain)
                FIELD_PREP(MT_AGG_ARxCR_LIMIT(6), MT7615_RATE_RETRY - 1) |
                FIELD_PREP(MT_AGG_ARxCR_LIMIT(7), MT7615_RATE_RETRY - 1));
 
-       mask = MT_DMA_RCFR0_MCU_RX_MGMT |
-              MT_DMA_RCFR0_MCU_RX_CTL_NON_BAR |
-              MT_DMA_RCFR0_MCU_RX_CTL_BAR |
-              MT_DMA_RCFR0_MCU_RX_BYPASS |
-              MT_DMA_RCFR0_RX_DROPPED_UCAST |
-              MT_DMA_RCFR0_RX_DROPPED_MCAST;
-       set = FIELD_PREP(MT_DMA_RCFR0_RX_DROPPED_UCAST, 2) |
-             FIELD_PREP(MT_DMA_RCFR0_RX_DROPPED_MCAST, 2);
-       mt76_rmw(dev, MT_DMA_RCFR0(chain), mask, set);
+       if (!mt7615_firmware_offload(dev)) {
+               u32 mask, set;
+
+               mask = MT_DMA_RCFR0_MCU_RX_MGMT |
+                      MT_DMA_RCFR0_MCU_RX_CTL_NON_BAR |
+                      MT_DMA_RCFR0_MCU_RX_CTL_BAR |
+                      MT_DMA_RCFR0_MCU_RX_BYPASS |
+                      MT_DMA_RCFR0_RX_DROPPED_UCAST |
+                      MT_DMA_RCFR0_RX_DROPPED_MCAST;
+               set = FIELD_PREP(MT_DMA_RCFR0_RX_DROPPED_UCAST, 2) |
+                     FIELD_PREP(MT_DMA_RCFR0_RX_DROPPED_MCAST, 2);
+               mt76_rmw(dev, MT_DMA_RCFR0(chain), mask, set);
+       }
 }
 
 static void mt7615_mac_init(struct mt7615_dev *dev)