1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

ar71xx: ag71xx: use dma_unmap_single to unmap frames

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20001 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg
2010-03-05 20:29:10 +00:00
parent fc4c3342f3
commit 54b41868d6
2 changed files with 14 additions and 5 deletions

View File

@@ -185,9 +185,11 @@ static void ag71xx_ring_rx_clean(struct ag71xx *ag)
return;
for (i = 0; i < AG71XX_RX_RING_SIZE; i++)
if (ring->buf[i].skb)
if (ring->buf[i].skb) {
dma_unmap_single(&ag->dev->dev, ring->buf[i].dma_addr,
AG71XX_RX_PKT_SIZE, DMA_FROM_DEVICE);
kfree_skb(ring->buf[i].skb);
}
}
static int ag71xx_ring_rx_init(struct ag71xx *ag)
@@ -223,6 +225,7 @@ static int ag71xx_ring_rx_init(struct ag71xx *ag)
AG71XX_RX_PKT_SIZE,
DMA_FROM_DEVICE);
ring->buf[i].skb = skb;
ring->buf[i].dma_addr = dma_addr;
ring->buf[i].desc->data = (u32) dma_addr;
ring->buf[i].desc->ctrl = DESC_EMPTY;
}
@@ -264,6 +267,7 @@ static int ag71xx_ring_rx_refill(struct ag71xx *ag)
DMA_FROM_DEVICE);
ring->buf[i].skb = skb;
ring->buf[i].dma_addr = dma_addr;
ring->buf[i].desc->data = (u32) dma_addr;
}
@@ -684,6 +688,9 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
pktlen = ag71xx_desc_pktlen(desc);
pktlen -= ETH_FCS_LEN;
dma_unmap_single(&dev->dev, ring->buf[i].dma_addr,
AG71XX_RX_PKT_SIZE, DMA_FROM_DEVICE);
skb_put(skb, pktlen);
skb->dev = dev;