summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-08-10 15:31:38 +0000
committerFelix Fietkau <nbd@openwrt.org>2013-08-10 15:31:38 +0000
commit7b05fe59a459976cd63bc77d9593d5ac0fc9e90a (patch)
tree08fc6b40e38100ec1f59c85a00d312156400b057 /target
parentfd586c027563a7aa8fcbf45f7b1885d8bd7276cd (diff)
downloadopenwrt-7b05fe59a459976cd63bc77d9593d5ac0fc9e90a.tar.gz
openwrt-7b05fe59a459976cd63bc77d9593d5ac0fc9e90a.tar.bz2
openwrt-7b05fe59a459976cd63bc77d9593d5ac0fc9e90a.zip
ar71xx: allow mtu > 1500 based on the configured tx/rx mtu register value
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 37748
Diffstat (limited to 'target')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index 50029ffafe..5913bb6de4 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -1042,13 +1042,22 @@ static void ag71xx_netpoll(struct net_device *dev)
}
#endif
+static int ag71xx_change_mtu(struct net_device *dev, int new_mtu)
+{
+ if (new_mtu < 68 ||
+ new_mtu > AG71XX_TX_MTU_LEN - ETH_HLEN - ETH_FCS_LEN)
+ return -EINVAL;
+
+ dev->mtu = new_mtu;
+}
+
static const struct net_device_ops ag71xx_netdev_ops = {
.ndo_open = ag71xx_open,
.ndo_stop = ag71xx_stop,
.ndo_start_xmit = ag71xx_hard_start_xmit,
.ndo_do_ioctl = ag71xx_do_ioctl,
.ndo_tx_timeout = ag71xx_tx_timeout,
- .ndo_change_mtu = eth_change_mtu,
+ .ndo_change_mtu = ag71xx_change_mtu,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,
#ifdef CONFIG_NET_POLL_CONTROLLER