diff options
author | Florian Fainelli <florian@openwrt.org> | 2010-03-06 19:55:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-07 18:25:52 -0500 |
commit | 30765d0502905a9248e5de72fc7ac83c23422861 (patch) | |
tree | a026bb9bdfa387be39f61d9c498d0f59eea4e144 /drivers/net/cpmac.c | |
parent | 8d15d3864a733476931f7e0b3d82824cddc766c2 (diff) |
cpmac: fix the receiving of 802.1q frames
Despite what the comment above CPMAC_SKB_SIZE says, the hardware also
needs to account for the FCS length in a received frame. This patch fix
the receiving of 802.1q frames which have 4 more bytes. While at it
unhardcode the definition and use the one from if_vlan.h.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cpmac.c')
-rw-r--r-- | drivers/net/cpmac.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c index 9d489421535e..55ee055d3321 100644 --- a/drivers/net/cpmac.c +++ b/drivers/net/cpmac.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/delay.h> | 28 | #include <linux/delay.h> |
29 | 29 | ||
30 | #include <linux/netdevice.h> | 30 | #include <linux/netdevice.h> |
31 | #include <linux/if_vlan.h> | ||
31 | #include <linux/etherdevice.h> | 32 | #include <linux/etherdevice.h> |
32 | #include <linux/ethtool.h> | 33 | #include <linux/ethtool.h> |
33 | #include <linux/skbuff.h> | 34 | #include <linux/skbuff.h> |
@@ -56,8 +57,8 @@ MODULE_PARM_DESC(debug_level, "Number of NETIF_MSG bits to enable"); | |||
56 | MODULE_PARM_DESC(dumb_switch, "Assume switch is not connected to MDIO bus"); | 57 | MODULE_PARM_DESC(dumb_switch, "Assume switch is not connected to MDIO bus"); |
57 | 58 | ||
58 | #define CPMAC_VERSION "0.5.1" | 59 | #define CPMAC_VERSION "0.5.1" |
59 | /* frame size + 802.1q tag */ | 60 | /* frame size + 802.1q tag + FCS size */ |
60 | #define CPMAC_SKB_SIZE (ETH_FRAME_LEN + 4) | 61 | #define CPMAC_SKB_SIZE (ETH_FRAME_LEN + ETH_FCS_LEN + VLAN_HLEN) |
61 | #define CPMAC_QUEUES 8 | 62 | #define CPMAC_QUEUES 8 |
62 | 63 | ||
63 | /* Ethernet registers */ | 64 | /* Ethernet registers */ |