diff options
author | Johannes Berg <johannes.berg@intel.com> | 2015-01-15 06:59:26 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-01-22 10:54:08 -0500 |
commit | 93d17cceb2620440aa3171e90b0ea69a97ac305d (patch) | |
tree | 169705aa8d4d2f2fb9c348815dd610729965658e | |
parent | d19ac5897163aacb9d485a435f4d98f6fb209d77 (diff) |
iwlwifi: mvm: generate statistics debugfs code
There's no need to duplicate the structure field name in the string,
just generate the string in the macro that's there anyway. To keep
the debugfs output the same, rename one (otherwise unused) field.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/debugfs.c | 162 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/fw-api-stats.h | 2 |
2 files changed, 78 insertions, 86 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c index afd1986a3216..82c09d86af8c 100644 --- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c | |||
@@ -654,10 +654,10 @@ out: | |||
654 | return ret ?: count; | 654 | return ret ?: count; |
655 | } | 655 | } |
656 | 656 | ||
657 | #define PRINT_STATS_LE32(_str, _val) \ | 657 | #define PRINT_STATS_LE32(_struct, _memb) \ |
658 | pos += scnprintf(buf + pos, bufsz - pos, \ | 658 | pos += scnprintf(buf + pos, bufsz - pos, \ |
659 | fmt_table, _str, \ | 659 | fmt_table, #_memb, \ |
660 | le32_to_cpu(_val)) | 660 | le32_to_cpu(_struct->_memb)) |
661 | 661 | ||
662 | static ssize_t iwl_dbgfs_fw_rx_stats_read(struct file *file, | 662 | static ssize_t iwl_dbgfs_fw_rx_stats_read(struct file *file, |
663 | char __user *user_buf, size_t count, | 663 | char __user *user_buf, size_t count, |
@@ -692,97 +692,89 @@ static ssize_t iwl_dbgfs_fw_rx_stats_read(struct file *file, | |||
692 | 692 | ||
693 | pos += scnprintf(buf + pos, bufsz - pos, fmt_header, | 693 | pos += scnprintf(buf + pos, bufsz - pos, fmt_header, |
694 | "Statistics_Rx - OFDM"); | 694 | "Statistics_Rx - OFDM"); |
695 | PRINT_STATS_LE32("ina_cnt", ofdm->ina_cnt); | 695 | PRINT_STATS_LE32(ofdm, ina_cnt); |
696 | PRINT_STATS_LE32("fina_cnt", ofdm->fina_cnt); | 696 | PRINT_STATS_LE32(ofdm, fina_cnt); |
697 | PRINT_STATS_LE32("plcp_err", ofdm->plcp_err); | 697 | PRINT_STATS_LE32(ofdm, plcp_err); |
698 | PRINT_STATS_LE32("crc32_err", ofdm->crc32_err); | 698 | PRINT_STATS_LE32(ofdm, crc32_err); |
699 | PRINT_STATS_LE32("overrun_err", ofdm->overrun_err); | 699 | PRINT_STATS_LE32(ofdm, overrun_err); |
700 | PRINT_STATS_LE32("early_overrun_err", ofdm->early_overrun_err); | 700 | PRINT_STATS_LE32(ofdm, early_overrun_err); |
701 | PRINT_STATS_LE32("crc32_good", ofdm->crc32_good); | 701 | PRINT_STATS_LE32(ofdm, crc32_good); |
702 | PRINT_STATS_LE32("false_alarm_cnt", ofdm->false_alarm_cnt); | 702 | PRINT_STATS_LE32(ofdm, false_alarm_cnt); |
703 | PRINT_STATS_LE32("fina_sync_err_cnt", ofdm->fina_sync_err_cnt); | 703 | PRINT_STATS_LE32(ofdm, fina_sync_err_cnt); |
704 | PRINT_STATS_LE32("sfd_timeout", ofdm->sfd_timeout); | 704 | PRINT_STATS_LE32(ofdm, sfd_timeout); |
705 | PRINT_STATS_LE32("fina_timeout", ofdm->fina_timeout); | 705 | PRINT_STATS_LE32(ofdm, fina_timeout); |
706 | PRINT_STATS_LE32("unresponded_rts", ofdm->unresponded_rts); | 706 | PRINT_STATS_LE32(ofdm, unresponded_rts); |
707 | PRINT_STATS_LE32("rxe_frame_lmt_overrun", | 707 | PRINT_STATS_LE32(ofdm, rxe_frame_lmt_overrun); |
708 | ofdm->rxe_frame_limit_overrun); | 708 | PRINT_STATS_LE32(ofdm, sent_ack_cnt); |
709 | PRINT_STATS_LE32("sent_ack_cnt", ofdm->sent_ack_cnt); | 709 | PRINT_STATS_LE32(ofdm, sent_cts_cnt); |
710 | PRINT_STATS_LE32("sent_cts_cnt", ofdm->sent_cts_cnt); | 710 | PRINT_STATS_LE32(ofdm, sent_ba_rsp_cnt); |
711 | PRINT_STATS_LE32("sent_ba_rsp_cnt", ofdm->sent_ba_rsp_cnt); | 711 | PRINT_STATS_LE32(ofdm, dsp_self_kill); |
712 | PRINT_STATS_LE32("dsp_self_kill", ofdm->dsp_self_kill); | 712 | PRINT_STATS_LE32(ofdm, mh_format_err); |
713 | PRINT_STATS_LE32("mh_format_err", ofdm->mh_format_err); | 713 | PRINT_STATS_LE32(ofdm, re_acq_main_rssi_sum); |
714 | PRINT_STATS_LE32("re_acq_main_rssi_sum", ofdm->re_acq_main_rssi_sum); | 714 | PRINT_STATS_LE32(ofdm, reserved); |
715 | PRINT_STATS_LE32("reserved", ofdm->reserved); | ||
716 | 715 | ||
717 | pos += scnprintf(buf + pos, bufsz - pos, fmt_header, | 716 | pos += scnprintf(buf + pos, bufsz - pos, fmt_header, |
718 | "Statistics_Rx - CCK"); | 717 | "Statistics_Rx - CCK"); |
719 | PRINT_STATS_LE32("ina_cnt", cck->ina_cnt); | 718 | PRINT_STATS_LE32(cck, ina_cnt); |
720 | PRINT_STATS_LE32("fina_cnt", cck->fina_cnt); | 719 | PRINT_STATS_LE32(cck, fina_cnt); |
721 | PRINT_STATS_LE32("plcp_err", cck->plcp_err); | 720 | PRINT_STATS_LE32(cck, plcp_err); |
722 | PRINT_STATS_LE32("crc32_err", cck->crc32_err); | 721 | PRINT_STATS_LE32(cck, crc32_err); |
723 | PRINT_STATS_LE32("overrun_err", cck->overrun_err); | 722 | PRINT_STATS_LE32(cck, overrun_err); |
724 | PRINT_STATS_LE32("early_overrun_err", cck->early_overrun_err); | 723 | PRINT_STATS_LE32(cck, early_overrun_err); |
725 | PRINT_STATS_LE32("crc32_good", cck->crc32_good); | 724 | PRINT_STATS_LE32(cck, crc32_good); |
726 | PRINT_STATS_LE32("false_alarm_cnt", cck->false_alarm_cnt); | 725 | PRINT_STATS_LE32(cck, false_alarm_cnt); |
727 | PRINT_STATS_LE32("fina_sync_err_cnt", cck->fina_sync_err_cnt); | 726 | PRINT_STATS_LE32(cck, fina_sync_err_cnt); |
728 | PRINT_STATS_LE32("sfd_timeout", cck->sfd_timeout); | 727 | PRINT_STATS_LE32(cck, sfd_timeout); |
729 | PRINT_STATS_LE32("fina_timeout", cck->fina_timeout); | 728 | PRINT_STATS_LE32(cck, fina_timeout); |
730 | PRINT_STATS_LE32("unresponded_rts", cck->unresponded_rts); | 729 | PRINT_STATS_LE32(cck, unresponded_rts); |
731 | PRINT_STATS_LE32("rxe_frame_lmt_overrun", | 730 | PRINT_STATS_LE32(cck, rxe_frame_lmt_overrun); |
732 | cck->rxe_frame_limit_overrun); | 731 | PRINT_STATS_LE32(cck, sent_ack_cnt); |
733 | PRINT_STATS_LE32("sent_ack_cnt", cck->sent_ack_cnt); | 732 | PRINT_STATS_LE32(cck, sent_cts_cnt); |
734 | PRINT_STATS_LE32("sent_cts_cnt", cck->sent_cts_cnt); | 733 | PRINT_STATS_LE32(cck, sent_ba_rsp_cnt); |
735 | PRINT_STATS_LE32("sent_ba_rsp_cnt", cck->sent_ba_rsp_cnt); | 734 | PRINT_STATS_LE32(cck, dsp_self_kill); |
736 | PRINT_STATS_LE32("dsp_self_kill", cck->dsp_self_kill); | 735 | PRINT_STATS_LE32(cck, mh_format_err); |
737 | PRINT_STATS_LE32("mh_format_err", cck->mh_format_err); | 736 | PRINT_STATS_LE32(cck, re_acq_main_rssi_sum); |
738 | PRINT_STATS_LE32("re_acq_main_rssi_sum", cck->re_acq_main_rssi_sum); | 737 | PRINT_STATS_LE32(cck, reserved); |
739 | PRINT_STATS_LE32("reserved", cck->reserved); | ||
740 | 738 | ||
741 | pos += scnprintf(buf + pos, bufsz - pos, fmt_header, | 739 | pos += scnprintf(buf + pos, bufsz - pos, fmt_header, |
742 | "Statistics_Rx - GENERAL"); | 740 | "Statistics_Rx - GENERAL"); |
743 | PRINT_STATS_LE32("bogus_cts", general->bogus_cts); | 741 | PRINT_STATS_LE32(general, bogus_cts); |
744 | PRINT_STATS_LE32("bogus_ack", general->bogus_ack); | 742 | PRINT_STATS_LE32(general, bogus_ack); |
745 | PRINT_STATS_LE32("non_bssid_frames", general->non_bssid_frames); | 743 | PRINT_STATS_LE32(general, non_bssid_frames); |
746 | PRINT_STATS_LE32("filtered_frames", general->filtered_frames); | 744 | PRINT_STATS_LE32(general, filtered_frames); |
747 | PRINT_STATS_LE32("non_channel_beacons", general->non_channel_beacons); | 745 | PRINT_STATS_LE32(general, non_channel_beacons); |
748 | PRINT_STATS_LE32("channel_beacons", general->channel_beacons); | 746 | PRINT_STATS_LE32(general, channel_beacons); |
749 | PRINT_STATS_LE32("num_missed_bcon", general->num_missed_bcon); | 747 | PRINT_STATS_LE32(general, num_missed_bcon); |
750 | PRINT_STATS_LE32("adc_rx_saturation_time", | 748 | PRINT_STATS_LE32(general, adc_rx_saturation_time); |
751 | general->adc_rx_saturation_time); | 749 | PRINT_STATS_LE32(general, ina_detection_search_time); |
752 | PRINT_STATS_LE32("ina_detection_search_time", | 750 | PRINT_STATS_LE32(general, beacon_silence_rssi_a); |
753 | general->ina_detection_search_time); | 751 | PRINT_STATS_LE32(general, beacon_silence_rssi_b); |
754 | PRINT_STATS_LE32("beacon_silence_rssi_a", | 752 | PRINT_STATS_LE32(general, beacon_silence_rssi_c); |
755 | general->beacon_silence_rssi_a); | 753 | PRINT_STATS_LE32(general, interference_data_flag); |
756 | PRINT_STATS_LE32("beacon_silence_rssi_b", | 754 | PRINT_STATS_LE32(general, channel_load); |
757 | general->beacon_silence_rssi_b); | 755 | PRINT_STATS_LE32(general, dsp_false_alarms); |
758 | PRINT_STATS_LE32("beacon_silence_rssi_c", | 756 | PRINT_STATS_LE32(general, beacon_rssi_a); |
759 | general->beacon_silence_rssi_c); | 757 | PRINT_STATS_LE32(general, beacon_rssi_b); |
760 | PRINT_STATS_LE32("interference_data_flag", | 758 | PRINT_STATS_LE32(general, beacon_rssi_c); |
761 | general->interference_data_flag); | 759 | PRINT_STATS_LE32(general, beacon_energy_a); |
762 | PRINT_STATS_LE32("channel_load", general->channel_load); | 760 | PRINT_STATS_LE32(general, beacon_energy_b); |
763 | PRINT_STATS_LE32("dsp_false_alarms", general->dsp_false_alarms); | 761 | PRINT_STATS_LE32(general, beacon_energy_c); |
764 | PRINT_STATS_LE32("beacon_rssi_a", general->beacon_rssi_a); | 762 | PRINT_STATS_LE32(general, num_bt_kills); |
765 | PRINT_STATS_LE32("beacon_rssi_b", general->beacon_rssi_b); | 763 | PRINT_STATS_LE32(general, mac_id); |
766 | PRINT_STATS_LE32("beacon_rssi_c", general->beacon_rssi_c); | 764 | PRINT_STATS_LE32(general, directed_data_mpdu); |
767 | PRINT_STATS_LE32("beacon_energy_a", general->beacon_energy_a); | ||
768 | PRINT_STATS_LE32("beacon_energy_b", general->beacon_energy_b); | ||
769 | PRINT_STATS_LE32("beacon_energy_c", general->beacon_energy_c); | ||
770 | PRINT_STATS_LE32("num_bt_kills", general->num_bt_kills); | ||
771 | PRINT_STATS_LE32("mac_id", general->mac_id); | ||
772 | PRINT_STATS_LE32("directed_data_mpdu", general->directed_data_mpdu); | ||
773 | 765 | ||
774 | pos += scnprintf(buf + pos, bufsz - pos, fmt_header, | 766 | pos += scnprintf(buf + pos, bufsz - pos, fmt_header, |
775 | "Statistics_Rx - HT"); | 767 | "Statistics_Rx - HT"); |
776 | PRINT_STATS_LE32("plcp_err", ht->plcp_err); | 768 | PRINT_STATS_LE32(ht, plcp_err); |
777 | PRINT_STATS_LE32("overrun_err", ht->overrun_err); | 769 | PRINT_STATS_LE32(ht, overrun_err); |
778 | PRINT_STATS_LE32("early_overrun_err", ht->early_overrun_err); | 770 | PRINT_STATS_LE32(ht, early_overrun_err); |
779 | PRINT_STATS_LE32("crc32_good", ht->crc32_good); | 771 | PRINT_STATS_LE32(ht, crc32_good); |
780 | PRINT_STATS_LE32("crc32_err", ht->crc32_err); | 772 | PRINT_STATS_LE32(ht, crc32_err); |
781 | PRINT_STATS_LE32("mh_format_err", ht->mh_format_err); | 773 | PRINT_STATS_LE32(ht, mh_format_err); |
782 | PRINT_STATS_LE32("agg_crc32_good", ht->agg_crc32_good); | 774 | PRINT_STATS_LE32(ht, agg_crc32_good); |
783 | PRINT_STATS_LE32("agg_mpdu_cnt", ht->agg_mpdu_cnt); | 775 | PRINT_STATS_LE32(ht, agg_mpdu_cnt); |
784 | PRINT_STATS_LE32("agg_cnt", ht->agg_cnt); | 776 | PRINT_STATS_LE32(ht, agg_cnt); |
785 | PRINT_STATS_LE32("unsupport_mcs", ht->unsupport_mcs); | 777 | PRINT_STATS_LE32(ht, unsupport_mcs); |
786 | 778 | ||
787 | mutex_unlock(&mvm->mutex); | 779 | mutex_unlock(&mvm->mutex); |
788 | 780 | ||
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-stats.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-stats.h index bda3a3691f20..928168b18346 100644 --- a/drivers/net/wireless/iwlwifi/mvm/fw-api-stats.h +++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-stats.h | |||
@@ -131,7 +131,7 @@ struct mvm_statistics_rx_phy { | |||
131 | __le32 sfd_timeout; | 131 | __le32 sfd_timeout; |
132 | __le32 fina_timeout; | 132 | __le32 fina_timeout; |
133 | __le32 unresponded_rts; | 133 | __le32 unresponded_rts; |
134 | __le32 rxe_frame_limit_overrun; | 134 | __le32 rxe_frame_lmt_overrun; |
135 | __le32 sent_ack_cnt; | 135 | __le32 sent_ack_cnt; |
136 | __le32 sent_cts_cnt; | 136 | __le32 sent_cts_cnt; |
137 | __le32 sent_ba_rsp_cnt; | 137 | __le32 sent_ba_rsp_cnt; |