ath9k_htc: Add a module parameter to disable blink
authorHong Xu <hong@topbug.net>
Sun, 11 Jan 2015 19:45:53 +0000 (11:45 -0800)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 23 Jan 2015 17:16:11 +0000 (19:16 +0200)
Add an option "blink" to enable or disable the LED blink. The default
value is set to 1 so that existing users would not experience any
unexpected changes.

Signed-off-by: Hong Xu <hong@topbug.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath9k/htc.h
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
drivers/net/wireless/ath/ath9k/htc_drv_init.c

index 9dde265d3f846a683534831b43778829f6ff0b4d..c43fec51b8ec8fd4bdcd1e4fb6692e7004c1e816 100644 (file)
@@ -44,6 +44,9 @@
 
 extern struct ieee80211_ops ath9k_htc_ops;
 extern int htc_modparam_nohwcrypt;
+#ifdef CONFIG_MAC80211_LEDS
+extern int led_blink;
+#endif
 
 enum htc_phymode {
        HTC_MODE_11NA           = 0,
index 50f74a2a4cf8f99b8a619d7502cc6a225fa9005c..998b558d4126bad40ced970a1d6a08cc121cbd97 100644 (file)
@@ -279,6 +279,10 @@ void ath9k_init_leds(struct ath9k_htc_priv *priv)
        else
                priv->ah->led_pin = ATH_LED_PIN_DEF;
 
+       if (!led_blink)
+               priv->led_cdev.default_trigger =
+                       ieee80211_get_radio_led_name(priv->hw);
+
        ath9k_configure_leds(priv);
 
        snprintf(priv->led_name, sizeof(priv->led_name),
index e8fa9448da2410dc7cc833100853bc247d2ee378..947012757f8119526b2fd7ac59004fd5f76ad191 100644 (file)
@@ -39,6 +39,10 @@ module_param_named(ps_enable, ath9k_ps_enable, int, 0444);
 MODULE_PARM_DESC(ps_enable, "Enable WLAN PowerSave");
 
 #ifdef CONFIG_MAC80211_LEDS
+int led_blink = 1;
+module_param_named(blink, led_blink, int, 0444);
+MODULE_PARM_DESC(blink, "Enable LED blink on activity");
+
 static const struct ieee80211_tpt_blink ath9k_htc_tpt_blink[] = {
        { .throughput = 0 * 1024, .blink_time = 334 },
        { .throughput = 1 * 1024, .blink_time = 260 },