debugfs_htt_stats.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. /* SPDX-License-Identifier: BSD-3-Clause-Clear */
  2. /*
  3. * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef DEBUG_HTT_STATS_H
  7. #define DEBUG_HTT_STATS_H
  8. #define ATH12K_HTT_STATS_BUF_SIZE (1024 * 512)
  9. #define ATH12K_HTT_STATS_COOKIE_LSB GENMASK_ULL(31, 0)
  10. #define ATH12K_HTT_STATS_COOKIE_MSB GENMASK_ULL(63, 32)
  11. #define ATH12K_HTT_STATS_MAGIC_VALUE 0xF0F0F0F0
  12. #define ATH12K_HTT_STATS_SUBTYPE_MAX 16
  13. #define ATH12K_HTT_MAX_STRING_LEN 256
  14. #define ATH12K_HTT_STATS_RESET_BITMAP32_OFFSET(_idx) ((_idx) & 0x1f)
  15. #define ATH12K_HTT_STATS_RESET_BITMAP64_OFFSET(_idx) ((_idx) & 0x3f)
  16. #define ATH12K_HTT_STATS_RESET_BITMAP32_BIT(_idx) (1 << \
  17. ATH12K_HTT_STATS_RESET_BITMAP32_OFFSET(_idx))
  18. #define ATH12K_HTT_STATS_RESET_BITMAP64_BIT(_idx) (1 << \
  19. ATH12K_HTT_STATS_RESET_BITMAP64_OFFSET(_idx))
  20. void ath12k_debugfs_htt_stats_register(struct ath12k *ar);
  21. #ifdef CONFIG_ATH12K_DEBUGFS
  22. void ath12k_debugfs_htt_ext_stats_handler(struct ath12k_base *ab,
  23. struct sk_buff *skb);
  24. #else /* CONFIG_ATH12K_DEBUGFS */
  25. static inline void ath12k_debugfs_htt_ext_stats_handler(struct ath12k_base *ab,
  26. struct sk_buff *skb)
  27. {
  28. }
  29. #endif
  30. /**
  31. * DOC: target -> host extended statistics upload
  32. *
  33. * The following field definitions describe the format of the HTT
  34. * target to host stats upload confirmation message.
  35. * The message contains a cookie echoed from the HTT host->target stats
  36. * upload request, which identifies which request the confirmation is
  37. * for, and a single stats can span over multiple HTT stats indication
  38. * due to the HTT message size limitation so every HTT ext stats
  39. * indication will have tag-length-value stats information elements.
  40. * The tag-length header for each HTT stats IND message also includes a
  41. * status field, to indicate whether the request for the stat type in
  42. * question was fully met, partially met, unable to be met, or invalid
  43. * (if the stat type in question is disabled in the target).
  44. * A Done bit 1's indicate the end of the of stats info elements.
  45. *
  46. *
  47. * |31 16|15 12|11|10 8|7 5|4 0|
  48. * |--------------------------------------------------------------|
  49. * | reserved | msg type |
  50. * |--------------------------------------------------------------|
  51. * | cookie LSBs |
  52. * |--------------------------------------------------------------|
  53. * | cookie MSBs |
  54. * |--------------------------------------------------------------|
  55. * | stats entry length | rsvd | D| S | stat type |
  56. * |--------------------------------------------------------------|
  57. * | type-specific stats info |
  58. * | (see debugfs_htt_stats.h) |
  59. * |--------------------------------------------------------------|
  60. * Header fields:
  61. * - MSG_TYPE
  62. * Bits 7:0
  63. * Purpose: Identifies this is a extended statistics upload confirmation
  64. * message.
  65. * Value: 0x1c
  66. * - COOKIE_LSBS
  67. * Bits 31:0
  68. * Purpose: Provide a mechanism to match a target->host stats confirmation
  69. * message with its preceding host->target stats request message.
  70. * Value: MSBs of the opaque cookie specified by the host-side requestor
  71. * - COOKIE_MSBS
  72. * Bits 31:0
  73. * Purpose: Provide a mechanism to match a target->host stats confirmation
  74. * message with its preceding host->target stats request message.
  75. * Value: MSBs of the opaque cookie specified by the host-side requestor
  76. *
  77. * Stats Information Element tag-length header fields:
  78. * - STAT_TYPE
  79. * Bits 7:0
  80. * Purpose: identifies the type of statistics info held in the
  81. * following information element
  82. * Value: ath12k_dbg_htt_ext_stats_type
  83. * - STATUS
  84. * Bits 10:8
  85. * Purpose: indicate whether the requested stats are present
  86. * Value:
  87. * 0 -> The requested stats have been delivered in full
  88. * 1 -> The requested stats have been delivered in part
  89. * 2 -> The requested stats could not be delivered (error case)
  90. * 3 -> The requested stat type is either not recognized (invalid)
  91. * - DONE
  92. * Bits 11
  93. * Purpose:
  94. * Indicates the completion of the stats entry, this will be the last
  95. * stats conf HTT segment for the requested stats type.
  96. * Value:
  97. * 0 -> the stats retrieval is ongoing
  98. * 1 -> the stats retrieval is complete
  99. * - LENGTH
  100. * Bits 31:16
  101. * Purpose: indicate the stats information size
  102. * Value: This field specifies the number of bytes of stats information
  103. * that follows the element tag-length header.
  104. * It is expected but not required that this length is a multiple of
  105. * 4 bytes.
  106. */
  107. #define ATH12K_HTT_T2H_EXT_STATS_INFO1_DONE BIT(11)
  108. #define ATH12K_HTT_T2H_EXT_STATS_INFO1_LENGTH GENMASK(31, 16)
  109. struct ath12k_htt_extd_stats_msg {
  110. __le32 info0;
  111. __le64 cookie;
  112. __le32 info1;
  113. u8 data[];
  114. } __packed;
  115. /* htt_dbg_ext_stats_type */
  116. enum ath12k_dbg_htt_ext_stats_type {
  117. ATH12K_DBG_HTT_EXT_STATS_RESET = 0,
  118. ATH12K_DBG_HTT_EXT_STATS_PDEV_TX = 1,
  119. ATH12K_DBG_HTT_EXT_STATS_PDEV_TX_SCHED = 4,
  120. ATH12K_DBG_HTT_EXT_STATS_PDEV_ERROR = 5,
  121. ATH12K_DBG_HTT_EXT_STATS_PDEV_TQM = 6,
  122. ATH12K_DBG_HTT_EXT_STATS_TX_DE_INFO = 8,
  123. /* keep this last */
  124. ATH12K_DBG_HTT_NUM_EXT_STATS,
  125. };
  126. enum ath12k_dbg_htt_tlv_tag {
  127. HTT_STATS_TX_PDEV_CMN_TAG = 0,
  128. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1,
  129. HTT_STATS_TX_PDEV_SIFS_TAG = 2,
  130. HTT_STATS_TX_PDEV_FLUSH_TAG = 3,
  131. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11,
  132. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12,
  133. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13,
  134. HTT_STATS_TX_TQM_CMN_TAG = 14,
  135. HTT_STATS_TX_TQM_PDEV_TAG = 15,
  136. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17,
  137. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18,
  138. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19,
  139. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20,
  140. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21,
  141. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22,
  142. HTT_STATS_TX_DE_CMN_TAG = 23,
  143. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36,
  144. HTT_STATS_TX_SCHED_CMN_TAG = 37,
  145. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39,
  146. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43,
  147. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44,
  148. HTT_STATS_HW_INTR_MISC_TAG = 54,
  149. HTT_STATS_HW_PDEV_ERRS_TAG = 56,
  150. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65,
  151. HTT_STATS_WHAL_TX_TAG = 66,
  152. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67,
  153. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86,
  154. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87,
  155. HTT_STATS_HW_WAR_TAG = 89,
  156. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100,
  157. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102,
  158. HTT_STATS_MU_PPDU_DIST_TAG = 129,
  159. HTT_STATS_MAX_TAG,
  160. };
  161. #define ATH12K_HTT_STATS_MAC_ID GENMASK(7, 0)
  162. #define ATH12K_HTT_TX_PDEV_MAX_SIFS_BURST_STATS 9
  163. #define ATH12K_HTT_TX_PDEV_MAX_FLUSH_REASON_STATS 150
  164. /* MU MIMO distribution stats is a 2-dimensional array
  165. * with dimension one denoting stats for nr4[0] or nr8[1]
  166. */
  167. #define ATH12K_HTT_STATS_NUM_NR_BINS 2
  168. #define ATH12K_HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST 10
  169. #define ATH12K_HTT_TX_PDEV_MAX_SIFS_BURST_HIST_STATS 10
  170. #define ATH12K_HTT_STATS_MAX_NUM_SCHED_STATUS 9
  171. #define ATH12K_HTT_STATS_NUM_SCHED_STATUS_WORDS \
  172. (ATH12K_HTT_STATS_NUM_NR_BINS * ATH12K_HTT_STATS_MAX_NUM_SCHED_STATUS)
  173. #define ATH12K_HTT_STATS_MU_PPDU_PER_BURST_WORDS \
  174. (ATH12K_HTT_STATS_NUM_NR_BINS * ATH12K_HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST)
  175. enum ath12k_htt_tx_pdev_underrun_enum {
  176. HTT_STATS_TX_PDEV_NO_DATA_UNDERRUN = 0,
  177. HTT_STATS_TX_PDEV_DATA_UNDERRUN_BETWEEN_MPDU = 1,
  178. HTT_STATS_TX_PDEV_DATA_UNDERRUN_WITHIN_MPDU = 2,
  179. HTT_TX_PDEV_MAX_URRN_STATS = 3,
  180. };
  181. enum ath12k_htt_stats_reset_cfg_param_alloc_pos {
  182. ATH12K_HTT_STATS_RESET_PARAM_CFG_32_BYTES = 1,
  183. ATH12K_HTT_STATS_RESET_PARAM_CFG_64_BYTES,
  184. ATH12K_HTT_STATS_RESET_PARAM_CFG_128_BYTES,
  185. };
  186. struct debug_htt_stats_req {
  187. bool done;
  188. bool override_cfg_param;
  189. u8 pdev_id;
  190. enum ath12k_dbg_htt_ext_stats_type type;
  191. u32 cfg_param[4];
  192. u8 peer_addr[ETH_ALEN];
  193. struct completion htt_stats_rcvd;
  194. u32 buf_len;
  195. u8 buf[];
  196. };
  197. struct ath12k_htt_tx_pdev_stats_cmn_tlv {
  198. __le32 mac_id__word;
  199. __le32 hw_queued;
  200. __le32 hw_reaped;
  201. __le32 underrun;
  202. __le32 hw_paused;
  203. __le32 hw_flush;
  204. __le32 hw_filt;
  205. __le32 tx_abort;
  206. __le32 mpdu_requed;
  207. __le32 tx_xretry;
  208. __le32 data_rc;
  209. __le32 mpdu_dropped_xretry;
  210. __le32 illgl_rate_phy_err;
  211. __le32 cont_xretry;
  212. __le32 tx_timeout;
  213. __le32 pdev_resets;
  214. __le32 phy_underrun;
  215. __le32 txop_ovf;
  216. __le32 seq_posted;
  217. __le32 seq_failed_queueing;
  218. __le32 seq_completed;
  219. __le32 seq_restarted;
  220. __le32 mu_seq_posted;
  221. __le32 seq_switch_hw_paused;
  222. __le32 next_seq_posted_dsr;
  223. __le32 seq_posted_isr;
  224. __le32 seq_ctrl_cached;
  225. __le32 mpdu_count_tqm;
  226. __le32 msdu_count_tqm;
  227. __le32 mpdu_removed_tqm;
  228. __le32 msdu_removed_tqm;
  229. __le32 mpdus_sw_flush;
  230. __le32 mpdus_hw_filter;
  231. __le32 mpdus_truncated;
  232. __le32 mpdus_ack_failed;
  233. __le32 mpdus_expired;
  234. __le32 mpdus_seq_hw_retry;
  235. __le32 ack_tlv_proc;
  236. __le32 coex_abort_mpdu_cnt_valid;
  237. __le32 coex_abort_mpdu_cnt;
  238. __le32 num_total_ppdus_tried_ota;
  239. __le32 num_data_ppdus_tried_ota;
  240. __le32 local_ctrl_mgmt_enqued;
  241. __le32 local_ctrl_mgmt_freed;
  242. __le32 local_data_enqued;
  243. __le32 local_data_freed;
  244. __le32 mpdu_tried;
  245. __le32 isr_wait_seq_posted;
  246. __le32 tx_active_dur_us_low;
  247. __le32 tx_active_dur_us_high;
  248. __le32 remove_mpdus_max_retries;
  249. __le32 comp_delivered;
  250. __le32 ppdu_ok;
  251. __le32 self_triggers;
  252. __le32 tx_time_dur_data;
  253. __le32 seq_qdepth_repost_stop;
  254. __le32 mu_seq_min_msdu_repost_stop;
  255. __le32 seq_min_msdu_repost_stop;
  256. __le32 seq_txop_repost_stop;
  257. __le32 next_seq_cancel;
  258. __le32 fes_offsets_err_cnt;
  259. __le32 num_mu_peer_blacklisted;
  260. __le32 mu_ofdma_seq_posted;
  261. __le32 ul_mumimo_seq_posted;
  262. __le32 ul_ofdma_seq_posted;
  263. __le32 thermal_suspend_cnt;
  264. __le32 dfs_suspend_cnt;
  265. __le32 tx_abort_suspend_cnt;
  266. __le32 tgt_specific_opaque_txq_suspend_info;
  267. __le32 last_suspend_reason;
  268. } __packed;
  269. struct ath12k_htt_tx_pdev_stats_urrn_tlv {
  270. DECLARE_FLEX_ARRAY(__le32, urrn_stats);
  271. } __packed;
  272. struct ath12k_htt_tx_pdev_stats_flush_tlv {
  273. DECLARE_FLEX_ARRAY(__le32, flush_errs);
  274. } __packed;
  275. struct ath12k_htt_tx_pdev_stats_phy_err_tlv {
  276. DECLARE_FLEX_ARRAY(__le32, phy_errs);
  277. } __packed;
  278. struct ath12k_htt_tx_pdev_stats_sifs_tlv {
  279. DECLARE_FLEX_ARRAY(__le32, sifs_status);
  280. } __packed;
  281. struct ath12k_htt_pdev_ctrl_path_tx_stats_tlv {
  282. __le32 fw_tx_mgmt_subtype[ATH12K_HTT_STATS_SUBTYPE_MAX];
  283. } __packed;
  284. struct ath12k_htt_tx_pdev_stats_sifs_hist_tlv {
  285. DECLARE_FLEX_ARRAY(__le32, sifs_hist_status);
  286. } __packed;
  287. enum ath12k_htt_stats_hw_mode {
  288. ATH12K_HTT_STATS_HWMODE_AC = 0,
  289. ATH12K_HTT_STATS_HWMODE_AX = 1,
  290. ATH12K_HTT_STATS_HWMODE_BE = 2,
  291. };
  292. struct ath12k_htt_tx_pdev_mu_ppdu_dist_stats_tlv {
  293. __le32 hw_mode;
  294. __le32 num_seq_term_status[ATH12K_HTT_STATS_NUM_SCHED_STATUS_WORDS];
  295. __le32 num_ppdu_cmpl_per_burst[ATH12K_HTT_STATS_MU_PPDU_PER_BURST_WORDS];
  296. __le32 num_seq_posted[ATH12K_HTT_STATS_NUM_NR_BINS];
  297. __le32 num_ppdu_posted_per_burst[ATH12K_HTT_STATS_MU_PPDU_PER_BURST_WORDS];
  298. } __packed;
  299. #define ATH12K_HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID GENMASK(7, 0)
  300. #define ATH12K_HTT_TX_PDEV_STATS_SCHED_PER_TXQ_ID GENMASK(15, 8)
  301. #define ATH12K_HTT_TX_PDEV_NUM_SCHED_ORDER_LOG 20
  302. struct ath12k_htt_stats_tx_sched_cmn_tlv {
  303. __le32 mac_id__word;
  304. __le32 current_timestamp;
  305. } __packed;
  306. struct ath12k_htt_tx_pdev_stats_sched_per_txq_tlv {
  307. __le32 mac_id__word;
  308. __le32 sched_policy;
  309. __le32 last_sched_cmd_posted_timestamp;
  310. __le32 last_sched_cmd_compl_timestamp;
  311. __le32 sched_2_tac_lwm_count;
  312. __le32 sched_2_tac_ring_full;
  313. __le32 sched_cmd_post_failure;
  314. __le32 num_active_tids;
  315. __le32 num_ps_schedules;
  316. __le32 sched_cmds_pending;
  317. __le32 num_tid_register;
  318. __le32 num_tid_unregister;
  319. __le32 num_qstats_queried;
  320. __le32 qstats_update_pending;
  321. __le32 last_qstats_query_timestamp;
  322. __le32 num_tqm_cmdq_full;
  323. __le32 num_de_sched_algo_trigger;
  324. __le32 num_rt_sched_algo_trigger;
  325. __le32 num_tqm_sched_algo_trigger;
  326. __le32 notify_sched;
  327. __le32 dur_based_sendn_term;
  328. __le32 su_notify2_sched;
  329. __le32 su_optimal_queued_msdus_sched;
  330. __le32 su_delay_timeout_sched;
  331. __le32 su_min_txtime_sched_delay;
  332. __le32 su_no_delay;
  333. __le32 num_supercycles;
  334. __le32 num_subcycles_with_sort;
  335. __le32 num_subcycles_no_sort;
  336. } __packed;
  337. struct ath12k_htt_sched_txq_cmd_posted_tlv {
  338. DECLARE_FLEX_ARRAY(__le32, sched_cmd_posted);
  339. } __packed;
  340. struct ath12k_htt_sched_txq_cmd_reaped_tlv {
  341. DECLARE_FLEX_ARRAY(__le32, sched_cmd_reaped);
  342. } __packed;
  343. struct ath12k_htt_sched_txq_sched_order_su_tlv {
  344. DECLARE_FLEX_ARRAY(__le32, sched_order_su);
  345. } __packed;
  346. struct ath12k_htt_sched_txq_sched_ineligibility_tlv {
  347. DECLARE_FLEX_ARRAY(__le32, sched_ineligibility);
  348. } __packed;
  349. enum ath12k_htt_sched_txq_supercycle_triggers_tlv_enum {
  350. ATH12K_HTT_SCHED_SUPERCYCLE_TRIGGER_NONE = 0,
  351. ATH12K_HTT_SCHED_SUPERCYCLE_TRIGGER_FORCED,
  352. ATH12K_HTT_SCHED_SUPERCYCLE_TRIGGER_LESS_NUM_TIDQ_ENTRIES,
  353. ATH12K_HTT_SCHED_SUPERCYCLE_TRIGGER_LESS_NUM_ACTIVE_TIDS,
  354. ATH12K_HTT_SCHED_SUPERCYCLE_TRIGGER_MAX_ITR_REACHED,
  355. ATH12K_HTT_SCHED_SUPERCYCLE_TRIGGER_DUR_THRESHOLD_REACHED,
  356. ATH12K_HTT_SCHED_SUPERCYCLE_TRIGGER_TWT_TRIGGER,
  357. ATH12K_HTT_SCHED_SUPERCYCLE_TRIGGER_MAX,
  358. };
  359. struct ath12k_htt_sched_txq_supercycle_triggers_tlv {
  360. DECLARE_FLEX_ARRAY(__le32, supercycle_triggers);
  361. } __packed;
  362. struct ath12k_htt_hw_stats_pdev_errs_tlv {
  363. __le32 mac_id__word;
  364. __le32 tx_abort;
  365. __le32 tx_abort_fail_count;
  366. __le32 rx_abort;
  367. __le32 rx_abort_fail_count;
  368. __le32 warm_reset;
  369. __le32 cold_reset;
  370. __le32 tx_flush;
  371. __le32 tx_glb_reset;
  372. __le32 tx_txq_reset;
  373. __le32 rx_timeout_reset;
  374. __le32 mac_cold_reset_restore_cal;
  375. __le32 mac_cold_reset;
  376. __le32 mac_warm_reset;
  377. __le32 mac_only_reset;
  378. __le32 phy_warm_reset;
  379. __le32 phy_warm_reset_ucode_trig;
  380. __le32 mac_warm_reset_restore_cal;
  381. __le32 mac_sfm_reset;
  382. __le32 phy_warm_reset_m3_ssr;
  383. __le32 phy_warm_reset_reason_phy_m3;
  384. __le32 phy_warm_reset_reason_tx_hw_stuck;
  385. __le32 phy_warm_reset_reason_num_rx_frame_stuck;
  386. __le32 phy_warm_reset_reason_wal_rx_rec_rx_busy;
  387. __le32 phy_warm_reset_reason_wal_rx_rec_mac_hng;
  388. __le32 phy_warm_reset_reason_mac_conv_phy_reset;
  389. __le32 wal_rx_recovery_rst_mac_hang_cnt;
  390. __le32 wal_rx_recovery_rst_known_sig_cnt;
  391. __le32 wal_rx_recovery_rst_no_rx_cnt;
  392. __le32 wal_rx_recovery_rst_no_rx_consec_cnt;
  393. __le32 wal_rx_recovery_rst_rx_busy_cnt;
  394. __le32 wal_rx_recovery_rst_phy_mac_hang_cnt;
  395. __le32 rx_flush_cnt;
  396. __le32 phy_warm_reset_reason_tx_exp_cca_stuck;
  397. __le32 phy_warm_reset_reason_tx_consec_flsh_war;
  398. __le32 phy_warm_reset_reason_tx_hwsch_reset_war;
  399. __le32 phy_warm_reset_reason_hwsch_cca_wdog_war;
  400. __le32 fw_rx_rings_reset;
  401. __le32 rx_dest_drain_rx_descs_leak_prevented;
  402. __le32 rx_dest_drain_rx_descs_saved_cnt;
  403. __le32 rx_dest_drain_rxdma2reo_leak_detected;
  404. __le32 rx_dest_drain_rxdma2fw_leak_detected;
  405. __le32 rx_dest_drain_rxdma2wbm_leak_detected;
  406. __le32 rx_dest_drain_rxdma1_2sw_leak_detected;
  407. __le32 rx_dest_drain_rx_drain_ok_mac_idle;
  408. __le32 rx_dest_drain_ok_mac_not_idle;
  409. __le32 rx_dest_drain_prerequisite_invld;
  410. __le32 rx_dest_drain_skip_non_lmac_reset;
  411. __le32 rx_dest_drain_hw_fifo_notempty_post_wait;
  412. } __packed;
  413. #define ATH12K_HTT_STATS_MAX_HW_INTR_NAME_LEN 8
  414. struct ath12k_htt_hw_stats_intr_misc_tlv {
  415. u8 hw_intr_name[ATH12K_HTT_STATS_MAX_HW_INTR_NAME_LEN];
  416. __le32 mask;
  417. __le32 count;
  418. } __packed;
  419. struct ath12k_htt_hw_stats_whal_tx_tlv {
  420. __le32 mac_id__word;
  421. __le32 last_unpause_ppdu_id;
  422. __le32 hwsch_unpause_wait_tqm_write;
  423. __le32 hwsch_dummy_tlv_skipped;
  424. __le32 hwsch_misaligned_offset_received;
  425. __le32 hwsch_reset_count;
  426. __le32 hwsch_dev_reset_war;
  427. __le32 hwsch_delayed_pause;
  428. __le32 hwsch_long_delayed_pause;
  429. __le32 sch_rx_ppdu_no_response;
  430. __le32 sch_selfgen_response;
  431. __le32 sch_rx_sifs_resp_trigger;
  432. } __packed;
  433. struct ath12k_htt_hw_war_stats_tlv {
  434. __le32 mac_id__word;
  435. DECLARE_FLEX_ARRAY(__le32, hw_wars);
  436. } __packed;
  437. struct ath12k_htt_tx_tqm_cmn_stats_tlv {
  438. __le32 mac_id__word;
  439. __le32 max_cmdq_id;
  440. __le32 list_mpdu_cnt_hist_intvl;
  441. __le32 add_msdu;
  442. __le32 q_empty;
  443. __le32 q_not_empty;
  444. __le32 drop_notification;
  445. __le32 desc_threshold;
  446. __le32 hwsch_tqm_invalid_status;
  447. __le32 missed_tqm_gen_mpdus;
  448. __le32 tqm_active_tids;
  449. __le32 tqm_inactive_tids;
  450. __le32 tqm_active_msduq_flows;
  451. __le32 msduq_timestamp_updates;
  452. __le32 msduq_updates_mpdu_head_info_cmd;
  453. __le32 msduq_updates_emp_to_nonemp_status;
  454. __le32 get_mpdu_head_info_cmds_by_query;
  455. __le32 get_mpdu_head_info_cmds_by_tac;
  456. __le32 gen_mpdu_cmds_by_query;
  457. __le32 high_prio_q_not_empty;
  458. } __packed;
  459. struct ath12k_htt_tx_tqm_error_stats_tlv {
  460. __le32 q_empty_failure;
  461. __le32 q_not_empty_failure;
  462. __le32 add_msdu_failure;
  463. __le32 tqm_cache_ctl_err;
  464. __le32 tqm_soft_reset;
  465. __le32 tqm_reset_num_in_use_link_descs;
  466. __le32 tqm_reset_num_lost_link_descs;
  467. __le32 tqm_reset_num_lost_host_tx_buf_cnt;
  468. __le32 tqm_reset_num_in_use_internal_tqm;
  469. __le32 tqm_reset_num_in_use_idle_link_rng;
  470. __le32 tqm_reset_time_to_tqm_hang_delta_ms;
  471. __le32 tqm_reset_recovery_time_ms;
  472. __le32 tqm_reset_num_peers_hdl;
  473. __le32 tqm_reset_cumm_dirty_hw_mpduq_cnt;
  474. __le32 tqm_reset_cumm_dirty_hw_msduq_proc;
  475. __le32 tqm_reset_flush_cache_cmd_su_cnt;
  476. __le32 tqm_reset_flush_cache_cmd_other_cnt;
  477. __le32 tqm_reset_flush_cache_cmd_trig_type;
  478. __le32 tqm_reset_flush_cache_cmd_trig_cfg;
  479. __le32 tqm_reset_flush_cmd_skp_status_null;
  480. } __packed;
  481. struct ath12k_htt_tx_tqm_gen_mpdu_stats_tlv {
  482. DECLARE_FLEX_ARRAY(__le32, gen_mpdu_end_reason);
  483. } __packed;
  484. #define ATH12K_HTT_TX_TQM_MAX_LIST_MPDU_END_REASON 16
  485. #define ATH12K_HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS 16
  486. struct ath12k_htt_tx_tqm_list_mpdu_stats_tlv {
  487. DECLARE_FLEX_ARRAY(__le32, list_mpdu_end_reason);
  488. } __packed;
  489. struct ath12k_htt_tx_tqm_list_mpdu_cnt_tlv {
  490. DECLARE_FLEX_ARRAY(__le32, list_mpdu_cnt_hist);
  491. } __packed;
  492. struct ath12k_htt_tx_tqm_pdev_stats_tlv {
  493. __le32 msdu_count;
  494. __le32 mpdu_count;
  495. __le32 remove_msdu;
  496. __le32 remove_mpdu;
  497. __le32 remove_msdu_ttl;
  498. __le32 send_bar;
  499. __le32 bar_sync;
  500. __le32 notify_mpdu;
  501. __le32 sync_cmd;
  502. __le32 write_cmd;
  503. __le32 hwsch_trigger;
  504. __le32 ack_tlv_proc;
  505. __le32 gen_mpdu_cmd;
  506. __le32 gen_list_cmd;
  507. __le32 remove_mpdu_cmd;
  508. __le32 remove_mpdu_tried_cmd;
  509. __le32 mpdu_queue_stats_cmd;
  510. __le32 mpdu_head_info_cmd;
  511. __le32 msdu_flow_stats_cmd;
  512. __le32 remove_msdu_cmd;
  513. __le32 remove_msdu_ttl_cmd;
  514. __le32 flush_cache_cmd;
  515. __le32 update_mpduq_cmd;
  516. __le32 enqueue;
  517. __le32 enqueue_notify;
  518. __le32 notify_mpdu_at_head;
  519. __le32 notify_mpdu_state_valid;
  520. __le32 sched_udp_notify1;
  521. __le32 sched_udp_notify2;
  522. __le32 sched_nonudp_notify1;
  523. __le32 sched_nonudp_notify2;
  524. } __packed;
  525. struct ath12k_htt_tx_de_cmn_stats_tlv {
  526. __le32 mac_id__word;
  527. __le32 tcl2fw_entry_count;
  528. __le32 not_to_fw;
  529. __le32 invalid_pdev_vdev_peer;
  530. __le32 tcl_res_invalid_addrx;
  531. __le32 wbm2fw_entry_count;
  532. __le32 invalid_pdev;
  533. __le32 tcl_res_addrx_timeout;
  534. __le32 invalid_vdev;
  535. __le32 invalid_tcl_exp_frame_desc;
  536. __le32 vdev_id_mismatch_cnt;
  537. } __packed;
  538. struct ath12k_htt_tx_de_eapol_packets_stats_tlv {
  539. __le32 m1_packets;
  540. __le32 m2_packets;
  541. __le32 m3_packets;
  542. __le32 m4_packets;
  543. __le32 g1_packets;
  544. __le32 g2_packets;
  545. __le32 rc4_packets;
  546. __le32 eap_packets;
  547. __le32 eapol_start_packets;
  548. __le32 eapol_logoff_packets;
  549. __le32 eapol_encap_asf_packets;
  550. } __packed;
  551. struct ath12k_htt_tx_de_classify_stats_tlv {
  552. __le32 arp_packets;
  553. __le32 igmp_packets;
  554. __le32 dhcp_packets;
  555. __le32 host_inspected;
  556. __le32 htt_included;
  557. __le32 htt_valid_mcs;
  558. __le32 htt_valid_nss;
  559. __le32 htt_valid_preamble_type;
  560. __le32 htt_valid_chainmask;
  561. __le32 htt_valid_guard_interval;
  562. __le32 htt_valid_retries;
  563. __le32 htt_valid_bw_info;
  564. __le32 htt_valid_power;
  565. __le32 htt_valid_key_flags;
  566. __le32 htt_valid_no_encryption;
  567. __le32 fse_entry_count;
  568. __le32 fse_priority_be;
  569. __le32 fse_priority_high;
  570. __le32 fse_priority_low;
  571. __le32 fse_traffic_ptrn_be;
  572. __le32 fse_traffic_ptrn_over_sub;
  573. __le32 fse_traffic_ptrn_bursty;
  574. __le32 fse_traffic_ptrn_interactive;
  575. __le32 fse_traffic_ptrn_periodic;
  576. __le32 fse_hwqueue_alloc;
  577. __le32 fse_hwqueue_created;
  578. __le32 fse_hwqueue_send_to_host;
  579. __le32 mcast_entry;
  580. __le32 bcast_entry;
  581. __le32 htt_update_peer_cache;
  582. __le32 htt_learning_frame;
  583. __le32 fse_invalid_peer;
  584. __le32 mec_notify;
  585. } __packed;
  586. struct ath12k_htt_tx_de_classify_failed_stats_tlv {
  587. __le32 ap_bss_peer_not_found;
  588. __le32 ap_bcast_mcast_no_peer;
  589. __le32 sta_delete_in_progress;
  590. __le32 ibss_no_bss_peer;
  591. __le32 invalid_vdev_type;
  592. __le32 invalid_ast_peer_entry;
  593. __le32 peer_entry_invalid;
  594. __le32 ethertype_not_ip;
  595. __le32 eapol_lookup_failed;
  596. __le32 qpeer_not_allow_data;
  597. __le32 fse_tid_override;
  598. __le32 ipv6_jumbogram_zero_length;
  599. __le32 qos_to_non_qos_in_prog;
  600. __le32 ap_bcast_mcast_eapol;
  601. __le32 unicast_on_ap_bss_peer;
  602. __le32 ap_vdev_invalid;
  603. __le32 incomplete_llc;
  604. __le32 eapol_duplicate_m3;
  605. __le32 eapol_duplicate_m4;
  606. } __packed;
  607. struct ath12k_htt_tx_de_classify_status_stats_tlv {
  608. __le32 eok;
  609. __le32 classify_done;
  610. __le32 lookup_failed;
  611. __le32 send_host_dhcp;
  612. __le32 send_host_mcast;
  613. __le32 send_host_unknown_dest;
  614. __le32 send_host;
  615. __le32 status_invalid;
  616. } __packed;
  617. struct ath12k_htt_tx_de_enqueue_packets_stats_tlv {
  618. __le32 enqueued_pkts;
  619. __le32 to_tqm;
  620. __le32 to_tqm_bypass;
  621. } __packed;
  622. struct ath12k_htt_tx_de_enqueue_discard_stats_tlv {
  623. __le32 discarded_pkts;
  624. __le32 local_frames;
  625. __le32 is_ext_msdu;
  626. } __packed;
  627. struct ath12k_htt_tx_de_compl_stats_tlv {
  628. __le32 tcl_dummy_frame;
  629. __le32 tqm_dummy_frame;
  630. __le32 tqm_notify_frame;
  631. __le32 fw2wbm_enq;
  632. __le32 tqm_bypass_frame;
  633. } __packed;
  634. #endif