diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2009-07-17 12:30:20 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-24 15:05:24 -0400 |
commit | e5108d075c705ed3336163d9ead2b8fe629f680d (patch) | |
tree | 892f975c79fa5842eb263ad35e393f7f8d8ca409 | |
parent | a283c0116b0cc5e82327e50ad4d05f6d4d42c603 (diff) |
iwlwifi: Led blinking counting both tx and rx
For controlling led blinking, counting both tx and rx data traffic; this
will be able to handle traffic in either direction
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>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-led.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-led.c b/drivers/net/wireless/iwlwifi/iwl-led.c index 36d88a045043..8c8115293b3c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-led.c +++ b/drivers/net/wireless/iwlwifi/iwl-led.c | |||
@@ -54,7 +54,7 @@ static const char *led_type_str[] = { | |||
54 | 54 | ||
55 | 55 | ||
56 | static const struct { | 56 | static const struct { |
57 | u16 tpt; | 57 | u16 tpt; /* Mb/s */ |
58 | u8 on_time; | 58 | u8 on_time; |
59 | u8 off_time; | 59 | u8 off_time; |
60 | } blink_tbl[] = | 60 | } blink_tbl[] = |
@@ -264,13 +264,15 @@ static int iwl_leds_register_led(struct iwl_priv *priv, struct iwl_led *led, | |||
264 | 264 | ||
265 | 265 | ||
266 | /* | 266 | /* |
267 | * calculate blink rate according to last 2 sec Tx/Rx activities | 267 | * calculate blink rate according to last second Tx/Rx activities |
268 | */ | 268 | */ |
269 | static int iwl_get_blink_rate(struct iwl_priv *priv) | 269 | static int iwl_get_blink_rate(struct iwl_priv *priv) |
270 | { | 270 | { |
271 | int i; | 271 | int i; |
272 | u64 current_tpt = priv->tx_stats[2].bytes; | 272 | /* count both tx and rx traffic to be able to |
273 | /* FIXME: + priv->rx_stats[2].bytes; */ | 273 | * handle traffic in either direction |
274 | */ | ||
275 | u64 current_tpt = priv->tx_stats[2].bytes + priv->rx_stats[2].bytes; | ||
274 | s64 tpt = current_tpt - priv->led_tpt; | 276 | s64 tpt = current_tpt - priv->led_tpt; |
275 | 277 | ||
276 | if (tpt < 0) /* wraparound */ | 278 | if (tpt < 0) /* wraparound */ |