skb = fep->rx_skbuff[curidx];
- dma_unmap_single(fep->dev, skb->data,
+ dma_unmap_single(fep->dev, CBDR_BUFADDR(bdp),
L1_CACHE_ALIGN(PKT_MAXBUF_SIZE),
DMA_FROM_DEVICE);
skb = fep->rx_skbuff[curidx];
- dma_unmap_single(fep->dev, skb->data,
+ dma_unmap_single(fep->dev, CBDR_BUFADDR(bdp),
L1_CACHE_ALIGN(PKT_MAXBUF_SIZE),
DMA_FROM_DEVICE);
skb = fep->rx_skbuff[curidx];
- dma_unmap_single(fep->dev, skb->data,
+ dma_unmap_single(fep->dev, CBDR_BUFADDR(bdp),
L1_CACHE_ALIGN(PKT_MAXBUF_SIZE),
DMA_FROM_DEVICE);
skb = fep->rx_skbuff[curidx];
- dma_unmap_single(fep->dev, skb->data,
+ dma_unmap_single(fep->dev, CBDR_BUFADDR(bdp),
L1_CACHE_ALIGN(PKT_MAXBUF_SIZE),
DMA_FROM_DEVICE);
fep->stats.collisions++;
/* unmap */
- dma_unmap_single(fep->dev, skb->data, skb->len, DMA_TO_DEVICE);
+ dma_unmap_single(fep->dev, CBDR_BUFADDR(bdp),
+ skb->len, DMA_TO_DEVICE);
/*
* Free the sk buffer associated with this last transmit.
{
struct fs_enet_private *fep = netdev_priv(dev);
struct sk_buff *skb;
+ cbd_t *bdp;
int i;
/*
* Reset SKB transmit buffers.
*/
- for (i = 0; i < fep->tx_ring; i++) {
+ for (i = 0, bdp = fep->tx_bd_base; i < fep->tx_ring; i++, bdp++) {
if ((skb = fep->tx_skbuff[i]) == NULL)
continue;
/* unmap */
- dma_unmap_single(fep->dev, skb->data, skb->len, DMA_TO_DEVICE);
+ dma_unmap_single(fep->dev, CBDR_BUFADDR(bdp),
+ skb->len, DMA_TO_DEVICE);
fep->tx_skbuff[i] = NULL;
dev_kfree_skb(skb);
/*
* Reset SKB receive buffers
*/
- for (i = 0; i < fep->rx_ring; i++) {
+ for (i = 0, bdp = fep->rx_bd_base; i < fep->rx_ring; i++, bdp++) {
if ((skb = fep->rx_skbuff[i]) == NULL)
continue;
/* unmap */
- dma_unmap_single(fep->dev, skb->data,
+ dma_unmap_single(fep->dev, CBDR_BUFADDR(bdp),
L1_CACHE_ALIGN(PKT_MAXBUF_SIZE),
DMA_FROM_DEVICE);