]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
net: xilinx_emacps: Make MTU of 1500 possible
authorStefan Eichenberger <eichest@gmail.com>
Mon, 11 Aug 2014 12:46:01 +0000 (14:46 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 11 Aug 2014 13:36:39 +0000 (15:36 +0200)
The current driver limits the MTU to  (1500 - hard_header_len). If the kernel
boots the MTU is set to 1500 but if once changed to < 1500 it is not possible
to set it back to 1500 again.

After this fix it is possible to set the MTU back to 1500.

The specific change MTU function is replaced by the standard eth_change_mtu
one.

Signed-off-by: Stefan Eichenberger <stefan.eichenberger@netmodule.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/ethernet/xilinx/xilinx_emacps.c

index 28e4da6dd0f4bb53d365b9f5adbfcb10c88e3630..ac359cbab76b90a954b12396f807a2c62f85117c 100644 (file)
@@ -2483,24 +2483,6 @@ static void xemacps_set_rx_mode(struct net_device *ndev)
        xemacps_write(lp->baseaddr, XEMACPS_NWCFG_OFFSET, regval);
 }
 
-#define MIN_MTU 60
-#define MAX_MTU 1500
-/**
- * xemacps_change_mtu - Change maximum transfer unit
- * @ndev: network interface device structure
- * @new_mtu: new vlaue for maximum frame size
- * Return: 0 on success, negative value if error.
- */
-static int xemacps_change_mtu(struct net_device *ndev, int new_mtu)
-{
-       if ((new_mtu < MIN_MTU) ||
-               ((new_mtu + ndev->hard_header_len) > MAX_MTU))
-               return -EINVAL;
-
-       ndev->mtu = new_mtu;    /* change mtu in net_device structure */
-       return 0;
-}
-
 /**
  * xemacps_get_settings - get device specific settings.
  * Usage: Issue "ethtool ethX" under linux prompt.
@@ -3141,7 +3123,7 @@ static struct net_device_ops netdev_ops = {
        .ndo_set_rx_mode        = xemacps_set_rx_mode,
        .ndo_set_mac_address    = xemacps_set_mac_address,
        .ndo_do_ioctl           = xemacps_ioctl,
-       .ndo_change_mtu         = xemacps_change_mtu,
+       .ndo_change_mtu         = eth_change_mtu,
        .ndo_tx_timeout         = xemacps_tx_timeout,
        .ndo_get_stats          = xemacps_get_stats,
 };