linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] b43: Output message at startup if hardware switch for radio is off
@ 2007-11-09 22:47 Larry Finger
  2007-11-10 15:24 ` Michael Buesch
  0 siblings, 1 reply; 4+ messages in thread
From: Larry Finger @ 2007-11-09 22:47 UTC (permalink / raw)
  To: John Linville, Michael Buesch; +Cc: Bcm43xx-dev, linux-wireless

Now that the radio is controlled by rfkill, there is a potential
difficulty in helping a new user get started, as it is unlikely
that they will have setup rfkill. This patch prints a message if
the interface is started with the hardware switch off.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

John,

This patch is intended for the everything branch of wireless-2.6.

Larry

 main.c   |   10 +++++++---
 main.h   |    2 ++
 rfkill.c |    2 +-
 3 files changed, 10 insertions(+), 4 deletions(-)

Index: wireless-2.6/drivers/net/wireless/b43/main.c
===================================================================
--- wireless-2.6.orig/drivers/net/wireless/b43/main.c
+++ wireless-2.6/drivers/net/wireless/b43/main.c
@@ -3181,11 +3181,15 @@ static void setup_struct_phy_for_init(st
 
 static void setup_struct_wldev_for_init(struct b43_wldev *dev)
 {
+	struct b43_wl *wl = dev->wl;
+
 	/* Flags */
 	dev->reg124_set_0x4 = 0;
-	/* Assume the radio is enabled. If it's not enabled, the state will
-	 * immediately get fixed on the first periodic work run. */
-	dev->radio_hw_enable = 1;
+	dev->radio_hw_enable = b43_is_hw_radio_enabled(dev);
+	if (!dev->radio_hw_enable)
+		b43info(wl, "***** The hardware switch for your radio switch"
+			" is off.\n          ***** Until it is switched on,"
+			" your device will not work.\n");
 
 	/* Stats */
 	memset(&dev->stats, 0, sizeof(dev->stats));
Index: wireless-2.6/drivers/net/wireless/b43/main.h
===================================================================
--- wireless-2.6.orig/drivers/net/wireless/b43/main.h
+++ wireless-2.6/drivers/net/wireless/b43/main.h
@@ -116,6 +116,8 @@ void b43_mac_enable(struct b43_wldev *de
 
 void b43_controller_restart(struct b43_wldev *dev, const char *reason);
 
+bool b43_is_hw_radio_enabled(struct b43_wldev *dev);
+
 #define B43_PS_ENABLED	(1 << 0)	/* Force enable hardware power saving */
 #define B43_PS_DISABLED	(1 << 1)	/* Force disable hardware power saving */
 #define B43_PS_AWAKE	(1 << 2)	/* Force device awake */
Index: wireless-2.6/drivers/net/wireless/b43/rfkill.c
===================================================================
--- wireless-2.6.orig/drivers/net/wireless/b43/rfkill.c
+++ wireless-2.6/drivers/net/wireless/b43/rfkill.c
@@ -27,7 +27,7 @@
 
 
 /* Returns TRUE, if the radio is enabled in hardware. */
-static bool b43_is_hw_radio_enabled(struct b43_wldev *dev)
+bool b43_is_hw_radio_enabled(struct b43_wldev *dev)
 {
 	if (dev->phy.rev >= 3) {
 		if (!(b43_read32(dev, B43_MMIO_RADIO_HWENABLED_HI)

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

end of thread, other threads:[~2007-11-13 15:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-09 22:47 [PATCH] b43: Output message at startup if hardware switch for radio is off Larry Finger
2007-11-10 15:24 ` Michael Buesch
2007-11-12 12:36   ` Holger Schurig
2007-11-13 15:22     ` Dan Williams

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).