diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2007-10-10 23:44:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:03:27 -0500 |
commit | 93bb7f3a7bb5c95da10242d9763994a466c90b1d (patch) | |
tree | 8c248e88ea2be5ae791003050bda848b4a72dd36 /drivers/net/wireless/b43legacy/main.c | |
parent | ba48f7bb8062982ec916868cc8c90360aad82e53 (diff) |
b43legacy: RF-kill support
This adds full support for the RFKILL button and the RFKILL LED trigger.
This is a port to b43legacy of a patch by Michael Buesch <mb@bu3sch.de>
for b43.
Signed-off-by: Larry Finger<Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43legacy/main.c')
-rw-r--r-- | drivers/net/wireless/b43legacy/main.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index 43edd08297a4..04bc3f6c5e63 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -1993,7 +1993,7 @@ static bool b43legacy_is_hw_radio_enabled(struct b43legacy_wldev *dev) | |||
1993 | /* This is the opposite of b43legacy_chip_init() */ | 1993 | /* This is the opposite of b43legacy_chip_init() */ |
1994 | static void b43legacy_chip_exit(struct b43legacy_wldev *dev) | 1994 | static void b43legacy_chip_exit(struct b43legacy_wldev *dev) |
1995 | { | 1995 | { |
1996 | b43legacy_radio_turn_off(dev); | 1996 | b43legacy_radio_turn_off(dev, 1); |
1997 | b43legacy_leds_exit(dev); | 1997 | b43legacy_leds_exit(dev); |
1998 | b43legacy_gpio_cleanup(dev); | 1998 | b43legacy_gpio_cleanup(dev); |
1999 | /* firmware is released later */ | 1999 | /* firmware is released later */ |
@@ -2106,7 +2106,7 @@ out: | |||
2106 | return err; | 2106 | return err; |
2107 | 2107 | ||
2108 | err_radio_off: | 2108 | err_radio_off: |
2109 | b43legacy_radio_turn_off(dev); | 2109 | b43legacy_radio_turn_off(dev, 1); |
2110 | err_leds_exit: | 2110 | err_leds_exit: |
2111 | b43legacy_leds_exit(dev); | 2111 | b43legacy_leds_exit(dev); |
2112 | b43legacy_gpio_cleanup(dev); | 2112 | b43legacy_gpio_cleanup(dev); |
@@ -2154,8 +2154,7 @@ static void b43legacy_periodic_every1sec(struct b43legacy_wldev *dev) | |||
2154 | radio_hw_enable = b43legacy_is_hw_radio_enabled(dev); | 2154 | radio_hw_enable = b43legacy_is_hw_radio_enabled(dev); |
2155 | if (unlikely(dev->radio_hw_enable != radio_hw_enable)) { | 2155 | if (unlikely(dev->radio_hw_enable != radio_hw_enable)) { |
2156 | dev->radio_hw_enable = radio_hw_enable; | 2156 | dev->radio_hw_enable = radio_hw_enable; |
2157 | b43legacyinfo(dev->wl, "Radio hardware status changed to %s\n", | 2157 | b43legacy_rfkill_toggled(dev, radio_hw_enable); |
2158 | (radio_hw_enable) ? "enabled" : "disabled"); | ||
2159 | } | 2158 | } |
2160 | } | 2159 | } |
2161 | 2160 | ||
@@ -2647,7 +2646,7 @@ static int b43legacy_dev_config(struct ieee80211_hw *hw, | |||
2647 | " physically off. Press the" | 2646 | " physically off. Press the" |
2648 | " button to turn it on.\n"); | 2647 | " button to turn it on.\n"); |
2649 | } else { | 2648 | } else { |
2650 | b43legacy_radio_turn_off(dev); | 2649 | b43legacy_radio_turn_off(dev, 0); |
2651 | b43legacyinfo(dev->wl, "Radio turned off by" | 2650 | b43legacyinfo(dev->wl, "Radio turned off by" |
2652 | " software\n"); | 2651 | " software\n"); |
2653 | } | 2652 | } |
@@ -3034,11 +3033,15 @@ static void b43legacy_wireless_core_exit(struct b43legacy_wldev *dev) | |||
3034 | cancel_work_sync(&dev->restart_work); | 3033 | cancel_work_sync(&dev->restart_work); |
3035 | mutex_lock(&wl->mutex); | 3034 | mutex_lock(&wl->mutex); |
3036 | 3035 | ||
3036 | mutex_unlock(&dev->wl->mutex); | ||
3037 | b43legacy_rfkill_exit(dev); | ||
3038 | mutex_lock(&dev->wl->mutex); | ||
3039 | |||
3037 | b43legacy_rng_exit(dev->wl); | 3040 | b43legacy_rng_exit(dev->wl); |
3038 | b43legacy_pio_free(dev); | 3041 | b43legacy_pio_free(dev); |
3039 | b43legacy_dma_free(dev); | 3042 | b43legacy_dma_free(dev); |
3040 | b43legacy_chip_exit(dev); | 3043 | b43legacy_chip_exit(dev); |
3041 | b43legacy_radio_turn_off(dev); | 3044 | b43legacy_radio_turn_off(dev, 1); |
3042 | b43legacy_switch_analog(dev, 0); | 3045 | b43legacy_switch_analog(dev, 0); |
3043 | if (phy->dyn_tssi_tbl) | 3046 | if (phy->dyn_tssi_tbl) |
3044 | kfree(phy->tssi2dbm); | 3047 | kfree(phy->tssi2dbm); |
@@ -3206,6 +3209,7 @@ static int b43legacy_wireless_core_init(struct b43legacy_wldev *dev) | |||
3206 | memset(wl->mac_addr, 0, ETH_ALEN); | 3209 | memset(wl->mac_addr, 0, ETH_ALEN); |
3207 | b43legacy_upload_card_macaddress(dev); | 3210 | b43legacy_upload_card_macaddress(dev); |
3208 | b43legacy_security_init(dev); | 3211 | b43legacy_security_init(dev); |
3212 | b43legacy_rfkill_init(dev); | ||
3209 | b43legacy_rng_init(wl); | 3213 | b43legacy_rng_init(wl); |
3210 | 3214 | ||
3211 | b43legacy_set_status(dev, B43legacy_STAT_INITIALIZED); | 3215 | b43legacy_set_status(dev, B43legacy_STAT_INITIALIZED); |
@@ -3527,7 +3531,7 @@ static int b43legacy_wireless_core_attach(struct b43legacy_wldev *dev) | |||
3527 | wl->current_dev = dev; | 3531 | wl->current_dev = dev; |
3528 | INIT_WORK(&dev->restart_work, b43legacy_chip_reset); | 3532 | INIT_WORK(&dev->restart_work, b43legacy_chip_reset); |
3529 | 3533 | ||
3530 | b43legacy_radio_turn_off(dev); | 3534 | b43legacy_radio_turn_off(dev, 1); |
3531 | b43legacy_switch_analog(dev, 0); | 3535 | b43legacy_switch_analog(dev, 0); |
3532 | ssb_device_disable(dev->dev, 0); | 3536 | ssb_device_disable(dev->dev, 0); |
3533 | ssb_bus_may_powerdown(bus); | 3537 | ssb_bus_may_powerdown(bus); |