mediatek: mtk_eth_soc: Change RX DMA L4 valid bit definition

This commit is contained in:
hanwckf 2024-09-10 01:56:35 +08:00
parent 9a18653aab
commit f1f4dfef8c

View File

@ -1382,7 +1382,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
while (done < budget) {
struct net_device *netdev;
unsigned int pktlen;
unsigned int pktlen, *rxdcsum;
dma_addr_t dma_addr;
int mac;
@ -1456,10 +1456,12 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget,
skb->dev = netdev;
skb_put(skb, pktlen);
if ((!MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_RX_V2) &&
(trxd.rxd4 & eth->rx_dma_l4_valid)) ||
(MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_RX_V2) &&
(trxd.rxd3 & eth->rx_dma_l4_valid)))
if ((MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_RX_V2)))
rxdcsum = &trxd.rxd3;
else
rxdcsum = &trxd.rxd4;
if (*rxdcsum & eth->rx_dma_l4_valid)
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
skb_checksum_none_assert(skb);
@ -3542,7 +3544,7 @@ static int mtk_probe(struct platform_device *pdev)
eth->rx_dma_l4_valid = RX_DMA_L4_VALID_PDMA;
eth->ip_align = NET_IP_ALIGN;
} else {
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_RX_V2))
eth->rx_dma_l4_valid = RX_DMA_L4_VALID_V2;
else
eth->rx_dma_l4_valid = RX_DMA_L4_VALID;