diff options
author | Bob Copeland <me@bobcopeland.com> | 2009-06-10 22:22:21 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 14:57:41 -0400 |
commit | f0f3d388baabdbc613548d6ad8e5da7616b1cbd1 (patch) | |
tree | 21e14ebff8352acd6e584d8783f5b712611d48fa /drivers/net | |
parent | 46026e8f487c075f9ec4d671348e351eb5e46d3e (diff) |
ath5k: enable hardware LEDs
Cardbus and some PCI cards use hardware LEDs rather than software GPIOs.
Program them with the proper blink patterns when idle, scanning or
associated. Fixes http://bugzilla.kernel.org/show_bug.cgi?id=13288.
Tested-by: Frans Pop <elendil@planet.nl>
Tested-by: Mark Hindley <mark@hindley.org.uk>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/attach.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 20 |
2 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath5k/attach.c b/drivers/net/wireless/ath/ath5k/attach.c index c41ef58393e..9a84d9410b2 100644 --- a/drivers/net/wireless/ath/ath5k/attach.c +++ b/drivers/net/wireless/ath/ath5k/attach.c | |||
@@ -319,6 +319,9 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version) | |||
319 | 319 | ||
320 | ath5k_hw_rfgain_opt_init(ah); | 320 | ath5k_hw_rfgain_opt_init(ah); |
321 | 321 | ||
322 | /* turn on HW LEDs */ | ||
323 | ath5k_hw_set_ledstate(ah, AR5K_LED_INIT); | ||
324 | |||
322 | return ah; | 325 | return ah; |
323 | err_free: | 326 | err_free: |
324 | kfree(ah); | 327 | kfree(ah); |
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index ea045151f95..f26a6896062 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -248,6 +248,8 @@ static void ath5k_bss_info_changed(struct ieee80211_hw *hw, | |||
248 | struct ieee80211_vif *vif, | 248 | struct ieee80211_vif *vif, |
249 | struct ieee80211_bss_conf *bss_conf, | 249 | struct ieee80211_bss_conf *bss_conf, |
250 | u32 changes); | 250 | u32 changes); |
251 | static void ath5k_sw_scan_start(struct ieee80211_hw *hw); | ||
252 | static void ath5k_sw_scan_complete(struct ieee80211_hw *hw); | ||
251 | 253 | ||
252 | static const struct ieee80211_ops ath5k_hw_ops = { | 254 | static const struct ieee80211_ops ath5k_hw_ops = { |
253 | .tx = ath5k_tx, | 255 | .tx = ath5k_tx, |
@@ -265,6 +267,8 @@ static const struct ieee80211_ops ath5k_hw_ops = { | |||
265 | .set_tsf = ath5k_set_tsf, | 267 | .set_tsf = ath5k_set_tsf, |
266 | .reset_tsf = ath5k_reset_tsf, | 268 | .reset_tsf = ath5k_reset_tsf, |
267 | .bss_info_changed = ath5k_bss_info_changed, | 269 | .bss_info_changed = ath5k_bss_info_changed, |
270 | .sw_scan_start = ath5k_sw_scan_start, | ||
271 | .sw_scan_complete = ath5k_sw_scan_complete, | ||
268 | }; | 272 | }; |
269 | 273 | ||
270 | /* | 274 | /* |
@@ -3167,6 +3171,8 @@ static void ath5k_bss_info_changed(struct ieee80211_hw *hw, | |||
3167 | sc->assoc = bss_conf->assoc; | 3171 | sc->assoc = bss_conf->assoc; |
3168 | if (sc->opmode == NL80211_IFTYPE_STATION) | 3172 | if (sc->opmode == NL80211_IFTYPE_STATION) |
3169 | set_beacon_filter(hw, sc->assoc); | 3173 | set_beacon_filter(hw, sc->assoc); |
3174 | ath5k_hw_set_ledstate(sc->ah, sc->assoc ? | ||
3175 | AR5K_LED_ASSOC : AR5K_LED_INIT); | ||
3170 | } | 3176 | } |
3171 | 3177 | ||
3172 | if (changes & BSS_CHANGED_BEACON && | 3178 | if (changes & BSS_CHANGED_BEACON && |
@@ -3179,3 +3185,17 @@ static void ath5k_bss_info_changed(struct ieee80211_hw *hw, | |||
3179 | unlock: | 3185 | unlock: |
3180 | mutex_unlock(&sc->lock); | 3186 | mutex_unlock(&sc->lock); |
3181 | } | 3187 | } |
3188 | |||
3189 | static void ath5k_sw_scan_start(struct ieee80211_hw *hw) | ||
3190 | { | ||
3191 | struct ath5k_softc *sc = hw->priv; | ||
3192 | if (!sc->assoc) | ||
3193 | ath5k_hw_set_ledstate(sc->ah, AR5K_LED_SCAN); | ||
3194 | } | ||
3195 | |||
3196 | static void ath5k_sw_scan_complete(struct ieee80211_hw *hw) | ||
3197 | { | ||
3198 | struct ath5k_softc *sc = hw->priv; | ||
3199 | ath5k_hw_set_ledstate(sc->ah, sc->assoc ? | ||
3200 | AR5K_LED_ASSOC : AR5K_LED_INIT); | ||
3201 | } | ||