Skip to contentSkip to conversation

ath9k_htc: Add a module parameter to disable blink

PATCH Applied Hong Xu 4 participants 4 messages Jan 11, 2015 – Jan 23, 2015 Qualcomm Atheros ATH9K wireless driver

v2 of 3 Applied Latest is v3 →

lore
Share & tools
lore

Hong Xu

author
#0 lore raw

PATCH v2 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          | 3 +++
 drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | 4 ++++
 drivers/net/wireless/ath/ath9k/htc_drv_init.c | 4 ++++
 3 files changed, 11 insertions(+)
drivers/net/wireless/ath/ath9k/htc.h +3 -0
index 9dde265..c43fec5 100644
@@ -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,
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..9470127 100644
@@ -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 },
Signature · 1 line
2.2.1
#1 lore raw
Quoted 30 lines · Hong Xu

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          | 3 +++
  drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | 4 ++++
  drivers/net/wireless/ath/ath9k/htc_drv_init.c | 4 ++++
  3 files changed, 11 insertions(+)
drivers/net/wireless/ath/ath9k/htc.h +3 -0
index 9dde265..c43fec5 100644
@@ -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,
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c +0 -0
index 50f74a2..998b558 100644

drivers/net/wireless/ath/ath9k/htc_drv_gpio.c void ath9k_init_leds(struct ath9k_htc_priv *priv) · line 285

Quoted 7 lines
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c +4 -0
@@ -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);
+

So is this function/file also conditionally compiled on CONFIG_MAC80211_LEDS. In my tree it is not so you will get a warning and loading the module will probably fail.

Regards,
Arend

Quoted 18 lines
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c +0 -0
  	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..9470127 100644
@@ -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 },
#2 lore raw

Am 12.01.2015 um 10:48 schrieb Arend van Spriel:

Quoted 36 lines · Hong Xu
Quoted 35 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          | 3 +++
  drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | 4 ++++
  drivers/net/wireless/ath/ath9k/htc_drv_init.c | 4 ++++
  3 files changed, 11 insertions(+)
drivers/net/wireless/ath/ath9k/htc.h +3 -0
index 9dde265..c43fec5 100644
@@ -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,
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c +0 -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;
 
Quoted 8 lines

drivers/net/wireless/ath/ath9k/htc_drv_gpio.c void ath9k_init_leds(struct ath9k_htc_priv *priv) · line 285

Quoted 4 lines
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c +4 -0
+    if (!led_blink)
+        priv->led_cdev.default_trigger =
+            ieee80211_get_radio_led_name(priv->hw);
+

So is this function/file also conditionally compiled on CONFIG_MAC80211_LEDS. In my tree it is not so you will get a warning and loading the module will probably fail.

It is conditionally compiled on CONFIG_MAC80211_LEDS.

Quoted 24 lines

Regards,
Arend

Quoted 20 lines
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c +0 -0
      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..9470127 100644
@@ -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 },
Signature · 2 lines
Regards,
Oleksij
Applied
#3 lore raw
In reply to Hong Xu
Quoted 6 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.

Thanks, applied to wireless-drivers-next.git.

Kalle Valo