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