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