iwl-3945-debugfs.c 19 KB

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