2 ===================================================================
3 --- b43.orig/dma.c 2008-07-27 13:56:25.000000000 +0200
4 +++ b43/dma.c 2008-07-27 14:02:26.000000000 +0200
5 @@ -328,11 +328,11 @@ static inline
9 - dmaaddr = ssb_dma_map_single(ring->dev->dev,
10 - buf, len, DMA_TO_DEVICE);
11 + dmaaddr = dma_map_single(ring->dev->dev->dma_dev,
12 + buf, len, DMA_TO_DEVICE);
14 - dmaaddr = ssb_dma_map_single(ring->dev->dev,
15 - buf, len, DMA_FROM_DEVICE);
16 + dmaaddr = dma_map_single(ring->dev->dev->dma_dev,
17 + buf, len, DMA_FROM_DEVICE);
21 @@ -343,11 +343,11 @@ static inline
22 dma_addr_t addr, size_t len, int tx)
25 - ssb_dma_unmap_single(ring->dev->dev,
26 - addr, len, DMA_TO_DEVICE);
27 + dma_unmap_single(ring->dev->dev->dma_dev,
28 + addr, len, DMA_TO_DEVICE);
30 - ssb_dma_unmap_single(ring->dev->dev,
31 - addr, len, DMA_FROM_DEVICE);
32 + dma_unmap_single(ring->dev->dev->dma_dev,
33 + addr, len, DMA_FROM_DEVICE);
37 @@ -356,8 +356,8 @@ static inline
38 dma_addr_t addr, size_t len)
40 B43_WARN_ON(ring->tx);
41 - ssb_dma_sync_single_for_cpu(ring->dev->dev,
42 - addr, len, DMA_FROM_DEVICE);
43 + dma_sync_single_for_cpu(ring->dev->dev->dma_dev,
44 + addr, len, DMA_FROM_DEVICE);
48 @@ -365,8 +365,8 @@ static inline
49 dma_addr_t addr, size_t len)
51 B43_WARN_ON(ring->tx);
52 - ssb_dma_sync_single_for_device(ring->dev->dev,
53 - addr, len, DMA_FROM_DEVICE);
54 + dma_sync_single_for_device(ring->dev->dev->dma_dev,
55 + addr, len, DMA_FROM_DEVICE);
59 @@ -381,6 +381,7 @@ static inline
61 static int alloc_ringmemory(struct b43_dmaring *ring)
63 + struct device *dma_dev = ring->dev->dev->dma_dev;
64 gfp_t flags = GFP_KERNEL;
66 /* The specs call for 4K buffers for 30- and 32-bit DMA with 4K
67 @@ -391,14 +392,11 @@ static int alloc_ringmemory(struct b43_dmaring *ring)
68 * For unknown reasons - possibly a hardware error - the BCM4311 rev
69 * 02, which uses 64-bit DMA, needs the ring buffer in very low memory,
70 * which accounts for the GFP_DMA flag below.
72 - * The flags here must match the flags in free_ringmemory below!
74 if (ring->type == B43_DMA_64BIT)
76 - ring->descbase = ssb_dma_alloc_consistent(ring->dev->dev,
77 - B43_DMA_RINGMEMSIZE,
78 - &(ring->dmabase), flags);
79 + ring->descbase = dma_alloc_coherent(dma_dev, B43_DMA_RINGMEMSIZE,
80 + &(ring->dmabase), flags);
81 if (!ring->descbase) {
82 b43err(ring->dev->wl, "DMA ringmemory allocation failed\n");
84 @@ -410,13 +408,10 @@ static int alloc_ringmemory(struct b43_dmaring *ring)
86 static void free_ringmemory(struct b43_dmaring *ring)
88 - gfp_t flags = GFP_KERNEL;
90 - if (ring->type == B43_DMA_64BIT)
92 + struct device *dma_dev = ring->dev->dev->dma_dev;
94 - ssb_dma_free_consistent(ring->dev->dev, B43_DMA_RINGMEMSIZE,
95 - ring->descbase, ring->dmabase, flags);
96 + dma_free_coherent(dma_dev, B43_DMA_RINGMEMSIZE,
97 + ring->descbase, ring->dmabase);
100 /* Reset the RX DMA channel */
101 @@ -523,7 +518,7 @@ static bool b43_dma_mapping_error(struct b43_dmaring *ring,
103 size_t buffersize, bool dma_to_device)
105 - if (unlikely(ssb_dma_mapping_error(ring->dev->dev, addr)))
106 + if (unlikely(dma_mapping_error(addr)))
109 switch (ring->type) {
110 @@ -849,10 +844,10 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
113 /* test for ability to dma to txhdr_cache */
114 - dma_test = ssb_dma_map_single(dev->dev,
116 - b43_txhdr_size(dev),
118 + dma_test = dma_map_single(dev->dev->dma_dev,
120 + b43_txhdr_size(dev),
123 if (b43_dma_mapping_error(ring, dma_test,
124 b43_txhdr_size(dev), 1)) {
125 @@ -864,10 +859,10 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
126 if (!ring->txhdr_cache)
129 - dma_test = ssb_dma_map_single(dev->dev,
131 - b43_txhdr_size(dev),
133 + dma_test = dma_map_single(dev->dev->dma_dev,
135 + b43_txhdr_size(dev),
138 if (b43_dma_mapping_error(ring, dma_test,
139 b43_txhdr_size(dev), 1)) {
140 @@ -878,9 +873,9 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
144 - ssb_dma_unmap_single(dev->dev,
145 - dma_test, b43_txhdr_size(dev),
147 + dma_unmap_single(dev->dev->dma_dev,
148 + dma_test, b43_txhdr_size(dev),
152 err = alloc_ringmemory(ring);