diff options
author | Michael Lee <igvtee@gmail.com> | 2017-04-27 09:04:31 +0800 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2017-05-18 14:50:16 +0200 |
commit | eee09bfe01e8cc2db1501f82dde7b9b6bb424faf (patch) | |
tree | 3bfcf47dfb557addf060bae62cdbfca8fe70ce9f /target/linux/ramips/patches-4.4/0501-net-next-mediatek-add-the-drivers-core-files.patch | |
parent | 224e5f5efa22b8a0132522367afd3b22f05d53e1 (diff) | |
download | upstream-eee09bfe01e8cc2db1501f82dde7b9b6bb424faf.tar.gz upstream-eee09bfe01e8cc2db1501f82dde7b9b6bb424faf.tar.bz2 upstream-eee09bfe01e8cc2db1501f82dde7b9b6bb424faf.zip |
ramips: support jumbo frame on mt7621 up to 2k
Signed-off-by: Michael Lee <igvtee@gmail.com>
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 cc4c2a152d..72ed2c5df1 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); +} |