提交 e5108d07 编写于 作者: W Wey-Yi Guy 提交者: John W. Linville

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: NWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: NReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 a283c011
...@@ -54,7 +54,7 @@ static const char *led_type_str[] = { ...@@ -54,7 +54,7 @@ static const char *led_type_str[] = {
static const struct { static const struct {
u16 tpt; u16 tpt; /* Mb/s */
u8 on_time; u8 on_time;
u8 off_time; u8 off_time;
} blink_tbl[] = } blink_tbl[] =
...@@ -264,13 +264,15 @@ static int iwl_leds_register_led(struct iwl_priv *priv, struct iwl_led *led, ...@@ -264,13 +264,15 @@ static int iwl_leds_register_led(struct iwl_priv *priv, struct iwl_led *led,
/* /*
* calculate blink rate according to last 2 sec Tx/Rx activities * calculate blink rate according to last second Tx/Rx activities
*/ */
static int iwl_get_blink_rate(struct iwl_priv *priv) static int iwl_get_blink_rate(struct iwl_priv *priv)
{ {
int i; int i;
u64 current_tpt = priv->tx_stats[2].bytes; /* count both tx and rx traffic to be able to
/* FIXME: + priv->rx_stats[2].bytes; */ * handle traffic in either direction
*/
u64 current_tpt = priv->tx_stats[2].bytes + priv->rx_stats[2].bytes;
s64 tpt = current_tpt - priv->led_tpt; s64 tpt = current_tpt - priv->led_tpt;
if (tpt < 0) /* wraparound */ if (tpt < 0) /* wraparound */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册