diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-04-30 17:21:49 -0400 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-05-13 13:42:55 -0400 |
commit | 1d60a79ed516edcc62c5f74e4223d21e10a5cc14 (patch) | |
tree | d863e07be1b9111dfea6c655ef23278b24d8a263 /drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c | |
parent | a2064b7a4a22d118087898e4308670da7ac07911 (diff) |
iwlwifi: separate statistics flag function for agn & 3945
Since agn and 3945 have different statistics_notif data structure, each
should has its own statistics_flag function.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c index 90be033ee269..75d6bfcbc607 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c | |||
@@ -28,6 +28,27 @@ | |||
28 | 28 | ||
29 | #include "iwl-agn-debugfs.h" | 29 | #include "iwl-agn-debugfs.h" |
30 | 30 | ||
31 | static int iwl_statistics_flag(struct iwl_priv *priv, char *buf, int bufsz) | ||
32 | { | ||
33 | int p = 0; | ||
34 | |||
35 | p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", | ||
36 | le32_to_cpu(priv->_agn.statistics.flag)); | ||
37 | if (le32_to_cpu(priv->_agn.statistics.flag) & | ||
38 | UCODE_STATISTICS_CLEAR_MSK) | ||
39 | p += scnprintf(buf + p, bufsz - p, | ||
40 | "\tStatistics have been cleared\n"); | ||
41 | p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\n", | ||
42 | (le32_to_cpu(priv->_agn.statistics.flag) & | ||
43 | UCODE_STATISTICS_FREQUENCY_MSK) | ||
44 | ? "2.4 GHz" : "5.2 GHz"); | ||
45 | p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n", | ||
46 | (le32_to_cpu(priv->_agn.statistics.flag) & | ||
47 | UCODE_STATISTICS_NARROW_BAND_MSK) | ||
48 | ? "enabled" : "disabled"); | ||
49 | return p; | ||
50 | } | ||
51 | |||
31 | ssize_t iwl_ucode_rx_stats_read(struct file *file, char __user *user_buf, | 52 | ssize_t iwl_ucode_rx_stats_read(struct file *file, char __user *user_buf, |
32 | size_t count, loff_t *ppos) | 53 | size_t count, loff_t *ppos) |
33 | { | 54 | { |
@@ -75,7 +96,7 @@ ssize_t iwl_ucode_rx_stats_read(struct file *file, char __user *user_buf, | |||
75 | max_general = &priv->_agn.max_delta.rx.general; | 96 | max_general = &priv->_agn.max_delta.rx.general; |
76 | max_ht = &priv->_agn.max_delta.rx.ofdm_ht; | 97 | max_ht = &priv->_agn.max_delta.rx.ofdm_ht; |
77 | 98 | ||
78 | pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz); | 99 | pos += iwl_statistics_flag(priv, buf, bufsz); |
79 | pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" | 100 | pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" |
80 | "acumulative delta max\n", | 101 | "acumulative delta max\n", |
81 | "Statistics_Rx - OFDM:"); | 102 | "Statistics_Rx - OFDM:"); |
@@ -543,7 +564,7 @@ ssize_t iwl_ucode_tx_stats_read(struct file *file, | |||
543 | accum_tx = &priv->_agn.accum_statistics.tx; | 564 | accum_tx = &priv->_agn.accum_statistics.tx; |
544 | delta_tx = &priv->_agn.delta_statistics.tx; | 565 | delta_tx = &priv->_agn.delta_statistics.tx; |
545 | max_tx = &priv->_agn.max_delta.tx; | 566 | max_tx = &priv->_agn.max_delta.tx; |
546 | pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz); | 567 | pos += iwl_statistics_flag(priv, buf, bufsz); |
547 | pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" | 568 | pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" |
548 | "acumulative delta max\n", | 569 | "acumulative delta max\n", |
549 | "Statistics_Tx:"); | 570 | "Statistics_Tx:"); |
@@ -768,7 +789,7 @@ ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf, | |||
768 | accum_div = &priv->_agn.accum_statistics.general.div; | 789 | accum_div = &priv->_agn.accum_statistics.general.div; |
769 | delta_div = &priv->_agn.delta_statistics.general.div; | 790 | delta_div = &priv->_agn.delta_statistics.general.div; |
770 | max_div = &priv->_agn.max_delta.general.div; | 791 | max_div = &priv->_agn.max_delta.general.div; |
771 | pos += iwl_dbgfs_statistics_flag(priv, buf, bufsz); | 792 | pos += iwl_statistics_flag(priv, buf, bufsz); |
772 | pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" | 793 | pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" |
773 | "acumulative delta max\n", | 794 | "acumulative delta max\n", |
774 | "Statistics_General:"); | 795 | "Statistics_General:"); |