diff options
Diffstat (limited to 'target/linux/ramips/patches-4.4/0501-net-next-mediatek-add-the-drivers-core-files.patch')
-rw-r--r-- | target/linux/ramips/patches-4.4/0501-net-next-mediatek-add-the-drivers-core-files.patch | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/target/linux/ramips/patches-4.4/0501-net-next-mediatek-add-the-drivers-core-files.patch b/target/linux/ramips/patches-4.4/0501-net-next-mediatek-add-the-drivers-core-files.patch index cc4c2a1..72ed2c5 100644 --- a/target/linux/ramips/patches-4.4/0501-net-next-mediatek-add-the-drivers-core-files.patch +++ b/target/linux/ramips/patches-4.4/0501-net-next-mediatek-add-the-drivers-core-files.patch @@ -600,7 +600,7 @@ Signed-off-by: Michael Lee <igvtee@gmail.com> +#endif --- /dev/null +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -0,0 +1,1587 @@ +@@ -0,0 +1,1593 @@ +/* This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License @@ -1945,6 +1945,10 @@ Signed-off-by: Michael Lee <igvtee@gmail.com> + if (!(priv->flags & FE_FLAG_JUMBO_FRAME)) + return eth_change_mtu(dev, new_mtu); + ++ if (IS_ENABLED(CONFIG_SOC_MT7621)) ++ if (new_mtu > 2048) ++ return -EINVAL; ++ + frag_size = fe_max_frag_size(new_mtu); + if (new_mtu < 68 || frag_size > PAGE_SIZE) + return -EINVAL; @@ -1968,15 +1972,17 @@ Signed-off-by: Michael Lee <igvtee@gmail.com> + return 0; + + fe_stop(dev); -+ fwd_cfg = fe_r32(FE_GDMA1_FWD_CFG); -+ if (new_mtu <= ETH_DATA_LEN) { -+ fwd_cfg &= ~FE_GDM1_JMB_EN; -+ } else { -+ fwd_cfg &= ~(FE_GDM1_JMB_LEN_MASK << FE_GDM1_JMB_LEN_SHIFT); -+ fwd_cfg |= (DIV_ROUND_UP(frag_size, 1024) << -+ FE_GDM1_JMB_LEN_SHIFT) | FE_GDM1_JMB_EN; ++ if (!IS_ENABLED(CONFIG_SOC_MT7621)) { ++ fwd_cfg = fe_r32(FE_GDMA1_FWD_CFG); ++ if (new_mtu <= ETH_DATA_LEN) { ++ fwd_cfg &= ~FE_GDM1_JMB_EN; ++ } else { ++ fwd_cfg &= ~(FE_GDM1_JMB_LEN_MASK << FE_GDM1_JMB_LEN_SHIFT); ++ fwd_cfg |= (DIV_ROUND_UP(frag_size, 1024) << ++ FE_GDM1_JMB_LEN_SHIFT) | FE_GDM1_JMB_EN; ++ } ++ fe_w32(fwd_cfg, FE_GDMA1_FWD_CFG); + } -+ fe_w32(fwd_cfg, FE_GDMA1_FWD_CFG); + + return fe_open(dev); +} |