summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43/main.c
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2007-09-20 22:14:18 +0200
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 16:52:24 -0700
commitfda9abcf1a5b6b78a4ead25729583541af9876b5 (patch)
treead8029180557a5c4dce3f0a4e7c118bffca25eef /drivers/net/wireless/b43/main.c
parent6a724d68a38c33ba4c7f7b5f008301ac12c9ced1 (diff)
[B43]: Support for turning the radio off from software.
This adds support for turning the radio off in software. That's useful in environments, where you don't want the RF to radiate any signals, but don't want to bring the interface down. Cc: Larry Finger <larry.finger@lwfinger.net> Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/b43/main.c')
-rw-r--r--drivers/net/wireless/b43/main.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index cc5285407e8..b44c9f92884 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2874,6 +2874,21 @@ static int b43_dev_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)
if (b43_is_mode(wl, IEEE80211_IF_TYPE_AP))
b43_set_beacon_int(dev, conf->beacon_int);
+ if (!!conf->radio_enabled != phy->radio_on) {
+ if (conf->radio_enabled) {
+ b43_radio_turn_on(dev);
+ b43info(dev->wl, "Radio turned on by software\n");
+ if (!dev->radio_hw_enable) {
+ b43info(dev->wl, "The hardware RF-kill button "
+ "still turns the radio physically off. "
+ "Press the button to turn it on.\n");
+ }
+ } else {
+ b43_radio_turn_off(dev);
+ b43info(dev->wl, "Radio turned off by software\n");
+ }
+ }
+
spin_lock_irqsave(&wl->irq_lock, flags);
b43_interrupt_enable(dev, savedirqs);
mmiowb();
@@ -3218,6 +3233,8 @@ static void setup_struct_phy_for_init(struct b43_wldev *dev,
phy->aci_wlan_automatic = 0;
phy->aci_hw_rssi = 0;
+ phy->radio_off_context.valid = 0;
+
lo = phy->lo_control;
if (lo) {
memset(lo, 0, sizeof(*(phy->lo_control)));