aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@intel.com>2013-10-14 06:18:41 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-10-18 10:02:22 -0400
commit3f617281a64b8a9c1c9f9fb76ea6bc642e1a1b01 (patch)
tree4d1691114acf41edda31b485e28cd18e3cd6be06
parent0af8835e3b37f69085b786be4c6ff79ea6965596 (diff)
iwlwifi: mvm: fix fw_rx_stats debugfs entry
The fw_rx_stats entry in debugfs was getting truncated because the internal buffer used to hold the string was too short. The calculation of the needed buffer size was rather bogus. Simplify the calculation by multiplying the number of entries in the entire structure by the size of each data line and adding the size of the header lines. Additionally, add the mac_id value, which was missing. Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/debugfs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
index a5813437d262..0675f0c8ef93 100644
--- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c
@@ -654,9 +654,11 @@ static ssize_t iwl_dbgfs_fw_rx_stats_read(struct file *file,
654 int pos = 0; 654 int pos = 0;
655 char *buf; 655 char *buf;
656 int ret; 656 int ret;
657 int bufsz = sizeof(struct mvm_statistics_rx_phy) * 20 + 657 /* 43 is the size of each data line, 33 is the size of each header */
658 sizeof(struct mvm_statistics_rx_non_phy) * 10 + 658 size_t bufsz =
659 sizeof(struct mvm_statistics_rx_ht_phy) * 10 + 200; 659 ((sizeof(struct mvm_statistics_rx) / sizeof(__le32)) * 43) +
660 (4 * 33) + 1;
661
660 struct mvm_statistics_rx_phy *ofdm; 662 struct mvm_statistics_rx_phy *ofdm;
661 struct mvm_statistics_rx_phy *cck; 663 struct mvm_statistics_rx_phy *cck;
662 struct mvm_statistics_rx_non_phy *general; 664 struct mvm_statistics_rx_non_phy *general;
@@ -751,6 +753,7 @@ static ssize_t iwl_dbgfs_fw_rx_stats_read(struct file *file,
751 PRINT_STATS_LE32("beacon_energy_b", general->beacon_energy_b); 753 PRINT_STATS_LE32("beacon_energy_b", general->beacon_energy_b);
752 PRINT_STATS_LE32("beacon_energy_c", general->beacon_energy_c); 754 PRINT_STATS_LE32("beacon_energy_c", general->beacon_energy_c);
753 PRINT_STATS_LE32("num_bt_kills", general->num_bt_kills); 755 PRINT_STATS_LE32("num_bt_kills", general->num_bt_kills);
756 PRINT_STATS_LE32("mac_id", general->mac_id);
754 PRINT_STATS_LE32("directed_data_mpdu", general->directed_data_mpdu); 757 PRINT_STATS_LE32("directed_data_mpdu", general->directed_data_mpdu);
755 758
756 pos += scnprintf(buf + pos, bufsz - pos, fmt_header, 759 pos += scnprintf(buf + pos, bufsz - pos, fmt_header,