public inbox for b43-dev@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/2] bcma: inform drivers about translation bits needed for the board
@ 2011-07-19  8:05 Rafał Miłecki
  2011-07-19  8:05 ` [PATCH 2/2] b43: bcma: get DMA translation bits Rafał Miłecki
       [not found] ` <4E2596FB.5030105@gnu.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Rafał Miłecki @ 2011-07-19  8:05 UTC (permalink / raw)
  To: linux-wireless, John W. Linville
  Cc: b43-dev, Pavel Roskin, Rafał Miłecki

When using DMA, drivers need to pass special translation info to the
hardware.

Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
---
 drivers/bcma/main.c       |   12 ++++++++++++
 include/linux/bcma/bcma.h |    2 ++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 873e2e4..660288c 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -164,6 +164,18 @@ int bcma_bus_register(struct bcma_bus *bus)
 	return 0;
 }
 
+u32 bcma_dma_translation(struct bcma_bus *bus)
+{
+	switch (bus->hosttype) {
+	case BCMA_HOSTTYPE_PCI:
+		return 0x40000000;
+	default:
+		pr_err("DMA translation unknown for host %d\n", bus->hosttype);
+	}
+	return 0;
+}
+EXPORT_SYMBOL(bcma_dma_translation);
+
 void bcma_bus_unregister(struct bcma_bus *bus)
 {
 	bcma_unregister_cores(bus);
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index cc1582d..921671b 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -255,6 +255,8 @@ void bcma_awrite32(struct bcma_device *core, u16 offset, u32 value)
 #define bcma_maskset32(cc, offset, mask, set) \
 	bcma_write32(cc, offset, (bcma_read32(cc, offset) & (mask)) | (set))
 
+extern u32 bcma_dma_translation(struct bcma_bus *bus);
+
 extern bool bcma_core_is_enabled(struct bcma_device *core);
 extern void bcma_core_disable(struct bcma_device *core, u32 flags);
 extern int bcma_core_enable(struct bcma_device *core, u32 flags);
-- 
1.7.3.4

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

end of thread, other threads:[~2011-07-19 18:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-19  8:05 [PATCH 1/2] bcma: inform drivers about translation bits needed for the board Rafał Miłecki
2011-07-19  8:05 ` [PATCH 2/2] b43: bcma: get DMA translation bits Rafał Miłecki
     [not found]   ` <4E259A1B.3040306@gnu.org>
2011-07-19 18:46     ` Rafał Miłecki
     [not found] ` <4E2596FB.5030105@gnu.org>
2011-07-19 17:14   ` [PATCH 1/2] bcma: inform drivers about translation bits needed for the board Rafał Miłecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox