diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2009-09-23 04:19:12 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-09-23 11:35:54 -0400 |
commit | e31f7b96f0252e8da06df1bc7fd0f6dbc8cbec42 (patch) | |
tree | a9b9220dc1621e7153e68c0e8f529846f700ceae /drivers/net/wireless/ath/ath9k/main.c | |
parent | 33e2fb2f2b5d3b2f491fccab0ead256e34447cc6 (diff) |
ath9k: Fix RFKILL bugs
This patch fixes 2 issues in RFKILL:
* Calling wiphy_rfkill_stop_polling() in ath9k_stop
would mean that the driver cannot report HW status
when the radio is re-enabled. Move this to ath_detach().
* Calling ath_radio_{enable/disable} without checking the current
state results in ath_radio_enable() being called repeatedly
for every invocation of rfkill_poll(). This is not needed
in any case since wiphy_rfkill_set_hw_state() would call
->stop() if the radio has been disabled.
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 5055f1842b89..52bed89063d4 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -1226,11 +1226,6 @@ static void ath9k_rfkill_poll_state(struct ieee80211_hw *hw) | |||
1226 | bool blocked = !!ath_is_rfkill_set(sc); | 1226 | bool blocked = !!ath_is_rfkill_set(sc); |
1227 | 1227 | ||
1228 | wiphy_rfkill_set_hw_state(hw->wiphy, blocked); | 1228 | wiphy_rfkill_set_hw_state(hw->wiphy, blocked); |
1229 | |||
1230 | if (blocked) | ||
1231 | ath_radio_disable(sc); | ||
1232 | else | ||
1233 | ath_radio_enable(sc); | ||
1234 | } | 1229 | } |
1235 | 1230 | ||
1236 | static void ath_start_rfkill_poll(struct ath_softc *sc) | 1231 | static void ath_start_rfkill_poll(struct ath_softc *sc) |
@@ -1260,6 +1255,7 @@ void ath_detach(struct ath_softc *sc) | |||
1260 | DPRINTF(sc, ATH_DBG_CONFIG, "Detach ATH hw\n"); | 1255 | DPRINTF(sc, ATH_DBG_CONFIG, "Detach ATH hw\n"); |
1261 | 1256 | ||
1262 | ath_deinit_leds(sc); | 1257 | ath_deinit_leds(sc); |
1258 | wiphy_rfkill_stop_polling(sc->hw->wiphy); | ||
1263 | 1259 | ||
1264 | for (i = 0; i < sc->num_sec_wiphy; i++) { | 1260 | for (i = 0; i < sc->num_sec_wiphy; i++) { |
1265 | struct ath_wiphy *aphy = sc->sec_wiphy[i]; | 1261 | struct ath_wiphy *aphy = sc->sec_wiphy[i]; |
@@ -2166,8 +2162,6 @@ static void ath9k_stop(struct ieee80211_hw *hw) | |||
2166 | } else | 2162 | } else |
2167 | sc->rx.rxlink = NULL; | 2163 | sc->rx.rxlink = NULL; |
2168 | 2164 | ||
2169 | wiphy_rfkill_stop_polling(sc->hw->wiphy); | ||
2170 | |||
2171 | /* disable HAL and put h/w to sleep */ | 2165 | /* disable HAL and put h/w to sleep */ |
2172 | ath9k_hw_disable(sc->sc_ah); | 2166 | ath9k_hw_disable(sc->sc_ah); |
2173 | ath9k_hw_configpcipowersave(sc->sc_ah, 1, 1); | 2167 | ath9k_hw_configpcipowersave(sc->sc_ah, 1, 1); |