X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/a8744163a13e6bb84eb8057f457d95284248c580..1d3c32c54381ae0e02aa6d4324304a21f53673e2:/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c 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 01834887c..e5eced228 100644 --- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c +++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c @@ -473,6 +473,8 @@ static int ag71xx_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) if (!ag71xx_desc_empty(desc)) goto err_drop; + ag71xx_add_ar8216_header(ag, skb); + if (skb->len <= 0) { DBG("%s: packet len is too small\n", ag->dev->name); goto err_drop; @@ -647,15 +649,20 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit) skb_put(skb, pktlen); skb->dev = dev; - skb->protocol = eth_type_trans(skb, dev); skb->ip_summed = CHECKSUM_NONE; - netif_receive_skb(skb); - dev->last_rx = jiffies; dev->stats.rx_packets++; dev->stats.rx_bytes += pktlen; + if (ag71xx_remove_ar8216_header(ag, skb) != 0) { + dev->stats.rx_dropped++; + kfree_skb(skb); + } else { + skb->protocol = eth_type_trans(skb, dev); + netif_receive_skb(skb); + } + ring->buf[i].skb = NULL; done++;