ath9k: Add a module parameter to disable led blinking.
Some vendors require the LED to be ON always irrespective of any radio activity. Introducing a module parameter to disable blinking, so that one can choose between always on or led blink during activity. Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
ee031112d9
commit
9a75c2ff6d
|
@ -628,6 +628,7 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz)
|
||||||
|
|
||||||
extern struct ieee80211_ops ath9k_ops;
|
extern struct ieee80211_ops ath9k_ops;
|
||||||
extern int modparam_nohwcrypt;
|
extern int modparam_nohwcrypt;
|
||||||
|
extern int led_blink;
|
||||||
|
|
||||||
irqreturn_t ath_isr(int irq, void *dev);
|
irqreturn_t ath_isr(int irq, void *dev);
|
||||||
int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
|
int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
|
||||||
|
|
|
@ -76,6 +76,7 @@ static void ath_led_brightness(struct led_classdev *led_cdev,
|
||||||
case LED_FULL:
|
case LED_FULL:
|
||||||
if (led->led_type == ATH_LED_ASSOC) {
|
if (led->led_type == ATH_LED_ASSOC) {
|
||||||
sc->sc_flags |= SC_OP_LED_ASSOCIATED;
|
sc->sc_flags |= SC_OP_LED_ASSOCIATED;
|
||||||
|
if (led_blink)
|
||||||
ieee80211_queue_delayed_work(sc->hw,
|
ieee80211_queue_delayed_work(sc->hw,
|
||||||
&sc->ath_led_blink_work, 0);
|
&sc->ath_led_blink_work, 0);
|
||||||
} else if (led->led_type == ATH_LED_RADIO) {
|
} else if (led->led_type == ATH_LED_RADIO) {
|
||||||
|
@ -143,6 +144,7 @@ void ath_init_leds(struct ath_softc *sc)
|
||||||
/* LED off, active low */
|
/* LED off, active low */
|
||||||
ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
|
ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
|
||||||
|
|
||||||
|
if (led_blink)
|
||||||
INIT_DELAYED_WORK(&sc->ath_led_blink_work, ath_led_blink_work);
|
INIT_DELAYED_WORK(&sc->ath_led_blink_work, ath_led_blink_work);
|
||||||
|
|
||||||
trigger = ieee80211_get_radio_led_name(sc->hw);
|
trigger = ieee80211_get_radio_led_name(sc->hw);
|
||||||
|
@ -180,6 +182,7 @@ void ath_init_leds(struct ath_softc *sc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
if (led_blink)
|
||||||
cancel_delayed_work_sync(&sc->ath_led_blink_work);
|
cancel_delayed_work_sync(&sc->ath_led_blink_work);
|
||||||
ath_deinit_leds(sc);
|
ath_deinit_leds(sc);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,10 @@ int modparam_nohwcrypt;
|
||||||
module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
|
module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
|
||||||
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption");
|
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption");
|
||||||
|
|
||||||
|
int led_blink = 1;
|
||||||
|
module_param_named(blink, led_blink, int, 0444);
|
||||||
|
MODULE_PARM_DESC(blink, "Enable LED blink on activity");
|
||||||
|
|
||||||
/* We use the hw_value as an index into our private channel structure */
|
/* We use the hw_value as an index into our private channel structure */
|
||||||
|
|
||||||
#define CHAN2G(_freq, _idx) { \
|
#define CHAN2G(_freq, _idx) { \
|
||||||
|
|
|
@ -1241,7 +1241,9 @@ static void ath9k_stop(struct ieee80211_hw *hw)
|
||||||
|
|
||||||
aphy->state = ATH_WIPHY_INACTIVE;
|
aphy->state = ATH_WIPHY_INACTIVE;
|
||||||
|
|
||||||
|
if (led_blink)
|
||||||
cancel_delayed_work_sync(&sc->ath_led_blink_work);
|
cancel_delayed_work_sync(&sc->ath_led_blink_work);
|
||||||
|
|
||||||
cancel_delayed_work_sync(&sc->tx_complete_work);
|
cancel_delayed_work_sync(&sc->tx_complete_work);
|
||||||
cancel_work_sync(&sc->paprd_work);
|
cancel_work_sync(&sc->paprd_work);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue