treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / net / wireless / ath / ath11k / debug_htt_stats.h
blob4bdb62dd7b8dcb467edd02a4e0b72757ee0a599d
1 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
2 /*
3 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
4 */
6 #ifndef DEBUG_HTT_STATS_H
7 #define DEBUG_HTT_STATS_H
9 #define HTT_STATS_COOKIE_LSB GENMASK_ULL(31, 0)
10 #define HTT_STATS_COOKIE_MSB GENMASK_ULL(63, 32)
11 #define HTT_STATS_MAGIC_VALUE 0xF0F0F0F0
13 enum htt_tlv_tag_t {
14 HTT_STATS_TX_PDEV_CMN_TAG = 0,
15 HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1,
16 HTT_STATS_TX_PDEV_SIFS_TAG = 2,
17 HTT_STATS_TX_PDEV_FLUSH_TAG = 3,
18 HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4,
19 HTT_STATS_STRING_TAG = 5,
20 HTT_STATS_TX_HWQ_CMN_TAG = 6,
21 HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7,
22 HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8,
23 HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9,
24 HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10,
25 HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11,
26 HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12,
27 HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13,
28 HTT_STATS_TX_TQM_CMN_TAG = 14,
29 HTT_STATS_TX_TQM_PDEV_TAG = 15,
30 HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16,
31 HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17,
32 HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18,
33 HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19,
34 HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20,
35 HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21,
36 HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22,
37 HTT_STATS_TX_DE_CMN_TAG = 23,
38 HTT_STATS_RING_IF_TAG = 24,
39 HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25,
40 HTT_STATS_SFM_CMN_TAG = 26,
41 HTT_STATS_SRING_STATS_TAG = 27,
42 HTT_STATS_RX_PDEV_FW_STATS_TAG = 28,
43 HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29,
44 HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30,
45 HTT_STATS_RX_SOC_FW_STATS_TAG = 31,
46 HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32,
47 HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33,
48 HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34,
49 HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35,
50 HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36,
51 HTT_STATS_TX_SCHED_CMN_TAG = 37,
52 HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38,
53 HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39,
54 HTT_STATS_RING_IF_CMN_TAG = 40,
55 HTT_STATS_SFM_CLIENT_USER_TAG = 41,
56 HTT_STATS_SFM_CLIENT_TAG = 42,
57 HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43,
58 HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44,
59 HTT_STATS_SRING_CMN_TAG = 45,
60 HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46,
61 HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47,
62 HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48,
63 HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49,
64 HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50,
65 HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51,
66 HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52,
67 HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53,
68 HTT_STATS_HW_INTR_MISC_TAG = 54,
69 HTT_STATS_HW_WD_TIMEOUT_TAG = 55,
70 HTT_STATS_HW_PDEV_ERRS_TAG = 56,
71 HTT_STATS_COUNTER_NAME_TAG = 57,
72 HTT_STATS_TX_TID_DETAILS_TAG = 58,
73 HTT_STATS_RX_TID_DETAILS_TAG = 59,
74 HTT_STATS_PEER_STATS_CMN_TAG = 60,
75 HTT_STATS_PEER_DETAILS_TAG = 61,
76 HTT_STATS_PEER_TX_RATE_STATS_TAG = 62,
77 HTT_STATS_PEER_RX_RATE_STATS_TAG = 63,
78 HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64,
79 HTT_STATS_TX_DE_COMPL_STATS_TAG = 65,
80 HTT_STATS_WHAL_TX_TAG = 66,
81 HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67,
82 HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68,
83 HTT_STATS_TX_TID_DETAILS_V1_TAG = 69,
84 HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70,
85 HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71,
86 HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72,
87 HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73,
88 HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74,
89 HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75,
90 HTT_STATS_PDEV_TWT_SESSION_TAG = 76,
91 HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77,
92 HTT_STATS_RX_REFILL_REO_ERR_TAG = 78,
93 HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79,
94 HTT_STATS_TX_SOUNDING_STATS_TAG = 80,
95 HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81,
96 HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82,
97 HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83,
98 HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84,
99 HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85,
100 HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86,
101 HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87,
102 HTT_STATS_PDEV_OBSS_PD_TAG = 88,
104 HTT_STATS_MAX_TAG,
107 #define HTT_STATS_MAX_STRING_SZ32 4
108 #define HTT_STATS_MACID_INVALID 0xff
109 #define HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS 10
110 #define HTT_TX_HWQ_MAX_CMD_RESULT_STATS 13
111 #define HTT_TX_HWQ_MAX_CMD_STALL_STATS 5
112 #define HTT_TX_HWQ_MAX_FES_RESULT_STATS 10
114 enum htt_tx_pdev_underrun_enum {
115 HTT_STATS_TX_PDEV_NO_DATA_UNDERRUN = 0,
116 HTT_STATS_TX_PDEV_DATA_UNDERRUN_BETWEEN_MPDU = 1,
117 HTT_STATS_TX_PDEV_DATA_UNDERRUN_WITHIN_MPDU = 2,
118 HTT_TX_PDEV_MAX_URRN_STATS = 3,
121 #define HTT_TX_PDEV_MAX_FLUSH_REASON_STATS 71
122 #define HTT_TX_PDEV_MAX_SIFS_BURST_STATS 9
123 #define HTT_TX_PDEV_MAX_SIFS_BURST_HIST_STATS 10
124 #define HTT_TX_PDEV_MAX_PHY_ERR_STATS 18
125 #define HTT_TX_PDEV_SCHED_TX_MODE_MAX 4
126 #define HTT_TX_PDEV_NUM_SCHED_ORDER_LOG 20
128 #define HTT_RX_STATS_REFILL_MAX_RING 4
129 #define HTT_RX_STATS_RXDMA_MAX_ERR 16
130 #define HTT_RX_STATS_FW_DROP_REASON_MAX 16
132 /* Bytes stored in little endian order */
133 /* Length should be multiple of DWORD */
134 struct htt_stats_string_tlv {
135 u32 data[0]; /* Can be variable length */
136 } __packed;
138 /* == TX PDEV STATS == */
139 struct htt_tx_pdev_stats_cmn_tlv {
140 u32 mac_id__word;
141 u32 hw_queued;
142 u32 hw_reaped;
143 u32 underrun;
144 u32 hw_paused;
145 u32 hw_flush;
146 u32 hw_filt;
147 u32 tx_abort;
148 u32 mpdu_requed;
149 u32 tx_xretry;
150 u32 data_rc;
151 u32 mpdu_dropped_xretry;
152 u32 illgl_rate_phy_err;
153 u32 cont_xretry;
154 u32 tx_timeout;
155 u32 pdev_resets;
156 u32 phy_underrun;
157 u32 txop_ovf;
158 u32 seq_posted;
159 u32 seq_failed_queueing;
160 u32 seq_completed;
161 u32 seq_restarted;
162 u32 mu_seq_posted;
163 u32 seq_switch_hw_paused;
164 u32 next_seq_posted_dsr;
165 u32 seq_posted_isr;
166 u32 seq_ctrl_cached;
167 u32 mpdu_count_tqm;
168 u32 msdu_count_tqm;
169 u32 mpdu_removed_tqm;
170 u32 msdu_removed_tqm;
171 u32 mpdus_sw_flush;
172 u32 mpdus_hw_filter;
173 u32 mpdus_truncated;
174 u32 mpdus_ack_failed;
175 u32 mpdus_expired;
176 u32 mpdus_seq_hw_retry;
177 u32 ack_tlv_proc;
178 u32 coex_abort_mpdu_cnt_valid;
179 u32 coex_abort_mpdu_cnt;
180 u32 num_total_ppdus_tried_ota;
181 u32 num_data_ppdus_tried_ota;
182 u32 local_ctrl_mgmt_enqued;
183 u32 local_ctrl_mgmt_freed;
184 u32 local_data_enqued;
185 u32 local_data_freed;
186 u32 mpdu_tried;
187 u32 isr_wait_seq_posted;
189 u32 tx_active_dur_us_low;
190 u32 tx_active_dur_us_high;
193 /* NOTE: Variable length TLV, use length spec to infer array size */
194 struct htt_tx_pdev_stats_urrn_tlv_v {
195 u32 urrn_stats[0]; /* HTT_TX_PDEV_MAX_URRN_STATS */
198 /* NOTE: Variable length TLV, use length spec to infer array size */
199 struct htt_tx_pdev_stats_flush_tlv_v {
200 u32 flush_errs[0]; /* HTT_TX_PDEV_MAX_FLUSH_REASON_STATS */
203 /* NOTE: Variable length TLV, use length spec to infer array size */
204 struct htt_tx_pdev_stats_sifs_tlv_v {
205 u32 sifs_status[0]; /* HTT_TX_PDEV_MAX_SIFS_BURST_STATS */
208 /* NOTE: Variable length TLV, use length spec to infer array size */
209 struct htt_tx_pdev_stats_phy_err_tlv_v {
210 u32 phy_errs[0]; /* HTT_TX_PDEV_MAX_PHY_ERR_STATS */
213 /* NOTE: Variable length TLV, use length spec to infer array size */
214 struct htt_tx_pdev_stats_sifs_hist_tlv_v {
215 u32 sifs_hist_status[0]; /* HTT_TX_PDEV_SIFS_BURST_HIST_STATS */
218 struct htt_tx_pdev_stats_tx_ppdu_stats_tlv_v {
219 u32 num_data_ppdus_legacy_su;
220 u32 num_data_ppdus_ac_su;
221 u32 num_data_ppdus_ax_su;
222 u32 num_data_ppdus_ac_su_txbf;
223 u32 num_data_ppdus_ax_su_txbf;
226 /* NOTE: Variable length TLV, use length spec to infer array size .
228 * Tried_mpdu_cnt_hist is the histogram of MPDUs tries per HWQ.
229 * The tries here is the count of the MPDUS within a PPDU that the
230 * HW had attempted to transmit on air, for the HWSCH Schedule
231 * command submitted by FW.It is not the retry attempts.
232 * The histogram bins are 0-29, 30-59, 60-89 and so on. The are
233 * 10 bins in this histogram. They are defined in FW using the
234 * following macros
235 * #define WAL_MAX_TRIED_MPDU_CNT_HISTOGRAM 9
236 * #define WAL_TRIED_MPDU_CNT_HISTOGRAM_INTERVAL 30
238 struct htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v {
239 u32 hist_bin_size;
240 u32 tried_mpdu_cnt_hist[0]; /* HTT_TX_PDEV_TRIED_MPDU_CNT_HIST */
243 /* == SOC ERROR STATS == */
245 /* =============== PDEV ERROR STATS ============== */
246 #define HTT_STATS_MAX_HW_INTR_NAME_LEN 8
247 struct htt_hw_stats_intr_misc_tlv {
248 /* Stored as little endian */
249 u8 hw_intr_name[HTT_STATS_MAX_HW_INTR_NAME_LEN];
250 u32 mask;
251 u32 count;
254 #define HTT_STATS_MAX_HW_MODULE_NAME_LEN 8
255 struct htt_hw_stats_wd_timeout_tlv {
256 /* Stored as little endian */
257 u8 hw_module_name[HTT_STATS_MAX_HW_MODULE_NAME_LEN];
258 u32 count;
261 struct htt_hw_stats_pdev_errs_tlv {
262 u32 mac_id__word; /* BIT [ 7 : 0] : mac_id */
263 u32 tx_abort;
264 u32 tx_abort_fail_count;
265 u32 rx_abort;
266 u32 rx_abort_fail_count;
267 u32 warm_reset;
268 u32 cold_reset;
269 u32 tx_flush;
270 u32 tx_glb_reset;
271 u32 tx_txq_reset;
272 u32 rx_timeout_reset;
275 struct htt_hw_stats_whal_tx_tlv {
276 u32 mac_id__word;
277 u32 last_unpause_ppdu_id;
278 u32 hwsch_unpause_wait_tqm_write;
279 u32 hwsch_dummy_tlv_skipped;
280 u32 hwsch_misaligned_offset_received;
281 u32 hwsch_reset_count;
282 u32 hwsch_dev_reset_war;
283 u32 hwsch_delayed_pause;
284 u32 hwsch_long_delayed_pause;
285 u32 sch_rx_ppdu_no_response;
286 u32 sch_selfgen_response;
287 u32 sch_rx_sifs_resp_trigger;
290 /* ============ PEER STATS ============ */
291 struct htt_msdu_flow_stats_tlv {
292 u32 last_update_timestamp;
293 u32 last_add_timestamp;
294 u32 last_remove_timestamp;
295 u32 total_processed_msdu_count;
296 u32 cur_msdu_count_in_flowq;
297 u32 sw_peer_id;
298 u32 tx_flow_no__tid_num__drop_rule;
299 u32 last_cycle_enqueue_count;
300 u32 last_cycle_dequeue_count;
301 u32 last_cycle_drop_count;
302 u32 current_drop_th;
305 #define MAX_HTT_TID_NAME 8
307 /* Tidq stats */
308 struct htt_tx_tid_stats_tlv {
309 /* Stored as little endian */
310 u8 tid_name[MAX_HTT_TID_NAME];
311 u32 sw_peer_id__tid_num;
312 u32 num_sched_pending__num_ppdu_in_hwq;
313 u32 tid_flags;
314 u32 hw_queued;
315 u32 hw_reaped;
316 u32 mpdus_hw_filter;
318 u32 qdepth_bytes;
319 u32 qdepth_num_msdu;
320 u32 qdepth_num_mpdu;
321 u32 last_scheduled_tsmp;
322 u32 pause_module_id;
323 u32 block_module_id;
324 u32 tid_tx_airtime;
327 /* Tidq stats */
328 struct htt_tx_tid_stats_v1_tlv {
329 /* Stored as little endian */
330 u8 tid_name[MAX_HTT_TID_NAME];
331 u32 sw_peer_id__tid_num;
332 u32 num_sched_pending__num_ppdu_in_hwq;
333 u32 tid_flags;
334 u32 max_qdepth_bytes;
335 u32 max_qdepth_n_msdus;
336 u32 rsvd;
338 u32 qdepth_bytes;
339 u32 qdepth_num_msdu;
340 u32 qdepth_num_mpdu;
341 u32 last_scheduled_tsmp;
342 u32 pause_module_id;
343 u32 block_module_id;
344 u32 tid_tx_airtime;
345 u32 allow_n_flags;
346 u32 sendn_frms_allowed;
349 struct htt_rx_tid_stats_tlv {
350 u32 sw_peer_id__tid_num;
351 u8 tid_name[MAX_HTT_TID_NAME];
352 u32 dup_in_reorder;
353 u32 dup_past_outside_window;
354 u32 dup_past_within_window;
355 u32 rxdesc_err_decrypt;
356 u32 tid_rx_airtime;
359 #define HTT_MAX_COUNTER_NAME 8
360 struct htt_counter_tlv {
361 u8 counter_name[HTT_MAX_COUNTER_NAME];
362 u32 count;
365 struct htt_peer_stats_cmn_tlv {
366 u32 ppdu_cnt;
367 u32 mpdu_cnt;
368 u32 msdu_cnt;
369 u32 pause_bitmap;
370 u32 block_bitmap;
371 u32 current_timestamp;
372 u32 peer_tx_airtime;
373 u32 peer_rx_airtime;
374 s32 rssi;
375 u32 peer_enqueued_count_low;
376 u32 peer_enqueued_count_high;
377 u32 peer_dequeued_count_low;
378 u32 peer_dequeued_count_high;
379 u32 peer_dropped_count_low;
380 u32 peer_dropped_count_high;
381 u32 ppdu_transmitted_bytes_low;
382 u32 ppdu_transmitted_bytes_high;
383 u32 peer_ttl_removed_count;
384 u32 inactive_time;
387 struct htt_peer_details_tlv {
388 u32 peer_type;
389 u32 sw_peer_id;
390 u32 vdev_pdev_ast_idx;
391 struct htt_mac_addr mac_addr;
392 u32 peer_flags;
393 u32 qpeer_flags;
396 enum htt_stats_param_type {
397 HTT_STATS_PREAM_OFDM,
398 HTT_STATS_PREAM_CCK,
399 HTT_STATS_PREAM_HT,
400 HTT_STATS_PREAM_VHT,
401 HTT_STATS_PREAM_HE,
402 HTT_STATS_PREAM_RSVD,
403 HTT_STATS_PREAM_RSVD1,
405 HTT_STATS_PREAM_COUNT,
408 #define HTT_TX_PEER_STATS_NUM_MCS_COUNTERS 12
409 #define HTT_TX_PEER_STATS_NUM_GI_COUNTERS 4
410 #define HTT_TX_PEER_STATS_NUM_DCM_COUNTERS 5
411 #define HTT_TX_PEER_STATS_NUM_BW_COUNTERS 4
412 #define HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS 8
413 #define HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
415 struct htt_tx_peer_rate_stats_tlv {
416 u32 tx_ldpc;
417 u32 rts_cnt;
418 u32 ack_rssi;
420 u32 tx_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
421 u32 tx_su_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
422 u32 tx_mu_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
423 /* element 0,1, ...7 -> NSS 1,2, ...8 */
424 u32 tx_nss[HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS];
425 /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
426 u32 tx_bw[HTT_TX_PEER_STATS_NUM_BW_COUNTERS];
427 u32 tx_stbc[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
428 u32 tx_pream[HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES];
430 /* Counters to track number of tx packets in each GI
431 * (400us, 800us, 1600us & 3200us) in each mcs (0-11)
433 u32 tx_gi[HTT_TX_PEER_STATS_NUM_GI_COUNTERS][HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
435 /* Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
436 u32 tx_dcm[HTT_TX_PEER_STATS_NUM_DCM_COUNTERS];
440 #define HTT_RX_PEER_STATS_NUM_MCS_COUNTERS 12
441 #define HTT_RX_PEER_STATS_NUM_GI_COUNTERS 4
442 #define HTT_RX_PEER_STATS_NUM_DCM_COUNTERS 5
443 #define HTT_RX_PEER_STATS_NUM_BW_COUNTERS 4
444 #define HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS 8
445 #define HTT_RX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
447 struct htt_rx_peer_rate_stats_tlv {
448 u32 nsts;
450 /* Number of rx ldpc packets */
451 u32 rx_ldpc;
452 /* Number of rx rts packets */
453 u32 rts_cnt;
455 u32 rssi_mgmt; /* units = dB above noise floor */
456 u32 rssi_data; /* units = dB above noise floor */
457 u32 rssi_comb; /* units = dB above noise floor */
458 u32 rx_mcs[HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
459 /* element 0,1, ...7 -> NSS 1,2, ...8 */
460 u32 rx_nss[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS];
461 u32 rx_dcm[HTT_RX_PEER_STATS_NUM_DCM_COUNTERS];
462 u32 rx_stbc[HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
463 /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
464 u32 rx_bw[HTT_RX_PEER_STATS_NUM_BW_COUNTERS];
465 u32 rx_pream[HTT_RX_PEER_STATS_NUM_PREAMBLE_TYPES];
466 /* units = dB above noise floor */
467 u8 rssi_chain[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS]
468 [HTT_RX_PEER_STATS_NUM_BW_COUNTERS];
470 /* Counters to track number of rx packets in each GI in each mcs (0-11) */
471 u32 rx_gi[HTT_RX_PEER_STATS_NUM_GI_COUNTERS]
472 [HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
475 enum htt_peer_stats_req_mode {
476 HTT_PEER_STATS_REQ_MODE_NO_QUERY,
477 HTT_PEER_STATS_REQ_MODE_QUERY_TQM,
478 HTT_PEER_STATS_REQ_MODE_FLUSH_TQM,
481 enum htt_peer_stats_tlv_enum {
482 HTT_PEER_STATS_CMN_TLV = 0,
483 HTT_PEER_DETAILS_TLV = 1,
484 HTT_TX_PEER_RATE_STATS_TLV = 2,
485 HTT_RX_PEER_RATE_STATS_TLV = 3,
486 HTT_TX_TID_STATS_TLV = 4,
487 HTT_RX_TID_STATS_TLV = 5,
488 HTT_MSDU_FLOW_STATS_TLV = 6,
490 HTT_PEER_STATS_MAX_TLV = 31,
493 /* =========== MUMIMO HWQ stats =========== */
494 /* MU MIMO stats per hwQ */
495 struct htt_tx_hwq_mu_mimo_sch_stats_tlv {
496 u32 mu_mimo_sch_posted;
497 u32 mu_mimo_sch_failed;
498 u32 mu_mimo_ppdu_posted;
501 struct htt_tx_hwq_mu_mimo_mpdu_stats_tlv {
502 u32 mu_mimo_mpdus_queued_usr;
503 u32 mu_mimo_mpdus_tried_usr;
504 u32 mu_mimo_mpdus_failed_usr;
505 u32 mu_mimo_mpdus_requeued_usr;
506 u32 mu_mimo_err_no_ba_usr;
507 u32 mu_mimo_mpdu_underrun_usr;
508 u32 mu_mimo_ampdu_underrun_usr;
511 struct htt_tx_hwq_mu_mimo_cmn_stats_tlv {
512 u32 mac_id__hwq_id__word;
515 /* == TX HWQ STATS == */
516 struct htt_tx_hwq_stats_cmn_tlv {
517 u32 mac_id__hwq_id__word;
519 /* PPDU level stats */
520 u32 xretry;
521 u32 underrun_cnt;
522 u32 flush_cnt;
523 u32 filt_cnt;
524 u32 null_mpdu_bmap;
525 u32 user_ack_failure;
526 u32 ack_tlv_proc;
527 u32 sched_id_proc;
528 u32 null_mpdu_tx_count;
529 u32 mpdu_bmap_not_recvd;
531 /* Selfgen stats per hwQ */
532 u32 num_bar;
533 u32 rts;
534 u32 cts2self;
535 u32 qos_null;
537 /* MPDU level stats */
538 u32 mpdu_tried_cnt;
539 u32 mpdu_queued_cnt;
540 u32 mpdu_ack_fail_cnt;
541 u32 mpdu_filt_cnt;
542 u32 false_mpdu_ack_count;
544 u32 txq_timeout;
547 /* NOTE: Variable length TLV, use length spec to infer array size */
548 struct htt_tx_hwq_difs_latency_stats_tlv_v {
549 u32 hist_intvl;
550 /* histogram of ppdu post to hwsch - > cmd status received */
551 u32 difs_latency_hist[0]; /* HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS */
554 /* NOTE: Variable length TLV, use length spec to infer array size */
555 struct htt_tx_hwq_cmd_result_stats_tlv_v {
556 /* Histogram of sched cmd result */
557 u32 cmd_result[0]; /* HTT_TX_HWQ_MAX_CMD_RESULT_STATS */
560 /* NOTE: Variable length TLV, use length spec to infer array size */
561 struct htt_tx_hwq_cmd_stall_stats_tlv_v {
562 /* Histogram of various pause conitions */
563 u32 cmd_stall_status[0]; /* HTT_TX_HWQ_MAX_CMD_STALL_STATS */
566 /* NOTE: Variable length TLV, use length spec to infer array size */
567 struct htt_tx_hwq_fes_result_stats_tlv_v {
568 /* Histogram of number of user fes result */
569 u32 fes_result[0]; /* HTT_TX_HWQ_MAX_FES_RESULT_STATS */
572 /* NOTE: Variable length TLV, use length spec to infer array size
574 * The hwq_tried_mpdu_cnt_hist is a histogram of MPDUs tries per HWQ.
575 * The tries here is the count of the MPDUS within a PPDU that the HW
576 * had attempted to transmit on air, for the HWSCH Schedule command
577 * submitted by FW in this HWQ .It is not the retry attempts. The
578 * histogram bins are 0-29, 30-59, 60-89 and so on. The are 10 bins
579 * in this histogram.
580 * they are defined in FW using the following macros
581 * #define WAL_MAX_TRIED_MPDU_CNT_HISTOGRAM 9
582 * #define WAL_TRIED_MPDU_CNT_HISTOGRAM_INTERVAL 30
584 struct htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v {
585 u32 hist_bin_size;
586 /* Histogram of number of mpdus on tried mpdu */
587 u32 tried_mpdu_cnt_hist[0]; /* HTT_TX_HWQ_TRIED_MPDU_CNT_HIST */
590 /* NOTE: Variable length TLV, use length spec to infer array size
592 * The txop_used_cnt_hist is the histogram of txop per burst. After
593 * completing the burst, we identify the txop used in the burst and
594 * incr the corresponding bin.
595 * Each bin represents 1ms & we have 10 bins in this histogram.
596 * they are deined in FW using the following macros
597 * #define WAL_MAX_TXOP_USED_CNT_HISTOGRAM 10
598 * #define WAL_TXOP_USED_HISTOGRAM_INTERVAL 1000 ( 1 ms )
600 struct htt_tx_hwq_txop_used_cnt_hist_tlv_v {
601 /* Histogram of txop used cnt */
602 u32 txop_used_cnt_hist[0]; /* HTT_TX_HWQ_TXOP_USED_CNT_HIST */
605 /* == TX SELFGEN STATS == */
606 struct htt_tx_selfgen_cmn_stats_tlv {
607 u32 mac_id__word;
608 u32 su_bar;
609 u32 rts;
610 u32 cts2self;
611 u32 qos_null;
612 u32 delayed_bar_1; /* MU user 1 */
613 u32 delayed_bar_2; /* MU user 2 */
614 u32 delayed_bar_3; /* MU user 3 */
615 u32 delayed_bar_4; /* MU user 4 */
616 u32 delayed_bar_5; /* MU user 5 */
617 u32 delayed_bar_6; /* MU user 6 */
618 u32 delayed_bar_7; /* MU user 7 */
621 struct htt_tx_selfgen_ac_stats_tlv {
622 /* 11AC */
623 u32 ac_su_ndpa;
624 u32 ac_su_ndp;
625 u32 ac_mu_mimo_ndpa;
626 u32 ac_mu_mimo_ndp;
627 u32 ac_mu_mimo_brpoll_1; /* MU user 1 */
628 u32 ac_mu_mimo_brpoll_2; /* MU user 2 */
629 u32 ac_mu_mimo_brpoll_3; /* MU user 3 */
632 struct htt_tx_selfgen_ax_stats_tlv {
633 /* 11AX */
634 u32 ax_su_ndpa;
635 u32 ax_su_ndp;
636 u32 ax_mu_mimo_ndpa;
637 u32 ax_mu_mimo_ndp;
638 u32 ax_mu_mimo_brpoll_1; /* MU user 1 */
639 u32 ax_mu_mimo_brpoll_2; /* MU user 2 */
640 u32 ax_mu_mimo_brpoll_3; /* MU user 3 */
641 u32 ax_mu_mimo_brpoll_4; /* MU user 4 */
642 u32 ax_mu_mimo_brpoll_5; /* MU user 5 */
643 u32 ax_mu_mimo_brpoll_6; /* MU user 6 */
644 u32 ax_mu_mimo_brpoll_7; /* MU user 7 */
645 u32 ax_basic_trigger;
646 u32 ax_bsr_trigger;
647 u32 ax_mu_bar_trigger;
648 u32 ax_mu_rts_trigger;
651 struct htt_tx_selfgen_ac_err_stats_tlv {
652 /* 11AC error stats */
653 u32 ac_su_ndp_err;
654 u32 ac_su_ndpa_err;
655 u32 ac_mu_mimo_ndpa_err;
656 u32 ac_mu_mimo_ndp_err;
657 u32 ac_mu_mimo_brp1_err;
658 u32 ac_mu_mimo_brp2_err;
659 u32 ac_mu_mimo_brp3_err;
662 struct htt_tx_selfgen_ax_err_stats_tlv {
663 /* 11AX error stats */
664 u32 ax_su_ndp_err;
665 u32 ax_su_ndpa_err;
666 u32 ax_mu_mimo_ndpa_err;
667 u32 ax_mu_mimo_ndp_err;
668 u32 ax_mu_mimo_brp1_err;
669 u32 ax_mu_mimo_brp2_err;
670 u32 ax_mu_mimo_brp3_err;
671 u32 ax_mu_mimo_brp4_err;
672 u32 ax_mu_mimo_brp5_err;
673 u32 ax_mu_mimo_brp6_err;
674 u32 ax_mu_mimo_brp7_err;
675 u32 ax_basic_trigger_err;
676 u32 ax_bsr_trigger_err;
677 u32 ax_mu_bar_trigger_err;
678 u32 ax_mu_rts_trigger_err;
681 /* == TX MU STATS == */
682 #define HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS 4
683 #define HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS 8
684 #define HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS 74
686 struct htt_tx_pdev_mu_mimo_sch_stats_tlv {
687 /* mu-mimo sw sched cmd stats */
688 u32 mu_mimo_sch_posted;
689 u32 mu_mimo_sch_failed;
690 /* MU PPDU stats per hwQ */
691 u32 mu_mimo_ppdu_posted;
693 * Counts the number of users in each transmission of
694 * the given TX mode.
696 * Index is the number of users - 1.
698 u32 ac_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
699 u32 ax_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
700 u32 ax_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
703 struct htt_tx_pdev_mu_mimo_mpdu_stats_tlv {
704 u32 mu_mimo_mpdus_queued_usr;
705 u32 mu_mimo_mpdus_tried_usr;
706 u32 mu_mimo_mpdus_failed_usr;
707 u32 mu_mimo_mpdus_requeued_usr;
708 u32 mu_mimo_err_no_ba_usr;
709 u32 mu_mimo_mpdu_underrun_usr;
710 u32 mu_mimo_ampdu_underrun_usr;
712 u32 ax_mu_mimo_mpdus_queued_usr;
713 u32 ax_mu_mimo_mpdus_tried_usr;
714 u32 ax_mu_mimo_mpdus_failed_usr;
715 u32 ax_mu_mimo_mpdus_requeued_usr;
716 u32 ax_mu_mimo_err_no_ba_usr;
717 u32 ax_mu_mimo_mpdu_underrun_usr;
718 u32 ax_mu_mimo_ampdu_underrun_usr;
720 u32 ax_ofdma_mpdus_queued_usr;
721 u32 ax_ofdma_mpdus_tried_usr;
722 u32 ax_ofdma_mpdus_failed_usr;
723 u32 ax_ofdma_mpdus_requeued_usr;
724 u32 ax_ofdma_err_no_ba_usr;
725 u32 ax_ofdma_mpdu_underrun_usr;
726 u32 ax_ofdma_ampdu_underrun_usr;
729 #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_AC 1
730 #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_AX 2
731 #define HTT_STATS_TX_SCHED_MODE_MU_OFDMA_AX 3
733 struct htt_tx_pdev_mpdu_stats_tlv {
734 /* mpdu level stats */
735 u32 mpdus_queued_usr;
736 u32 mpdus_tried_usr;
737 u32 mpdus_failed_usr;
738 u32 mpdus_requeued_usr;
739 u32 err_no_ba_usr;
740 u32 mpdu_underrun_usr;
741 u32 ampdu_underrun_usr;
742 u32 user_index;
743 u32 tx_sched_mode; /* HTT_STATS_TX_SCHED_MODE_xxx */
746 /* == TX SCHED STATS == */
747 /* NOTE: Variable length TLV, use length spec to infer array size */
748 struct htt_sched_txq_cmd_posted_tlv_v {
749 u32 sched_cmd_posted[0]; /* HTT_TX_PDEV_SCHED_TX_MODE_MAX */
752 /* NOTE: Variable length TLV, use length spec to infer array size */
753 struct htt_sched_txq_cmd_reaped_tlv_v {
754 u32 sched_cmd_reaped[0]; /* HTT_TX_PDEV_SCHED_TX_MODE_MAX */
757 /* NOTE: Variable length TLV, use length spec to infer array size */
758 struct htt_sched_txq_sched_order_su_tlv_v {
759 u32 sched_order_su[0]; /* HTT_TX_PDEV_NUM_SCHED_ORDER_LOG */
762 enum htt_sched_txq_sched_ineligibility_tlv_enum {
763 HTT_SCHED_TID_SKIP_SCHED_MASK_DISABLED = 0,
764 HTT_SCHED_TID_SKIP_NOTIFY_MPDU,
765 HTT_SCHED_TID_SKIP_MPDU_STATE_INVALID,
766 HTT_SCHED_TID_SKIP_SCHED_DISABLED,
767 HTT_SCHED_TID_SKIP_TQM_BYPASS_CMD_PENDING,
768 HTT_SCHED_TID_SKIP_SECOND_SU_SCHEDULE,
770 HTT_SCHED_TID_SKIP_CMD_SLOT_NOT_AVAIL,
771 HTT_SCHED_TID_SKIP_NO_ENQ,
772 HTT_SCHED_TID_SKIP_LOW_ENQ,
773 HTT_SCHED_TID_SKIP_PAUSED,
774 HTT_SCHED_TID_SKIP_UL,
775 HTT_SCHED_TID_REMOVE_PAUSED,
776 HTT_SCHED_TID_REMOVE_NO_ENQ,
777 HTT_SCHED_TID_REMOVE_UL,
778 HTT_SCHED_TID_QUERY,
779 HTT_SCHED_TID_SU_ONLY,
780 HTT_SCHED_TID_ELIGIBLE,
781 HTT_SCHED_INELIGIBILITY_MAX,
784 /* NOTE: Variable length TLV, use length spec to infer array size */
785 struct htt_sched_txq_sched_ineligibility_tlv_v {
786 /* indexed by htt_sched_txq_sched_ineligibility_tlv_enum */
787 u32 sched_ineligibility[0];
790 struct htt_tx_pdev_stats_sched_per_txq_tlv {
791 u32 mac_id__txq_id__word;
792 u32 sched_policy;
793 u32 last_sched_cmd_posted_timestamp;
794 u32 last_sched_cmd_compl_timestamp;
795 u32 sched_2_tac_lwm_count;
796 u32 sched_2_tac_ring_full;
797 u32 sched_cmd_post_failure;
798 u32 num_active_tids;
799 u32 num_ps_schedules;
800 u32 sched_cmds_pending;
801 u32 num_tid_register;
802 u32 num_tid_unregister;
803 u32 num_qstats_queried;
804 u32 qstats_update_pending;
805 u32 last_qstats_query_timestamp;
806 u32 num_tqm_cmdq_full;
807 u32 num_de_sched_algo_trigger;
808 u32 num_rt_sched_algo_trigger;
809 u32 num_tqm_sched_algo_trigger;
810 u32 notify_sched;
811 u32 dur_based_sendn_term;
814 struct htt_stats_tx_sched_cmn_tlv {
815 /* BIT [ 7 : 0] :- mac_id
816 * BIT [31 : 8] :- reserved
818 u32 mac_id__word;
819 /* Current timestamp */
820 u32 current_timestamp;
823 /* == TQM STATS == */
824 #define HTT_TX_TQM_MAX_GEN_MPDU_END_REASON 16
825 #define HTT_TX_TQM_MAX_LIST_MPDU_END_REASON 16
826 #define HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS 16
828 /* NOTE: Variable length TLV, use length spec to infer array size */
829 struct htt_tx_tqm_gen_mpdu_stats_tlv_v {
830 u32 gen_mpdu_end_reason[0]; /* HTT_TX_TQM_MAX_GEN_MPDU_END_REASON */
833 /* NOTE: Variable length TLV, use length spec to infer array size */
834 struct htt_tx_tqm_list_mpdu_stats_tlv_v {
835 u32 list_mpdu_end_reason[0]; /* HTT_TX_TQM_MAX_LIST_MPDU_END_REASON */
838 /* NOTE: Variable length TLV, use length spec to infer array size */
839 struct htt_tx_tqm_list_mpdu_cnt_tlv_v {
840 u32 list_mpdu_cnt_hist[0];
841 /* HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS */
844 struct htt_tx_tqm_pdev_stats_tlv_v {
845 u32 msdu_count;
846 u32 mpdu_count;
847 u32 remove_msdu;
848 u32 remove_mpdu;
849 u32 remove_msdu_ttl;
850 u32 send_bar;
851 u32 bar_sync;
852 u32 notify_mpdu;
853 u32 sync_cmd;
854 u32 write_cmd;
855 u32 hwsch_trigger;
856 u32 ack_tlv_proc;
857 u32 gen_mpdu_cmd;
858 u32 gen_list_cmd;
859 u32 remove_mpdu_cmd;
860 u32 remove_mpdu_tried_cmd;
861 u32 mpdu_queue_stats_cmd;
862 u32 mpdu_head_info_cmd;
863 u32 msdu_flow_stats_cmd;
864 u32 remove_msdu_cmd;
865 u32 remove_msdu_ttl_cmd;
866 u32 flush_cache_cmd;
867 u32 update_mpduq_cmd;
868 u32 enqueue;
869 u32 enqueue_notify;
870 u32 notify_mpdu_at_head;
871 u32 notify_mpdu_state_valid;
873 * On receiving TQM_FLOW_NOT_EMPTY_STATUS from TQM, (on MSDUs being enqueued
874 * the flow is non empty), if the number of MSDUs is greater than the threshold,
875 * notify is incremented. UDP_THRESH counters are for UDP MSDUs, and NONUDP are
876 * for non-UDP MSDUs.
877 * MSDUQ_SWNOTIFY_UDP_THRESH1 threshold - sched_udp_notify1 is incremented
878 * MSDUQ_SWNOTIFY_UDP_THRESH2 threshold - sched_udp_notify2 is incremented
879 * MSDUQ_SWNOTIFY_NONUDP_THRESH1 threshold - sched_nonudp_notify1 is incremented
880 * MSDUQ_SWNOTIFY_NONUDP_THRESH2 threshold - sched_nonudp_notify2 is incremented
882 * Notify signifies that we trigger the scheduler.
884 u32 sched_udp_notify1;
885 u32 sched_udp_notify2;
886 u32 sched_nonudp_notify1;
887 u32 sched_nonudp_notify2;
890 struct htt_tx_tqm_cmn_stats_tlv {
891 u32 mac_id__word;
892 u32 max_cmdq_id;
893 u32 list_mpdu_cnt_hist_intvl;
895 /* Global stats */
896 u32 add_msdu;
897 u32 q_empty;
898 u32 q_not_empty;
899 u32 drop_notification;
900 u32 desc_threshold;
903 struct htt_tx_tqm_error_stats_tlv {
904 /* Error stats */
905 u32 q_empty_failure;
906 u32 q_not_empty_failure;
907 u32 add_msdu_failure;
910 /* == TQM CMDQ stats == */
911 struct htt_tx_tqm_cmdq_status_tlv {
912 u32 mac_id__cmdq_id__word;
913 u32 sync_cmd;
914 u32 write_cmd;
915 u32 gen_mpdu_cmd;
916 u32 mpdu_queue_stats_cmd;
917 u32 mpdu_head_info_cmd;
918 u32 msdu_flow_stats_cmd;
919 u32 remove_mpdu_cmd;
920 u32 remove_msdu_cmd;
921 u32 flush_cache_cmd;
922 u32 update_mpduq_cmd;
923 u32 update_msduq_cmd;
926 /* == TX-DE STATS == */
927 /* Structures for tx de stats */
928 struct htt_tx_de_eapol_packets_stats_tlv {
929 u32 m1_packets;
930 u32 m2_packets;
931 u32 m3_packets;
932 u32 m4_packets;
933 u32 g1_packets;
934 u32 g2_packets;
937 struct htt_tx_de_classify_failed_stats_tlv {
938 u32 ap_bss_peer_not_found;
939 u32 ap_bcast_mcast_no_peer;
940 u32 sta_delete_in_progress;
941 u32 ibss_no_bss_peer;
942 u32 invalid_vdev_type;
943 u32 invalid_ast_peer_entry;
944 u32 peer_entry_invalid;
945 u32 ethertype_not_ip;
946 u32 eapol_lookup_failed;
947 u32 qpeer_not_allow_data;
948 u32 fse_tid_override;
949 u32 ipv6_jumbogram_zero_length;
950 u32 qos_to_non_qos_in_prog;
953 struct htt_tx_de_classify_stats_tlv {
954 u32 arp_packets;
955 u32 igmp_packets;
956 u32 dhcp_packets;
957 u32 host_inspected;
958 u32 htt_included;
959 u32 htt_valid_mcs;
960 u32 htt_valid_nss;
961 u32 htt_valid_preamble_type;
962 u32 htt_valid_chainmask;
963 u32 htt_valid_guard_interval;
964 u32 htt_valid_retries;
965 u32 htt_valid_bw_info;
966 u32 htt_valid_power;
967 u32 htt_valid_key_flags;
968 u32 htt_valid_no_encryption;
969 u32 fse_entry_count;
970 u32 fse_priority_be;
971 u32 fse_priority_high;
972 u32 fse_priority_low;
973 u32 fse_traffic_ptrn_be;
974 u32 fse_traffic_ptrn_over_sub;
975 u32 fse_traffic_ptrn_bursty;
976 u32 fse_traffic_ptrn_interactive;
977 u32 fse_traffic_ptrn_periodic;
978 u32 fse_hwqueue_alloc;
979 u32 fse_hwqueue_created;
980 u32 fse_hwqueue_send_to_host;
981 u32 mcast_entry;
982 u32 bcast_entry;
983 u32 htt_update_peer_cache;
984 u32 htt_learning_frame;
985 u32 fse_invalid_peer;
987 * mec_notify is HTT TX WBM multicast echo check notification
988 * from firmware to host. FW sends SA addresses to host for all
989 * multicast/broadcast packets received on STA side.
991 u32 mec_notify;
994 struct htt_tx_de_classify_status_stats_tlv {
995 u32 eok;
996 u32 classify_done;
997 u32 lookup_failed;
998 u32 send_host_dhcp;
999 u32 send_host_mcast;
1000 u32 send_host_unknown_dest;
1001 u32 send_host;
1002 u32 status_invalid;
1005 struct htt_tx_de_enqueue_packets_stats_tlv {
1006 u32 enqueued_pkts;
1007 u32 to_tqm;
1008 u32 to_tqm_bypass;
1011 struct htt_tx_de_enqueue_discard_stats_tlv {
1012 u32 discarded_pkts;
1013 u32 local_frames;
1014 u32 is_ext_msdu;
1017 struct htt_tx_de_compl_stats_tlv {
1018 u32 tcl_dummy_frame;
1019 u32 tqm_dummy_frame;
1020 u32 tqm_notify_frame;
1021 u32 fw2wbm_enq;
1022 u32 tqm_bypass_frame;
1026 * The htt_tx_de_fw2wbm_ring_full_hist_tlv is a histogram of time we waited
1027 * for the fw2wbm ring buffer. we are requesting a buffer in FW2WBM release
1028 * ring,which may fail, due to non availability of buffer. Hence we sleep for
1029 * 200us & again request for it. This is a histogram of time we wait, with
1030 * bin of 200ms & there are 10 bin (2 seconds max)
1031 * They are defined by the following macros in FW
1032 * #define ENTRIES_PER_BIN_COUNT 1000 // per bin 1000 * 200us = 200ms
1033 * #define RING_FULL_BIN_ENTRIES (WAL_TX_DE_FW2WBM_ALLOC_TIMEOUT_COUNT /
1034 * ENTRIES_PER_BIN_COUNT)
1036 struct htt_tx_de_fw2wbm_ring_full_hist_tlv {
1037 u32 fw2wbm_ring_full_hist[0];
1040 struct htt_tx_de_cmn_stats_tlv {
1041 u32 mac_id__word;
1043 /* Global Stats */
1044 u32 tcl2fw_entry_count;
1045 u32 not_to_fw;
1046 u32 invalid_pdev_vdev_peer;
1047 u32 tcl_res_invalid_addrx;
1048 u32 wbm2fw_entry_count;
1049 u32 invalid_pdev;
1052 /* == RING-IF STATS == */
1053 #define HTT_STATS_LOW_WM_BINS 5
1054 #define HTT_STATS_HIGH_WM_BINS 5
1056 struct htt_ring_if_stats_tlv {
1057 u32 base_addr; /* DWORD aligned base memory address of the ring */
1058 u32 elem_size;
1059 u32 num_elems__prefetch_tail_idx;
1060 u32 head_idx__tail_idx;
1061 u32 shadow_head_idx__shadow_tail_idx;
1062 u32 num_tail_incr;
1063 u32 lwm_thresh__hwm_thresh;
1064 u32 overrun_hit_count;
1065 u32 underrun_hit_count;
1066 u32 prod_blockwait_count;
1067 u32 cons_blockwait_count;
1068 u32 low_wm_hit_count[HTT_STATS_LOW_WM_BINS];
1069 u32 high_wm_hit_count[HTT_STATS_HIGH_WM_BINS];
1072 struct htt_ring_if_cmn_tlv {
1073 u32 mac_id__word;
1074 u32 num_records;
1077 /* == SFM STATS == */
1078 /* NOTE: Variable length TLV, use length spec to infer array size */
1079 struct htt_sfm_client_user_tlv_v {
1080 /* Number of DWORDS used per user and per client */
1081 u32 dwords_used_by_user_n[0];
1084 struct htt_sfm_client_tlv {
1085 /* Client ID */
1086 u32 client_id;
1087 /* Minimum number of buffers */
1088 u32 buf_min;
1089 /* Maximum number of buffers */
1090 u32 buf_max;
1091 /* Number of Busy buffers */
1092 u32 buf_busy;
1093 /* Number of Allocated buffers */
1094 u32 buf_alloc;
1095 /* Number of Available/Usable buffers */
1096 u32 buf_avail;
1097 /* Number of users */
1098 u32 num_users;
1101 struct htt_sfm_cmn_tlv {
1102 u32 mac_id__word;
1103 /* Indicates the total number of 128 byte buffers
1104 * in the CMEM that are available for buffer sharing
1106 u32 buf_total;
1107 /* Indicates for certain client or all the clients
1108 * there is no dowrd saved in SFM, refer to SFM_R1_MEM_EMPTY
1110 u32 mem_empty;
1111 /* DEALLOCATE_BUFFERS, refer to register SFM_R0_DEALLOCATE_BUFFERS */
1112 u32 deallocate_bufs;
1113 /* Number of Records */
1114 u32 num_records;
1117 /* == SRNG STATS == */
1118 struct htt_sring_stats_tlv {
1119 u32 mac_id__ring_id__arena__ep;
1120 u32 base_addr_lsb; /* DWORD aligned base memory address of the ring */
1121 u32 base_addr_msb;
1122 u32 ring_size;
1123 u32 elem_size;
1125 u32 num_avail_words__num_valid_words;
1126 u32 head_ptr__tail_ptr;
1127 u32 consumer_empty__producer_full;
1128 u32 prefetch_count__internal_tail_ptr;
1131 struct htt_sring_cmn_tlv {
1132 u32 num_records;
1135 /* == PDEV TX RATE CTRL STATS == */
1136 #define HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS 12
1137 #define HTT_TX_PDEV_STATS_NUM_GI_COUNTERS 4
1138 #define HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS 5
1139 #define HTT_TX_PDEV_STATS_NUM_BW_COUNTERS 4
1140 #define HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
1141 #define HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
1142 #define HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS 4
1143 #define HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS 8
1144 #define HTT_TX_PDEV_STATS_NUM_LTF 4
1146 #define HTT_TX_NUM_OF_SOUNDING_STATS_WORDS \
1147 (HTT_TX_PDEV_STATS_NUM_BW_COUNTERS * \
1148 HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS)
1150 struct htt_tx_pdev_rate_stats_tlv {
1151 u32 mac_id__word;
1152 u32 tx_ldpc;
1153 u32 rts_cnt;
1154 /* RSSI value of last ack packet (units = dB above noise floor) */
1155 u32 ack_rssi;
1157 u32 tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
1159 u32 tx_su_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
1160 u32 tx_mu_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
1162 /* element 0,1, ...7 -> NSS 1,2, ...8 */
1163 u32 tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
1164 /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
1165 u32 tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
1166 u32 tx_stbc[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
1167 u32 tx_pream[HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES];
1169 /* Counters to track number of tx packets
1170 * in each GI (400us, 800us, 1600us & 3200us) in each mcs (0-11)
1172 u32 tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
1174 /* Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
1175 u32 tx_dcm[HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS];
1176 /* Number of CTS-acknowledged RTS packets */
1177 u32 rts_success;
1180 * Counters for legacy 11a and 11b transmissions.
1182 * The index corresponds to:
1184 * CCK: 0: 1 Mbps, 1: 2 Mbps, 2: 5.5 Mbps, 3: 11 Mbps
1186 * OFDM: 0: 6 Mbps, 1: 9 Mbps, 2: 12 Mbps, 3: 18 Mbps,
1187 * 4: 24 Mbps, 5: 36 Mbps, 6: 48 Mbps, 7: 54 Mbps
1189 u32 tx_legacy_cck_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS];
1190 u32 tx_legacy_ofdm_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
1192 u32 ac_mu_mimo_tx_ldpc;
1193 u32 ax_mu_mimo_tx_ldpc;
1194 u32 ofdma_tx_ldpc;
1197 * Counters for 11ax HE LTF selection during TX.
1199 * The index corresponds to:
1201 * 0: unused, 1: 1x LTF, 2: 2x LTF, 3: 4x LTF
1203 u32 tx_he_ltf[HTT_TX_PDEV_STATS_NUM_LTF];
1205 u32 ac_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
1206 u32 ax_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
1207 u32 ofdma_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
1209 u32 ac_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
1210 u32 ax_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
1211 u32 ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
1213 u32 ac_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
1214 u32 ax_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
1215 u32 ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
1217 u32 ac_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS]
1218 [HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
1219 u32 ax_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS]
1220 [HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
1221 u32 ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS]
1222 [HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
1225 /* == PDEV RX RATE CTRL STATS == */
1226 #define HTT_RX_PDEV_STATS_NUM_LEGACY_CCK_STATS 4
1227 #define HTT_RX_PDEV_STATS_NUM_LEGACY_OFDM_STATS 8
1228 #define HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS 12
1229 #define HTT_RX_PDEV_STATS_NUM_GI_COUNTERS 4
1230 #define HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS 5
1231 #define HTT_RX_PDEV_STATS_NUM_BW_COUNTERS 4
1232 #define HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
1233 #define HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
1234 #define HTT_RX_PDEV_MAX_OFDMA_NUM_USER 8
1235 #define HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS 16
1237 struct htt_rx_pdev_rate_stats_tlv {
1238 u32 mac_id__word;
1239 u32 nsts;
1241 u32 rx_ldpc;
1242 u32 rts_cnt;
1244 u32 rssi_mgmt; /* units = dB above noise floor */
1245 u32 rssi_data; /* units = dB above noise floor */
1246 u32 rssi_comb; /* units = dB above noise floor */
1247 u32 rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
1248 /* element 0,1, ...7 -> NSS 1,2, ...8 */
1249 u32 rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
1250 u32 rx_dcm[HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS];
1251 u32 rx_stbc[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
1252 /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
1253 u32 rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
1254 u32 rx_pream[HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES];
1255 u8 rssi_chain[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS]
1256 [HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
1257 /* units = dB above noise floor */
1259 /* Counters to track number of rx packets
1260 * in each GI in each mcs (0-11)
1262 u32 rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
1263 s32 rssi_in_dbm; /* rx Signal Strength value in dBm unit */
1265 u32 rx_11ax_su_ext;
1266 u32 rx_11ac_mumimo;
1267 u32 rx_11ax_mumimo;
1268 u32 rx_11ax_ofdma;
1269 u32 txbf;
1270 u32 rx_legacy_cck_rate[HTT_RX_PDEV_STATS_NUM_LEGACY_CCK_STATS];
1271 u32 rx_legacy_ofdm_rate[HTT_RX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
1272 u32 rx_active_dur_us_low;
1273 u32 rx_active_dur_us_high;
1275 u32 rx_11ax_ul_ofdma;
1277 u32 ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
1278 u32 ul_ofdma_rx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS]
1279 [HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
1280 u32 ul_ofdma_rx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
1281 u32 ul_ofdma_rx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
1282 u32 ul_ofdma_rx_stbc;
1283 u32 ul_ofdma_rx_ldpc;
1285 /* record the stats for each user index */
1286 u32 rx_ulofdma_non_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER]; /* ppdu level */
1287 u32 rx_ulofdma_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER]; /* ppdu level */
1288 u32 rx_ulofdma_mpdu_ok[HTT_RX_PDEV_MAX_OFDMA_NUM_USER]; /* mpdu level */
1289 u32 rx_ulofdma_mpdu_fail[HTT_RX_PDEV_MAX_OFDMA_NUM_USER]; /* mpdu level */
1291 u32 nss_count;
1292 u32 pilot_count;
1293 /* RxEVM stats in dB */
1294 s32 rx_pilot_evm_db[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS]
1295 [HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS];
1296 /* rx_pilot_evm_db_mean:
1297 * EVM mean across pilots, computed as
1298 * mean(10*log10(rx_pilot_evm_linear)) = mean(rx_pilot_evm_db)
1300 s32 rx_pilot_evm_db_mean[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
1301 s8 rx_ul_fd_rssi[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS]
1302 [HTT_RX_PDEV_MAX_OFDMA_NUM_USER]; /* dBm units */
1303 /* per_chain_rssi_pkt_type:
1304 * This field shows what type of rx frame the per-chain RSSI was computed
1305 * on, by recording the frame type and sub-type as bit-fields within this
1306 * field:
1307 * BIT [3 : 0] :- IEEE80211_FC0_TYPE
1308 * BIT [7 : 4] :- IEEE80211_FC0_SUBTYPE
1309 * BIT [31 : 8] :- Reserved
1311 u32 per_chain_rssi_pkt_type;
1312 s8 rx_per_chain_rssi_in_dbm[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS]
1313 [HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
1316 /* == RX PDEV/SOC STATS == */
1317 struct htt_rx_soc_fw_stats_tlv {
1318 u32 fw_reo_ring_data_msdu;
1319 u32 fw_to_host_data_msdu_bcmc;
1320 u32 fw_to_host_data_msdu_uc;
1321 u32 ofld_remote_data_buf_recycle_cnt;
1322 u32 ofld_remote_free_buf_indication_cnt;
1324 u32 ofld_buf_to_host_data_msdu_uc;
1325 u32 reo_fw_ring_to_host_data_msdu_uc;
1327 u32 wbm_sw_ring_reap;
1328 u32 wbm_forward_to_host_cnt;
1329 u32 wbm_target_recycle_cnt;
1331 u32 target_refill_ring_recycle_cnt;
1334 /* NOTE: Variable length TLV, use length spec to infer array size */
1335 struct htt_rx_soc_fw_refill_ring_empty_tlv_v {
1336 u32 refill_ring_empty_cnt[0]; /* HTT_RX_STATS_REFILL_MAX_RING */
1339 /* NOTE: Variable length TLV, use length spec to infer array size */
1340 struct htt_rx_soc_fw_refill_ring_num_refill_tlv_v {
1341 u32 refill_ring_num_refill[0]; /* HTT_RX_STATS_REFILL_MAX_RING */
1344 /* RXDMA error code from WBM released packets */
1345 enum htt_rx_rxdma_error_code_enum {
1346 HTT_RX_RXDMA_OVERFLOW_ERR = 0,
1347 HTT_RX_RXDMA_MPDU_LENGTH_ERR = 1,
1348 HTT_RX_RXDMA_FCS_ERR = 2,
1349 HTT_RX_RXDMA_DECRYPT_ERR = 3,
1350 HTT_RX_RXDMA_TKIP_MIC_ERR = 4,
1351 HTT_RX_RXDMA_UNECRYPTED_ERR = 5,
1352 HTT_RX_RXDMA_MSDU_LEN_ERR = 6,
1353 HTT_RX_RXDMA_MSDU_LIMIT_ERR = 7,
1354 HTT_RX_RXDMA_WIFI_PARSE_ERR = 8,
1355 HTT_RX_RXDMA_AMSDU_PARSE_ERR = 9,
1356 HTT_RX_RXDMA_SA_TIMEOUT_ERR = 10,
1357 HTT_RX_RXDMA_DA_TIMEOUT_ERR = 11,
1358 HTT_RX_RXDMA_FLOW_TIMEOUT_ERR = 12,
1359 HTT_RX_RXDMA_FLUSH_REQUEST = 13,
1360 HTT_RX_RXDMA_ERR_CODE_RVSD0 = 14,
1361 HTT_RX_RXDMA_ERR_CODE_RVSD1 = 15,
1363 /* This MAX_ERR_CODE should not be used in any host/target messages,
1364 * so that even though it is defined within a host/target interface
1365 * definition header file, it isn't actually part of the host/target
1366 * interface, and thus can be modified.
1368 HTT_RX_RXDMA_MAX_ERR_CODE
1371 /* NOTE: Variable length TLV, use length spec to infer array size */
1372 struct htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v {
1373 u32 rxdma_err[0]; /* HTT_RX_RXDMA_MAX_ERR_CODE */
1376 /* REO error code from WBM released packets */
1377 enum htt_rx_reo_error_code_enum {
1378 HTT_RX_REO_QUEUE_DESC_ADDR_ZERO = 0,
1379 HTT_RX_REO_QUEUE_DESC_NOT_VALID = 1,
1380 HTT_RX_AMPDU_IN_NON_BA = 2,
1381 HTT_RX_NON_BA_DUPLICATE = 3,
1382 HTT_RX_BA_DUPLICATE = 4,
1383 HTT_RX_REGULAR_FRAME_2K_JUMP = 5,
1384 HTT_RX_BAR_FRAME_2K_JUMP = 6,
1385 HTT_RX_REGULAR_FRAME_OOR = 7,
1386 HTT_RX_BAR_FRAME_OOR = 8,
1387 HTT_RX_BAR_FRAME_NO_BA_SESSION = 9,
1388 HTT_RX_BAR_FRAME_SN_EQUALS_SSN = 10,
1389 HTT_RX_PN_CHECK_FAILED = 11,
1390 HTT_RX_2K_ERROR_HANDLING_FLAG_SET = 12,
1391 HTT_RX_PN_ERROR_HANDLING_FLAG_SET = 13,
1392 HTT_RX_QUEUE_DESCRIPTOR_BLOCKED_SET = 14,
1393 HTT_RX_REO_ERR_CODE_RVSD = 15,
1395 /* This MAX_ERR_CODE should not be used in any host/target messages,
1396 * so that even though it is defined within a host/target interface
1397 * definition header file, it isn't actually part of the host/target
1398 * interface, and thus can be modified.
1400 HTT_RX_REO_MAX_ERR_CODE
1403 /* NOTE: Variable length TLV, use length spec to infer array size */
1404 struct htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v {
1405 u32 reo_err[0]; /* HTT_RX_REO_MAX_ERR_CODE */
1408 /* == RX PDEV STATS == */
1409 #define HTT_STATS_SUBTYPE_MAX 16
1411 struct htt_rx_pdev_fw_stats_tlv {
1412 u32 mac_id__word;
1413 u32 ppdu_recvd;
1414 u32 mpdu_cnt_fcs_ok;
1415 u32 mpdu_cnt_fcs_err;
1416 u32 tcp_msdu_cnt;
1417 u32 tcp_ack_msdu_cnt;
1418 u32 udp_msdu_cnt;
1419 u32 other_msdu_cnt;
1420 u32 fw_ring_mpdu_ind;
1421 u32 fw_ring_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
1422 u32 fw_ring_ctrl_subtype[HTT_STATS_SUBTYPE_MAX];
1423 u32 fw_ring_mcast_data_msdu;
1424 u32 fw_ring_bcast_data_msdu;
1425 u32 fw_ring_ucast_data_msdu;
1426 u32 fw_ring_null_data_msdu;
1427 u32 fw_ring_mpdu_drop;
1428 u32 ofld_local_data_ind_cnt;
1429 u32 ofld_local_data_buf_recycle_cnt;
1430 u32 drx_local_data_ind_cnt;
1431 u32 drx_local_data_buf_recycle_cnt;
1432 u32 local_nondata_ind_cnt;
1433 u32 local_nondata_buf_recycle_cnt;
1435 u32 fw_status_buf_ring_refill_cnt;
1436 u32 fw_status_buf_ring_empty_cnt;
1437 u32 fw_pkt_buf_ring_refill_cnt;
1438 u32 fw_pkt_buf_ring_empty_cnt;
1439 u32 fw_link_buf_ring_refill_cnt;
1440 u32 fw_link_buf_ring_empty_cnt;
1442 u32 host_pkt_buf_ring_refill_cnt;
1443 u32 host_pkt_buf_ring_empty_cnt;
1444 u32 mon_pkt_buf_ring_refill_cnt;
1445 u32 mon_pkt_buf_ring_empty_cnt;
1446 u32 mon_status_buf_ring_refill_cnt;
1447 u32 mon_status_buf_ring_empty_cnt;
1448 u32 mon_desc_buf_ring_refill_cnt;
1449 u32 mon_desc_buf_ring_empty_cnt;
1450 u32 mon_dest_ring_update_cnt;
1451 u32 mon_dest_ring_full_cnt;
1453 u32 rx_suspend_cnt;
1454 u32 rx_suspend_fail_cnt;
1455 u32 rx_resume_cnt;
1456 u32 rx_resume_fail_cnt;
1457 u32 rx_ring_switch_cnt;
1458 u32 rx_ring_restore_cnt;
1459 u32 rx_flush_cnt;
1460 u32 rx_recovery_reset_cnt;
1463 #define HTT_STATS_PHY_ERR_MAX 43
1465 struct htt_rx_pdev_fw_stats_phy_err_tlv {
1466 u32 mac_id__word;
1467 u32 total_phy_err_cnt;
1468 /* Counts of different types of phy errs
1469 * The mapping of PHY error types to phy_err array elements is HW dependent.
1470 * The only currently-supported mapping is shown below:
1472 * 0 phyrx_err_phy_off Reception aborted due to receiving a PHY_OFF TLV
1473 * 1 phyrx_err_synth_off
1474 * 2 phyrx_err_ofdma_timing
1475 * 3 phyrx_err_ofdma_signal_parity
1476 * 4 phyrx_err_ofdma_rate_illegal
1477 * 5 phyrx_err_ofdma_length_illegal
1478 * 6 phyrx_err_ofdma_restart
1479 * 7 phyrx_err_ofdma_service
1480 * 8 phyrx_err_ppdu_ofdma_power_drop
1481 * 9 phyrx_err_cck_blokker
1482 * 10 phyrx_err_cck_timing
1483 * 11 phyrx_err_cck_header_crc
1484 * 12 phyrx_err_cck_rate_illegal
1485 * 13 phyrx_err_cck_length_illegal
1486 * 14 phyrx_err_cck_restart
1487 * 15 phyrx_err_cck_service
1488 * 16 phyrx_err_cck_power_drop
1489 * 17 phyrx_err_ht_crc_err
1490 * 18 phyrx_err_ht_length_illegal
1491 * 19 phyrx_err_ht_rate_illegal
1492 * 20 phyrx_err_ht_zlf
1493 * 21 phyrx_err_false_radar_ext
1494 * 22 phyrx_err_green_field
1495 * 23 phyrx_err_bw_gt_dyn_bw
1496 * 24 phyrx_err_leg_ht_mismatch
1497 * 25 phyrx_err_vht_crc_error
1498 * 26 phyrx_err_vht_siga_unsupported
1499 * 27 phyrx_err_vht_lsig_len_invalid
1500 * 28 phyrx_err_vht_ndp_or_zlf
1501 * 29 phyrx_err_vht_nsym_lt_zero
1502 * 30 phyrx_err_vht_rx_extra_symbol_mismatch
1503 * 31 phyrx_err_vht_rx_skip_group_id0
1504 * 32 phyrx_err_vht_rx_skip_group_id1to62
1505 * 33 phyrx_err_vht_rx_skip_group_id63
1506 * 34 phyrx_err_ofdm_ldpc_decoder_disabled
1507 * 35 phyrx_err_defer_nap
1508 * 36 phyrx_err_fdomain_timeout
1509 * 37 phyrx_err_lsig_rel_check
1510 * 38 phyrx_err_bt_collision
1511 * 39 phyrx_err_unsupported_mu_feedback
1512 * 40 phyrx_err_ppdu_tx_interrupt_rx
1513 * 41 phyrx_err_unsupported_cbf
1514 * 42 phyrx_err_other
1516 u32 phy_err[HTT_STATS_PHY_ERR_MAX];
1519 /* NOTE: Variable length TLV, use length spec to infer array size */
1520 struct htt_rx_pdev_fw_ring_mpdu_err_tlv_v {
1521 /* Num error MPDU for each RxDMA error type */
1522 u32 fw_ring_mpdu_err[0]; /* HTT_RX_STATS_RXDMA_MAX_ERR */
1525 /* NOTE: Variable length TLV, use length spec to infer array size */
1526 struct htt_rx_pdev_fw_mpdu_drop_tlv_v {
1527 /* Num MPDU dropped */
1528 u32 fw_mpdu_drop[0]; /* HTT_RX_STATS_FW_DROP_REASON_MAX */
1531 #define HTT_PDEV_CCA_STATS_TX_FRAME_INFO_PRESENT (0x1)
1532 #define HTT_PDEV_CCA_STATS_RX_FRAME_INFO_PRESENT (0x2)
1533 #define HTT_PDEV_CCA_STATS_RX_CLEAR_INFO_PRESENT (0x4)
1534 #define HTT_PDEV_CCA_STATS_MY_RX_FRAME_INFO_PRESENT (0x8)
1535 #define HTT_PDEV_CCA_STATS_USEC_CNT_INFO_PRESENT (0x10)
1536 #define HTT_PDEV_CCA_STATS_MED_RX_IDLE_INFO_PRESENT (0x20)
1537 #define HTT_PDEV_CCA_STATS_MED_TX_IDLE_GLOBAL_INFO_PRESENT (0x40)
1538 #define HTT_PDEV_CCA_STATS_CCA_OBBS_USEC_INFO_PRESENT (0x80)
1540 struct htt_pdev_stats_cca_counters_tlv {
1541 /* Below values are obtained from the HW Cycles counter registers */
1542 u32 tx_frame_usec;
1543 u32 rx_frame_usec;
1544 u32 rx_clear_usec;
1545 u32 my_rx_frame_usec;
1546 u32 usec_cnt;
1547 u32 med_rx_idle_usec;
1548 u32 med_tx_idle_global_usec;
1549 u32 cca_obss_usec;
1552 struct htt_pdev_cca_stats_hist_v1_tlv {
1553 u32 chan_num;
1554 /* num of CCA records (Num of htt_pdev_stats_cca_counters_tlv)*/
1555 u32 num_records;
1556 u32 valid_cca_counters_bitmap;
1557 u32 collection_interval;
1559 /* This will be followed by an array which contains the CCA stats
1560 * collected in the last N intervals,
1561 * if the indication is for last N intervals CCA stats.
1562 * Then the pdev_cca_stats[0] element contains the oldest CCA stats
1563 * and pdev_cca_stats[N-1] will have the most recent CCA stats.
1564 * htt_pdev_stats_cca_counters_tlv cca_hist_tlv[1];
1568 struct htt_pdev_stats_twt_session_tlv {
1569 u32 vdev_id;
1570 struct htt_mac_addr peer_mac;
1571 u32 flow_id_flags;
1573 /* TWT_DIALOG_ID_UNAVAILABLE is used
1574 * when TWT session is not initiated by host
1576 u32 dialog_id;
1577 u32 wake_dura_us;
1578 u32 wake_intvl_us;
1579 u32 sp_offset_us;
1582 struct htt_pdev_stats_twt_sessions_tlv {
1583 u32 pdev_id;
1584 u32 num_sessions;
1585 struct htt_pdev_stats_twt_session_tlv twt_session[0];
1588 enum htt_rx_reo_resource_sample_id_enum {
1589 /* Global link descriptor queued in REO */
1590 HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_0 = 0,
1591 HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_1 = 1,
1592 HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_2 = 2,
1593 /*Number of queue descriptors of this aging group */
1594 HTT_RX_REO_RESOURCE_BUFFERS_USED_AC0 = 3,
1595 HTT_RX_REO_RESOURCE_BUFFERS_USED_AC1 = 4,
1596 HTT_RX_REO_RESOURCE_BUFFERS_USED_AC2 = 5,
1597 HTT_RX_REO_RESOURCE_BUFFERS_USED_AC3 = 6,
1598 /* Total number of MSDUs buffered in AC */
1599 HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC0 = 7,
1600 HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC1 = 8,
1601 HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC2 = 9,
1602 HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC3 = 10,
1604 HTT_RX_REO_RESOURCE_STATS_MAX = 16
1607 struct htt_rx_reo_resource_stats_tlv_v {
1608 /* Variable based on the Number of records. HTT_RX_REO_RESOURCE_STATS_MAX */
1609 u32 sample_id;
1610 u32 total_max;
1611 u32 total_avg;
1612 u32 total_sample;
1613 u32 non_zeros_avg;
1614 u32 non_zeros_sample;
1615 u32 last_non_zeros_max;
1616 u32 last_non_zeros_min;
1617 u32 last_non_zeros_avg;
1618 u32 last_non_zeros_sample;
1621 /* == TX SOUNDING STATS == */
1623 enum htt_txbf_sound_steer_modes {
1624 HTT_IMPLICIT_TXBF_STEER_STATS = 0,
1625 HTT_EXPLICIT_TXBF_SU_SIFS_STEER_STATS = 1,
1626 HTT_EXPLICIT_TXBF_SU_RBO_STEER_STATS = 2,
1627 HTT_EXPLICIT_TXBF_MU_SIFS_STEER_STATS = 3,
1628 HTT_EXPLICIT_TXBF_MU_RBO_STEER_STATS = 4,
1629 HTT_TXBF_MAX_NUM_OF_MODES = 5
1632 enum htt_stats_sounding_tx_mode {
1633 HTT_TX_AC_SOUNDING_MODE = 0,
1634 HTT_TX_AX_SOUNDING_MODE = 1,
1637 struct htt_tx_sounding_stats_tlv {
1638 u32 tx_sounding_mode; /* HTT_TX_XX_SOUNDING_MODE */
1639 /* Counts number of soundings for all steering modes in each bw */
1640 u32 cbf_20[HTT_TXBF_MAX_NUM_OF_MODES];
1641 u32 cbf_40[HTT_TXBF_MAX_NUM_OF_MODES];
1642 u32 cbf_80[HTT_TXBF_MAX_NUM_OF_MODES];
1643 u32 cbf_160[HTT_TXBF_MAX_NUM_OF_MODES];
1645 * The sounding array is a 2-D array stored as an 1-D array of
1646 * u32. The stats for a particular user/bw combination is
1647 * referenced with the following:
1649 * sounding[(user* max_bw) + bw]
1651 * ... where max_bw == 4 for 160mhz
1653 u32 sounding[HTT_TX_NUM_OF_SOUNDING_STATS_WORDS];
1656 struct htt_pdev_obss_pd_stats_tlv {
1657 u32 num_obss_tx_ppdu_success;
1658 u32 num_obss_tx_ppdu_failure;
1661 void ath11k_debug_htt_stats_init(struct ath11k *ar);
1662 #endif