diff options
author | Vasanthakumar Thiagarajan <vasanth@atheros.com> | 2009-03-14 10:29:41 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-03-27 20:12:53 -0400 |
commit | 85067c06ba0329c37d5a357ced1f39a5583ccc98 (patch) | |
tree | 77b4f04fbf408e00bd66ad959ed61be53c96fdc8 /drivers/net/wireless/ath9k | |
parent | 7f0216a49bea717b9606b81c60f2f0b6152123eb (diff) |
ath9k: Keep LED on in idle state after association
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k')
-rw-r--r-- | drivers/net/wireless/ath9k/main.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 7d27eed78af4..4c29cef66a61 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -940,18 +940,25 @@ static void ath_led_blink_work(struct work_struct *work) | |||
940 | 940 | ||
941 | if (!(sc->sc_flags & SC_OP_LED_ASSOCIATED)) | 941 | if (!(sc->sc_flags & SC_OP_LED_ASSOCIATED)) |
942 | return; | 942 | return; |
943 | ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, | 943 | |
944 | (sc->sc_flags & SC_OP_LED_ON) ? 1 : 0); | 944 | if ((sc->led_on_duration == ATH_LED_ON_DURATION_IDLE) || |
945 | (sc->led_off_duration == ATH_LED_OFF_DURATION_IDLE)) | ||
946 | ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, 0); | ||
947 | else | ||
948 | ath9k_hw_set_gpio(sc->sc_ah, ATH_LED_PIN, | ||
949 | (sc->sc_flags & SC_OP_LED_ON) ? 1 : 0); | ||
945 | 950 | ||
946 | queue_delayed_work(sc->hw->workqueue, &sc->ath_led_blink_work, | 951 | queue_delayed_work(sc->hw->workqueue, &sc->ath_led_blink_work, |
947 | (sc->sc_flags & SC_OP_LED_ON) ? | 952 | (sc->sc_flags & SC_OP_LED_ON) ? |
948 | msecs_to_jiffies(sc->led_off_duration) : | 953 | msecs_to_jiffies(sc->led_off_duration) : |
949 | msecs_to_jiffies(sc->led_on_duration)); | 954 | msecs_to_jiffies(sc->led_on_duration)); |
950 | 955 | ||
951 | sc->led_on_duration = | 956 | sc->led_on_duration = sc->led_on_cnt ? |
952 | max((ATH_LED_ON_DURATION_IDLE - sc->led_on_cnt), 25); | 957 | max((ATH_LED_ON_DURATION_IDLE - sc->led_on_cnt), 25) : |
953 | sc->led_off_duration = | 958 | ATH_LED_ON_DURATION_IDLE; |
954 | max((ATH_LED_OFF_DURATION_IDLE - sc->led_off_cnt), 10); | 959 | sc->led_off_duration = sc->led_off_cnt ? |
960 | max((ATH_LED_OFF_DURATION_IDLE - sc->led_off_cnt), 10) : | ||
961 | ATH_LED_OFF_DURATION_IDLE; | ||
955 | sc->led_on_cnt = sc->led_off_cnt = 0; | 962 | sc->led_on_cnt = sc->led_off_cnt = 0; |
956 | if (sc->sc_flags & SC_OP_LED_ON) | 963 | if (sc->sc_flags & SC_OP_LED_ON) |
957 | sc->sc_flags &= ~SC_OP_LED_ON; | 964 | sc->sc_flags &= ~SC_OP_LED_ON; |