diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-rx.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-rx.c | 41 |
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 | */ | ||
557 | static 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 | ||
553 | void iwl_rx_statistics(struct iwl_priv *priv, | 591 | void 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); |