aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-04-18 02:56:30 -0400
committerDavid S. Miller <davem@davemloft.net>2008-04-18 02:56:30 -0400
commit1e42198609d73ed1a9adcba2af275c24c2678420 (patch)
tree32fd4d9073bfc0f3909af8f9fb4bcff38951d01a /drivers/net/wireless/b43
parent794eb6bf20ebf992c040ea831cd3a9c64b0c1f7a (diff)
parent4b119e21d0c66c22e8ca03df05d9de623d0eb50f (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r--drivers/net/wireless/b43/dma.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index f1b983cb9c1f..21c886a9a1d9 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -328,10 +328,10 @@ static inline
328 dma_addr_t dmaaddr; 328 dma_addr_t dmaaddr;
329 329
330 if (tx) { 330 if (tx) {
331 dmaaddr = dma_map_single(ring->dev->dev->dev, 331 dmaaddr = dma_map_single(ring->dev->dev->dma_dev,
332 buf, len, DMA_TO_DEVICE); 332 buf, len, DMA_TO_DEVICE);
333 } else { 333 } else {
334 dmaaddr = dma_map_single(ring->dev->dev->dev, 334 dmaaddr = dma_map_single(ring->dev->dev->dma_dev,
335 buf, len, DMA_FROM_DEVICE); 335 buf, len, DMA_FROM_DEVICE);
336 } 336 }
337 337
@@ -343,9 +343,10 @@ static inline
343 dma_addr_t addr, size_t len, int tx) 343 dma_addr_t addr, size_t len, int tx)
344{ 344{
345 if (tx) { 345 if (tx) {
346 dma_unmap_single(ring->dev->dev->dev, addr, len, DMA_TO_DEVICE); 346 dma_unmap_single(ring->dev->dev->dma_dev,
347 addr, len, DMA_TO_DEVICE);
347 } else { 348 } else {
348 dma_unmap_single(ring->dev->dev->dev, 349 dma_unmap_single(ring->dev->dev->dma_dev,
349 addr, len, DMA_FROM_DEVICE); 350 addr, len, DMA_FROM_DEVICE);
350 } 351 }
351} 352}
@@ -355,7 +356,7 @@ static inline
355 dma_addr_t addr, size_t len) 356 dma_addr_t addr, size_t len)
356{ 357{
357 B43_WARN_ON(ring->tx); 358 B43_WARN_ON(ring->tx);
358 dma_sync_single_for_cpu(ring->dev->dev->dev, 359 dma_sync_single_for_cpu(ring->dev->dev->dma_dev,
359 addr, len, DMA_FROM_DEVICE); 360 addr, len, DMA_FROM_DEVICE);
360} 361}
361 362
@@ -364,7 +365,7 @@ static inline
364 dma_addr_t addr, size_t len) 365 dma_addr_t addr, size_t len)
365{ 366{
366 B43_WARN_ON(ring->tx); 367 B43_WARN_ON(ring->tx);
367 dma_sync_single_for_device(ring->dev->dev->dev, 368 dma_sync_single_for_device(ring->dev->dev->dma_dev,
368 addr, len, DMA_FROM_DEVICE); 369 addr, len, DMA_FROM_DEVICE);
369} 370}
370 371
@@ -380,7 +381,7 @@ static inline
380 381
381static int alloc_ringmemory(struct b43_dmaring *ring) 382static int alloc_ringmemory(struct b43_dmaring *ring)
382{ 383{
383 struct device *dev = ring->dev->dev->dev; 384 struct device *dma_dev = ring->dev->dev->dma_dev;
384 gfp_t flags = GFP_KERNEL; 385 gfp_t flags = GFP_KERNEL;
385 386
386 /* The specs call for 4K buffers for 30- and 32-bit DMA with 4K 387 /* The specs call for 4K buffers for 30- and 32-bit DMA with 4K
@@ -394,7 +395,7 @@ static int alloc_ringmemory(struct b43_dmaring *ring)
394 */ 395 */
395 if (ring->type == B43_DMA_64BIT) 396 if (ring->type == B43_DMA_64BIT)
396 flags |= GFP_DMA; 397 flags |= GFP_DMA;
397 ring->descbase = dma_alloc_coherent(dev, B43_DMA_RINGMEMSIZE, 398 ring->descbase = dma_alloc_coherent(dma_dev, B43_DMA_RINGMEMSIZE,
398 &(ring->dmabase), flags); 399 &(ring->dmabase), flags);
399 if (!ring->descbase) { 400 if (!ring->descbase) {
400 b43err(ring->dev->wl, "DMA ringmemory allocation failed\n"); 401 b43err(ring->dev->wl, "DMA ringmemory allocation failed\n");
@@ -407,9 +408,9 @@ static int alloc_ringmemory(struct b43_dmaring *ring)
407 408
408static void free_ringmemory(struct b43_dmaring *ring) 409static void free_ringmemory(struct b43_dmaring *ring)
409{ 410{
410 struct device *dev = ring->dev->dev->dev; 411 struct device *dma_dev = ring->dev->dev->dma_dev;
411 412
412 dma_free_coherent(dev, B43_DMA_RINGMEMSIZE, 413 dma_free_coherent(dma_dev, B43_DMA_RINGMEMSIZE,
413 ring->descbase, ring->dmabase); 414 ring->descbase, ring->dmabase);
414} 415}
415 416
@@ -818,7 +819,7 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
818 goto err_kfree_meta; 819 goto err_kfree_meta;
819 820
820 /* test for ability to dma to txhdr_cache */ 821 /* test for ability to dma to txhdr_cache */
821 dma_test = dma_map_single(dev->dev->dev, 822 dma_test = dma_map_single(dev->dev->dma_dev,
822 ring->txhdr_cache, 823 ring->txhdr_cache,
823 b43_txhdr_size(dev), 824 b43_txhdr_size(dev),
824 DMA_TO_DEVICE); 825 DMA_TO_DEVICE);
@@ -833,7 +834,7 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
833 if (!ring->txhdr_cache) 834 if (!ring->txhdr_cache)
834 goto err_kfree_meta; 835 goto err_kfree_meta;
835 836
836 dma_test = dma_map_single(dev->dev->dev, 837 dma_test = dma_map_single(dev->dev->dma_dev,
837 ring->txhdr_cache, 838 ring->txhdr_cache,
838 b43_txhdr_size(dev), 839 b43_txhdr_size(dev),
839 DMA_TO_DEVICE); 840 DMA_TO_DEVICE);
@@ -847,7 +848,7 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
847 } 848 }
848 } 849 }
849 850
850 dma_unmap_single(dev->dev->dev, 851 dma_unmap_single(dev->dev->dma_dev,
851 dma_test, b43_txhdr_size(dev), 852 dma_test, b43_txhdr_size(dev),
852 DMA_TO_DEVICE); 853 DMA_TO_DEVICE);
853 } 854 }