aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-09-17 13:43:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-07 16:39:35 -0400
commit02f5dac08364d01a8b2c8e298b529b97f356b3f5 (patch)
treebac5af488fd78d5b6162cf506d325535ed34a19a /drivers
parent5953a62e7df064a5d7ba7e790d590f27c65ddf4c (diff)
iwlwifi: add LED mode to support different LED behavior
Today's implementation allow LED to blink based on the traffic condition. We introduce an additional LED mode that reflects the RF state. The supported LED modes after this are: IWL_LED_BLINK (current/default) - blink rate based on current Tx/Rx traffic IWL_LED_RF_STATE (new) - LED OFF: No power/RF disabled, the LED is emitting no light LED ON: Powered/RF enabled, the LED is emitting light in a stable non-flashing state. In order to provide the flexibility to support different LED behavior per user/system preference we add "led_mode" iwlcore module parameter. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-led.c9
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-led.h12
2 files changed, 20 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-led.c b/drivers/net/wireless/iwlwifi/iwl-led.c
index f547233c5b79..685ba9d6f082 100644
--- a/drivers/net/wireless/iwlwifi/iwl-led.c
+++ b/drivers/net/wireless/iwlwifi/iwl-led.c
@@ -42,6 +42,12 @@
42#include "iwl-core.h" 42#include "iwl-core.h"
43#include "iwl-io.h" 43#include "iwl-io.h"
44 44
45/* default: IWL_LED_BLINK(0) using blinking index table */
46static int led_mode;
47module_param(led_mode, int, S_IRUGO);
48MODULE_PARM_DESC(led_mode, "led mode: 0=blinking, 1=On(RF On)/Off(RF Off), "
49 "(default 0)\n");
50
45#ifdef CONFIG_IWLWIFI_DEBUG 51#ifdef CONFIG_IWLWIFI_DEBUG
46static const char *led_type_str[] = { 52static const char *led_type_str[] = {
47 __stringify(IWL_LED_TRG_TX), 53 __stringify(IWL_LED_TRG_TX),
@@ -199,7 +205,8 @@ static int iwl_led_off_reg(struct iwl_priv *priv, int led_id)
199static int iwl_led_associate(struct iwl_priv *priv, int led_id) 205static int iwl_led_associate(struct iwl_priv *priv, int led_id)
200{ 206{
201 IWL_DEBUG_LED(priv, "Associated\n"); 207 IWL_DEBUG_LED(priv, "Associated\n");
202 priv->allow_blinking = 1; 208 if (led_mode == IWL_LED_BLINK)
209 priv->allow_blinking = 1;
203 return iwl_led_on_reg(priv, led_id); 210 return iwl_led_on_reg(priv, led_id);
204} 211}
205static int iwl_led_disassociate(struct iwl_priv *priv, int led_id) 212static int iwl_led_disassociate(struct iwl_priv *priv, int led_id)
diff --git a/drivers/net/wireless/iwlwifi/iwl-led.h b/drivers/net/wireless/iwlwifi/iwl-led.h
index ef9b174c37ff..dd76b266c633 100644
--- a/drivers/net/wireless/iwlwifi/iwl-led.h
+++ b/drivers/net/wireless/iwlwifi/iwl-led.h
@@ -47,6 +47,18 @@ enum led_type {
47 IWL_LED_TRG_RADIO, 47 IWL_LED_TRG_RADIO,
48 IWL_LED_TRG_MAX, 48 IWL_LED_TRG_MAX,
49}; 49};
50
51/*
52 * LED mode
53 * IWL_LED_BLINK: adjust led blink rate based on blink table
54 * IWL_LED_RF_STATE: turn LED on/off based on RF state
55 * LED ON = RF ON
56 * LED OFF = RF OFF
57 */
58enum iwl_led_mode {
59 IWL_LED_BLINK,
60 IWL_LED_RF_STATE,
61};
50#endif 62#endif
51 63
52#ifdef CONFIG_IWLWIFI_LEDS 64#ifdef CONFIG_IWLWIFI_LEDS