#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)
} __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 {
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)
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;
}
DMA_FROM_DEVICE);
ring->buf[i].skb = skb;
+ ring->buf[i].dma_addr = dma_addr;
ring->buf[i].desc->data = (u32) dma_addr;
}
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;