lantiq: fix maximum ethernet header length
[openwrt/svn-archive/archive.git] / target / linux / lantiq / patches-3.10 / 0207-NET-fix-etop-igplen.patch
1 --- a/drivers/net/ethernet/lantiq_etop.c
2 +++ b/drivers/net/ethernet/lantiq_etop.c
3 @@ -31,6 +31,7 @@
4 #include <linux/mm.h>
5 #include <linux/platform_device.h>
6 #include <linux/ethtool.h>
7 +#include <linux/if_vlan.h>
8 #include <linux/init.h>
9 #include <linux/delay.h>
10 #include <linux/io.h>
11 @@ -764,8 +765,10 @@ ltq_etop_change_mtu(struct net_device *d
12 struct ltq_etop_priv *priv = netdev_priv(dev);
13 unsigned long flags;
14
15 + int max = ETH_HLEN + VLAN_HLEN + new_mtu + ETH_FCS_LEN;
16 +
17 spin_lock_irqsave(&priv->lock, flags);
18 - ltq_etop_w32((ETOP_PLEN_UNDER << 16) | new_mtu,
19 + ltq_etop_w32((ETOP_PLEN_UNDER << 16) | max,
20 LTQ_ETOP_IGPLEN);
21 spin_unlock_irqrestore(&priv->lock, flags);
22 }