diff options
author | David S. Miller <davem@davemloft.net> | 2008-08-27 18:37:58 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-08-29 02:13:12 -0700 |
commit | 7a715f46012f3552294154978aed59cba9804928 (patch) | |
tree | 9e7079ae4ad370b63ac6c8a4face573d6cf60533 /drivers/net/myri_sbus.c | |
parent | 5778002874de0fb7e3d8c4a0a4afb6b1a6297069 (diff) | |
download | blackbird-op-linux-7a715f46012f3552294154978aed59cba9804928.tar.gz blackbird-op-linux-7a715f46012f3552294154978aed59cba9804928.zip |
sparc: Make SBUS DMA interfaces take struct device.
This is the first step in converting all the SBUS drivers
over to generic dma_*().
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/myri_sbus.c')
-rw-r--r-- | drivers/net/myri_sbus.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c index 656a260fc956..c17462159d9d 100644 --- a/drivers/net/myri_sbus.c +++ b/drivers/net/myri_sbus.c @@ -243,7 +243,8 @@ static void myri_clean_rings(struct myri_eth *mp) u32 dma_addr; dma_addr = sbus_readl(&rxd->myri_scatters[0].addr); - sbus_unmap_single(mp->myri_sdev, dma_addr, RX_ALLOC_SIZE, SBUS_DMA_FROMDEVICE); + sbus_unmap_single(&mp->myri_sdev->ofdev.dev, dma_addr, + RX_ALLOC_SIZE, SBUS_DMA_FROMDEVICE); dev_kfree_skb(mp->rx_skbs[i]); mp->rx_skbs[i] = NULL; } @@ -259,7 +260,9 @@ static void myri_clean_rings(struct myri_eth *mp) u32 dma_addr; dma_addr = sbus_readl(&txd->myri_gathers[0].addr); - sbus_unmap_single(mp->myri_sdev, dma_addr, (skb->len + 3) & ~3, SBUS_DMA_TODEVICE); + sbus_unmap_single(&mp->myri_sdev->ofdev.dev, dma_addr, + (skb->len + 3) & ~3, + SBUS_DMA_TODEVICE); dev_kfree_skb(mp->tx_skbs[i]); mp->tx_skbs[i] = NULL; } @@ -288,7 +291,9 @@ static void myri_init_rings(struct myri_eth *mp, int from_irq) skb->dev = dev; skb_put(skb, RX_ALLOC_SIZE); - dma_addr = sbus_map_single(mp->myri_sdev, skb->data, RX_ALLOC_SIZE, SBUS_DMA_FROMDEVICE); + dma_addr = sbus_map_single(&mp->myri_sdev->ofdev.dev, + skb->data, RX_ALLOC_SIZE, + SBUS_DMA_FROMDEVICE); sbus_writel(dma_addr, &rxd[i].myri_scatters[0].addr); sbus_writel(RX_ALLOC_SIZE, &rxd[i].myri_scatters[0].len); sbus_writel(i, &rxd[i].ctx); @@ -344,7 +349,8 @@ static void myri_tx(struct myri_eth *mp, struct net_device *dev) DTX(("SKB[%d] ", entry)); dma_addr = sbus_readl(&sq->myri_txd[entry].myri_gathers[0].addr); - sbus_unmap_single(mp->myri_sdev, dma_addr, skb->len, SBUS_DMA_TODEVICE); + sbus_unmap_single(&mp->myri_sdev->ofdev.dev, dma_addr, + skb->len, SBUS_DMA_TODEVICE); dev_kfree_skb(skb); mp->tx_skbs[entry] = NULL; dev->stats.tx_packets++; @@ -423,7 +429,7 @@ static void myri_rx(struct myri_eth *mp, struct net_device *dev) /* Check for errors. */ DRX(("rxd[%d]: %p len[%d] csum[%08x] ", entry, rxd, len, csum)); - sbus_dma_sync_single_for_cpu(mp->myri_sdev, + sbus_dma_sync_single_for_cpu(&mp->myri_sdev->ofdev.dev, sbus_readl(&rxd->myri_scatters[0].addr), RX_ALLOC_SIZE, SBUS_DMA_FROMDEVICE); if (len < (ETH_HLEN + MYRI_PAD_LEN) || (skb->data[0] != MYRI_PAD_LEN)) { @@ -442,7 +448,7 @@ static void myri_rx(struct myri_eth *mp, struct net_device *dev) drops++; DRX(("DROP ")); dev->stats.rx_dropped++; - sbus_dma_sync_single_for_device(mp->myri_sdev, + sbus_dma_sync_single_for_device(&mp->myri_sdev->ofdev.dev, sbus_readl(&rxd->myri_scatters[0].addr), RX_ALLOC_SIZE, SBUS_DMA_FROMDEVICE); @@ -464,14 +470,14 @@ static void myri_rx(struct myri_eth *mp, struct net_device *dev) DRX(("skb_alloc(FAILED) ")); goto drop_it; } - sbus_unmap_single(mp->myri_sdev, + sbus_unmap_single(&mp->myri_sdev->ofdev.dev, sbus_readl(&rxd->myri_scatters[0].addr), RX_ALLOC_SIZE, SBUS_DMA_FROMDEVICE); mp->rx_skbs[index] = new_skb; new_skb->dev = dev; skb_put(new_skb, RX_ALLOC_SIZE); - dma_addr = sbus_map_single(mp->myri_sdev, + dma_addr = sbus_map_single(&mp->myri_sdev->ofdev.dev, new_skb->data, RX_ALLOC_SIZE, SBUS_DMA_FROMDEVICE); @@ -500,7 +506,7 @@ static void myri_rx(struct myri_eth *mp, struct net_device *dev) /* Reuse original ring buffer. */ DRX(("reuse ")); - sbus_dma_sync_single_for_device(mp->myri_sdev, + sbus_dma_sync_single_for_device(&mp->myri_sdev->ofdev.dev, sbus_readl(&rxd->myri_scatters[0].addr), RX_ALLOC_SIZE, SBUS_DMA_FROMDEVICE); @@ -652,7 +658,8 @@ static int myri_start_xmit(struct sk_buff *skb, struct net_device *dev) sbus_writew((skb->data[4] << 8) | skb->data[5], &txd->addr[3]); } - dma_addr = sbus_map_single(mp->myri_sdev, skb->data, len, SBUS_DMA_TODEVICE); + dma_addr = sbus_map_single(&mp->myri_sdev->ofdev.dev, skb->data, + len, SBUS_DMA_TODEVICE); sbus_writel(dma_addr, &txd->myri_gathers[0].addr); sbus_writel(len, &txd->myri_gathers[0].len); sbus_writel(1, &txd->num_sg); |