aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2010-03-05 20:29:10 +0000
committerGabor Juhos <juhosg@openwrt.org>2010-03-05 20:29:10 +0000
commitcdf9393b6478dc0f1e5b31655e25800bf7a77637 (patch)
tree65ee9413a63e203d9d3624cd9afb68b09badf071 /target/linux/ar71xx
parentb9c5d6edc92cdb526524651b08b96fc6319e6db5 (diff)
downloadupstream-cdf9393b6478dc0f1e5b31655e25800bf7a77637.tar.gz
upstream-cdf9393b6478dc0f1e5b31655e25800bf7a77637.tar.bz2
upstream-cdf9393b6478dc0f1e5b31655e25800bf7a77637.zip
ar71xx: ag71xx: use dma_unmap_single to unmap frames
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20001 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h8
-rw-r--r--target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c11
2 files changed, 14 insertions, 5 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h
index 74593ddcc4..5e3573b335 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.29"
+#define AG71XX_DRV_VERSION "0.5.30"
#define AG71XX_NAPI_WEIGHT 64
#define AG71XX_OOM_REFILL (1 + HZ/10)
@@ -88,8 +88,10 @@ struct ag71xx_desc {
} __attribute__((aligned(4)));
struct ag71xx_buf {
- struct sk_buff *skb;
- struct ag71xx_desc *desc;
+ struct sk_buff *skb;
+ struct ag71xx_desc *desc;
+ dma_addr_t dma_addr;
+ u32 pad;
};
struct ag71xx_ring {
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 a3edd43aaf..cb4ccf06b6 100644
--- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
+++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
@@ -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;