3945-debug.c 18 KB

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