Skip to contentSkip to conversation

ath9k_htc: Add a module parameter to disable blink

PATCH New Hong Xu 2 participants 2 messages Jan 11, 2015 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore

Hong Xu

author
#0 lore raw

PATCH 1/1 ath9k_htc: Add a module parameter to disable blink

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.

---
 drivers/net/wireless/ath/ath9k/htc.h          | 1 +
 drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | 4 ++++
 drivers/net/wireless/ath/ath9k/htc_drv_init.c | 4 ++++
 3 files changed, 9 insertions(+)
drivers/net/wireless/ath/ath9k/htc.h +1 -0
index 9dde265..5697097 100644
@@ -44,6 +44,7 @@
 
 extern struct ieee80211_ops ath9k_htc_ops;
 extern int htc_modparam_nohwcrypt;
+extern int led_blink;
 
 enum htc_phymode {
 	HTC_MODE_11NA		= 0,
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c +4 -0
index 50f74a2..998b558 100644
@@ -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),
drivers/net/wireless/ath/ath9k/htc_drv_init.c +4 -0
index e8fa944..c762d84 100644
@@ -38,6 +38,10 @@ static int ath9k_ps_enable;
 module_param_named(ps_enable, ath9k_ps_enable, int, 0444);
 MODULE_PARM_DESC(ps_enable, "Enable WLAN PowerSave");
 
+int led_blink = 1;
+module_param_named(blink, led_blink, int, 0444);
+MODULE_PARM_DESC(blink, "Enable LED blink on activity");
+
 #ifdef CONFIG_MAC80211_LEDS
 static const struct ieee80211_tpt_blink ath9k_htc_tpt_blink[] = {
 	{ .throughput = 0 * 1024, .blink_time = 334 },
Signature · 1 line
2.2.1
#1 lore raw

PATCH 1/1 ath9k_htc: Add a module parameter to disable blink

Am 11.01.2015 um 08:09 schrieb Hong Xu:

Quoted 42 lines

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.

---
 drivers/net/wireless/ath/ath9k/htc.h          | 1 +
 drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | 4 ++++
 drivers/net/wireless/ath/ath9k/htc_drv_init.c | 4 ++++
 3 files changed, 9 insertions(+)
drivers/net/wireless/ath/ath9k/htc.h +1 -0
index 9dde265..5697097 100644
@@ -44,6 +44,7 @@
 
 extern struct ieee80211_ops ath9k_htc_ops;
 extern int htc_modparam_nohwcrypt;
+extern int led_blink;
 
 enum htc_phymode {
 	HTC_MODE_11NA		= 0,
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c +4 -0
index 50f74a2..998b558 100644
@@ -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),
drivers/net/wireless/ath/ath9k/htc_drv_init.c +0 -0
index e8fa944..c762d84 100644

drivers/net/wireless/ath/ath9k/htc_drv_init.c static int ath9k_ps_enable; · line 47

Quoted 10 lines
drivers/net/wireless/ath/ath9k/htc_drv_init.c +4 -0
@@ -38,6 +38,10 @@ static int ath9k_ps_enable;
 module_param_named(ps_enable, ath9k_ps_enable, int, 0444);
 MODULE_PARM_DESC(ps_enable, "Enable WLAN PowerSave");
 
+int led_blink = 1;
+module_param_named(blink, led_blink, int, 0444);
+MODULE_PARM_DESC(blink, "Enable LED blink on activity");
+
 #ifdef CONFIG_MAC80211_LEDS
 static const struct ieee80211_tpt_blink ath9k_htc_tpt_blink[] = {
 	{ .throughput = 0 * 1024, .blink_time = 334 },

Nice, thank you!

Please resend this patch to Kalle Valo.

Signature · 10 lines
Regards,
Oleksij

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: OpenPGP digital signature
Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20150111/bfc5dca7/attachment.pgp