diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-07-14 11:08:57 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-07-23 11:41:18 -0400 |
commit | 7980fba54ec42f7c206b2bb469baeb3a0a2e8a93 (patch) | |
tree | a51924951f40f302009dd9ae9869a09d9303d61c /drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c | |
parent | af8ee0553b4ce077319190cde680d74ad18ddfad (diff) |
iwlagn: Add support for bluetooth statistics notification
WiFi/BT combo devices has different statistics notification
structure, adding the support here to make sure the structure
align correctly.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c | 134 |
1 files changed, 91 insertions, 43 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c index 11dd1f736bed..19d1e5e86261 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c | |||
@@ -31,21 +31,24 @@ | |||
31 | static int iwl_statistics_flag(struct iwl_priv *priv, char *buf, int bufsz) | 31 | static int iwl_statistics_flag(struct iwl_priv *priv, char *buf, int bufsz) |
32 | { | 32 | { |
33 | int p = 0; | 33 | int p = 0; |
34 | u32 flag; | ||
34 | 35 | ||
35 | p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", | 36 | if (priv->cfg->bt_statistics) |
36 | le32_to_cpu(priv->_agn.statistics.flag)); | 37 | flag = le32_to_cpu(priv->_agn.statistics_bt.flag); |
37 | if (le32_to_cpu(priv->_agn.statistics.flag) & | 38 | else |
38 | UCODE_STATISTICS_CLEAR_MSK) | 39 | flag = le32_to_cpu(priv->_agn.statistics.flag); |
40 | |||
41 | p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", flag); | ||
42 | if (flag & UCODE_STATISTICS_CLEAR_MSK) | ||
39 | p += scnprintf(buf + p, bufsz - p, | 43 | p += scnprintf(buf + p, bufsz - p, |
40 | "\tStatistics have been cleared\n"); | 44 | "\tStatistics have been cleared\n"); |
41 | p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\n", | 45 | p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\n", |
42 | (le32_to_cpu(priv->_agn.statistics.flag) & | 46 | (flag & UCODE_STATISTICS_FREQUENCY_MSK) |
43 | UCODE_STATISTICS_FREQUENCY_MSK) | 47 | ? "2.4 GHz" : "5.2 GHz"); |
44 | ? "2.4 GHz" : "5.2 GHz"); | ||
45 | p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n", | 48 | p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n", |
46 | (le32_to_cpu(priv->_agn.statistics.flag) & | 49 | (flag & UCODE_STATISTICS_NARROW_BAND_MSK) |
47 | UCODE_STATISTICS_NARROW_BAND_MSK) | 50 | ? "enabled" : "disabled"); |
48 | ? "enabled" : "disabled"); | 51 | |
49 | return p; | 52 | return p; |
50 | } | 53 | } |
51 | 54 | ||
@@ -79,22 +82,43 @@ ssize_t iwl_ucode_rx_stats_read(struct file *file, char __user *user_buf, | |||
79 | * the last statistics notification from uCode | 82 | * the last statistics notification from uCode |
80 | * might not reflect the current uCode activity | 83 | * might not reflect the current uCode activity |
81 | */ | 84 | */ |
82 | ofdm = &priv->_agn.statistics.rx.ofdm; | 85 | if (priv->cfg->bt_statistics) { |
83 | cck = &priv->_agn.statistics.rx.cck; | 86 | ofdm = &priv->_agn.statistics_bt.rx.ofdm; |
84 | general = &priv->_agn.statistics.rx.general; | 87 | cck = &priv->_agn.statistics_bt.rx.cck; |
85 | ht = &priv->_agn.statistics.rx.ofdm_ht; | 88 | general = &priv->_agn.statistics_bt.rx.general.common; |
86 | accum_ofdm = &priv->_agn.accum_statistics.rx.ofdm; | 89 | ht = &priv->_agn.statistics_bt.rx.ofdm_ht; |
87 | accum_cck = &priv->_agn.accum_statistics.rx.cck; | 90 | accum_ofdm = &priv->_agn.accum_statistics_bt.rx.ofdm; |
88 | accum_general = &priv->_agn.accum_statistics.rx.general; | 91 | accum_cck = &priv->_agn.accum_statistics_bt.rx.cck; |
89 | accum_ht = &priv->_agn.accum_statistics.rx.ofdm_ht; | 92 | accum_general = |
90 | delta_ofdm = &priv->_agn.delta_statistics.rx.ofdm; | 93 | &priv->_agn.accum_statistics_bt.rx.general.common; |
91 | delta_cck = &priv->_agn.delta_statistics.rx.cck; | 94 | accum_ht = &priv->_agn.accum_statistics_bt.rx.ofdm_ht; |
92 | delta_general = &priv->_agn.delta_statistics.rx.general; | 95 | delta_ofdm = &priv->_agn.delta_statistics_bt.rx.ofdm; |
93 | delta_ht = &priv->_agn.delta_statistics.rx.ofdm_ht; | 96 | delta_cck = &priv->_agn.delta_statistics_bt.rx.cck; |
94 | max_ofdm = &priv->_agn.max_delta.rx.ofdm; | 97 | delta_general = |
95 | max_cck = &priv->_agn.max_delta.rx.cck; | 98 | &priv->_agn.delta_statistics_bt.rx.general.common; |
96 | max_general = &priv->_agn.max_delta.rx.general; | 99 | delta_ht = &priv->_agn.delta_statistics_bt.rx.ofdm_ht; |
97 | max_ht = &priv->_agn.max_delta.rx.ofdm_ht; | 100 | max_ofdm = &priv->_agn.max_delta_bt.rx.ofdm; |
101 | max_cck = &priv->_agn.max_delta_bt.rx.cck; | ||
102 | max_general = &priv->_agn.max_delta_bt.rx.general.common; | ||
103 | max_ht = &priv->_agn.max_delta_bt.rx.ofdm_ht; | ||
104 | } else { | ||
105 | ofdm = &priv->_agn.statistics.rx.ofdm; | ||
106 | cck = &priv->_agn.statistics.rx.cck; | ||
107 | general = &priv->_agn.statistics.rx.general; | ||
108 | ht = &priv->_agn.statistics.rx.ofdm_ht; | ||
109 | accum_ofdm = &priv->_agn.accum_statistics.rx.ofdm; | ||
110 | accum_cck = &priv->_agn.accum_statistics.rx.cck; | ||
111 | accum_general = &priv->_agn.accum_statistics.rx.general; | ||
112 | accum_ht = &priv->_agn.accum_statistics.rx.ofdm_ht; | ||
113 | delta_ofdm = &priv->_agn.delta_statistics.rx.ofdm; | ||
114 | delta_cck = &priv->_agn.delta_statistics.rx.cck; | ||
115 | delta_general = &priv->_agn.delta_statistics.rx.general; | ||
116 | delta_ht = &priv->_agn.delta_statistics.rx.ofdm_ht; | ||
117 | max_ofdm = &priv->_agn.max_delta.rx.ofdm; | ||
118 | max_cck = &priv->_agn.max_delta.rx.cck; | ||
119 | max_general = &priv->_agn.max_delta.rx.general; | ||
120 | max_ht = &priv->_agn.max_delta.rx.ofdm_ht; | ||
121 | } | ||
98 | 122 | ||
99 | pos += iwl_statistics_flag(priv, buf, bufsz); | 123 | pos += iwl_statistics_flag(priv, buf, bufsz); |
100 | pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" | 124 | pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" |
@@ -560,10 +584,18 @@ ssize_t iwl_ucode_tx_stats_read(struct file *file, | |||
560 | * the last statistics notification from uCode | 584 | * the last statistics notification from uCode |
561 | * might not reflect the current uCode activity | 585 | * might not reflect the current uCode activity |
562 | */ | 586 | */ |
563 | tx = &priv->_agn.statistics.tx; | 587 | if (priv->cfg->bt_statistics) { |
564 | accum_tx = &priv->_agn.accum_statistics.tx; | 588 | tx = &priv->_agn.statistics_bt.tx; |
565 | delta_tx = &priv->_agn.delta_statistics.tx; | 589 | accum_tx = &priv->_agn.accum_statistics_bt.tx; |
566 | max_tx = &priv->_agn.max_delta.tx; | 590 | delta_tx = &priv->_agn.delta_statistics_bt.tx; |
591 | max_tx = &priv->_agn.max_delta_bt.tx; | ||
592 | } else { | ||
593 | tx = &priv->_agn.statistics.tx; | ||
594 | accum_tx = &priv->_agn.accum_statistics.tx; | ||
595 | delta_tx = &priv->_agn.delta_statistics.tx; | ||
596 | max_tx = &priv->_agn.max_delta.tx; | ||
597 | } | ||
598 | |||
567 | pos += iwl_statistics_flag(priv, buf, bufsz); | 599 | pos += iwl_statistics_flag(priv, buf, bufsz); |
568 | pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" | 600 | pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" |
569 | "acumulative delta max\n", | 601 | "acumulative delta max\n", |
@@ -777,18 +809,34 @@ ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf, | |||
777 | * the last statistics notification from uCode | 809 | * the last statistics notification from uCode |
778 | * might not reflect the current uCode activity | 810 | * might not reflect the current uCode activity |
779 | */ | 811 | */ |
780 | general = &priv->_agn.statistics.general.common; | 812 | if (priv->cfg->bt_statistics) { |
781 | dbg = &priv->_agn.statistics.general.common.dbg; | 813 | general = &priv->_agn.statistics_bt.general.common; |
782 | div = &priv->_agn.statistics.general.common.div; | 814 | dbg = &priv->_agn.statistics_bt.general.common.dbg; |
783 | accum_general = &priv->_agn.accum_statistics.general.common; | 815 | div = &priv->_agn.statistics_bt.general.common.div; |
784 | delta_general = &priv->_agn.delta_statistics.general.common; | 816 | accum_general = &priv->_agn.accum_statistics_bt.general.common; |
785 | max_general = &priv->_agn.max_delta.general.common; | 817 | accum_dbg = &priv->_agn.accum_statistics_bt.general.common.dbg; |
786 | accum_dbg = &priv->_agn.accum_statistics.general.common.dbg; | 818 | accum_div = &priv->_agn.accum_statistics_bt.general.common.div; |
787 | delta_dbg = &priv->_agn.delta_statistics.general.common.dbg; | 819 | delta_general = &priv->_agn.delta_statistics_bt.general.common; |
788 | max_dbg = &priv->_agn.max_delta.general.common.dbg; | 820 | max_general = &priv->_agn.max_delta_bt.general.common; |
789 | accum_div = &priv->_agn.accum_statistics.general.common.div; | 821 | delta_dbg = &priv->_agn.delta_statistics_bt.general.common.dbg; |
790 | delta_div = &priv->_agn.delta_statistics.general.common.div; | 822 | max_dbg = &priv->_agn.max_delta_bt.general.common.dbg; |
791 | max_div = &priv->_agn.max_delta.general.common.div; | 823 | delta_div = &priv->_agn.delta_statistics_bt.general.common.div; |
824 | max_div = &priv->_agn.max_delta_bt.general.common.div; | ||
825 | } else { | ||
826 | general = &priv->_agn.statistics.general.common; | ||
827 | dbg = &priv->_agn.statistics.general.common.dbg; | ||
828 | div = &priv->_agn.statistics.general.common.div; | ||
829 | accum_general = &priv->_agn.accum_statistics.general.common; | ||
830 | accum_dbg = &priv->_agn.accum_statistics.general.common.dbg; | ||
831 | accum_div = &priv->_agn.accum_statistics.general.common.div; | ||
832 | delta_general = &priv->_agn.delta_statistics.general.common; | ||
833 | max_general = &priv->_agn.max_delta.general.common; | ||
834 | delta_dbg = &priv->_agn.delta_statistics.general.common.dbg; | ||
835 | max_dbg = &priv->_agn.max_delta.general.common.dbg; | ||
836 | delta_div = &priv->_agn.delta_statistics.general.common.div; | ||
837 | max_div = &priv->_agn.max_delta.general.common.div; | ||
838 | } | ||
839 | |||
792 | pos += iwl_statistics_flag(priv, buf, bufsz); | 840 | pos += iwl_statistics_flag(priv, buf, bufsz); |
793 | pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" | 841 | pos += scnprintf(buf + pos, bufsz - pos, "%-32s current" |
794 | "acumulative delta max\n", | 842 | "acumulative delta max\n", |