summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell/skge.c
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2016-10-17 21:54:06 +0200
committerDavid S. Miller <davem@davemloft.net>2016-10-18 17:34:19 +0200
commit5777987e0f4bf83c874b538d6be4029f4597878a (patch)
tree19e8032818b84253d0f72e8bf49b86cb31e677bf /drivers/net/ethernet/marvell/skge.c
parentethernet/intel: use core min/max MTU checking (diff)
downloadlinux-5777987e0f4bf83c874b538d6be4029f4597878a.tar.xz
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/skge.c')
-rw-r--r--drivers/net/ethernet/marvell/skge.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c
index 7173836fe361..9c4b722c3fdd 100644
--- a/drivers/net/ethernet/marvell/skge.c
+++ b/drivers/net/ethernet/marvell/skge.c
@@ -2900,9 +2900,6 @@ static int skge_change_mtu(struct net_device *dev, int new_mtu)
{
int err;
- if (new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU)
- return -EINVAL;
-
if (!netif_running(dev)) {
dev->mtu = new_mtu;
return 0;
@@ -3857,6 +3854,10 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port,
dev->watchdog_timeo = TX_WATCHDOG;
dev->irq = hw->pdev->irq;
+ /* MTU range: 60 - 9000 */
+ dev->min_mtu = ETH_ZLEN;
+ dev->max_mtu = ETH_JUMBO_MTU;
+
if (highmem)
dev->features |= NETIF_F_HIGHDMA;