#include "mtk_eth_soc.h"
-@@ -1240,12 +1241,14 @@ static int mtk_poll_rx(struct napi_struc
- u8 *data, *new_data;
- struct mtk_rx_dma *rxd, trxd;
- int done = 0, bytes = 0;
-+ bool uses_dsa = eth->netdev[0] && netdev_uses_dsa(eth->netdev[0]);
-
- while (done < budget) {
- struct net_device *netdev;
- unsigned int pktlen;
- dma_addr_t dma_addr;
- int mac;
-+ u16 hash;
-
- ring = mtk_get_rx_ring(eth);
- if (unlikely(!ring))
-@@ -1259,13 +1262,13 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1280,13 +1281,12 @@ static int mtk_poll_rx(struct napi_struc
break;
/* find out which mac the packet come from. values start at 1 */
- if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
-+ if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
++ if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628) ||
++ (trxd.rxd4 & RX_DMA_SPECIAL_TAG))
mac = 0;
- } else {
- mac = (trxd.rxd4 >> RX_DMA_FPORT_SHIFT) &
- RX_DMA_FPORT_MASK;
- mac--;
- }
-+ else if (uses_dsa)
-+ mac = !(trxd.rxd4 >> 22);
+ else
+ mac = ((trxd.rxd4 >> RX_DMA_FPORT_SHIFT) &
+ RX_DMA_FPORT_MASK) - 1;
if (unlikely(mac < 0 || mac >= MTK_MAC_COUNT ||
!eth->netdev[mac]))
-@@ -2247,6 +2250,9 @@ static void mtk_gdm_config(struct mtk_et
+@@ -2268,6 +2268,9 @@ static void mtk_gdm_config(struct mtk_et
val |= config;
#define MTK_GDMA_ICS_EN BIT(22)
#define MTK_GDMA_TCS_EN BIT(21)
#define MTK_GDMA_UCS_EN BIT(20)
+@@ -324,6 +325,7 @@
+ #define RX_DMA_L4_VALID_PDMA BIT(30) /* when PDMA is used */
+ #define RX_DMA_FPORT_SHIFT 19
+ #define RX_DMA_FPORT_MASK 0x7
++#define RX_DMA_SPECIAL_TAG BIT(22)
+
+ /* PHY Indirect Access Control registers */
+ #define MTK_PHY_IAC 0x10004