diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2010-03-27 13:05:20 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2010-03-27 13:05:20 +0000 |
commit | 8db8756bc66be3f3432887e17f76214568892872 (patch) | |
tree | 6fd34da85fa2d24d8902a6fd0a2133caf6bfed5f /target/linux/ar71xx | |
parent | 1f415dbfe9a8c4b6666e2531ccce568c62d9a276 (diff) | |
download | upstream-8db8756bc66be3f3432887e17f76214568892872.tar.gz upstream-8db8756bc66be3f3432887e17f76214568892872.tar.bz2 upstream-8db8756bc66be3f3432887e17f76214568892872.zip |
ar71xx: ag71xx: reorganize ag71xx_rx_packet function
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20504 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx')
-rw-r--r-- | target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c | 13 |
1 files changed, 7 insertions, 6 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 8244239663..3cf4f5eced 100644 --- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c +++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c @@ -772,6 +772,7 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit) struct ag71xx_desc *desc = ring->buf[i].desc; struct sk_buff *skb; int pktlen; + int err; if (ag71xx_desc_empty(desc)) break; @@ -790,19 +791,19 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit) dma_unmap_single(&dev->dev, ring->buf[i].dma_addr, AG71XX_RX_PKT_SIZE, DMA_FROM_DEVICE); - skb_put(skb, pktlen); - - skb->dev = dev; - skb->ip_summed = CHECKSUM_NONE; - dev->last_rx = jiffies; dev->stats.rx_packets++; dev->stats.rx_bytes += pktlen; - if (ag71xx_remove_ar8216_header(ag, skb) != 0) { + err = ag71xx_remove_ar8216_header(ag, skb); + if (err) { dev->stats.rx_dropped++; kfree_skb(skb); } else { + skb_put(skb, pktlen); + + skb->dev = dev; + skb->ip_summed = CHECKSUM_NONE; skb->protocol = eth_type_trans(skb, dev); netif_receive_skb(skb); } |