From e419c9d49f37a80362b644cf6c133b38e1c0410c Mon Sep 17 00:00:00 2001 From: acoul Date: Fri, 30 Oct 2015 19:36:31 +0200 Subject: [PATCH] target/ath25: ar231x ethernet driver: enable baby jumbo frames --- .../302-eth_baby_jumbo_frames.patch | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 target/linux/ath25/patches-4.1/302-eth_baby_jumbo_frames.patch diff --git a/target/linux/ath25/patches-4.1/302-eth_baby_jumbo_frames.patch b/target/linux/ath25/patches-4.1/302-eth_baby_jumbo_frames.patch new file mode 100644 index 0000000000..6ce6a69421 --- /dev/null +++ b/target/linux/ath25/patches-4.1/302-eth_baby_jumbo_frames.patch @@ -0,0 +1,62 @@ +--- a/drivers/net/ethernet/atheros/ar231x/ar231x.h ++++ b/drivers/net/ethernet/atheros/ar231x/ar231x.h +@@ -4,6 +4,7 @@ + * Copyright (C) 2004 by Sameer Dekate + * Copyright (C) 2006 Imre Kaloz + * Copyright (C) 2006-2009 Felix Fietkau ++ * Copyright (C) 2015 Alexandros C. Couloumbis + * + * Thanks to Atheros for providing hardware and documentation + * enabling me to write this driver. +--- a/drivers/net/ethernet/atheros/ar231x/ar231x.c ++++ b/drivers/net/ethernet/atheros/ar231x/ar231x.c +@@ -4,6 +4,7 @@ + * Copyright (C) 2004 by Sameer Dekate + * Copyright (C) 2006 Imre Kaloz + * Copyright (C) 2006-2009 Felix Fietkau ++ * Copyright (C) 2015 Alexandros C. Couloumbis + * + * Thanks to Atheros for providing hardware and documentation + * enabling me to write this driver. +@@ -152,13 +153,31 @@ ar231x_netpoll(struct net_device *dev) + } + #endif + ++/* ++ * Enable baby jumbo packet support (as per RFC 4638). ++ * ++ * ath25_change_mtu: set interface MTU. ++ * A modified eth_change_mtu, changing the upper limit from ETH_DATA_LEN to ++ * AR2313_MTU. This means that baby jumbo packets may be used by ++ * PPPoE users, assuming that AR2313_MTU > ETH_DATA_LEN. ++ * ++ * Returns 0 on success, -EINVAL otherwise. ++ */ ++static int ath25_change_mtu(struct net_device *dev, int new_mtu) ++{ ++ if (new_mtu < 68 || new_mtu > AR2313_MTU) ++ return -EINVAL; ++ dev->mtu = new_mtu; ++ return 0; ++} ++ + static const struct net_device_ops ar231x_ops = { + .ndo_open = ar231x_open, + .ndo_stop = ar231x_close, + .ndo_start_xmit = ar231x_start_xmit, + .ndo_set_rx_mode = ar231x_multicast_list, + .ndo_do_ioctl = ar231x_ioctl, +- .ndo_change_mtu = eth_change_mtu, ++ .ndo_change_mtu = ath25_change_mtu, + .ndo_validate_addr = eth_validate_addr, + .ndo_set_mac_address = eth_mac_addr, + .ndo_tx_timeout = ar231x_tx_timeout, +@@ -955,7 +974,7 @@ static int ar231x_open(struct net_device + + mdelay(10); + +- dev->mtu = 1500; ++ dev->mtu = ETH_DATA_LEN; + netif_start_queue(dev); + + sp->eth_regs->mac_control |= MAC_CONTROL_RE; -- 2.35.1