public inbox for b43-dev@lists.infradead.org
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>
Cc: b43-dev@lists.infradead.org, "Pavel Roskin" <proski@gnu.org>,
	"Rafał Miłecki" <zajec5@gmail.com>
Subject: [PATCH 1/2] bcma: inform drivers about translation bits needed for the board
Date: Tue, 19 Jul 2011 10:05:00 +0200	[thread overview]
Message-ID: <1311062701-3455-1-git-send-email-zajec5@gmail.com> (raw)

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

             reply	other threads:[~2011-07-19  8:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-19  8:05 Rafał Miłecki [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1311062701-3455-1-git-send-email-zajec5@gmail.com \
    --to=zajec5@gmail.com \
    --cc=b43-dev@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=proski@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox