aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-rx.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-10-09 16:20:29 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:48:00 -0400
commit92a35bda792cf9295b1d399f7c937d4560292b1e (patch)
tree4b3121359d69542286480b7b16d2b91c8149415a /drivers/net/wireless/iwlwifi/iwl-rx.c
parent88804e2b33b6ab3974ff2330cd045ca53d6750c5 (diff)
iwlwifi: showing accumulative ucode statistics counters
Adding accumulative statistics counters in iwlwifi driver. Statistics counters are reported by uCode every beacon interval; but can be reset by uCode when needed. The accumulative statistics counters is maintained by driver to keep track of the history of all the counters. Update the ucode stats files in debugfs to display both latest and accumulative counters. 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/net/wireless/iwlwifi/iwl-rx.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index 493626bcd3ec..7ad327ef9cb5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -548,6 +548,44 @@ static void iwl_rx_calc_noise(struct iwl_priv *priv)
548 priv->last_rx_noise); 548 priv->last_rx_noise);
549} 549}
550 550
551#ifdef CONFIG_IWLWIFI_DEBUG
552/*
553 * based on the assumption of all statistics counter are in DWORD
554 * FIXME: This function is for debugging, do not deal with
555 * the case of counters roll-over.
556 */
557static void iwl_accumulative_statistics(struct iwl_priv *priv,
558 __le32 *stats)
559{
560 int i;
561 __le32 *prev_stats;
562 u32 *accum_stats;
563
564 prev_stats = (__le32 *)&priv->statistics;
565 accum_stats = (u32 *)&priv->accum_statistics;
566
567 for (i = sizeof(__le32); i < sizeof(struct iwl_notif_statistics);
568 i += sizeof(__le32), stats++, prev_stats++, accum_stats++)
569 if (le32_to_cpu(*stats) > le32_to_cpu(*prev_stats))
570 *accum_stats += (le32_to_cpu(*stats) -
571 le32_to_cpu(*prev_stats));
572
573 /* reset accumulative statistics for "no-counter" type statistics */
574 priv->accum_statistics.general.temperature =
575 priv->statistics.general.temperature;
576 priv->accum_statistics.general.temperature_m =
577 priv->statistics.general.temperature_m;
578 priv->accum_statistics.general.ttl_timestamp =
579 priv->statistics.general.ttl_timestamp;
580 priv->accum_statistics.tx.tx_power.ant_a =
581 priv->statistics.tx.tx_power.ant_a;
582 priv->accum_statistics.tx.tx_power.ant_b =
583 priv->statistics.tx.tx_power.ant_b;
584 priv->accum_statistics.tx.tx_power.ant_c =
585 priv->statistics.tx.tx_power.ant_c;
586}
587#endif
588
551#define REG_RECALIB_PERIOD (60) 589#define REG_RECALIB_PERIOD (60)
552 590
553void iwl_rx_statistics(struct iwl_priv *priv, 591void iwl_rx_statistics(struct iwl_priv *priv,
@@ -566,6 +604,9 @@ void iwl_rx_statistics(struct iwl_priv *priv,
566 STATISTICS_REPLY_FLG_HT40_MODE_MSK) != 604 STATISTICS_REPLY_FLG_HT40_MODE_MSK) !=
567 (pkt->u.stats.flag & STATISTICS_REPLY_FLG_HT40_MODE_MSK))); 605 (pkt->u.stats.flag & STATISTICS_REPLY_FLG_HT40_MODE_MSK)));
568 606
607#ifdef CONFIG_IWLWIFI_DEBUG
608 iwl_accumulative_statistics(priv, (__le32 *)&pkt->u.stats);
609#endif
569 memcpy(&priv->statistics, &pkt->u.stats, sizeof(priv->statistics)); 610 memcpy(&priv->statistics, &pkt->u.stats, sizeof(priv->statistics));
570 611
571 set_bit(STATUS_STATISTICS, &priv->status); 612 set_bit(STATUS_STATISTICS, &priv->status);