summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell/pxa168_eth.c
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2016-10-17 15:54:06 -0400
committerDavid S. Miller <davem@davemloft.net>2016-10-18 11:34:19 -0400
commit5777987e0f4bf83c874b538d6be4029f4597878a (patch)
tree19e8032818b84253d0f72e8bf49b86cb31e677bf /drivers/net/ethernet/marvell/pxa168_eth.c
parent91c527a55664ddf4bee26673a35f91748dae4142 (diff)
downloadlinux-5777987e0f4bf83c874b538d6be4029f4597878a.tar.gz
linux-5777987e0f4bf83c874b538d6be4029f4597878a.tar.bz2
linux-5777987e0f4bf83c874b538d6be4029f4597878a.zip
ethernet/marvell: use core min/max MTU checking
mvneta: min_mtu 68, max_mtu 9676 - mtu validation routine mostly did range check, merge back into mvneta_change_mtu for simplicity mvpp2: min_mtu 68, max_mtu 9676 - mtu validation routine mostly did range check, merge back into mvpp2_change_mtu for simplicity pxa168_eth: min_mtu 68, max_mtu 9500 skge: min_mtu 60, max_mtu 9000 sky2: min_mtu 68, max_mtu 1500 or 9000, depending on hw CC: netdev@vger.kernel.org CC: Mirko Lindner <mlindner@marvell.com> CC: Stephen Hemminger <stephen@networkplumber.org> CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell/pxa168_eth.c')
-rw-r--r--drivers/net/ethernet/marvell/pxa168_eth.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index 5d5000c8edf1..b78a838f306c 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1209,9 +1209,6 @@ static int pxa168_eth_change_mtu(struct net_device *dev, int mtu)
int retval;
struct pxa168_eth_private *pep = netdev_priv(dev);
- if ((mtu > 9500) || (mtu < 68))
- return -EINVAL;
-
dev->mtu = mtu;
retval = set_port_config_ext(pep);
@@ -1459,6 +1456,10 @@ static int pxa168_eth_probe(struct platform_device *pdev)
dev->base_addr = 0;
dev->ethtool_ops = &pxa168_ethtool_ops;
+ /* MTU range: 68 - 9500 */
+ dev->min_mtu = ETH_MIN_MTU;
+ dev->max_mtu = 9500;
+
INIT_WORK(&pep->tx_timeout_task, pxa168_eth_tx_timeout_task);
if (pdev->dev.of_node)