3945-debug.c 19 KB

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