| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 1 | /****************************************************************************** | 
|  | 2 | * | 
|  | 3 | * GPL LICENSE SUMMARY | 
|  | 4 | * | 
|  | 5 | * Copyright(c) 2008 - 2010 Intel Corporation. All rights reserved. | 
|  | 6 | * | 
|  | 7 | * This program is free software; you can redistribute it and/or modify | 
|  | 8 | * it under the terms of version 2 of the GNU General Public License as | 
|  | 9 | * published by the Free Software Foundation. | 
|  | 10 | * | 
|  | 11 | * This program is distributed in the hope that it will be useful, but | 
|  | 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of | 
|  | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
|  | 14 | * General Public License for more details. | 
|  | 15 | * | 
|  | 16 | * You should have received a copy of the GNU General Public License | 
|  | 17 | * along with this program; if not, write to the Free Software | 
|  | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, | 
|  | 19 | * USA | 
|  | 20 | * | 
|  | 21 | * The full GNU General Public License is included in this distribution | 
|  | 22 | * in the file called LICENSE.GPL. | 
|  | 23 | * | 
|  | 24 | * Contact Information: | 
|  | 25 | *  Intel Linux Wireless <ilw@linux.intel.com> | 
|  | 26 | * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | 
|  | 27 | *****************************************************************************/ | 
| Wey-Yi Guy | 95b49ed | 2010-09-05 10:49:45 -0700 | [diff] [blame] | 28 | #include "iwl-agn.h" | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 29 | #include "iwl-agn-debugfs.h" | 
|  | 30 |  | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 31 | static const char *fmt_value = "  %-30s %10u\n"; | 
|  | 32 | static const char *fmt_hex   = "  %-30s       0x%02X\n"; | 
|  | 33 | static const char *fmt_table = "  %-30s %10u  %10u  %10u  %10u\n"; | 
|  | 34 | static const char *fmt_header = | 
|  | 35 | "%-32s    current  cumulative       delta         max\n"; | 
|  | 36 |  | 
| Wey-Yi Guy | 1d60a79 | 2010-04-30 14:21:49 -0700 | [diff] [blame] | 37 | static int iwl_statistics_flag(struct iwl_priv *priv, char *buf, int bufsz) | 
|  | 38 | { | 
|  | 39 | int p = 0; | 
| Wey-Yi Guy | 7980fba | 2010-07-14 08:08:57 -0700 | [diff] [blame] | 40 | u32 flag; | 
| Wey-Yi Guy | 1d60a79 | 2010-04-30 14:21:49 -0700 | [diff] [blame] | 41 |  | 
| Stanislaw Gruszka | 9f60e7e | 2011-01-28 16:47:51 +0100 | [diff] [blame] | 42 | if (iwl_bt_statistics(priv)) | 
| Wey-Yi Guy | 7980fba | 2010-07-14 08:08:57 -0700 | [diff] [blame] | 43 | flag = le32_to_cpu(priv->_agn.statistics_bt.flag); | 
|  | 44 | else | 
|  | 45 | flag = le32_to_cpu(priv->_agn.statistics.flag); | 
|  | 46 |  | 
|  | 47 | p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", flag); | 
|  | 48 | if (flag & UCODE_STATISTICS_CLEAR_MSK) | 
| Wey-Yi Guy | 1d60a79 | 2010-04-30 14:21:49 -0700 | [diff] [blame] | 49 | p += scnprintf(buf + p, bufsz - p, | 
| Wey-Yi Guy | 7980fba | 2010-07-14 08:08:57 -0700 | [diff] [blame] | 50 | "\tStatistics have been cleared\n"); | 
| Wey-Yi Guy | 1d60a79 | 2010-04-30 14:21:49 -0700 | [diff] [blame] | 51 | p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\n", | 
| Wey-Yi Guy | 7980fba | 2010-07-14 08:08:57 -0700 | [diff] [blame] | 52 | (flag & UCODE_STATISTICS_FREQUENCY_MSK) | 
|  | 53 | ? "2.4 GHz" : "5.2 GHz"); | 
| Wey-Yi Guy | 1d60a79 | 2010-04-30 14:21:49 -0700 | [diff] [blame] | 54 | p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n", | 
| Wey-Yi Guy | 7980fba | 2010-07-14 08:08:57 -0700 | [diff] [blame] | 55 | (flag & UCODE_STATISTICS_NARROW_BAND_MSK) | 
|  | 56 | ? "enabled" : "disabled"); | 
|  | 57 |  | 
| Wey-Yi Guy | 1d60a79 | 2010-04-30 14:21:49 -0700 | [diff] [blame] | 58 | return p; | 
|  | 59 | } | 
|  | 60 |  | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 61 | ssize_t iwl_ucode_rx_stats_read(struct file *file, char __user *user_buf, | 
|  | 62 | size_t count, loff_t *ppos) | 
|  | 63 | { | 
|  | 64 | struct iwl_priv *priv = file->private_data; | 
|  | 65 | int pos = 0; | 
|  | 66 | char *buf; | 
|  | 67 | int bufsz = sizeof(struct statistics_rx_phy) * 40 + | 
|  | 68 | sizeof(struct statistics_rx_non_phy) * 40 + | 
|  | 69 | sizeof(struct statistics_rx_ht_phy) * 40 + 400; | 
|  | 70 | ssize_t ret; | 
|  | 71 | struct statistics_rx_phy *ofdm, *accum_ofdm, *delta_ofdm, *max_ofdm; | 
|  | 72 | struct statistics_rx_phy *cck, *accum_cck, *delta_cck, *max_cck; | 
|  | 73 | struct statistics_rx_non_phy *general, *accum_general; | 
|  | 74 | struct statistics_rx_non_phy *delta_general, *max_general; | 
|  | 75 | struct statistics_rx_ht_phy *ht, *accum_ht, *delta_ht, *max_ht; | 
|  | 76 |  | 
|  | 77 | if (!iwl_is_alive(priv)) | 
|  | 78 | return -EAGAIN; | 
|  | 79 |  | 
|  | 80 | buf = kzalloc(bufsz, GFP_KERNEL); | 
|  | 81 | if (!buf) { | 
|  | 82 | IWL_ERR(priv, "Can not allocate Buffer\n"); | 
|  | 83 | return -ENOMEM; | 
|  | 84 | } | 
|  | 85 |  | 
|  | 86 | /* | 
|  | 87 | * the statistic information display here is based on | 
|  | 88 | * the last statistics notification from uCode | 
|  | 89 | * might not reflect the current uCode activity | 
|  | 90 | */ | 
| Stanislaw Gruszka | 9f60e7e | 2011-01-28 16:47:51 +0100 | [diff] [blame] | 91 | if (iwl_bt_statistics(priv)) { | 
| Wey-Yi Guy | 7980fba | 2010-07-14 08:08:57 -0700 | [diff] [blame] | 92 | ofdm = &priv->_agn.statistics_bt.rx.ofdm; | 
|  | 93 | cck = &priv->_agn.statistics_bt.rx.cck; | 
|  | 94 | general = &priv->_agn.statistics_bt.rx.general.common; | 
|  | 95 | ht = &priv->_agn.statistics_bt.rx.ofdm_ht; | 
|  | 96 | accum_ofdm = &priv->_agn.accum_statistics_bt.rx.ofdm; | 
|  | 97 | accum_cck = &priv->_agn.accum_statistics_bt.rx.cck; | 
|  | 98 | accum_general = | 
|  | 99 | &priv->_agn.accum_statistics_bt.rx.general.common; | 
|  | 100 | accum_ht = &priv->_agn.accum_statistics_bt.rx.ofdm_ht; | 
|  | 101 | delta_ofdm = &priv->_agn.delta_statistics_bt.rx.ofdm; | 
|  | 102 | delta_cck = &priv->_agn.delta_statistics_bt.rx.cck; | 
|  | 103 | delta_general = | 
|  | 104 | &priv->_agn.delta_statistics_bt.rx.general.common; | 
|  | 105 | delta_ht = &priv->_agn.delta_statistics_bt.rx.ofdm_ht; | 
|  | 106 | max_ofdm = &priv->_agn.max_delta_bt.rx.ofdm; | 
|  | 107 | max_cck = &priv->_agn.max_delta_bt.rx.cck; | 
|  | 108 | max_general = &priv->_agn.max_delta_bt.rx.general.common; | 
|  | 109 | max_ht = &priv->_agn.max_delta_bt.rx.ofdm_ht; | 
|  | 110 | } else { | 
|  | 111 | ofdm = &priv->_agn.statistics.rx.ofdm; | 
|  | 112 | cck = &priv->_agn.statistics.rx.cck; | 
|  | 113 | general = &priv->_agn.statistics.rx.general; | 
|  | 114 | ht = &priv->_agn.statistics.rx.ofdm_ht; | 
|  | 115 | accum_ofdm = &priv->_agn.accum_statistics.rx.ofdm; | 
|  | 116 | accum_cck = &priv->_agn.accum_statistics.rx.cck; | 
|  | 117 | accum_general = &priv->_agn.accum_statistics.rx.general; | 
|  | 118 | accum_ht = &priv->_agn.accum_statistics.rx.ofdm_ht; | 
|  | 119 | delta_ofdm = &priv->_agn.delta_statistics.rx.ofdm; | 
|  | 120 | delta_cck = &priv->_agn.delta_statistics.rx.cck; | 
|  | 121 | delta_general = &priv->_agn.delta_statistics.rx.general; | 
|  | 122 | delta_ht = &priv->_agn.delta_statistics.rx.ofdm_ht; | 
|  | 123 | max_ofdm = &priv->_agn.max_delta.rx.ofdm; | 
|  | 124 | max_cck = &priv->_agn.max_delta.rx.cck; | 
|  | 125 | max_general = &priv->_agn.max_delta.rx.general; | 
|  | 126 | max_ht = &priv->_agn.max_delta.rx.ofdm_ht; | 
|  | 127 | } | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 128 |  | 
| Wey-Yi Guy | 1d60a79 | 2010-04-30 14:21:49 -0700 | [diff] [blame] | 129 | pos += iwl_statistics_flag(priv, buf, bufsz); | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 130 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 131 | fmt_header, "Statistics_Rx - OFDM:"); | 
|  | 132 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 133 | fmt_table, "ina_cnt:", | 
|  | 134 | le32_to_cpu(ofdm->ina_cnt), | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 135 | accum_ofdm->ina_cnt, | 
|  | 136 | delta_ofdm->ina_cnt, max_ofdm->ina_cnt); | 
|  | 137 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 138 | fmt_table, "fina_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 139 | le32_to_cpu(ofdm->fina_cnt), accum_ofdm->fina_cnt, | 
|  | 140 | delta_ofdm->fina_cnt, max_ofdm->fina_cnt); | 
|  | 141 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 142 | fmt_table, "plcp_err:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 143 | le32_to_cpu(ofdm->plcp_err), accum_ofdm->plcp_err, | 
|  | 144 | delta_ofdm->plcp_err, max_ofdm->plcp_err); | 
|  | 145 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 146 | fmt_table, "crc32_err:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 147 | le32_to_cpu(ofdm->crc32_err), accum_ofdm->crc32_err, | 
|  | 148 | delta_ofdm->crc32_err, max_ofdm->crc32_err); | 
|  | 149 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 150 | fmt_table, "overrun_err:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 151 | le32_to_cpu(ofdm->overrun_err), | 
|  | 152 | accum_ofdm->overrun_err, delta_ofdm->overrun_err, | 
|  | 153 | max_ofdm->overrun_err); | 
|  | 154 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 155 | fmt_table, "early_overrun_err:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 156 | le32_to_cpu(ofdm->early_overrun_err), | 
|  | 157 | accum_ofdm->early_overrun_err, | 
|  | 158 | delta_ofdm->early_overrun_err, | 
|  | 159 | max_ofdm->early_overrun_err); | 
|  | 160 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 161 | fmt_table, "crc32_good:", | 
|  | 162 | le32_to_cpu(ofdm->crc32_good), | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 163 | accum_ofdm->crc32_good, delta_ofdm->crc32_good, | 
|  | 164 | max_ofdm->crc32_good); | 
|  | 165 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 166 | fmt_table, "false_alarm_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 167 | le32_to_cpu(ofdm->false_alarm_cnt), | 
|  | 168 | accum_ofdm->false_alarm_cnt, | 
|  | 169 | delta_ofdm->false_alarm_cnt, | 
|  | 170 | max_ofdm->false_alarm_cnt); | 
|  | 171 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 172 | fmt_table, "fina_sync_err_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 173 | le32_to_cpu(ofdm->fina_sync_err_cnt), | 
|  | 174 | accum_ofdm->fina_sync_err_cnt, | 
|  | 175 | delta_ofdm->fina_sync_err_cnt, | 
|  | 176 | max_ofdm->fina_sync_err_cnt); | 
|  | 177 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 178 | fmt_table, "sfd_timeout:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 179 | le32_to_cpu(ofdm->sfd_timeout), | 
|  | 180 | accum_ofdm->sfd_timeout, delta_ofdm->sfd_timeout, | 
|  | 181 | max_ofdm->sfd_timeout); | 
|  | 182 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 183 | fmt_table, "fina_timeout:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 184 | le32_to_cpu(ofdm->fina_timeout), | 
|  | 185 | accum_ofdm->fina_timeout, delta_ofdm->fina_timeout, | 
|  | 186 | max_ofdm->fina_timeout); | 
|  | 187 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 188 | fmt_table, "unresponded_rts:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 189 | le32_to_cpu(ofdm->unresponded_rts), | 
|  | 190 | accum_ofdm->unresponded_rts, | 
|  | 191 | delta_ofdm->unresponded_rts, | 
|  | 192 | max_ofdm->unresponded_rts); | 
|  | 193 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 194 | fmt_table, "rxe_frame_lmt_ovrun:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 195 | le32_to_cpu(ofdm->rxe_frame_limit_overrun), | 
|  | 196 | accum_ofdm->rxe_frame_limit_overrun, | 
|  | 197 | delta_ofdm->rxe_frame_limit_overrun, | 
|  | 198 | max_ofdm->rxe_frame_limit_overrun); | 
|  | 199 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 200 | fmt_table, "sent_ack_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 201 | le32_to_cpu(ofdm->sent_ack_cnt), | 
|  | 202 | accum_ofdm->sent_ack_cnt, delta_ofdm->sent_ack_cnt, | 
|  | 203 | max_ofdm->sent_ack_cnt); | 
|  | 204 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 205 | fmt_table, "sent_cts_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 206 | le32_to_cpu(ofdm->sent_cts_cnt), | 
|  | 207 | accum_ofdm->sent_cts_cnt, delta_ofdm->sent_cts_cnt, | 
|  | 208 | max_ofdm->sent_cts_cnt); | 
|  | 209 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 210 | fmt_table, "sent_ba_rsp_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 211 | le32_to_cpu(ofdm->sent_ba_rsp_cnt), | 
|  | 212 | accum_ofdm->sent_ba_rsp_cnt, | 
|  | 213 | delta_ofdm->sent_ba_rsp_cnt, | 
|  | 214 | max_ofdm->sent_ba_rsp_cnt); | 
|  | 215 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 216 | fmt_table, "dsp_self_kill:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 217 | le32_to_cpu(ofdm->dsp_self_kill), | 
|  | 218 | accum_ofdm->dsp_self_kill, | 
|  | 219 | delta_ofdm->dsp_self_kill, | 
|  | 220 | max_ofdm->dsp_self_kill); | 
|  | 221 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 222 | fmt_table, "mh_format_err:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 223 | le32_to_cpu(ofdm->mh_format_err), | 
|  | 224 | accum_ofdm->mh_format_err, | 
|  | 225 | delta_ofdm->mh_format_err, | 
|  | 226 | max_ofdm->mh_format_err); | 
|  | 227 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 228 | fmt_table, "re_acq_main_rssi_sum:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 229 | le32_to_cpu(ofdm->re_acq_main_rssi_sum), | 
|  | 230 | accum_ofdm->re_acq_main_rssi_sum, | 
|  | 231 | delta_ofdm->re_acq_main_rssi_sum, | 
|  | 232 | max_ofdm->re_acq_main_rssi_sum); | 
|  | 233 |  | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 234 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 235 | fmt_header, "Statistics_Rx - CCK:"); | 
|  | 236 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 237 | fmt_table, "ina_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 238 | le32_to_cpu(cck->ina_cnt), accum_cck->ina_cnt, | 
|  | 239 | delta_cck->ina_cnt, max_cck->ina_cnt); | 
|  | 240 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 241 | fmt_table, "fina_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 242 | le32_to_cpu(cck->fina_cnt), accum_cck->fina_cnt, | 
|  | 243 | delta_cck->fina_cnt, max_cck->fina_cnt); | 
|  | 244 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 245 | fmt_table, "plcp_err:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 246 | le32_to_cpu(cck->plcp_err), accum_cck->plcp_err, | 
|  | 247 | delta_cck->plcp_err, max_cck->plcp_err); | 
|  | 248 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 249 | fmt_table, "crc32_err:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 250 | le32_to_cpu(cck->crc32_err), accum_cck->crc32_err, | 
|  | 251 | delta_cck->crc32_err, max_cck->crc32_err); | 
|  | 252 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 253 | fmt_table, "overrun_err:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 254 | le32_to_cpu(cck->overrun_err), | 
|  | 255 | accum_cck->overrun_err, delta_cck->overrun_err, | 
|  | 256 | max_cck->overrun_err); | 
|  | 257 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 258 | fmt_table, "early_overrun_err:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 259 | le32_to_cpu(cck->early_overrun_err), | 
|  | 260 | accum_cck->early_overrun_err, | 
|  | 261 | delta_cck->early_overrun_err, | 
|  | 262 | max_cck->early_overrun_err); | 
|  | 263 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 264 | fmt_table, "crc32_good:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 265 | le32_to_cpu(cck->crc32_good), accum_cck->crc32_good, | 
|  | 266 | delta_cck->crc32_good, max_cck->crc32_good); | 
|  | 267 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 268 | fmt_table, "false_alarm_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 269 | le32_to_cpu(cck->false_alarm_cnt), | 
|  | 270 | accum_cck->false_alarm_cnt, | 
|  | 271 | delta_cck->false_alarm_cnt, max_cck->false_alarm_cnt); | 
|  | 272 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 273 | fmt_table, "fina_sync_err_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 274 | le32_to_cpu(cck->fina_sync_err_cnt), | 
|  | 275 | accum_cck->fina_sync_err_cnt, | 
|  | 276 | delta_cck->fina_sync_err_cnt, | 
|  | 277 | max_cck->fina_sync_err_cnt); | 
|  | 278 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 279 | fmt_table, "sfd_timeout:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 280 | le32_to_cpu(cck->sfd_timeout), | 
|  | 281 | accum_cck->sfd_timeout, delta_cck->sfd_timeout, | 
|  | 282 | max_cck->sfd_timeout); | 
|  | 283 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 284 | fmt_table, "fina_timeout:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 285 | le32_to_cpu(cck->fina_timeout), | 
|  | 286 | accum_cck->fina_timeout, delta_cck->fina_timeout, | 
|  | 287 | max_cck->fina_timeout); | 
|  | 288 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 289 | fmt_table, "unresponded_rts:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 290 | le32_to_cpu(cck->unresponded_rts), | 
|  | 291 | accum_cck->unresponded_rts, delta_cck->unresponded_rts, | 
|  | 292 | max_cck->unresponded_rts); | 
|  | 293 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 294 | fmt_table, "rxe_frame_lmt_ovrun:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 295 | le32_to_cpu(cck->rxe_frame_limit_overrun), | 
|  | 296 | accum_cck->rxe_frame_limit_overrun, | 
|  | 297 | delta_cck->rxe_frame_limit_overrun, | 
|  | 298 | max_cck->rxe_frame_limit_overrun); | 
|  | 299 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 300 | fmt_table, "sent_ack_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 301 | le32_to_cpu(cck->sent_ack_cnt), | 
|  | 302 | accum_cck->sent_ack_cnt, delta_cck->sent_ack_cnt, | 
|  | 303 | max_cck->sent_ack_cnt); | 
|  | 304 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 305 | fmt_table, "sent_cts_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 306 | le32_to_cpu(cck->sent_cts_cnt), | 
|  | 307 | accum_cck->sent_cts_cnt, delta_cck->sent_cts_cnt, | 
|  | 308 | max_cck->sent_cts_cnt); | 
|  | 309 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 310 | fmt_table, "sent_ba_rsp_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 311 | le32_to_cpu(cck->sent_ba_rsp_cnt), | 
|  | 312 | accum_cck->sent_ba_rsp_cnt, | 
|  | 313 | delta_cck->sent_ba_rsp_cnt, | 
|  | 314 | max_cck->sent_ba_rsp_cnt); | 
|  | 315 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 316 | fmt_table, "dsp_self_kill:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 317 | le32_to_cpu(cck->dsp_self_kill), | 
|  | 318 | accum_cck->dsp_self_kill, delta_cck->dsp_self_kill, | 
|  | 319 | max_cck->dsp_self_kill); | 
|  | 320 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 321 | fmt_table, "mh_format_err:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 322 | le32_to_cpu(cck->mh_format_err), | 
|  | 323 | accum_cck->mh_format_err, delta_cck->mh_format_err, | 
|  | 324 | max_cck->mh_format_err); | 
|  | 325 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 326 | fmt_table, "re_acq_main_rssi_sum:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 327 | le32_to_cpu(cck->re_acq_main_rssi_sum), | 
|  | 328 | accum_cck->re_acq_main_rssi_sum, | 
|  | 329 | delta_cck->re_acq_main_rssi_sum, | 
|  | 330 | max_cck->re_acq_main_rssi_sum); | 
|  | 331 |  | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 332 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 333 | fmt_header, "Statistics_Rx - GENERAL:"); | 
|  | 334 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 335 | fmt_table, "bogus_cts:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 336 | le32_to_cpu(general->bogus_cts), | 
|  | 337 | accum_general->bogus_cts, delta_general->bogus_cts, | 
|  | 338 | max_general->bogus_cts); | 
|  | 339 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 340 | fmt_table, "bogus_ack:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 341 | le32_to_cpu(general->bogus_ack), | 
|  | 342 | accum_general->bogus_ack, delta_general->bogus_ack, | 
|  | 343 | max_general->bogus_ack); | 
|  | 344 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 345 | fmt_table, "non_bssid_frames:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 346 | le32_to_cpu(general->non_bssid_frames), | 
|  | 347 | accum_general->non_bssid_frames, | 
|  | 348 | delta_general->non_bssid_frames, | 
|  | 349 | max_general->non_bssid_frames); | 
|  | 350 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 351 | fmt_table, "filtered_frames:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 352 | le32_to_cpu(general->filtered_frames), | 
|  | 353 | accum_general->filtered_frames, | 
|  | 354 | delta_general->filtered_frames, | 
|  | 355 | max_general->filtered_frames); | 
|  | 356 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 357 | fmt_table, "non_channel_beacons:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 358 | le32_to_cpu(general->non_channel_beacons), | 
|  | 359 | accum_general->non_channel_beacons, | 
|  | 360 | delta_general->non_channel_beacons, | 
|  | 361 | max_general->non_channel_beacons); | 
|  | 362 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 363 | fmt_table, "channel_beacons:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 364 | le32_to_cpu(general->channel_beacons), | 
|  | 365 | accum_general->channel_beacons, | 
|  | 366 | delta_general->channel_beacons, | 
|  | 367 | max_general->channel_beacons); | 
|  | 368 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 369 | fmt_table, "num_missed_bcon:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 370 | le32_to_cpu(general->num_missed_bcon), | 
|  | 371 | accum_general->num_missed_bcon, | 
|  | 372 | delta_general->num_missed_bcon, | 
|  | 373 | max_general->num_missed_bcon); | 
|  | 374 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 375 | fmt_table, "adc_rx_saturation_time:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 376 | le32_to_cpu(general->adc_rx_saturation_time), | 
|  | 377 | accum_general->adc_rx_saturation_time, | 
|  | 378 | delta_general->adc_rx_saturation_time, | 
|  | 379 | max_general->adc_rx_saturation_time); | 
|  | 380 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 381 | fmt_table, "ina_detect_search_tm:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 382 | le32_to_cpu(general->ina_detection_search_time), | 
|  | 383 | accum_general->ina_detection_search_time, | 
|  | 384 | delta_general->ina_detection_search_time, | 
|  | 385 | max_general->ina_detection_search_time); | 
|  | 386 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 387 | fmt_table, "beacon_silence_rssi_a:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 388 | le32_to_cpu(general->beacon_silence_rssi_a), | 
|  | 389 | accum_general->beacon_silence_rssi_a, | 
|  | 390 | delta_general->beacon_silence_rssi_a, | 
|  | 391 | max_general->beacon_silence_rssi_a); | 
|  | 392 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 393 | fmt_table, "beacon_silence_rssi_b:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 394 | le32_to_cpu(general->beacon_silence_rssi_b), | 
|  | 395 | accum_general->beacon_silence_rssi_b, | 
|  | 396 | delta_general->beacon_silence_rssi_b, | 
|  | 397 | max_general->beacon_silence_rssi_b); | 
|  | 398 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 399 | fmt_table, "beacon_silence_rssi_c:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 400 | le32_to_cpu(general->beacon_silence_rssi_c), | 
|  | 401 | accum_general->beacon_silence_rssi_c, | 
|  | 402 | delta_general->beacon_silence_rssi_c, | 
|  | 403 | max_general->beacon_silence_rssi_c); | 
|  | 404 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 405 | fmt_table, "interference_data_flag:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 406 | le32_to_cpu(general->interference_data_flag), | 
|  | 407 | accum_general->interference_data_flag, | 
|  | 408 | delta_general->interference_data_flag, | 
|  | 409 | max_general->interference_data_flag); | 
|  | 410 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 411 | fmt_table, "channel_load:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 412 | le32_to_cpu(general->channel_load), | 
|  | 413 | accum_general->channel_load, | 
|  | 414 | delta_general->channel_load, | 
|  | 415 | max_general->channel_load); | 
|  | 416 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 417 | fmt_table, "dsp_false_alarms:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 418 | le32_to_cpu(general->dsp_false_alarms), | 
|  | 419 | accum_general->dsp_false_alarms, | 
|  | 420 | delta_general->dsp_false_alarms, | 
|  | 421 | max_general->dsp_false_alarms); | 
|  | 422 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 423 | fmt_table, "beacon_rssi_a:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 424 | le32_to_cpu(general->beacon_rssi_a), | 
|  | 425 | accum_general->beacon_rssi_a, | 
|  | 426 | delta_general->beacon_rssi_a, | 
|  | 427 | max_general->beacon_rssi_a); | 
|  | 428 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 429 | fmt_table, "beacon_rssi_b:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 430 | le32_to_cpu(general->beacon_rssi_b), | 
|  | 431 | accum_general->beacon_rssi_b, | 
|  | 432 | delta_general->beacon_rssi_b, | 
|  | 433 | max_general->beacon_rssi_b); | 
|  | 434 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 435 | fmt_table, "beacon_rssi_c:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 436 | le32_to_cpu(general->beacon_rssi_c), | 
|  | 437 | accum_general->beacon_rssi_c, | 
|  | 438 | delta_general->beacon_rssi_c, | 
|  | 439 | max_general->beacon_rssi_c); | 
|  | 440 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 441 | fmt_table, "beacon_energy_a:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 442 | le32_to_cpu(general->beacon_energy_a), | 
|  | 443 | accum_general->beacon_energy_a, | 
|  | 444 | delta_general->beacon_energy_a, | 
|  | 445 | max_general->beacon_energy_a); | 
|  | 446 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 447 | fmt_table, "beacon_energy_b:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 448 | le32_to_cpu(general->beacon_energy_b), | 
|  | 449 | accum_general->beacon_energy_b, | 
|  | 450 | delta_general->beacon_energy_b, | 
|  | 451 | max_general->beacon_energy_b); | 
|  | 452 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 453 | fmt_table, "beacon_energy_c:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 454 | le32_to_cpu(general->beacon_energy_c), | 
|  | 455 | accum_general->beacon_energy_c, | 
|  | 456 | delta_general->beacon_energy_c, | 
|  | 457 | max_general->beacon_energy_c); | 
|  | 458 |  | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 459 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 460 | fmt_header, "Statistics_Rx - OFDM_HT:"); | 
|  | 461 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 462 | fmt_table, "plcp_err:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 463 | le32_to_cpu(ht->plcp_err), accum_ht->plcp_err, | 
|  | 464 | delta_ht->plcp_err, max_ht->plcp_err); | 
|  | 465 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 466 | fmt_table, "overrun_err:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 467 | le32_to_cpu(ht->overrun_err), accum_ht->overrun_err, | 
|  | 468 | delta_ht->overrun_err, max_ht->overrun_err); | 
|  | 469 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 470 | fmt_table, "early_overrun_err:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 471 | le32_to_cpu(ht->early_overrun_err), | 
|  | 472 | accum_ht->early_overrun_err, | 
|  | 473 | delta_ht->early_overrun_err, | 
|  | 474 | max_ht->early_overrun_err); | 
|  | 475 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 476 | fmt_table, "crc32_good:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 477 | le32_to_cpu(ht->crc32_good), accum_ht->crc32_good, | 
|  | 478 | delta_ht->crc32_good, max_ht->crc32_good); | 
|  | 479 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 480 | fmt_table, "crc32_err:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 481 | le32_to_cpu(ht->crc32_err), accum_ht->crc32_err, | 
|  | 482 | delta_ht->crc32_err, max_ht->crc32_err); | 
|  | 483 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 484 | fmt_table, "mh_format_err:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 485 | le32_to_cpu(ht->mh_format_err), | 
|  | 486 | accum_ht->mh_format_err, | 
|  | 487 | delta_ht->mh_format_err, max_ht->mh_format_err); | 
|  | 488 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 489 | fmt_table, "agg_crc32_good:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 490 | le32_to_cpu(ht->agg_crc32_good), | 
|  | 491 | accum_ht->agg_crc32_good, | 
|  | 492 | delta_ht->agg_crc32_good, max_ht->agg_crc32_good); | 
|  | 493 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 494 | fmt_table, "agg_mpdu_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 495 | le32_to_cpu(ht->agg_mpdu_cnt), | 
|  | 496 | accum_ht->agg_mpdu_cnt, | 
|  | 497 | delta_ht->agg_mpdu_cnt, max_ht->agg_mpdu_cnt); | 
|  | 498 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 499 | fmt_table, "agg_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 500 | le32_to_cpu(ht->agg_cnt), accum_ht->agg_cnt, | 
|  | 501 | delta_ht->agg_cnt, max_ht->agg_cnt); | 
|  | 502 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 503 | fmt_table, "unsupport_mcs:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 504 | le32_to_cpu(ht->unsupport_mcs), | 
|  | 505 | accum_ht->unsupport_mcs, | 
|  | 506 | delta_ht->unsupport_mcs, max_ht->unsupport_mcs); | 
|  | 507 |  | 
|  | 508 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 
|  | 509 | kfree(buf); | 
|  | 510 | return ret; | 
|  | 511 | } | 
|  | 512 |  | 
|  | 513 | ssize_t iwl_ucode_tx_stats_read(struct file *file, | 
|  | 514 | char __user *user_buf, | 
|  | 515 | size_t count, loff_t *ppos) | 
|  | 516 | { | 
|  | 517 | struct iwl_priv *priv = file->private_data; | 
|  | 518 | int pos = 0; | 
|  | 519 | char *buf; | 
|  | 520 | int bufsz = (sizeof(struct statistics_tx) * 48) + 250; | 
|  | 521 | ssize_t ret; | 
|  | 522 | struct statistics_tx *tx, *accum_tx, *delta_tx, *max_tx; | 
|  | 523 |  | 
|  | 524 | if (!iwl_is_alive(priv)) | 
|  | 525 | return -EAGAIN; | 
|  | 526 |  | 
|  | 527 | buf = kzalloc(bufsz, GFP_KERNEL); | 
|  | 528 | if (!buf) { | 
|  | 529 | IWL_ERR(priv, "Can not allocate Buffer\n"); | 
|  | 530 | return -ENOMEM; | 
|  | 531 | } | 
|  | 532 |  | 
|  | 533 | /* the statistic information display here is based on | 
|  | 534 | * the last statistics notification from uCode | 
|  | 535 | * might not reflect the current uCode activity | 
|  | 536 | */ | 
| Stanislaw Gruszka | 9f60e7e | 2011-01-28 16:47:51 +0100 | [diff] [blame] | 537 | if (iwl_bt_statistics(priv)) { | 
| Wey-Yi Guy | 7980fba | 2010-07-14 08:08:57 -0700 | [diff] [blame] | 538 | tx = &priv->_agn.statistics_bt.tx; | 
|  | 539 | accum_tx = &priv->_agn.accum_statistics_bt.tx; | 
|  | 540 | delta_tx = &priv->_agn.delta_statistics_bt.tx; | 
|  | 541 | max_tx = &priv->_agn.max_delta_bt.tx; | 
|  | 542 | } else { | 
|  | 543 | tx = &priv->_agn.statistics.tx; | 
|  | 544 | accum_tx = &priv->_agn.accum_statistics.tx; | 
|  | 545 | delta_tx = &priv->_agn.delta_statistics.tx; | 
|  | 546 | max_tx = &priv->_agn.max_delta.tx; | 
|  | 547 | } | 
|  | 548 |  | 
| Wey-Yi Guy | 1d60a79 | 2010-04-30 14:21:49 -0700 | [diff] [blame] | 549 | pos += iwl_statistics_flag(priv, buf, bufsz); | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 550 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 551 | fmt_header, "Statistics_Tx:"); | 
|  | 552 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 553 | fmt_table, "preamble:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 554 | le32_to_cpu(tx->preamble_cnt), | 
|  | 555 | accum_tx->preamble_cnt, | 
|  | 556 | delta_tx->preamble_cnt, max_tx->preamble_cnt); | 
|  | 557 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 558 | fmt_table, "rx_detected_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 559 | le32_to_cpu(tx->rx_detected_cnt), | 
|  | 560 | accum_tx->rx_detected_cnt, | 
|  | 561 | delta_tx->rx_detected_cnt, max_tx->rx_detected_cnt); | 
|  | 562 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 563 | fmt_table, "bt_prio_defer_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 564 | le32_to_cpu(tx->bt_prio_defer_cnt), | 
|  | 565 | accum_tx->bt_prio_defer_cnt, | 
|  | 566 | delta_tx->bt_prio_defer_cnt, | 
|  | 567 | max_tx->bt_prio_defer_cnt); | 
|  | 568 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 569 | fmt_table, "bt_prio_kill_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 570 | le32_to_cpu(tx->bt_prio_kill_cnt), | 
|  | 571 | accum_tx->bt_prio_kill_cnt, | 
|  | 572 | delta_tx->bt_prio_kill_cnt, | 
|  | 573 | max_tx->bt_prio_kill_cnt); | 
|  | 574 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 575 | fmt_table, "few_bytes_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 576 | le32_to_cpu(tx->few_bytes_cnt), | 
|  | 577 | accum_tx->few_bytes_cnt, | 
|  | 578 | delta_tx->few_bytes_cnt, max_tx->few_bytes_cnt); | 
|  | 579 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 580 | fmt_table, "cts_timeout:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 581 | le32_to_cpu(tx->cts_timeout), accum_tx->cts_timeout, | 
|  | 582 | delta_tx->cts_timeout, max_tx->cts_timeout); | 
|  | 583 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 584 | fmt_table, "ack_timeout:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 585 | le32_to_cpu(tx->ack_timeout), | 
|  | 586 | accum_tx->ack_timeout, | 
|  | 587 | delta_tx->ack_timeout, max_tx->ack_timeout); | 
|  | 588 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 589 | fmt_table, "expected_ack_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 590 | le32_to_cpu(tx->expected_ack_cnt), | 
|  | 591 | accum_tx->expected_ack_cnt, | 
|  | 592 | delta_tx->expected_ack_cnt, | 
|  | 593 | max_tx->expected_ack_cnt); | 
|  | 594 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 595 | fmt_table, "actual_ack_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 596 | le32_to_cpu(tx->actual_ack_cnt), | 
|  | 597 | accum_tx->actual_ack_cnt, | 
|  | 598 | delta_tx->actual_ack_cnt, | 
|  | 599 | max_tx->actual_ack_cnt); | 
|  | 600 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 601 | fmt_table, "dump_msdu_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 602 | le32_to_cpu(tx->dump_msdu_cnt), | 
|  | 603 | accum_tx->dump_msdu_cnt, | 
|  | 604 | delta_tx->dump_msdu_cnt, | 
|  | 605 | max_tx->dump_msdu_cnt); | 
|  | 606 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 607 | fmt_table, "abort_nxt_frame_mismatch:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 608 | le32_to_cpu(tx->burst_abort_next_frame_mismatch_cnt), | 
|  | 609 | accum_tx->burst_abort_next_frame_mismatch_cnt, | 
|  | 610 | delta_tx->burst_abort_next_frame_mismatch_cnt, | 
|  | 611 | max_tx->burst_abort_next_frame_mismatch_cnt); | 
|  | 612 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 613 | fmt_table, "abort_missing_nxt_frame:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 614 | le32_to_cpu(tx->burst_abort_missing_next_frame_cnt), | 
|  | 615 | accum_tx->burst_abort_missing_next_frame_cnt, | 
|  | 616 | delta_tx->burst_abort_missing_next_frame_cnt, | 
|  | 617 | max_tx->burst_abort_missing_next_frame_cnt); | 
|  | 618 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 619 | fmt_table, "cts_timeout_collision:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 620 | le32_to_cpu(tx->cts_timeout_collision), | 
|  | 621 | accum_tx->cts_timeout_collision, | 
|  | 622 | delta_tx->cts_timeout_collision, | 
|  | 623 | max_tx->cts_timeout_collision); | 
|  | 624 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 625 | fmt_table, "ack_ba_timeout_collision:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 626 | le32_to_cpu(tx->ack_or_ba_timeout_collision), | 
|  | 627 | accum_tx->ack_or_ba_timeout_collision, | 
|  | 628 | delta_tx->ack_or_ba_timeout_collision, | 
|  | 629 | max_tx->ack_or_ba_timeout_collision); | 
|  | 630 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 631 | fmt_table, "agg ba_timeout:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 632 | le32_to_cpu(tx->agg.ba_timeout), | 
|  | 633 | accum_tx->agg.ba_timeout, | 
|  | 634 | delta_tx->agg.ba_timeout, | 
|  | 635 | max_tx->agg.ba_timeout); | 
|  | 636 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 637 | fmt_table, "agg ba_resched_frames:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 638 | le32_to_cpu(tx->agg.ba_reschedule_frames), | 
|  | 639 | accum_tx->agg.ba_reschedule_frames, | 
|  | 640 | delta_tx->agg.ba_reschedule_frames, | 
|  | 641 | max_tx->agg.ba_reschedule_frames); | 
|  | 642 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 643 | fmt_table, "agg scd_query_agg_frame:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 644 | le32_to_cpu(tx->agg.scd_query_agg_frame_cnt), | 
|  | 645 | accum_tx->agg.scd_query_agg_frame_cnt, | 
|  | 646 | delta_tx->agg.scd_query_agg_frame_cnt, | 
|  | 647 | max_tx->agg.scd_query_agg_frame_cnt); | 
|  | 648 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 649 | fmt_table, "agg scd_query_no_agg:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 650 | le32_to_cpu(tx->agg.scd_query_no_agg), | 
|  | 651 | accum_tx->agg.scd_query_no_agg, | 
|  | 652 | delta_tx->agg.scd_query_no_agg, | 
|  | 653 | max_tx->agg.scd_query_no_agg); | 
|  | 654 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 655 | fmt_table, "agg scd_query_agg:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 656 | le32_to_cpu(tx->agg.scd_query_agg), | 
|  | 657 | accum_tx->agg.scd_query_agg, | 
|  | 658 | delta_tx->agg.scd_query_agg, | 
|  | 659 | max_tx->agg.scd_query_agg); | 
|  | 660 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 661 | fmt_table, "agg scd_query_mismatch:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 662 | le32_to_cpu(tx->agg.scd_query_mismatch), | 
|  | 663 | accum_tx->agg.scd_query_mismatch, | 
|  | 664 | delta_tx->agg.scd_query_mismatch, | 
|  | 665 | max_tx->agg.scd_query_mismatch); | 
|  | 666 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 667 | fmt_table, "agg frame_not_ready:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 668 | le32_to_cpu(tx->agg.frame_not_ready), | 
|  | 669 | accum_tx->agg.frame_not_ready, | 
|  | 670 | delta_tx->agg.frame_not_ready, | 
|  | 671 | max_tx->agg.frame_not_ready); | 
|  | 672 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 673 | fmt_table, "agg underrun:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 674 | le32_to_cpu(tx->agg.underrun), | 
|  | 675 | accum_tx->agg.underrun, | 
|  | 676 | delta_tx->agg.underrun, max_tx->agg.underrun); | 
|  | 677 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 678 | fmt_table, "agg bt_prio_kill:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 679 | le32_to_cpu(tx->agg.bt_prio_kill), | 
|  | 680 | accum_tx->agg.bt_prio_kill, | 
|  | 681 | delta_tx->agg.bt_prio_kill, | 
|  | 682 | max_tx->agg.bt_prio_kill); | 
|  | 683 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 684 | fmt_table, "agg rx_ba_rsp_cnt:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 685 | le32_to_cpu(tx->agg.rx_ba_rsp_cnt), | 
|  | 686 | accum_tx->agg.rx_ba_rsp_cnt, | 
|  | 687 | delta_tx->agg.rx_ba_rsp_cnt, | 
|  | 688 | max_tx->agg.rx_ba_rsp_cnt); | 
|  | 689 |  | 
| Wey-Yi Guy | 470356b | 2010-04-30 11:35:15 -0700 | [diff] [blame] | 690 | if (tx->tx_power.ant_a || tx->tx_power.ant_b || tx->tx_power.ant_c) { | 
|  | 691 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 692 | "tx power: (1/2 dB step)\n"); | 
|  | 693 | if ((priv->cfg->valid_tx_ant & ANT_A) && tx->tx_power.ant_a) | 
|  | 694 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 695 | fmt_hex, "antenna A:", | 
| Wey-Yi Guy | 470356b | 2010-04-30 11:35:15 -0700 | [diff] [blame] | 696 | tx->tx_power.ant_a); | 
|  | 697 | if ((priv->cfg->valid_tx_ant & ANT_B) && tx->tx_power.ant_b) | 
|  | 698 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 699 | fmt_hex, "antenna B:", | 
| Wey-Yi Guy | 470356b | 2010-04-30 11:35:15 -0700 | [diff] [blame] | 700 | tx->tx_power.ant_b); | 
|  | 701 | if ((priv->cfg->valid_tx_ant & ANT_C) && tx->tx_power.ant_c) | 
|  | 702 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 703 | fmt_hex, "antenna C:", | 
| Wey-Yi Guy | 470356b | 2010-04-30 11:35:15 -0700 | [diff] [blame] | 704 | tx->tx_power.ant_c); | 
|  | 705 | } | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 706 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 
|  | 707 | kfree(buf); | 
|  | 708 | return ret; | 
|  | 709 | } | 
|  | 710 |  | 
|  | 711 | ssize_t iwl_ucode_general_stats_read(struct file *file, char __user *user_buf, | 
|  | 712 | size_t count, loff_t *ppos) | 
|  | 713 | { | 
|  | 714 | struct iwl_priv *priv = file->private_data; | 
|  | 715 | int pos = 0; | 
|  | 716 | char *buf; | 
|  | 717 | int bufsz = sizeof(struct statistics_general) * 10 + 300; | 
|  | 718 | ssize_t ret; | 
| Wey-Yi Guy | 325322e | 2010-07-14 08:07:27 -0700 | [diff] [blame] | 719 | struct statistics_general_common *general, *accum_general; | 
|  | 720 | struct statistics_general_common *delta_general, *max_general; | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 721 | struct statistics_dbg *dbg, *accum_dbg, *delta_dbg, *max_dbg; | 
|  | 722 | struct statistics_div *div, *accum_div, *delta_div, *max_div; | 
|  | 723 |  | 
|  | 724 | if (!iwl_is_alive(priv)) | 
|  | 725 | return -EAGAIN; | 
|  | 726 |  | 
|  | 727 | buf = kzalloc(bufsz, GFP_KERNEL); | 
|  | 728 | if (!buf) { | 
|  | 729 | IWL_ERR(priv, "Can not allocate Buffer\n"); | 
|  | 730 | return -ENOMEM; | 
|  | 731 | } | 
|  | 732 |  | 
|  | 733 | /* the statistic information display here is based on | 
|  | 734 | * the last statistics notification from uCode | 
|  | 735 | * might not reflect the current uCode activity | 
|  | 736 | */ | 
| Stanislaw Gruszka | 9f60e7e | 2011-01-28 16:47:51 +0100 | [diff] [blame] | 737 | if (iwl_bt_statistics(priv)) { | 
| Wey-Yi Guy | 7980fba | 2010-07-14 08:08:57 -0700 | [diff] [blame] | 738 | general = &priv->_agn.statistics_bt.general.common; | 
|  | 739 | dbg = &priv->_agn.statistics_bt.general.common.dbg; | 
|  | 740 | div = &priv->_agn.statistics_bt.general.common.div; | 
|  | 741 | accum_general = &priv->_agn.accum_statistics_bt.general.common; | 
|  | 742 | accum_dbg = &priv->_agn.accum_statistics_bt.general.common.dbg; | 
|  | 743 | accum_div = &priv->_agn.accum_statistics_bt.general.common.div; | 
|  | 744 | delta_general = &priv->_agn.delta_statistics_bt.general.common; | 
|  | 745 | max_general = &priv->_agn.max_delta_bt.general.common; | 
|  | 746 | delta_dbg = &priv->_agn.delta_statistics_bt.general.common.dbg; | 
|  | 747 | max_dbg = &priv->_agn.max_delta_bt.general.common.dbg; | 
|  | 748 | delta_div = &priv->_agn.delta_statistics_bt.general.common.div; | 
|  | 749 | max_div = &priv->_agn.max_delta_bt.general.common.div; | 
|  | 750 | } else { | 
|  | 751 | general = &priv->_agn.statistics.general.common; | 
|  | 752 | dbg = &priv->_agn.statistics.general.common.dbg; | 
|  | 753 | div = &priv->_agn.statistics.general.common.div; | 
|  | 754 | accum_general = &priv->_agn.accum_statistics.general.common; | 
|  | 755 | accum_dbg = &priv->_agn.accum_statistics.general.common.dbg; | 
|  | 756 | accum_div = &priv->_agn.accum_statistics.general.common.div; | 
|  | 757 | delta_general = &priv->_agn.delta_statistics.general.common; | 
|  | 758 | max_general = &priv->_agn.max_delta.general.common; | 
|  | 759 | delta_dbg = &priv->_agn.delta_statistics.general.common.dbg; | 
|  | 760 | max_dbg = &priv->_agn.max_delta.general.common.dbg; | 
|  | 761 | delta_div = &priv->_agn.delta_statistics.general.common.div; | 
|  | 762 | max_div = &priv->_agn.max_delta.general.common.div; | 
|  | 763 | } | 
|  | 764 |  | 
| Wey-Yi Guy | 1d60a79 | 2010-04-30 14:21:49 -0700 | [diff] [blame] | 765 | pos += iwl_statistics_flag(priv, buf, bufsz); | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 766 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 767 | fmt_header, "Statistics_General:"); | 
|  | 768 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 769 | fmt_value, "temperature:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 770 | le32_to_cpu(general->temperature)); | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 771 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 772 | fmt_value, "temperature_m:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 773 | le32_to_cpu(general->temperature_m)); | 
|  | 774 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 775 | fmt_value, "ttl_timestamp:", | 
|  | 776 | le32_to_cpu(general->ttl_timestamp)); | 
|  | 777 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 778 | fmt_table, "burst_check:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 779 | le32_to_cpu(dbg->burst_check), | 
|  | 780 | accum_dbg->burst_check, | 
|  | 781 | delta_dbg->burst_check, max_dbg->burst_check); | 
|  | 782 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 783 | fmt_table, "burst_count:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 784 | le32_to_cpu(dbg->burst_count), | 
|  | 785 | accum_dbg->burst_count, | 
|  | 786 | delta_dbg->burst_count, max_dbg->burst_count); | 
|  | 787 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 788 | fmt_table, "wait_for_silence_timeout_count:", | 
| Wey-Yi Guy | 9cae611 | 2010-07-06 10:39:33 -0700 | [diff] [blame] | 789 | le32_to_cpu(dbg->wait_for_silence_timeout_cnt), | 
|  | 790 | accum_dbg->wait_for_silence_timeout_cnt, | 
|  | 791 | delta_dbg->wait_for_silence_timeout_cnt, | 
|  | 792 | max_dbg->wait_for_silence_timeout_cnt); | 
|  | 793 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 794 | fmt_table, "sleep_time:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 795 | le32_to_cpu(general->sleep_time), | 
|  | 796 | accum_general->sleep_time, | 
|  | 797 | delta_general->sleep_time, max_general->sleep_time); | 
|  | 798 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 799 | fmt_table, "slots_out:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 800 | le32_to_cpu(general->slots_out), | 
|  | 801 | accum_general->slots_out, | 
|  | 802 | delta_general->slots_out, max_general->slots_out); | 
|  | 803 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 804 | fmt_table, "slots_idle:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 805 | le32_to_cpu(general->slots_idle), | 
|  | 806 | accum_general->slots_idle, | 
|  | 807 | delta_general->slots_idle, max_general->slots_idle); | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 808 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 809 | fmt_table, "tx_on_a:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 810 | le32_to_cpu(div->tx_on_a), accum_div->tx_on_a, | 
|  | 811 | delta_div->tx_on_a, max_div->tx_on_a); | 
|  | 812 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 813 | fmt_table, "tx_on_b:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 814 | le32_to_cpu(div->tx_on_b), accum_div->tx_on_b, | 
|  | 815 | delta_div->tx_on_b, max_div->tx_on_b); | 
|  | 816 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 817 | fmt_table, "exec_time:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 818 | le32_to_cpu(div->exec_time), accum_div->exec_time, | 
|  | 819 | delta_div->exec_time, max_div->exec_time); | 
|  | 820 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 821 | fmt_table, "probe_time:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 822 | le32_to_cpu(div->probe_time), accum_div->probe_time, | 
|  | 823 | delta_div->probe_time, max_div->probe_time); | 
|  | 824 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 825 | fmt_table, "rx_enable_counter:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 826 | le32_to_cpu(general->rx_enable_counter), | 
|  | 827 | accum_general->rx_enable_counter, | 
|  | 828 | delta_general->rx_enable_counter, | 
|  | 829 | max_general->rx_enable_counter); | 
|  | 830 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Jay Sternberg | 0b7e5e8 | 2010-09-08 09:42:35 -0700 | [diff] [blame] | 831 | fmt_table, "num_of_sos_states:", | 
| Abhijeet Kolekar | b8c7626 | 2010-04-08 15:29:07 -0700 | [diff] [blame] | 832 | le32_to_cpu(general->num_of_sos_states), | 
|  | 833 | accum_general->num_of_sos_states, | 
|  | 834 | delta_general->num_of_sos_states, | 
|  | 835 | max_general->num_of_sos_states); | 
|  | 836 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 
|  | 837 | kfree(buf); | 
|  | 838 | return ret; | 
|  | 839 | } | 
| Wey-Yi Guy | ffb7d89 | 2010-07-14 08:09:55 -0700 | [diff] [blame] | 840 |  | 
|  | 841 | ssize_t iwl_ucode_bt_stats_read(struct file *file, | 
|  | 842 | char __user *user_buf, | 
|  | 843 | size_t count, loff_t *ppos) | 
|  | 844 | { | 
|  | 845 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 
|  | 846 | int pos = 0; | 
|  | 847 | char *buf; | 
|  | 848 | int bufsz = (sizeof(struct statistics_bt_activity) * 24) + 200; | 
|  | 849 | ssize_t ret; | 
|  | 850 | struct statistics_bt_activity *bt, *accum_bt; | 
|  | 851 |  | 
|  | 852 | if (!iwl_is_alive(priv)) | 
|  | 853 | return -EAGAIN; | 
|  | 854 |  | 
| Wey-Yi Guy | f21dd00 | 2010-12-08 15:34:52 -0800 | [diff] [blame] | 855 | if (!priv->bt_enable_flag) | 
|  | 856 | return -EINVAL; | 
|  | 857 |  | 
| Wey-Yi Guy | ffb7d89 | 2010-07-14 08:09:55 -0700 | [diff] [blame] | 858 | /* make request to uCode to retrieve statistics information */ | 
|  | 859 | mutex_lock(&priv->mutex); | 
|  | 860 | ret = iwl_send_statistics_request(priv, CMD_SYNC, false); | 
|  | 861 | mutex_unlock(&priv->mutex); | 
|  | 862 |  | 
|  | 863 | if (ret) { | 
|  | 864 | IWL_ERR(priv, | 
|  | 865 | "Error sending statistics request: %zd\n", ret); | 
|  | 866 | return -EAGAIN; | 
|  | 867 | } | 
|  | 868 | buf = kzalloc(bufsz, GFP_KERNEL); | 
|  | 869 | if (!buf) { | 
|  | 870 | IWL_ERR(priv, "Can not allocate Buffer\n"); | 
|  | 871 | return -ENOMEM; | 
|  | 872 | } | 
|  | 873 |  | 
|  | 874 | /* | 
|  | 875 | * the statistic information display here is based on | 
|  | 876 | * the last statistics notification from uCode | 
|  | 877 | * might not reflect the current uCode activity | 
|  | 878 | */ | 
|  | 879 | bt = &priv->_agn.statistics_bt.general.activity; | 
|  | 880 | accum_bt = &priv->_agn.accum_statistics_bt.general.activity; | 
|  | 881 |  | 
|  | 882 | pos += iwl_statistics_flag(priv, buf, bufsz); | 
|  | 883 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_BT:\n"); | 
|  | 884 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 885 | "\t\t\tcurrent\t\t\taccumulative\n"); | 
|  | 886 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 887 | "hi_priority_tx_req_cnt:\t\t%u\t\t\t%u\n", | 
|  | 888 | le32_to_cpu(bt->hi_priority_tx_req_cnt), | 
|  | 889 | accum_bt->hi_priority_tx_req_cnt); | 
|  | 890 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 891 | "hi_priority_tx_denied_cnt:\t%u\t\t\t%u\n", | 
|  | 892 | le32_to_cpu(bt->hi_priority_tx_denied_cnt), | 
|  | 893 | accum_bt->hi_priority_tx_denied_cnt); | 
|  | 894 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 895 | "lo_priority_tx_req_cnt:\t\t%u\t\t\t%u\n", | 
|  | 896 | le32_to_cpu(bt->lo_priority_tx_req_cnt), | 
|  | 897 | accum_bt->lo_priority_tx_req_cnt); | 
|  | 898 | pos += scnprintf(buf + pos, bufsz - pos, | 
| Wey-Yi Guy | 74dee2c | 2010-07-31 08:34:12 -0700 | [diff] [blame] | 899 | "lo_priority_tx_denied_cnt:\t%u\t\t\t%u\n", | 
| Wey-Yi Guy | ffb7d89 | 2010-07-14 08:09:55 -0700 | [diff] [blame] | 900 | le32_to_cpu(bt->lo_priority_tx_denied_cnt), | 
|  | 901 | accum_bt->lo_priority_tx_denied_cnt); | 
|  | 902 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 903 | "hi_priority_rx_req_cnt:\t\t%u\t\t\t%u\n", | 
|  | 904 | le32_to_cpu(bt->hi_priority_rx_req_cnt), | 
|  | 905 | accum_bt->hi_priority_rx_req_cnt); | 
|  | 906 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 907 | "hi_priority_rx_denied_cnt:\t%u\t\t\t%u\n", | 
|  | 908 | le32_to_cpu(bt->hi_priority_rx_denied_cnt), | 
|  | 909 | accum_bt->hi_priority_rx_denied_cnt); | 
|  | 910 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 911 | "lo_priority_rx_req_cnt:\t\t%u\t\t\t%u\n", | 
|  | 912 | le32_to_cpu(bt->lo_priority_rx_req_cnt), | 
|  | 913 | accum_bt->lo_priority_rx_req_cnt); | 
|  | 914 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 915 | "lo_priority_rx_denied_cnt:\t%u\t\t\t%u\n", | 
|  | 916 | le32_to_cpu(bt->lo_priority_rx_denied_cnt), | 
|  | 917 | accum_bt->lo_priority_rx_denied_cnt); | 
|  | 918 |  | 
|  | 919 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 920 | "(rx)num_bt_kills:\t\t%u\t\t\t%u\n", | 
|  | 921 | le32_to_cpu(priv->_agn.statistics_bt.rx. | 
|  | 922 | general.num_bt_kills), | 
|  | 923 | priv->_agn.accum_statistics_bt.rx. | 
|  | 924 | general.num_bt_kills); | 
|  | 925 |  | 
|  | 926 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 
|  | 927 | kfree(buf); | 
|  | 928 | return ret; | 
|  | 929 | } | 
| Wey-Yi Guy | 54a9aa6 | 2010-09-05 10:49:42 -0700 | [diff] [blame] | 930 |  | 
|  | 931 | ssize_t iwl_reply_tx_error_read(struct file *file, | 
|  | 932 | char __user *user_buf, | 
|  | 933 | size_t count, loff_t *ppos) | 
|  | 934 | { | 
|  | 935 | struct iwl_priv *priv = (struct iwl_priv *)file->private_data; | 
|  | 936 | int pos = 0; | 
|  | 937 | char *buf; | 
| Wey-Yi Guy | 95b49ed | 2010-09-05 10:49:45 -0700 | [diff] [blame] | 938 | int bufsz = (sizeof(struct reply_tx_error_statistics) * 24) + | 
|  | 939 | (sizeof(struct reply_agg_tx_error_statistics) * 24) + 200; | 
| Wey-Yi Guy | 54a9aa6 | 2010-09-05 10:49:42 -0700 | [diff] [blame] | 940 | ssize_t ret; | 
|  | 941 |  | 
|  | 942 | if (!iwl_is_alive(priv)) | 
|  | 943 | return -EAGAIN; | 
|  | 944 |  | 
|  | 945 | buf = kzalloc(bufsz, GFP_KERNEL); | 
|  | 946 | if (!buf) { | 
|  | 947 | IWL_ERR(priv, "Can not allocate Buffer\n"); | 
|  | 948 | return -ENOMEM; | 
|  | 949 | } | 
|  | 950 |  | 
|  | 951 | pos += scnprintf(buf + pos, bufsz - pos, "Statistics_TX_Error:\n"); | 
|  | 952 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t\t%u\n", | 
|  | 953 | iwl_get_tx_fail_reason(TX_STATUS_POSTPONE_DELAY), | 
|  | 954 | priv->_agn.reply_tx_stats.pp_delay); | 
|  | 955 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 956 | iwl_get_tx_fail_reason(TX_STATUS_POSTPONE_FEW_BYTES), | 
|  | 957 | priv->_agn.reply_tx_stats.pp_few_bytes); | 
|  | 958 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 959 | iwl_get_tx_fail_reason(TX_STATUS_POSTPONE_BT_PRIO), | 
|  | 960 | priv->_agn.reply_tx_stats.pp_bt_prio); | 
|  | 961 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 962 | iwl_get_tx_fail_reason(TX_STATUS_POSTPONE_QUIET_PERIOD), | 
|  | 963 | priv->_agn.reply_tx_stats.pp_quiet_period); | 
|  | 964 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 965 | iwl_get_tx_fail_reason(TX_STATUS_POSTPONE_CALC_TTAK), | 
|  | 966 | priv->_agn.reply_tx_stats.pp_calc_ttak); | 
|  | 967 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n", | 
|  | 968 | iwl_get_tx_fail_reason( | 
|  | 969 | TX_STATUS_FAIL_INTERNAL_CROSSED_RETRY), | 
|  | 970 | priv->_agn.reply_tx_stats.int_crossed_retry); | 
|  | 971 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 972 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_SHORT_LIMIT), | 
|  | 973 | priv->_agn.reply_tx_stats.short_limit); | 
|  | 974 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 975 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_LONG_LIMIT), | 
|  | 976 | priv->_agn.reply_tx_stats.long_limit); | 
|  | 977 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 978 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_FIFO_UNDERRUN), | 
|  | 979 | priv->_agn.reply_tx_stats.fifo_underrun); | 
|  | 980 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 981 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_DRAIN_FLOW), | 
|  | 982 | priv->_agn.reply_tx_stats.drain_flow); | 
|  | 983 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 984 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_RFKILL_FLUSH), | 
|  | 985 | priv->_agn.reply_tx_stats.rfkill_flush); | 
|  | 986 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 987 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_LIFE_EXPIRE), | 
|  | 988 | priv->_agn.reply_tx_stats.life_expire); | 
|  | 989 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 990 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_DEST_PS), | 
|  | 991 | priv->_agn.reply_tx_stats.dest_ps); | 
|  | 992 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 993 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_HOST_ABORTED), | 
|  | 994 | priv->_agn.reply_tx_stats.host_abort); | 
|  | 995 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 996 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_BT_RETRY), | 
|  | 997 | priv->_agn.reply_tx_stats.pp_delay); | 
|  | 998 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 999 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_STA_INVALID), | 
|  | 1000 | priv->_agn.reply_tx_stats.sta_invalid); | 
|  | 1001 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 1002 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_FRAG_DROPPED), | 
|  | 1003 | priv->_agn.reply_tx_stats.frag_drop); | 
|  | 1004 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 1005 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_TID_DISABLE), | 
|  | 1006 | priv->_agn.reply_tx_stats.tid_disable); | 
|  | 1007 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 1008 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_FIFO_FLUSHED), | 
|  | 1009 | priv->_agn.reply_tx_stats.fifo_flush); | 
|  | 1010 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n", | 
|  | 1011 | iwl_get_tx_fail_reason( | 
|  | 1012 | TX_STATUS_FAIL_INSUFFICIENT_CF_POLL), | 
|  | 1013 | priv->_agn.reply_tx_stats.insuff_cf_poll); | 
|  | 1014 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
| Wey-Yi Guy | 1d27007 | 2010-09-07 12:42:20 -0700 | [diff] [blame] | 1015 | iwl_get_tx_fail_reason(TX_STATUS_FAIL_PASSIVE_NO_RX), | 
| Wey-Yi Guy | 54a9aa6 | 2010-09-05 10:49:42 -0700 | [diff] [blame] | 1016 | priv->_agn.reply_tx_stats.fail_hw_drop); | 
| Wey-Yi Guy | 1d27007 | 2010-09-07 12:42:20 -0700 | [diff] [blame] | 1017 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n", | 
| Wey-Yi Guy | 54a9aa6 | 2010-09-05 10:49:42 -0700 | [diff] [blame] | 1018 | iwl_get_tx_fail_reason( | 
| Wey-Yi Guy | 1d27007 | 2010-09-07 12:42:20 -0700 | [diff] [blame] | 1019 | TX_STATUS_FAIL_NO_BEACON_ON_RADAR), | 
| Wey-Yi Guy | 54a9aa6 | 2010-09-05 10:49:42 -0700 | [diff] [blame] | 1020 | priv->_agn.reply_tx_stats.sta_color_mismatch); | 
|  | 1021 | pos += scnprintf(buf + pos, bufsz - pos, "UNKNOWN:\t\t\t%u\n", | 
|  | 1022 | priv->_agn.reply_tx_stats.unknown); | 
|  | 1023 |  | 
| Wey-Yi Guy | 95b49ed | 2010-09-05 10:49:45 -0700 | [diff] [blame] | 1024 | pos += scnprintf(buf + pos, bufsz - pos, | 
|  | 1025 | "\nStatistics_Agg_TX_Error:\n"); | 
|  | 1026 |  | 
|  | 1027 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 1028 | iwl_get_agg_tx_fail_reason(AGG_TX_STATE_UNDERRUN_MSK), | 
|  | 1029 | priv->_agn.reply_agg_tx_stats.underrun); | 
|  | 1030 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 1031 | iwl_get_agg_tx_fail_reason(AGG_TX_STATE_BT_PRIO_MSK), | 
|  | 1032 | priv->_agn.reply_agg_tx_stats.bt_prio); | 
|  | 1033 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 1034 | iwl_get_agg_tx_fail_reason(AGG_TX_STATE_FEW_BYTES_MSK), | 
|  | 1035 | priv->_agn.reply_agg_tx_stats.few_bytes); | 
|  | 1036 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 1037 | iwl_get_agg_tx_fail_reason(AGG_TX_STATE_ABORT_MSK), | 
|  | 1038 | priv->_agn.reply_agg_tx_stats.abort); | 
|  | 1039 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n", | 
|  | 1040 | iwl_get_agg_tx_fail_reason( | 
|  | 1041 | AGG_TX_STATE_LAST_SENT_TTL_MSK), | 
|  | 1042 | priv->_agn.reply_agg_tx_stats.last_sent_ttl); | 
|  | 1043 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n", | 
|  | 1044 | iwl_get_agg_tx_fail_reason( | 
|  | 1045 | AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK), | 
|  | 1046 | priv->_agn.reply_agg_tx_stats.last_sent_try); | 
|  | 1047 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n", | 
|  | 1048 | iwl_get_agg_tx_fail_reason( | 
|  | 1049 | AGG_TX_STATE_LAST_SENT_BT_KILL_MSK), | 
|  | 1050 | priv->_agn.reply_agg_tx_stats.last_sent_bt_kill); | 
|  | 1051 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 1052 | iwl_get_agg_tx_fail_reason(AGG_TX_STATE_SCD_QUERY_MSK), | 
|  | 1053 | priv->_agn.reply_agg_tx_stats.scd_query); | 
|  | 1054 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n", | 
|  | 1055 | iwl_get_agg_tx_fail_reason( | 
|  | 1056 | AGG_TX_STATE_TEST_BAD_CRC32_MSK), | 
|  | 1057 | priv->_agn.reply_agg_tx_stats.bad_crc32); | 
|  | 1058 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 1059 | iwl_get_agg_tx_fail_reason(AGG_TX_STATE_RESPONSE_MSK), | 
|  | 1060 | priv->_agn.reply_agg_tx_stats.response); | 
|  | 1061 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 1062 | iwl_get_agg_tx_fail_reason(AGG_TX_STATE_DUMP_TX_MSK), | 
|  | 1063 | priv->_agn.reply_agg_tx_stats.dump_tx); | 
|  | 1064 | pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", | 
|  | 1065 | iwl_get_agg_tx_fail_reason(AGG_TX_STATE_DELAY_TX_MSK), | 
|  | 1066 | priv->_agn.reply_agg_tx_stats.delay_tx); | 
|  | 1067 | pos += scnprintf(buf + pos, bufsz - pos, "UNKNOWN:\t\t\t%u\n", | 
|  | 1068 | priv->_agn.reply_agg_tx_stats.unknown); | 
|  | 1069 |  | 
| Wey-Yi Guy | 54a9aa6 | 2010-09-05 10:49:42 -0700 | [diff] [blame] | 1070 | ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); | 
|  | 1071 | kfree(buf); | 
|  | 1072 | return ret; | 
|  | 1073 | } |