diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2010-04-09 08:40:06 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2010-04-09 08:40:06 +0000 |
commit | 4c29a2c2630d362813b79a6033c5ce32620b5db2 (patch) | |
tree | 6c3b16e42bedad7c857aa6b9fbb6e7569c0700da /target/linux/ar71xx/files | |
parent | 4a28844d80e086fa00ca39f3fabcf5a199606a8f (diff) | |
download | upstream-4c29a2c2630d362813b79a6033c5ce32620b5db2.tar.gz upstream-4c29a2c2630d362813b79a6033c5ce32620b5db2.tar.bz2 upstream-4c29a2c2630d362813b79a6033c5ce32620b5db2.zip |
ar71xx: ag71xx: avoid unalinged accesses when using the phy specific receive functions
Cc: backfire@openwrt.org
SVN-Revision: 20751
Diffstat (limited to 'target/linux/ar71xx/files')
-rw-r--r-- | target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h | 2 | ||||
-rw-r--r-- | target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h index 77551dd625..af41972481 100644 --- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h +++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h @@ -38,7 +38,7 @@ #define ETH_FCS_LEN 4 #define AG71XX_DRV_NAME "ag71xx" -#define AG71XX_DRV_VERSION "0.5.34" +#define AG71XX_DRV_VERSION "0.5.35" #define AG71XX_NAPI_WEIGHT 64 #define AG71XX_OOM_REFILL (1 + HZ/10) 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 27c19564fc..8d61294beb 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) |