mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-25 07:48:58 +02:00
backfire: ar71xx: ag71xx: avoid unalinged accesses when using the phy specific receive functions (backport of r20751)
git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@20760 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
612a3d373d
commit
311592bd07
@ -38,7 +38,7 @@
|
|||||||
#define ETH_FCS_LEN 4
|
#define ETH_FCS_LEN 4
|
||||||
|
|
||||||
#define AG71XX_DRV_NAME "ag71xx"
|
#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_NAPI_WEIGHT 64
|
||||||
#define AG71XX_OOM_REFILL (1 + HZ/10)
|
#define AG71XX_OOM_REFILL (1 + HZ/10)
|
||||||
|
@ -764,6 +764,9 @@ static int ag71xx_rx_copy_skb(struct ag71xx *ag, struct sk_buff **pskb,
|
|||||||
{
|
{
|
||||||
struct sk_buff *copy_skb;
|
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);
|
copy_skb = netdev_alloc_skb(ag->dev, pktlen + NET_IP_ALIGN);
|
||||||
if (!copy_skb)
|
if (!copy_skb)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -776,6 +779,10 @@ static int ag71xx_rx_copy_skb(struct ag71xx *ag, struct sk_buff **pskb,
|
|||||||
*pskb = copy_skb;
|
*pskb = copy_skb;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
keep:
|
||||||
|
skb_put(*pskb, pktlen);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
|
static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
|
||||||
|
Loading…
Reference in New Issue
Block a user