linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] b43legacy: Fix usage of struct device used for DMAing
@ 2008-04-11 10:16 Michael Buesch
  2008-04-13 23:00 ` Stefano Brivio
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Buesch @ 2008-04-11 10:16 UTC (permalink / raw)
  To: John Linville; +Cc: bcm43xx-dev, Stefano Brivio, linux-wireless

This fixes b43legacy for the SSB DMA API change.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: Stefano Brivio <stefano.brivio@polimi.it>

---

John, this is the fixed version of the bugfix for 2.6.25 :P


Index: wireless-testing/drivers/net/wireless/b43legacy/dma.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43legacy/dma.c	2008-02-16 19:08:12.000000000 +0100
+++ wireless-testing/drivers/net/wireless/b43legacy/dma.c	2008-04-11 12:15:56.000000000 +0200
@@ -393,11 +393,11 @@ dma_addr_t map_descbuffer(struct b43lega
 	dma_addr_t dmaaddr;
 
 	if (tx)
-		dmaaddr = dma_map_single(ring->dev->dev->dev,
+		dmaaddr = dma_map_single(ring->dev->dev->dma_dev,
 					 buf, len,
 					 DMA_TO_DEVICE);
 	else
-		dmaaddr = dma_map_single(ring->dev->dev->dev,
+		dmaaddr = dma_map_single(ring->dev->dev->dma_dev,
 					 buf, len,
 					 DMA_FROM_DEVICE);
 
@@ -411,11 +411,11 @@ void unmap_descbuffer(struct b43legacy_d
 		      int tx)
 {
 	if (tx)
-		dma_unmap_single(ring->dev->dev->dev,
+		dma_unmap_single(ring->dev->dev->dma_dev,
 				 addr, len,
 				 DMA_TO_DEVICE);
 	else
-		dma_unmap_single(ring->dev->dev->dev,
+		dma_unmap_single(ring->dev->dev->dma_dev,
 				 addr, len,
 				 DMA_FROM_DEVICE);
 }
@@ -427,7 +427,7 @@ void sync_descbuffer_for_cpu(struct b43l
 {
 	B43legacy_WARN_ON(ring->tx);
 
-	dma_sync_single_for_cpu(ring->dev->dev->dev,
+	dma_sync_single_for_cpu(ring->dev->dev->dma_dev,
 				addr, len, DMA_FROM_DEVICE);
 }
 
@@ -438,7 +438,7 @@ void sync_descbuffer_for_device(struct b
 {
 	B43legacy_WARN_ON(ring->tx);
 
-	dma_sync_single_for_device(ring->dev->dev->dev,
+	dma_sync_single_for_device(ring->dev->dev->dma_dev,
 				   addr, len, DMA_FROM_DEVICE);
 }
 
@@ -458,9 +458,9 @@ void free_descriptor_buffer(struct b43le
 
 static int alloc_ringmemory(struct b43legacy_dmaring *ring)
 {
-	struct device *dev = ring->dev->dev->dev;
+	struct device *dma_dev = ring->dev->dev->dma_dev;
 
-	ring->descbase = dma_alloc_coherent(dev, B43legacy_DMA_RINGMEMSIZE,
+	ring->descbase = dma_alloc_coherent(dma_dev, B43legacy_DMA_RINGMEMSIZE,
 					    &(ring->dmabase), GFP_KERNEL);
 	if (!ring->descbase) {
 		b43legacyerr(ring->dev->wl, "DMA ringmemory allocation"
@@ -474,9 +474,9 @@ static int alloc_ringmemory(struct b43le
 
 static void free_ringmemory(struct b43legacy_dmaring *ring)
 {
-	struct device *dev = ring->dev->dev->dev;
+	struct device *dma_dev = ring->dev->dev->dma_dev;
 
-	dma_free_coherent(dev, B43legacy_DMA_RINGMEMSIZE,
+	dma_free_coherent(dma_dev, B43legacy_DMA_RINGMEMSIZE,
 			  ring->descbase, ring->dmabase);
 }
 
@@ -886,7 +886,7 @@ struct b43legacy_dmaring *b43legacy_setu
 			goto err_kfree_meta;
 
 		/* test for ability to dma to txhdr_cache */
-		dma_test = dma_map_single(dev->dev->dev, ring->txhdr_cache,
+		dma_test = dma_map_single(dev->dev->dma_dev, ring->txhdr_cache,
 					  sizeof(struct b43legacy_txhdr_fw3),
 					  DMA_TO_DEVICE);
 
@@ -900,7 +900,7 @@ struct b43legacy_dmaring *b43legacy_setu
 			if (!ring->txhdr_cache)
 				goto err_kfree_meta;
 
-			dma_test = dma_map_single(dev->dev->dev,
+			dma_test = dma_map_single(dev->dev->dma_dev,
 					ring->txhdr_cache,
 					sizeof(struct b43legacy_txhdr_fw3),
 					DMA_TO_DEVICE);
@@ -910,7 +910,7 @@ struct b43legacy_dmaring *b43legacy_setu
 				goto err_kfree_txhdr_cache;
 		}
 
-		dma_unmap_single(dev->dev->dev,
+		dma_unmap_single(dev->dev->dma_dev,
 				 dma_test, sizeof(struct b43legacy_txhdr_fw3),
 				 DMA_TO_DEVICE);
 	}


-- 
Greetings Michael.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] b43legacy: Fix usage of struct device used for DMAing
  2008-04-11 10:16 [PATCH v2] b43legacy: Fix usage of struct device used for DMAing Michael Buesch
@ 2008-04-13 23:00 ` Stefano Brivio
  0 siblings, 0 replies; 2+ messages in thread
From: Stefano Brivio @ 2008-04-13 23:00 UTC (permalink / raw)
  To: Michael Buesch; +Cc: John Linville, bcm43xx-dev, linux-wireless

On Fri, 11 Apr 2008 12:16:36 +0200
Michael Buesch <mb@bu3sch.de> wrote:

> This fixes b43legacy for the SSB DMA API change.
> 
> Signed-off-by: Michael Buesch <mb@bu3sch.de>
> Cc: Stefano Brivio <stefano.brivio@polimi.it>

Acked-by: Stefano Brivio <stefano.brivio@polimi.it>


--
Ciao
Stefano

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-13 23:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-11 10:16 [PATCH v2] b43legacy: Fix usage of struct device used for DMAing Michael Buesch
2008-04-13 23:00 ` Stefano Brivio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).