b43-dev.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>,
	"Michael Büsch" <mb@bu3sch.de>,
	"Arend van Spriel" <arend@broadcom.com>,
	"Larry Finger" <Larry.Finger@lwfinger.net>,
	"George Kashperko" <george@znau.edu.ua>
Cc: b43-dev@lists.infradead.org, "Rafał Miłecki" <zajec5@gmail.com>
Subject: [TESTING ONLY][PATCH] b43: subscribe to bcmai
Date: Tue,  5 Apr 2011 22:07:08 +0200	[thread overview]
Message-ID: <1302034028-1947-1-git-send-email-zajec5@gmail.com> (raw)

---
 drivers/net/wireless/b43/b43.h  |    1 +
 drivers/net/wireless/b43/main.c |   43 ++++++++++++++++++++++++++++++++++++++-
 2 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index bd4cb75..283ee1d 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -6,6 +6,7 @@
 #include <linux/interrupt.h>
 #include <linux/hw_random.h>
 #include <linux/ssb/ssb.h>
+#include <linux/bcmai/bcmai.h>
 #include <net/mac80211.h>
 
 #include "debugfs.h"
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 57eb5b6..b35c49b 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -125,9 +125,15 @@ static const struct ssb_device_id b43_ssb_tbl[] = {
 	SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 16),
 	SSB_DEVTABLE_END
 };
-
 MODULE_DEVICE_TABLE(ssb, b43_ssb_tbl);
 
+static const struct bcmai_device_id b43_bcmai_tbl[] = {
+	BCMAI_CORE(BCMAI_MANUF_BCM, SSB_DEV_80211, 0x17),
+	BCMAI_CORE(BCMAI_MANUF_BCM, SSB_DEV_80211, 0x18),
+	BCMAI_CORETABLE_END
+};
+MODULE_DEVICE_TABLE(bcmai, b43_bcmai_tbl);
+
 /* Channel and ratetables are shared for all devices.
  * They can't be const, because ieee80211 puts some precalculated
  * data in there. This data is the same for all devices, so we don't
@@ -5069,6 +5075,28 @@ static void b43_remove(struct ssb_device *dev)
 	}
 }
 
+static int b43_bcmai_probe(struct bcmai_device *core)
+{
+	printk(KERN_INFO "Success! Hello world! :)\n");
+
+	bcmai_core_enable(core, 0x4);
+
+	u16 tmp = bcmai_read16(core, B43_MMIO_PHY_VER);
+	u16 analog_type = (tmp & B43_PHYVER_ANALOG) >> B43_PHYVER_ANALOG_SHIFT;
+	u16 phy_type = (tmp & B43_PHYVER_TYPE) >> B43_PHYVER_TYPE_SHIFT;
+	u16 phy_rev = (tmp & B43_PHYVER_VERSION);
+
+	bcmai_info("PHY (Analog %u, Type %u, Revision %u)\n",
+		analog_type, phy_type, phy_rev);
+
+	return 0;
+}
+
+static void b43_bcmai_remove(struct bcmai_device *core)
+{
+	printk(KERN_INFO "Success! Bye :)\n");
+}
+
 /* Perform a hardware reset. This can be called from any context. */
 void b43_controller_restart(struct b43_wldev *dev, const char *reason)
 {
@@ -5086,6 +5114,13 @@ static struct ssb_driver b43_ssb_driver = {
 	.remove		= b43_remove,
 };
 
+static struct bcmai_driver b43_bcmai_driver = {
+	.name		= KBUILD_MODNAME,
+	.id_table	= b43_bcmai_tbl,
+	.probe		= b43_bcmai_probe,
+	.remove		= b43_bcmai_remove,
+};
+
 static void b43_print_driverinfo(void)
 {
 	const char *feat_pci = "", *feat_pcmcia = "", *feat_nphy = "",
@@ -5127,6 +5162,9 @@ static int __init b43_init(void)
 	err = ssb_driver_register(&b43_ssb_driver);
 	if (err)
 		goto err_sdio_exit;
+	err = bcmai_driver_register(&b43_bcmai_driver);
+	if (err)
+		goto err_ssb_driver_exit;
 	b43_print_driverinfo();
 
 	return err;
@@ -5137,11 +5175,14 @@ err_pcmcia_exit:
 	b43_pcmcia_exit();
 err_dfs_exit:
 	b43_debugfs_exit();
+err_ssb_driver_exit:
+	ssb_driver_unregister(&b43_ssb_driver);
 	return err;
 }
 
 static void __exit b43_exit(void)
 {
+	bcmai_driver_unregister(&b43_bcmai_driver);
 	ssb_driver_unregister(&b43_ssb_driver);
 	b43_sdio_exit();
 	b43_pcmcia_exit();
-- 
1.7.3.4

                 reply	other threads:[~2011-04-05 20:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1302034028-1947-1-git-send-email-zajec5@gmail.com \
    --to=zajec5@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=arend@broadcom.com \
    --cc=b43-dev@lists.infradead.org \
    --cc=george@znau.edu.ua \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mb@bu3sch.de \
    /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;
as well as URLs for NNTP newsgroup(s).