summaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-04-09 08:40:06 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-04-09 08:40:06 +0000
commitda7aaa905b604709004e6dd0699bb09fb329e825 (patch)
treeae865599fe4faaa2b13eb96955585fe1fc714931 /target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
parentc74f817d1548b99425c8b589cf119f78231dc57a (diff)
ar71xx: ag71xx: avoid unalinged accesses when using the phy specific receive functions
Cc: backfire@openwrt.org git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20751 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
index 27c19564f..8d61294be 100644
--- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
+++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
@@ -764,6 +764,9 @@ static int ag71xx_rx_copy_skb(struct ag71xx *ag, struct sk_buff **pskb,
{
struct sk_buff *copy_skb;
+ if (ag->phy_dev && (ag->phy_dev->pkt_align % 4) == 2)
+ goto keep;
+
copy_skb = netdev_alloc_skb(ag->dev, pktlen + NET_IP_ALIGN);
if (!copy_skb)
return -ENOMEM;
@@ -776,6 +779,10 @@ static int ag71xx_rx_copy_skb(struct ag71xx *ag, struct sk_buff **pskb,
*pskb = copy_skb;
return 0;
+
+ keep:
+ skb_put(*pskb, pktlen);
+ return 0;
}
static int ag71xx_rx_packets(struct ag71xx *ag, int limit)