diff options
author | David S. Miller <davem@davemloft.net> | 2010-06-11 14:34:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-11 14:34:06 -0400 |
commit | 14599f1e341ee219abdd15f4eee5872d6f2d29f1 (patch) | |
tree | 3875181429010e58416ab34e6c06ef42de52e756 /drivers/net/wireless/b43legacy | |
parent | d8d1f30b95a635dbd610dcc5eb641aca8f4768cf (diff) | |
parent | 832c10fd733893f86c63bde1c65b005d5a2fe346 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Conflicts:
drivers/net/wireless/wl12xx/wl1271.h
drivers/net/wireless/wl12xx/wl1271_cmd.h
Diffstat (limited to 'drivers/net/wireless/b43legacy')
-rw-r--r-- | drivers/net/wireless/b43legacy/dma.c | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c index e91520d0312e..e03e01d0bc35 100644 --- a/drivers/net/wireless/b43legacy/dma.c +++ b/drivers/net/wireless/b43legacy/dma.c | |||
@@ -394,11 +394,11 @@ dma_addr_t map_descbuffer(struct b43legacy_dmaring *ring, | |||
394 | dma_addr_t dmaaddr; | 394 | dma_addr_t dmaaddr; |
395 | 395 | ||
396 | if (tx) | 396 | if (tx) |
397 | dmaaddr = ssb_dma_map_single(ring->dev->dev, | 397 | dmaaddr = dma_map_single(ring->dev->dev->dma_dev, |
398 | buf, len, | 398 | buf, len, |
399 | DMA_TO_DEVICE); | 399 | DMA_TO_DEVICE); |
400 | else | 400 | else |
401 | dmaaddr = ssb_dma_map_single(ring->dev->dev, | 401 | dmaaddr = dma_map_single(ring->dev->dev->dma_dev, |
402 | buf, len, | 402 | buf, len, |
403 | DMA_FROM_DEVICE); | 403 | DMA_FROM_DEVICE); |
404 | 404 | ||
@@ -412,11 +412,11 @@ void unmap_descbuffer(struct b43legacy_dmaring *ring, | |||
412 | int tx) | 412 | int tx) |
413 | { | 413 | { |
414 | if (tx) | 414 | if (tx) |
415 | ssb_dma_unmap_single(ring->dev->dev, | 415 | dma_unmap_single(ring->dev->dev->dma_dev, |
416 | addr, len, | 416 | addr, len, |
417 | DMA_TO_DEVICE); | 417 | DMA_TO_DEVICE); |
418 | else | 418 | else |
419 | ssb_dma_unmap_single(ring->dev->dev, | 419 | dma_unmap_single(ring->dev->dev->dma_dev, |
420 | addr, len, | 420 | addr, len, |
421 | DMA_FROM_DEVICE); | 421 | DMA_FROM_DEVICE); |
422 | } | 422 | } |
@@ -428,8 +428,8 @@ void sync_descbuffer_for_cpu(struct b43legacy_dmaring *ring, | |||
428 | { | 428 | { |
429 | B43legacy_WARN_ON(ring->tx); | 429 | B43legacy_WARN_ON(ring->tx); |
430 | 430 | ||
431 | ssb_dma_sync_single_for_cpu(ring->dev->dev, | 431 | dma_sync_single_for_cpu(ring->dev->dev->dma_dev, |
432 | addr, len, DMA_FROM_DEVICE); | 432 | addr, len, DMA_FROM_DEVICE); |
433 | } | 433 | } |
434 | 434 | ||
435 | static inline | 435 | static inline |
@@ -439,8 +439,8 @@ void sync_descbuffer_for_device(struct b43legacy_dmaring *ring, | |||
439 | { | 439 | { |
440 | B43legacy_WARN_ON(ring->tx); | 440 | B43legacy_WARN_ON(ring->tx); |
441 | 441 | ||
442 | ssb_dma_sync_single_for_device(ring->dev->dev, | 442 | dma_sync_single_for_device(ring->dev->dev->dma_dev, |
443 | addr, len, DMA_FROM_DEVICE); | 443 | addr, len, DMA_FROM_DEVICE); |
444 | } | 444 | } |
445 | 445 | ||
446 | static inline | 446 | static inline |
@@ -460,10 +460,10 @@ void free_descriptor_buffer(struct b43legacy_dmaring *ring, | |||
460 | static int alloc_ringmemory(struct b43legacy_dmaring *ring) | 460 | static int alloc_ringmemory(struct b43legacy_dmaring *ring) |
461 | { | 461 | { |
462 | /* GFP flags must match the flags in free_ringmemory()! */ | 462 | /* GFP flags must match the flags in free_ringmemory()! */ |
463 | ring->descbase = ssb_dma_alloc_consistent(ring->dev->dev, | 463 | ring->descbase = dma_alloc_coherent(ring->dev->dev->dma_dev, |
464 | B43legacy_DMA_RINGMEMSIZE, | 464 | B43legacy_DMA_RINGMEMSIZE, |
465 | &(ring->dmabase), | 465 | &(ring->dmabase), |
466 | GFP_KERNEL); | 466 | GFP_KERNEL); |
467 | if (!ring->descbase) { | 467 | if (!ring->descbase) { |
468 | b43legacyerr(ring->dev->wl, "DMA ringmemory allocation" | 468 | b43legacyerr(ring->dev->wl, "DMA ringmemory allocation" |
469 | " failed\n"); | 469 | " failed\n"); |
@@ -476,8 +476,8 @@ static int alloc_ringmemory(struct b43legacy_dmaring *ring) | |||
476 | 476 | ||
477 | static void free_ringmemory(struct b43legacy_dmaring *ring) | 477 | static void free_ringmemory(struct b43legacy_dmaring *ring) |
478 | { | 478 | { |
479 | ssb_dma_free_consistent(ring->dev->dev, B43legacy_DMA_RINGMEMSIZE, | 479 | dma_free_coherent(ring->dev->dev->dma_dev, B43legacy_DMA_RINGMEMSIZE, |
480 | ring->descbase, ring->dmabase, GFP_KERNEL); | 480 | ring->descbase, ring->dmabase); |
481 | } | 481 | } |
482 | 482 | ||
483 | /* Reset the RX DMA channel */ | 483 | /* Reset the RX DMA channel */ |
@@ -589,7 +589,7 @@ static bool b43legacy_dma_mapping_error(struct b43legacy_dmaring *ring, | |||
589 | size_t buffersize, | 589 | size_t buffersize, |
590 | bool dma_to_device) | 590 | bool dma_to_device) |
591 | { | 591 | { |
592 | if (unlikely(ssb_dma_mapping_error(ring->dev->dev, addr))) | 592 | if (unlikely(dma_mapping_error(ring->dev->dev->dma_dev, addr))) |
593 | return 1; | 593 | return 1; |
594 | 594 | ||
595 | switch (ring->type) { | 595 | switch (ring->type) { |
@@ -906,7 +906,7 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev, | |||
906 | goto err_kfree_meta; | 906 | goto err_kfree_meta; |
907 | 907 | ||
908 | /* test for ability to dma to txhdr_cache */ | 908 | /* test for ability to dma to txhdr_cache */ |
909 | dma_test = ssb_dma_map_single(dev->dev, ring->txhdr_cache, | 909 | dma_test = dma_map_single(dev->dev->dma_dev, ring->txhdr_cache, |
910 | sizeof(struct b43legacy_txhdr_fw3), | 910 | sizeof(struct b43legacy_txhdr_fw3), |
911 | DMA_TO_DEVICE); | 911 | DMA_TO_DEVICE); |
912 | 912 | ||
@@ -920,7 +920,7 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev, | |||
920 | if (!ring->txhdr_cache) | 920 | if (!ring->txhdr_cache) |
921 | goto err_kfree_meta; | 921 | goto err_kfree_meta; |
922 | 922 | ||
923 | dma_test = ssb_dma_map_single(dev->dev, | 923 | dma_test = dma_map_single(dev->dev->dma_dev, |
924 | ring->txhdr_cache, | 924 | ring->txhdr_cache, |
925 | sizeof(struct b43legacy_txhdr_fw3), | 925 | sizeof(struct b43legacy_txhdr_fw3), |
926 | DMA_TO_DEVICE); | 926 | DMA_TO_DEVICE); |
@@ -930,9 +930,9 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev, | |||
930 | goto err_kfree_txhdr_cache; | 930 | goto err_kfree_txhdr_cache; |
931 | } | 931 | } |
932 | 932 | ||
933 | ssb_dma_unmap_single(dev->dev, dma_test, | 933 | dma_unmap_single(dev->dev->dma_dev, dma_test, |
934 | sizeof(struct b43legacy_txhdr_fw3), | 934 | sizeof(struct b43legacy_txhdr_fw3), |
935 | DMA_TO_DEVICE); | 935 | DMA_TO_DEVICE); |
936 | } | 936 | } |
937 | 937 | ||
938 | ring->nr_slots = nr_slots; | 938 | ring->nr_slots = nr_slots; |
@@ -1040,9 +1040,12 @@ static int b43legacy_dma_set_mask(struct b43legacy_wldev *dev, u64 mask) | |||
1040 | /* Try to set the DMA mask. If it fails, try falling back to a | 1040 | /* Try to set the DMA mask. If it fails, try falling back to a |
1041 | * lower mask, as we can always also support a lower one. */ | 1041 | * lower mask, as we can always also support a lower one. */ |
1042 | while (1) { | 1042 | while (1) { |
1043 | err = ssb_dma_set_mask(dev->dev, mask); | 1043 | err = dma_set_mask(dev->dev->dma_dev, mask); |
1044 | if (!err) | 1044 | if (!err) { |
1045 | break; | 1045 | err = dma_set_coherent_mask(dev->dev->dma_dev, mask); |
1046 | if (!err) | ||
1047 | break; | ||
1048 | } | ||
1046 | if (mask == DMA_BIT_MASK(64)) { | 1049 | if (mask == DMA_BIT_MASK(64)) { |
1047 | mask = DMA_BIT_MASK(32); | 1050 | mask = DMA_BIT_MASK(32); |
1048 | fallback = 1; | 1051 | fallback = 1; |