Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: ethernet: mediatek: Use NET_IP_ALIGN to judge if HW RX_2BYTE_OFFSET is enabled

Should only enable HW RX_2BYTE_OFFSET function in the case NET_IP_ALIGN
equals to 2.

Signed-off-by: Mark Lee <mark-mc.lee@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Sean Wang and committed by
David S. Miller
880c2d4b 9e4f56f1

+2 -1
+2 -1
drivers/net/ethernet/mediatek/mtk_eth_soc.c
··· 1778 1778 1779 1779 static int mtk_start_dma(struct mtk_eth *eth) 1780 1780 { 1781 + u32 rx_2b_offset = (NET_IP_ALIGN == 2) ? MTK_RX_2B_OFFSET : 0; 1781 1782 int err; 1782 1783 1783 1784 err = mtk_dma_init(eth); ··· 1795 1794 MTK_QDMA_GLO_CFG); 1796 1795 1797 1796 mtk_w32(eth, 1798 - MTK_RX_DMA_EN | MTK_RX_2B_OFFSET | 1797 + MTK_RX_DMA_EN | rx_2b_offset | 1799 1798 MTK_RX_BT_32DWORDS | MTK_MULTI_EN, 1800 1799 MTK_PDMA_GLO_CFG); 1801 1800