iwl-3945-debugfs.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  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. *****************************************************************************/
  28. #include "iwl-3945-debugfs.h"
  29. static int iwl3945_statistics_flag(struct iwl_priv *priv, char *buf, int bufsz)
  30. {
  31. int p = 0;
  32. p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n",
  33. le32_to_cpu(priv->_3945.statistics.flag));
  34. if (le32_to_cpu(priv->_3945.statistics.flag) &
  35. UCODE_STATISTICS_CLEAR_MSK)
  36. p += scnprintf(buf + p, bufsz - p,
  37. "\tStatistics have been cleared\n");
  38. p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\n",
  39. (le32_to_cpu(priv->_3945.statistics.flag) &
  40. UCODE_STATISTICS_FREQUENCY_MSK)
  41. ? "2.4 GHz" : "5.2 GHz");
  42. p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n",
  43. (le32_to_cpu(priv->_3945.statistics.flag) &
  44. UCODE_STATISTICS_NARROW_BAND_MSK)
  45. ? "enabled" : "disabled");
  46. return p;
  47. }
  48. ssize_t iwl3945_ucode_rx_stats_read(struct file *file,
  49. char __user *user_buf,
  50. size_t count, loff_t *ppos)
  51. {
  52. struct iwl_priv *priv = file->private_data;
  53. int pos = 0;
  54. char *buf;
  55. int bufsz = sizeof(struct iwl39_statistics_rx_phy) * 40 +
  56. sizeof(struct iwl39_statistics_rx_non_phy) * 40 + 400;
  57. ssize_t ret;
  58. struct iwl39_statistics_rx_phy *ofdm, *accum_ofdm, *delta_ofdm, *max_ofdm;
  59. struct iwl39_statistics_rx_phy *cck, *accum_cck, *delta_cck, *max_cck;
  60. struct iwl39_statistics_rx_non_phy *general, *accum_general;
  61. struct iwl39_statistics_rx_non_phy *delta_general, *max_general;
  62. if (!iwl_is_alive(priv))
  63. return -EAGAIN;
  64. buf = kzalloc(bufsz, GFP_KERNEL);
  65. if (!buf) {
  66. IWL_ERR(priv, "Can not allocate Buffer\n");
  67. return -ENOMEM;
  68. }
  69. /*
  70. * The statistic information display here is based on
  71. * the last statistics notification from uCode
  72. * might not reflect the current uCode activity
  73. */
  74. ofdm = &priv->_3945.statistics.rx.ofdm;
  75. cck = &priv->_3945.statistics.rx.cck;
  76. general = &priv->_3945.statistics.rx.general;
  77. accum_ofdm = &priv->_3945.accum_statistics.rx.ofdm;
  78. accum_cck = &priv->_3945.accum_statistics.rx.cck;
  79. accum_general = &priv->_3945.accum_statistics.rx.general;
  80. delta_ofdm = &priv->_3945.delta_statistics.rx.ofdm;
  81. delta_cck = &priv->_3945.delta_statistics.rx.cck;
  82. delta_general = &priv->_3945.delta_statistics.rx.general;
  83. max_ofdm = &priv->_3945.max_delta.rx.ofdm;
  84. max_cck = &priv->_3945.max_delta.rx.cck;
  85. max_general = &priv->_3945.max_delta.rx.general;
  86. pos += iwl3945_statistics_flag(priv, buf, bufsz);
  87. pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
  88. "acumulative delta max\n",
  89. "Statistics_Rx - OFDM:");
  90. pos += scnprintf(buf + pos, bufsz - pos,
  91. " %-30s %10u %10u %10u %10u\n",
  92. "ina_cnt:", le32_to_cpu(ofdm->ina_cnt),
  93. accum_ofdm->ina_cnt,
  94. delta_ofdm->ina_cnt, max_ofdm->ina_cnt);
  95. pos += scnprintf(buf + pos, bufsz - pos,
  96. " %-30s %10u %10u %10u %10u\n",
  97. "fina_cnt:",
  98. le32_to_cpu(ofdm->fina_cnt), accum_ofdm->fina_cnt,
  99. delta_ofdm->fina_cnt, max_ofdm->fina_cnt);
  100. pos += scnprintf(buf + pos, bufsz - pos,
  101. " %-30s %10u %10u %10u %10u\n", "plcp_err:",
  102. le32_to_cpu(ofdm->plcp_err), accum_ofdm->plcp_err,
  103. delta_ofdm->plcp_err, max_ofdm->plcp_err);
  104. pos += scnprintf(buf + pos, bufsz - pos,
  105. " %-30s %10u %10u %10u %10u\n", "crc32_err:",
  106. le32_to_cpu(ofdm->crc32_err), accum_ofdm->crc32_err,
  107. delta_ofdm->crc32_err, max_ofdm->crc32_err);
  108. pos += scnprintf(buf + pos, bufsz - pos,
  109. " %-30s %10u %10u %10u %10u\n", "overrun_err:",
  110. le32_to_cpu(ofdm->overrun_err),
  111. accum_ofdm->overrun_err, delta_ofdm->overrun_err,
  112. max_ofdm->overrun_err);
  113. pos += scnprintf(buf + pos, bufsz - pos,
  114. " %-30s %10u %10u %10u %10u\n",
  115. "early_overrun_err:",
  116. le32_to_cpu(ofdm->early_overrun_err),
  117. accum_ofdm->early_overrun_err,
  118. delta_ofdm->early_overrun_err,
  119. max_ofdm->early_overrun_err);
  120. pos += scnprintf(buf + pos, bufsz - pos,
  121. " %-30s %10u %10u %10u %10u\n",
  122. "crc32_good:", le32_to_cpu(ofdm->crc32_good),
  123. accum_ofdm->crc32_good, delta_ofdm->crc32_good,
  124. max_ofdm->crc32_good);
  125. pos += scnprintf(buf + pos, bufsz - pos,
  126. " %-30s %10u %10u %10u %10u\n", "false_alarm_cnt:",
  127. le32_to_cpu(ofdm->false_alarm_cnt),
  128. accum_ofdm->false_alarm_cnt,
  129. delta_ofdm->false_alarm_cnt,
  130. max_ofdm->false_alarm_cnt);
  131. pos += scnprintf(buf + pos, bufsz - pos,
  132. " %-30s %10u %10u %10u %10u\n",
  133. "fina_sync_err_cnt:",
  134. le32_to_cpu(ofdm->fina_sync_err_cnt),
  135. accum_ofdm->fina_sync_err_cnt,
  136. delta_ofdm->fina_sync_err_cnt,
  137. max_ofdm->fina_sync_err_cnt);
  138. pos += scnprintf(buf + pos, bufsz - pos,
  139. " %-30s %10u %10u %10u %10u\n",
  140. "sfd_timeout:",
  141. le32_to_cpu(ofdm->sfd_timeout),
  142. accum_ofdm->sfd_timeout,
  143. delta_ofdm->sfd_timeout,
  144. max_ofdm->sfd_timeout);
  145. pos += scnprintf(buf + pos, bufsz - pos,
  146. " %-30s %10u %10u %10u %10u\n",
  147. "fina_timeout:",
  148. le32_to_cpu(ofdm->fina_timeout),
  149. accum_ofdm->fina_timeout,
  150. delta_ofdm->fina_timeout,
  151. max_ofdm->fina_timeout);
  152. pos += scnprintf(buf + pos, bufsz - pos,
  153. " %-30s %10u %10u %10u %10u\n",
  154. "unresponded_rts:",
  155. le32_to_cpu(ofdm->unresponded_rts),
  156. accum_ofdm->unresponded_rts,
  157. delta_ofdm->unresponded_rts,
  158. max_ofdm->unresponded_rts);
  159. pos += scnprintf(buf + pos, bufsz - pos,
  160. " %-30s %10u %10u %10u %10u\n",
  161. "rxe_frame_lmt_ovrun:",
  162. le32_to_cpu(ofdm->rxe_frame_limit_overrun),
  163. accum_ofdm->rxe_frame_limit_overrun,
  164. delta_ofdm->rxe_frame_limit_overrun,
  165. max_ofdm->rxe_frame_limit_overrun);
  166. pos += scnprintf(buf + pos, bufsz - pos,
  167. " %-30s %10u %10u %10u %10u\n",
  168. "sent_ack_cnt:",
  169. le32_to_cpu(ofdm->sent_ack_cnt),
  170. accum_ofdm->sent_ack_cnt,
  171. delta_ofdm->sent_ack_cnt,
  172. max_ofdm->sent_ack_cnt);
  173. pos += scnprintf(buf + pos, bufsz - pos,
  174. " %-30s %10u %10u %10u %10u\n",
  175. "sent_cts_cnt:",
  176. le32_to_cpu(ofdm->sent_cts_cnt),
  177. accum_ofdm->sent_cts_cnt,
  178. delta_ofdm->sent_cts_cnt, max_ofdm->sent_cts_cnt);
  179. pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
  180. "acumulative delta max\n",
  181. "Statistics_Rx - CCK:");
  182. pos += scnprintf(buf + pos, bufsz - pos,
  183. " %-30s %10u %10u %10u %10u\n",
  184. "ina_cnt:",
  185. le32_to_cpu(cck->ina_cnt), accum_cck->ina_cnt,
  186. delta_cck->ina_cnt, max_cck->ina_cnt);
  187. pos += scnprintf(buf + pos, bufsz - pos,
  188. " %-30s %10u %10u %10u %10u\n",
  189. "fina_cnt:",
  190. le32_to_cpu(cck->fina_cnt), accum_cck->fina_cnt,
  191. delta_cck->fina_cnt, max_cck->fina_cnt);
  192. pos += scnprintf(buf + pos, bufsz - pos,
  193. " %-30s %10u %10u %10u %10u\n",
  194. "plcp_err:",
  195. le32_to_cpu(cck->plcp_err), accum_cck->plcp_err,
  196. delta_cck->plcp_err, max_cck->plcp_err);
  197. pos += scnprintf(buf + pos, bufsz - pos,
  198. " %-30s %10u %10u %10u %10u\n",
  199. "crc32_err:",
  200. le32_to_cpu(cck->crc32_err), accum_cck->crc32_err,
  201. delta_cck->crc32_err, max_cck->crc32_err);
  202. pos += scnprintf(buf + pos, bufsz - pos,
  203. " %-30s %10u %10u %10u %10u\n",
  204. "overrun_err:",
  205. le32_to_cpu(cck->overrun_err),
  206. accum_cck->overrun_err,
  207. delta_cck->overrun_err, max_cck->overrun_err);
  208. pos += scnprintf(buf + pos, bufsz - pos,
  209. " %-30s %10u %10u %10u %10u\n",
  210. "early_overrun_err:",
  211. le32_to_cpu(cck->early_overrun_err),
  212. accum_cck->early_overrun_err,
  213. delta_cck->early_overrun_err,
  214. max_cck->early_overrun_err);
  215. pos += scnprintf(buf + pos, bufsz - pos,
  216. " %-30s %10u %10u %10u %10u\n",
  217. "crc32_good:",
  218. le32_to_cpu(cck->crc32_good), accum_cck->crc32_good,
  219. delta_cck->crc32_good,
  220. max_cck->crc32_good);
  221. pos += scnprintf(buf + pos, bufsz - pos,
  222. " %-30s %10u %10u %10u %10u\n",
  223. "false_alarm_cnt:",
  224. le32_to_cpu(cck->false_alarm_cnt),
  225. accum_cck->false_alarm_cnt,
  226. delta_cck->false_alarm_cnt, max_cck->false_alarm_cnt);
  227. pos += scnprintf(buf + pos, bufsz - pos,
  228. " %-30s %10u %10u %10u %10u\n",
  229. "fina_sync_err_cnt:",
  230. le32_to_cpu(cck->fina_sync_err_cnt),
  231. accum_cck->fina_sync_err_cnt,
  232. delta_cck->fina_sync_err_cnt,
  233. max_cck->fina_sync_err_cnt);
  234. pos += scnprintf(buf + pos, bufsz - pos,
  235. " %-30s %10u %10u %10u %10u\n",
  236. "sfd_timeout:",
  237. le32_to_cpu(cck->sfd_timeout),
  238. accum_cck->sfd_timeout,
  239. delta_cck->sfd_timeout, max_cck->sfd_timeout);
  240. pos += scnprintf(buf + pos, bufsz - pos,
  241. " %-30s %10u %10u %10u %10u\n",
  242. "fina_timeout:",
  243. le32_to_cpu(cck->fina_timeout),
  244. accum_cck->fina_timeout,
  245. delta_cck->fina_timeout, max_cck->fina_timeout);
  246. pos += scnprintf(buf + pos, bufsz - pos,
  247. " %-30s %10u %10u %10u %10u\n",
  248. "unresponded_rts:",
  249. le32_to_cpu(cck->unresponded_rts),
  250. accum_cck->unresponded_rts,
  251. delta_cck->unresponded_rts,
  252. max_cck->unresponded_rts);
  253. pos += scnprintf(buf + pos, bufsz - pos,
  254. " %-30s %10u %10u %10u %10u\n",
  255. "rxe_frame_lmt_ovrun:",
  256. le32_to_cpu(cck->rxe_frame_limit_overrun),
  257. accum_cck->rxe_frame_limit_overrun,
  258. delta_cck->rxe_frame_limit_overrun,
  259. max_cck->rxe_frame_limit_overrun);
  260. pos += scnprintf(buf + pos, bufsz - pos,
  261. " %-30s %10u %10u %10u %10u\n",
  262. "sent_ack_cnt:",
  263. le32_to_cpu(cck->sent_ack_cnt),
  264. accum_cck->sent_ack_cnt,
  265. delta_cck->sent_ack_cnt,
  266. max_cck->sent_ack_cnt);
  267. pos += scnprintf(buf + pos, bufsz - pos,
  268. " %-30s %10u %10u %10u %10u\n",
  269. "sent_cts_cnt:",
  270. le32_to_cpu(cck->sent_cts_cnt),
  271. accum_cck->sent_cts_cnt,
  272. delta_cck->sent_cts_cnt,
  273. max_cck->sent_cts_cnt);
  274. pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
  275. "acumulative delta max\n",
  276. "Statistics_Rx - GENERAL:");
  277. pos += scnprintf(buf + pos, bufsz - pos,
  278. " %-30s %10u %10u %10u %10u\n",
  279. "bogus_cts:",
  280. le32_to_cpu(general->bogus_cts),
  281. accum_general->bogus_cts,
  282. delta_general->bogus_cts, max_general->bogus_cts);
  283. pos += scnprintf(buf + pos, bufsz - pos,
  284. " %-30s %10u %10u %10u %10u\n",
  285. "bogus_ack:",
  286. le32_to_cpu(general->bogus_ack),
  287. accum_general->bogus_ack,
  288. delta_general->bogus_ack, max_general->bogus_ack);
  289. pos += scnprintf(buf + pos, bufsz - pos,
  290. " %-30s %10u %10u %10u %10u\n",
  291. "non_bssid_frames:",
  292. le32_to_cpu(general->non_bssid_frames),
  293. accum_general->non_bssid_frames,
  294. delta_general->non_bssid_frames,
  295. max_general->non_bssid_frames);
  296. pos += scnprintf(buf + pos, bufsz - pos,
  297. " %-30s %10u %10u %10u %10u\n",
  298. "filtered_frames:",
  299. le32_to_cpu(general->filtered_frames),
  300. accum_general->filtered_frames,
  301. delta_general->filtered_frames,
  302. max_general->filtered_frames);
  303. pos += scnprintf(buf + pos, bufsz - pos,
  304. " %-30s %10u %10u %10u %10u\n",
  305. "non_channel_beacons:",
  306. le32_to_cpu(general->non_channel_beacons),
  307. accum_general->non_channel_beacons,
  308. delta_general->non_channel_beacons,
  309. max_general->non_channel_beacons);
  310. ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
  311. kfree(buf);
  312. return ret;
  313. }
  314. ssize_t iwl3945_ucode_tx_stats_read(struct file *file,
  315. char __user *user_buf,
  316. size_t count, loff_t *ppos)
  317. {
  318. struct iwl_priv *priv = file->private_data;
  319. int pos = 0;
  320. char *buf;
  321. int bufsz = (sizeof(struct iwl39_statistics_tx) * 48) + 250;
  322. ssize_t ret;
  323. struct iwl39_statistics_tx *tx, *accum_tx, *delta_tx, *max_tx;
  324. if (!iwl_is_alive(priv))
  325. return -EAGAIN;
  326. buf = kzalloc(bufsz, GFP_KERNEL);
  327. if (!buf) {
  328. IWL_ERR(priv, "Can not allocate Buffer\n");
  329. return -ENOMEM;
  330. }
  331. /*
  332. * The statistic information display here is based on
  333. * the last statistics notification from uCode
  334. * might not reflect the current uCode activity
  335. */
  336. tx = &priv->_3945.statistics.tx;
  337. accum_tx = &priv->_3945.accum_statistics.tx;
  338. delta_tx = &priv->_3945.delta_statistics.tx;
  339. max_tx = &priv->_3945.max_delta.tx;
  340. pos += iwl3945_statistics_flag(priv, buf, bufsz);
  341. pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
  342. "acumulative delta max\n",
  343. "Statistics_Tx:");
  344. pos += scnprintf(buf + pos, bufsz - pos,
  345. " %-30s %10u %10u %10u %10u\n",
  346. "preamble:",
  347. le32_to_cpu(tx->preamble_cnt),
  348. accum_tx->preamble_cnt,
  349. delta_tx->preamble_cnt, max_tx->preamble_cnt);
  350. pos += scnprintf(buf + pos, bufsz - pos,
  351. " %-30s %10u %10u %10u %10u\n",
  352. "rx_detected_cnt:",
  353. le32_to_cpu(tx->rx_detected_cnt),
  354. accum_tx->rx_detected_cnt,
  355. delta_tx->rx_detected_cnt, max_tx->rx_detected_cnt);
  356. pos += scnprintf(buf + pos, bufsz - pos,
  357. " %-30s %10u %10u %10u %10u\n",
  358. "bt_prio_defer_cnt:",
  359. le32_to_cpu(tx->bt_prio_defer_cnt),
  360. accum_tx->bt_prio_defer_cnt,
  361. delta_tx->bt_prio_defer_cnt,
  362. max_tx->bt_prio_defer_cnt);
  363. pos += scnprintf(buf + pos, bufsz - pos,
  364. " %-30s %10u %10u %10u %10u\n",
  365. "bt_prio_kill_cnt:",
  366. le32_to_cpu(tx->bt_prio_kill_cnt),
  367. accum_tx->bt_prio_kill_cnt,
  368. delta_tx->bt_prio_kill_cnt,
  369. max_tx->bt_prio_kill_cnt);
  370. pos += scnprintf(buf + pos, bufsz - pos,
  371. " %-30s %10u %10u %10u %10u\n",
  372. "few_bytes_cnt:",
  373. le32_to_cpu(tx->few_bytes_cnt),
  374. accum_tx->few_bytes_cnt,
  375. delta_tx->few_bytes_cnt, max_tx->few_bytes_cnt);
  376. pos += scnprintf(buf + pos, bufsz - pos,
  377. " %-30s %10u %10u %10u %10u\n",
  378. "cts_timeout:",
  379. le32_to_cpu(tx->cts_timeout), accum_tx->cts_timeout,
  380. delta_tx->cts_timeout, max_tx->cts_timeout);
  381. pos += scnprintf(buf + pos, bufsz - pos,
  382. " %-30s %10u %10u %10u %10u\n",
  383. "ack_timeout:",
  384. le32_to_cpu(tx->ack_timeout),
  385. accum_tx->ack_timeout,
  386. delta_tx->ack_timeout, max_tx->ack_timeout);
  387. pos += scnprintf(buf + pos, bufsz - pos,
  388. " %-30s %10u %10u %10u %10u\n",
  389. "expected_ack_cnt:",
  390. le32_to_cpu(tx->expected_ack_cnt),
  391. accum_tx->expected_ack_cnt,
  392. delta_tx->expected_ack_cnt,
  393. max_tx->expected_ack_cnt);
  394. pos += scnprintf(buf + pos, bufsz - pos,
  395. " %-30s %10u %10u %10u %10u\n",
  396. "actual_ack_cnt:",
  397. le32_to_cpu(tx->actual_ack_cnt),
  398. accum_tx->actual_ack_cnt,
  399. delta_tx->actual_ack_cnt,
  400. max_tx->actual_ack_cnt);
  401. ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
  402. kfree(buf);
  403. return ret;
  404. }
  405. ssize_t iwl3945_ucode_general_stats_read(struct file *file,
  406. char __user *user_buf,
  407. size_t count, loff_t *ppos)
  408. {
  409. struct iwl_priv *priv = file->private_data;
  410. int pos = 0;
  411. char *buf;
  412. int bufsz = sizeof(struct iwl39_statistics_general) * 10 + 300;
  413. ssize_t ret;
  414. struct iwl39_statistics_general *general, *accum_general;
  415. struct iwl39_statistics_general *delta_general, *max_general;
  416. struct statistics_dbg *dbg, *accum_dbg, *delta_dbg, *max_dbg;
  417. struct iwl39_statistics_div *div, *accum_div, *delta_div, *max_div;
  418. if (!iwl_is_alive(priv))
  419. return -EAGAIN;
  420. buf = kzalloc(bufsz, GFP_KERNEL);
  421. if (!buf) {
  422. IWL_ERR(priv, "Can not allocate Buffer\n");
  423. return -ENOMEM;
  424. }
  425. /*
  426. * The statistic information display here is based on
  427. * the last statistics notification from uCode
  428. * might not reflect the current uCode activity
  429. */
  430. general = &priv->_3945.statistics.general;
  431. dbg = &priv->_3945.statistics.general.dbg;
  432. div = &priv->_3945.statistics.general.div;
  433. accum_general = &priv->_3945.accum_statistics.general;
  434. delta_general = &priv->_3945.delta_statistics.general;
  435. max_general = &priv->_3945.max_delta.general;
  436. accum_dbg = &priv->_3945.accum_statistics.general.dbg;
  437. delta_dbg = &priv->_3945.delta_statistics.general.dbg;
  438. max_dbg = &priv->_3945.max_delta.general.dbg;
  439. accum_div = &priv->_3945.accum_statistics.general.div;
  440. delta_div = &priv->_3945.delta_statistics.general.div;
  441. max_div = &priv->_3945.max_delta.general.div;
  442. pos += iwl3945_statistics_flag(priv, buf, bufsz);
  443. pos += scnprintf(buf + pos, bufsz - pos, "%-32s current"
  444. "acumulative delta max\n",
  445. "Statistics_General:");
  446. pos += scnprintf(buf + pos, bufsz - pos,
  447. " %-30s %10u %10u %10u %10u\n",
  448. "burst_check:",
  449. le32_to_cpu(dbg->burst_check),
  450. accum_dbg->burst_check,
  451. delta_dbg->burst_check, max_dbg->burst_check);
  452. pos += scnprintf(buf + pos, bufsz - pos,
  453. " %-30s %10u %10u %10u %10u\n",
  454. "burst_count:",
  455. le32_to_cpu(dbg->burst_count),
  456. accum_dbg->burst_count,
  457. delta_dbg->burst_count, max_dbg->burst_count);
  458. pos += scnprintf(buf + pos, bufsz - pos,
  459. " %-30s %10u %10u %10u %10u\n",
  460. "sleep_time:",
  461. le32_to_cpu(general->sleep_time),
  462. accum_general->sleep_time,
  463. delta_general->sleep_time, max_general->sleep_time);
  464. pos += scnprintf(buf + pos, bufsz - pos,
  465. " %-30s %10u %10u %10u %10u\n",
  466. "slots_out:",
  467. le32_to_cpu(general->slots_out),
  468. accum_general->slots_out,
  469. delta_general->slots_out, max_general->slots_out);
  470. pos += scnprintf(buf + pos, bufsz - pos,
  471. " %-30s %10u %10u %10u %10u\n",
  472. "slots_idle:",
  473. le32_to_cpu(general->slots_idle),
  474. accum_general->slots_idle,
  475. delta_general->slots_idle, max_general->slots_idle);
  476. pos += scnprintf(buf + pos, bufsz - pos, "ttl_timestamp:\t\t\t%u\n",
  477. le32_to_cpu(general->ttl_timestamp));
  478. pos += scnprintf(buf + pos, bufsz - pos,
  479. " %-30s %10u %10u %10u %10u\n",
  480. "tx_on_a:",
  481. le32_to_cpu(div->tx_on_a), accum_div->tx_on_a,
  482. delta_div->tx_on_a, max_div->tx_on_a);
  483. pos += scnprintf(buf + pos, bufsz - pos,
  484. " %-30s %10u %10u %10u %10u\n",
  485. "tx_on_b:",
  486. le32_to_cpu(div->tx_on_b), accum_div->tx_on_b,
  487. delta_div->tx_on_b, max_div->tx_on_b);
  488. pos += scnprintf(buf + pos, bufsz - pos,
  489. " %-30s %10u %10u %10u %10u\n",
  490. "exec_time:",
  491. le32_to_cpu(div->exec_time), accum_div->exec_time,
  492. delta_div->exec_time, max_div->exec_time);
  493. pos += scnprintf(buf + pos, bufsz - pos,
  494. " %-30s %10u %10u %10u %10u\n",
  495. "probe_time:",
  496. le32_to_cpu(div->probe_time), accum_div->probe_time,
  497. delta_div->probe_time, max_div->probe_time);
  498. ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
  499. kfree(buf);
  500. return ret;
  501. }