xref: /wlan-dirver/qca-wifi-host-cmn/dp/inc/cdp_txrx_mon_struct.h (revision 8cfe6b10058a04cafb17eed051f2ddf11bee8931)
1 /*
2  * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20  /**
21  * @file cdp_txrx_mon_struct.h
22  * @brief Define the monitor mode API structure
23  * shared by data path and the OS interface module
24  */
25 
26 #ifndef _CDP_TXRX_MON_STRUCT_H_
27 #define _CDP_TXRX_MON_STRUCT_H_
28 
29 #ifdef QCA_SUPPORT_LITE_MONITOR
30 
31 #define CDP_LITE_MON_PEER_MAX 16
32 
33 #define CDP_MON_FRM_TYPE_MAX 3
34 #define CDP_MON_FRM_FILTER_MODE_MAX 4
35 
36 #define CDP_LITE_MON_LEN_64B 0x40
37 #define CDP_LITE_MON_LEN_128B 0x80
38 #define CDP_LITE_MON_LEN_256B 0x100
39 #define CDP_LITE_MON_LEN_FULL 0xFFFF
40 
41 #define CDP_LITE_MON_FILTER_ALL 0xFFFF
42 
43 /* This should align with nac mac type enumerations in ieee80211_ioctl.h */
44 #define CDP_LITE_MON_PEER_MAC_TYPE_CLIENT 2
45 
46 /**
47  * enum cdp_lite_mon legacy_filter: legacy filters for tx/rx
48  * @LEGACY_FILTER_DISABLED: No filter / filter disabled
49  * @LEGACY_FILTER_MCOPY: M_Copy filter
50  * @LEGACY_FILTER_TX_CAPTURE: Tx_Capture filter
51  * @LEGACY_FILTER_RX_ENH_CAPTURE: Rx Enhance capture filter
52  * @LEGACY_FILTER_ADV_MON_FILTER: Advance Monitor filter
53  *
54  * Use to identify which filter is currently enabled using lite mon
55  */
56 enum cdp_lite_mon_legacy_filter {
57 	LEGACY_FILTER_DISABLED = 0,
58 	LEGACY_FILTER_MCOPY = 1,
59 	LEGACY_FILTER_TX_CAPTURE = 2,
60 	LEGACY_FILTER_RX_ENH_CAPTURE = 3,
61 	LEGACY_FILTER_ADV_MON_FILTER = 4,
62 };
63 
64 /* lite mon frame levels */
65 enum cdp_lite_mon_level {
66 	/* level invalid */
67 	CDP_LITE_MON_LEVEL_INVALID = 0,
68 	/* level msdu */
69 	CDP_LITE_MON_LEVEL_MSDU = 1,
70 	/* level mpdu */
71 	CDP_LITE_MON_LEVEL_MPDU = 2,
72 	/* level ppdu */
73 	CDP_LITE_MON_LEVEL_PPDU = 3,
74 };
75 
76 /* lite mon peer action */
77 enum cdp_lite_mon_peer_action {
78 	/* peer add */
79 	CDP_LITE_MON_PEER_ADD = 0,
80 	/* peer remove */
81 	CDP_LITE_MON_PEER_REMOVE = 1,
82 };
83 
84 /* lite mon config direction */
85 enum cdp_lite_mon_direction {
86 	/* lite mon config direction rx */
87 	CDP_LITE_MON_DIRECTION_RX = 1,
88 	/* lite mon config direction tx */
89 	CDP_LITE_MON_DIRECTION_TX = 2,
90 };
91 #endif
92 /* MU max user to sniff */
93 #define CDP_MU_SNIF_USER_MAX 4
94 /* EHT max type and compression mode */
95 #define CDP_EHT_TYPE_MODE_MAX 3
96 /* Same as MAX_20MHZ_SEGMENTS */
97 #define CDP_MAX_20MHZ_SEGS 16
98 /* Same as MAX_ANTENNA_EIGHT */
99 #define CDP_MAX_NUM_ANTENNA 8
100 
101 /* XXX not really a mode; there are really multiple PHY's */
102 enum cdp_mon_phymode {
103 	/* autoselect */
104 	CDP_IEEE80211_MODE_AUTO	= 0,
105 	/* 5GHz, OFDM */
106 	CDP_IEEE80211_MODE_11A	= 1,
107 	/* 2GHz, CCK */
108 	CDP_IEEE80211_MODE_11B	= 2,
109 	/* 2GHz, OFDM */
110 	CDP_IEEE80211_MODE_11G	= 3,
111 	/* 2GHz, GFSK */
112 	CDP_IEEE80211_MODE_FH	= 4,
113 	/* 5GHz, OFDM, 2x clock dynamic turbo */
114 	CDP_IEEE80211_MODE_TURBO_A	= 5,
115 	   /* 2GHz, OFDM, 2x clock dynamic turbo */
116 	CDP_IEEE80211_MODE_TURBO_G	= 6,
117 	/* 5Ghz, HT20 */
118 	CDP_IEEE80211_MODE_11NA_HT20	= 7,
119 	/* 2Ghz, HT20 */
120 	CDP_IEEE80211_MODE_11NG_HT20	= 8,
121 	/* 5Ghz, HT40 (ext ch +1) */
122 	CDP_IEEE80211_MODE_11NA_HT40PLUS	= 9,
123 	/* 5Ghz, HT40 (ext ch -1) */
124 	CDP_IEEE80211_MODE_11NA_HT40MINUS = 10,
125 	  /* 2Ghz, HT40 (ext ch +1) */
126 	CDP_IEEE80211_MODE_11NG_HT40PLUS = 11,
127 	/* 2Ghz, HT40 (ext ch -1) */
128 	CDP_IEEE80211_MODE_11NG_HT40MINUS = 12,
129 	/* 2Ghz, Auto HT40 */
130 	CDP_IEEE80211_MODE_11NG_HT40	= 13,
131 	/* 5Ghz, Auto HT40 */
132 	CDP_IEEE80211_MODE_11NA_HT40	= 14,
133 	/* 5Ghz, VHT20 */
134 	CDP_IEEE80211_MODE_11AC_VHT20	= 15,
135 	/* 5Ghz, VHT40 (Ext ch +1) */
136 	CDP_IEEE80211_MODE_11AC_VHT40PLUS   = 16,
137 	/* 5Ghz  VHT40 (Ext ch -1) */
138 	CDP_IEEE80211_MODE_11AC_VHT40MINUS  = 17,
139 	/* 5Ghz, VHT40 */
140 	CDP_IEEE80211_MODE_11AC_VHT40	= 18,
141 	/* 5Ghz, VHT80 */
142 	CDP_IEEE80211_MODE_11AC_VHT80	= 19,
143 	/* 5Ghz, VHT160 */
144 	CDP_IEEE80211_MODE_11AC_VHT160	= 20,
145 	/* 5Ghz, VHT80_80 */
146 	CDP_IEEE80211_MODE_11AC_VHT80_80	= 21,
147 };
148 
149 enum {
150 	CDP_PKT_TYPE_OFDM = 0,
151 	CDP_PKT_TYPE_CCK,
152 	CDP_PKT_TYPE_HT,
153 	CDP_PKT_TYPE_VHT,
154 	CDP_PKT_TYPE_HE,
155 	CDP_PKT_TYPE_EHT,
156 	CDP_PKT_TYPE_NO_SUP,
157 	CDP_PKT_TYPE_MAX,
158 };
159 
160 enum {
161 	CDP_SGI_0_8_US = 0,
162 	CDP_SGI_0_4_US,
163 	CDP_SGI_1_6_US,
164 	CDP_SGI_3_2_US,
165 };
166 
167 enum {
168 	CDP_RX_TYPE_SU = 0,
169 	CDP_RX_TYPE_MU_MIMO,
170 	CDP_RX_TYPE_MU_OFDMA,
171 	CDP_RX_TYPE_MU_OFDMA_MIMO,
172 	CDP_RX_TYPE_MAX,
173 };
174 
175 enum {
176 	CDP_MU_TYPE_DL = 0,
177 	CDP_MU_TYPE_UL,
178 	CDP_MU_TYPE_MAX,
179 };
180 
181 /*
182  *Band Width Types
183  */
184 enum CMN_BW_TYPES {
185 	CMN_BW_20MHZ,
186 	CMN_BW_40MHZ,
187 	CMN_BW_80MHZ,
188 	CMN_BW_160MHZ,
189 	CMN_BW_80_80MHZ,
190 #ifdef WLAN_FEATURE_11BE
191 	CMN_BW_320MHZ,
192 #endif
193 	CMN_BW_CNT,
194 	CMN_BW_IDLE = 0xFF, /*default BW state */
195 };
196 
197 enum cdp_punctured_modes {
198 	NO_PUNCTURE,
199 #ifdef WLAN_FEATURE_11BE
200 	PUNCTURED_20MHZ,
201 	PUNCTURED_40MHZ,
202 	PUNCTURED_80MHZ,
203 	PUNCTURED_120MHZ,
204 #endif
205 	PUNCTURED_MODE_CNT,
206 };
207 
208 struct cdp_mon_status {
209 	/* bss color value 1-63 used for update on ppdu_desc bsscolor */
210 	uint8_t bsscolor;
211 	int rs_numchains;
212 	int rs_flags;
213 #define IEEE80211_RX_FCS_ERROR      0x01
214 #define IEEE80211_RX_MIC_ERROR      0x02
215 #define IEEE80211_RX_DECRYPT_ERROR  0x04
216 /* holes in flags here between, ATH_RX_XXXX to IEEE80211_RX_XXX */
217 #define IEEE80211_RX_KEYMISS        0x200
218 #define IEEE80211_RX_PN_ERROR       0x400
219 	int rs_rssi;       /* RSSI (noise floor adjusted) */
220 	int rs_abs_rssi;   /* absolute RSSI */
221 	int rs_datarate;   /* data rate received */
222 	int rs_rateieee;
223 	int rs_ratephy1;
224 	int rs_ratephy2;
225 	int rs_ratephy3;
226 
227 /* Keep the same as ATH_MAX_ANTENNA */
228 #define IEEE80211_MAX_ANTENNA       3
229 	/* RSSI (noise floor adjusted) */
230 	u_int8_t    rs_rssictl[IEEE80211_MAX_ANTENNA];
231 	/* RSSI (noise floor adjusted) */
232 	u_int8_t    rs_rssiextn[IEEE80211_MAX_ANTENNA];
233 	/* rs_rssi is valid or not */
234 	u_int8_t    rs_isvalidrssi;
235 
236 	enum cdp_mon_phymode rs_phymode;
237 	int         rs_freq;
238 
239 	union {
240 		u_int8_t            data[8];
241 		u_int64_t           tsf;
242 	} rs_tstamp;
243 
244 	/*
245 	 * Detail channel structure of recv frame.
246 	 * It could be NULL if not available
247 	 */
248 
249 
250 #ifdef ATH_SUPPORT_AOW
251 	u_int16_t   rs_rxseq;      /* WLAN Sequence number */
252 #endif
253 #ifdef ATH_VOW_EXT_STATS
254 	/* Lower 16 bits holds the udp checksum offset in the data pkt */
255 	u_int32_t vow_extstats_offset;
256 	/* Higher 16 bits contains offset in the data pkt at which vow
257 	 * ext stats are embedded
258 	 */
259 #endif
260 	u_int8_t rs_isaggr;
261 	u_int8_t rs_isapsd;
262 	int16_t rs_noisefloor;
263 	u_int16_t  rs_channel;
264 #ifdef ATH_SUPPORT_TxBF
265 	u_int32_t   rs_rpttstamp;   /* txbf report time stamp*/
266 #endif
267 
268 	/* The following counts are meant to assist in stats calculation.
269 	 * These variables are incremented only in specific situations, and
270 	 * should not be relied upon for any purpose other than the original
271 	 * stats related purpose they have been introduced for.
272 	*/
273 
274 	u_int16_t   rs_cryptodecapcount; /* Crypto bytes decapped/demic'ed. */
275 	u_int8_t    rs_padspace;         /* No. of padding bytes present after
276 					  header in wbuf. */
277 	u_int8_t    rs_qosdecapcount;    /* QoS/HTC bytes decapped. */
278 
279 	/* End of stats calculation related counts. */
280 
281 	/*
282 	 * uint8_t     rs_lsig[IEEE80211_LSIG_LEN];
283 	 * uint8_t     rs_htsig[IEEE80211_HTSIG_LEN];
284 	 * uint8_t     rs_servicebytes[IEEE80211_SB_LEN];
285 	 * uint8_t     rs_fcs_error;
286 	*/
287 
288 	/* cdp convergence monitor mode status */
289 	union {
290 		u_int8_t            cdp_data[8];
291 		u_int64_t           cdp_tsf;
292 	} cdp_rs_tstamp;
293 
294 	uint8_t  cdp_rs_pream_type;
295 	uint32_t cdp_rs_user_rssi;
296 	uint8_t  cdp_rs_stbc;
297 	uint8_t  cdp_rs_sgi;
298 	uint32_t cdf_rs_rate_mcs;
299 	uint32_t cdp_rs_reception_type;
300 	uint32_t cdp_rs_bw;
301 	uint32_t cdp_rs_nss;
302 	uint8_t  cdp_rs_fcs_err;
303 	bool     cdp_rs_rxdma_err;
304 };
305 
306 enum {
307 	CDP_MON_PPDU_START = 0,
308 	CDP_MON_PPDU_END,
309 };
310 
311 #ifdef QCA_UNDECODED_METADATA_SUPPORT
312 /**
313  * enum cdp_mon_phyrx_abort_reason_code: Phy err code to store the reason
314  * why PHY generated an abort request.
315  */
316 enum cdp_mon_phyrx_abort_reason_code {
317 	CDP_PHYRX_ERR_PHY_OFF = 0,
318 	CDP_PHYRX_ERR_SYNTH_OFF,
319 	CDP_PHYRX_ERR_OFDMA_TIMING,
320 	CDP_PHYRX_ERR_OFDMA_SIGNAL_PARITY,
321 	CDP_PHYRX_ERR_OFDMA_RATE_ILLEGAL,
322 	CDP_PHYRX_ERR_OFDMA_LENGTH_ILLEGAL,
323 	CDP_PHYRX_ERR_OFDMA_RESTART,
324 	CDP_PHYRX_ERR_OFDMA_SERVICE,
325 	CDP_PHYRX_ERR_PPDU_OFDMA_POWER_DROP,
326 	CDP_PHYRX_ERR_CCK_BLOKKER,
327 	CDP_PHYRX_ERR_CCK_TIMING = 10,
328 	CDP_PHYRX_ERR_CCK_HEADER_CRC,
329 	CDP_PHYRX_ERR_CCK_RATE_ILLEGAL,
330 	CDP_PHYRX_ERR_CCK_LENGTH_ILLEGAL,
331 	CDP_PHYRX_ERR_CCK_RESTART,
332 	CDP_PHYRX_ERR_CCK_SERVICE,
333 	CDP_PHYRX_ERR_CCK_POWER_DROP,
334 	CDP_PHYRX_ERR_HT_CRC_ERR,
335 	CDP_PHYRX_ERR_HT_LENGTH_ILLEGAL,
336 	CDP_PHYRX_ERR_HT_RATE_ILLEGAL,
337 	CDP_PHYRX_ERR_HT_ZLF = 20,
338 	CDP_PHYRX_ERR_FALSE_RADAR_EXT,
339 	CDP_PHYRX_ERR_GREEN_FIELD,
340 	CDP_PHYRX_ERR_BW_GT_DYN_BW,
341 	CDP_PHYRX_ERR_HT_LSIG_RATE_MISMATCH,
342 	CDP_PHYRX_ERR_VHT_CRC_ERROR,
343 	CDP_PHYRX_ERR_VHT_SIGA_UNSUPPORTED,
344 	CDP_PHYRX_ERR_VHT_LSIG_LEN_INVALID,
345 	CDP_PHYRX_ERR_VHT_NDP_OR_ZLF,
346 	CDP_PHYRX_ERR_VHT_NSYM_LT_ZERO,
347 	CDP_PHYRX_ERR_VHT_RX_EXTRA_SYMBOL_MISMATCH = 30,
348 	CDP_PHYRX_ERR_VHT_RX_SKIP_GROUP_ID0,
349 	CDP_PHYRX_ERR_VHT_RX_SKIP_GROUP_ID1TO62,
350 	CDP_PHYRX_ERR_VHT_RX_SKIP_GROUP_ID63,
351 	CDP_PHYRX_ERR_OFDM_LDPC_DECODER_DISABLED,
352 	CDP_PHYRX_ERR_DEFER_NAP,
353 	CDP_PHYRX_ERR_FDOMAIN_TIMEOUT,
354 	CDP_PHYRX_ERR_LSIG_REL_CHECK,
355 	CDP_PHYRX_ERR_BT_COLLISION,
356 	CDP_PHYRX_ERR_UNSUPPORTED_MU_FEEDBACK,
357 	CDP_PHYRX_ERR_PPDU_TX_INTERRUPT_RX = 40,
358 	CDP_PHYRX_ERR_UNSUPPORTED_CBF,
359 	CDP_PHYRX_ERR_OTHER,
360 	CDP_PHYRX_ERR_HE_SIGA_UNSUPPORTED,
361 	CDP_PHYRX_ERR_HE_SIGA_CRC_ERROR,
362 	CDP_PHYRX_ERR_HE_SIGB_UNSUPPORTED,
363 	CDP_PHYRX_ERR_HE_SIGB_CRC_ERROR,
364 	CDP_PHYRX_ERR_HE_MU_MODE_UNSUPPORTED,
365 	CDP_PHYRX_ERR_HE_NDP_OR_ZLF,
366 	CDP_PHYRX_ERR_HE_NSYM_LT_ZERO,
367 	CDP_PHYRX_ERR_HE_RU_PARAMS_UNSUPPORTED = 50,
368 	CDP_PHYRX_ERR_HE_NUM_USERS_UNSUPPORTED,
369 	CDP_PHYRX_ERR_HE_SOUNDING_PARAMS_UNSUPPORTED,
370 	CDP_PHYRX_ERR_HE_EXT_SU_UNSUPPORTED,
371 	CDP_PHYRX_ERR_HE_TRIG_UNSUPPORTED,
372 	CDP_PHYRX_ERR_HE_LSIG_LEN_INVALID = 55,
373 	CDP_PHYRX_ERR_HE_LSIG_RATE_MISMATCH,
374 	CDP_PHYRX_ERR_OFDMA_SIGNAL_RELIABILITY,
375 	CDP_PHYRX_ERR_HT_NSYM_LT_ZERO,
376 	CDP_PHYRX_ERR_VHT_LSIG_RATE_MISMATCH,
377 	CDP_PHYRX_ERR_VHT_PAID_GID_MISMATCH = 60,
378 	CDP_PHYRX_ERR_VHT_UNSUPPORTED_BW,
379 	CDP_PHYRX_ERR_VHT_GI_DISAM_MISMATCH,
380 	CDP_PHYRX_ERR_RX_WDG_TIMEOUT = 63,
381 	CDP_PHYRX_ERR_MAX
382 };
383 #endif
384 
385 #define MAX_PPDU_ID_HIST 128
386 
387 /**
388  * struct cdp_pdev_mon_stats
389  * @status_ppdu_state: state on PPDU start and end
390  * @status_ppdu_start: status ring PPDU start TLV count
391  * @status_ppdu_end: status ring PPDU end TLV count
392  * @status_ppdu_compl: status ring matching start and end count on PPDU
393  * @status_ppdu_start_mis: status ring missing start TLV count on PPDU
394  * @status_ppdu_end_mis: status ring missing end TLV count on PPDU
395  * @mpdu_cnt_fcs_ok: MPDU ok count per pkt and reception type DL-UL and user
396  * @mpdu_cnt_fcs_err: MPDU err count per pkt and reception type DL-UL and user
397  * @ppdu_eht_type_mode: PPDU count per type compression mode and DL-UL
398  * @end_user_stats_cnt: PPDU end user TLV count
399  * @start_user_info_cnt: PPDU start user info TLV count
400  * @status_ppdu_done: status ring PPDU done TLV count
401  * @dest_ppdu_done: destination ring PPDU count
402  * @dest_mpdu_done: destination ring MPDU count
403  * @dup_mon_linkdesc_cnt: duplicate link descriptor indications from HW
404  * @dup_mon_buf_cnt: duplicate buffer indications from HW
405  * @tlv_tag_status_err: status not correct in the tlv tag
406  * @status_buf_done_war: Number of status ring buffers for which DMA not done
407  *  WAR is applied.
408  * @mon_rx_bufs_replenished_dest: Rx buffers replenish count
409  * @mon_rx_bufs_reaped_dest: Rx buffer reap count
410  * @ppdu_id_mismatch: counter to track ppdu id mismatch in
411  *  mointor status and monitor destination ring
412  * @ppdu_id_match: counter to track ppdu id match in
413  *  mointor status and monitor destination ring
414  * @status_ppdu_drop: Number of ppdu dropped from monitor status ring
415  * @dest_ppdu_drop: Number of ppdu dropped from monitor destination ring
416  * @mon_link_desc_invalid: msdu link desc invalid count
417  * @mon_rx_desc_invalid: rx_desc invalid count
418  * @mpdu_ppdu_id_mismatch_drop: mpdu's ppdu id did not match destination
419  *  ring ppdu id
420  * @mpdu_decap_type_invalid: mpdu decap type invalid count
421  * @rx_undecoded_count: Received undecoded frame count
422  * @rx_undecoded_error: Rx undecoded errors
423  * @rx_hdr_not_received: Rx HDR not received for MPDU
424  * @parent_buf_alloc: Numder of parent nbuf allocated for MPDU
425  * @parent_buf_free: Number of parent nbuf freed
426  * @pkt_buf_count: Number of packet buffers received
427  * @mpdus_to_stack: Number of MPDUs delivered to stack
428  * @status_buf_count: Number of status buffer received
429  * @empty_desc_ppdu: Number of empty desc received
430  * @total_ppdu_info_enq: Number of PPDUs enqueued to wq
431  * @total_ppdu_info_drop: Number of PPDUs dropped
432  * @total_ppdu_info_alloc: Number of PPDU info allocated
433  * @total_ppdu_info_free: Number of PPDU info freed
434  * @ppdu_drop_cnt: Total PPDU drop count
435  * @mpdu_drop_cnt: Total MPDU drop count
436  * @end_of_ppdu_drop_cnt: Total end of ppdu drop count
437  * @tlv_drop_cnt: TLV drop count
438  */
439 struct cdp_pdev_mon_stats {
440 #ifndef REMOVE_MON_DBG_STATS
441 	uint32_t status_ppdu_state;
442 	uint32_t status_ppdu_start;
443 	uint32_t status_ppdu_end;
444 	uint32_t status_ppdu_compl;
445 	uint32_t status_ppdu_start_mis;
446 	uint32_t status_ppdu_end_mis;
447 #endif
448 	uint32_t mpdu_cnt_fcs_ok[CDP_PKT_TYPE_MAX][CDP_RX_TYPE_MAX]
449 				[CDP_MU_TYPE_MAX][CDP_MU_SNIF_USER_MAX];
450 	uint32_t mpdu_cnt_fcs_err[CDP_PKT_TYPE_MAX][CDP_RX_TYPE_MAX]
451 				 [CDP_MU_TYPE_MAX][CDP_MU_SNIF_USER_MAX];
452 	uint32_t ppdu_eht_type_mode[CDP_EHT_TYPE_MODE_MAX][CDP_MU_TYPE_MAX];
453 	uint32_t end_user_stats_cnt;
454 	uint32_t start_user_info_cnt;
455 	uint32_t status_ppdu_done;
456 	uint32_t dest_ppdu_done;
457 	uint32_t dest_mpdu_done;
458 	uint32_t dest_mpdu_drop;
459 	uint32_t dup_mon_linkdesc_cnt;
460 	uint32_t dup_mon_buf_cnt;
461 	uint32_t stat_ring_ppdu_id_hist[MAX_PPDU_ID_HIST];
462 	uint32_t dest_ring_ppdu_id_hist[MAX_PPDU_ID_HIST];
463 	uint32_t ppdu_id_hist_idx;
464 	uint32_t mon_rx_dest_stuck;
465 	uint32_t tlv_tag_status_err;
466 	uint32_t status_buf_done_war;
467 	uint32_t mon_rx_bufs_replenished_dest;
468 	uint32_t mon_rx_bufs_reaped_dest;
469 	uint32_t ppdu_id_mismatch;
470 	uint32_t ppdu_id_match;
471 	uint32_t status_ppdu_drop;
472 	uint32_t dest_ppdu_drop;
473 	uint32_t mon_link_desc_invalid;
474 	uint32_t mon_rx_desc_invalid;
475 	uint32_t mon_nbuf_sanity_err;
476 	uint32_t mpdu_ppdu_id_mismatch_drop;
477 	uint32_t mpdu_decap_type_invalid;
478 #ifdef QCA_UNDECODED_METADATA_SUPPORT
479 	uint32_t rx_undecoded_count;
480 	uint32_t rx_undecoded_error[CDP_PHYRX_ERR_MAX];
481 #endif
482 	uint32_t rx_hdr_not_received;
483 	uint32_t parent_buf_alloc;
484 	uint32_t parent_buf_free;
485 	uint32_t pkt_buf_count;
486 	uint32_t mpdus_buf_to_stack;
487 	uint32_t status_buf_count;
488 	uint32_t empty_desc_ppdu;
489 	uint32_t total_ppdu_info_enq;
490 	uint32_t total_ppdu_info_drop;
491 	uint32_t total_ppdu_info_alloc;
492 	uint32_t total_ppdu_info_free;
493 	uint32_t ppdu_drop_cnt;
494 	uint32_t mpdu_drop_cnt;
495 	uint32_t end_of_ppdu_drop_cnt;
496 	uint32_t tlv_drop_cnt;
497 };
498 
499 #ifdef QCA_SUPPORT_LITE_MONITOR
500 /**
501  * cdp_lite_mon_filter_config - lite mon set/get filter config
502  * @direction: direction tx/rx
503  * @disable: disables lite mon
504  * @level: MSDU/MPDU/PPDU levels
505  * @metadata: meta information to be added
506  * @mgmt_filter: mgmt filter for modes fp,md,mo
507  * @ctrl_filter: ctrl filter for modes fp,md,mo
508  * @data_filter: data filter for modes fp,md,mo
509  * @len: mgmt/ctrl/data frame lens
510  * @debug: debug options
511  * @vdev_id: output vdev id
512  * @legacy_filter_enabled: legacy filter currently enabled
513  */
514 struct cdp_lite_mon_filter_config {
515 	uint8_t direction;
516 	uint8_t disable;
517 	uint8_t level;
518 	uint8_t metadata;
519 	uint16_t mgmt_filter[CDP_MON_FRM_FILTER_MODE_MAX];
520 	uint16_t ctrl_filter[CDP_MON_FRM_FILTER_MODE_MAX];
521 	uint16_t data_filter[CDP_MON_FRM_FILTER_MODE_MAX];
522 	uint16_t len[CDP_MON_FRM_TYPE_MAX];
523 	uint8_t debug;
524 	uint8_t vdev_id;
525 	uint8_t legacy_filter_enabled;
526 };
527 
528 /**
529  * cdp_lite_mon_peer_config - lite mon set peer config
530  * @direction: direction tx/rx
531  * @action: add/del
532  * @vdev_id: peer vdev id
533  * @mac: peer mac
534  */
535 struct cdp_lite_mon_peer_config {
536 	uint8_t direction;
537 	uint8_t action;
538 	uint8_t vdev_id;
539 	uint8_t mac[QDF_MAC_ADDR_SIZE];
540 };
541 
542 /**
543  * cdp_lite_mon_peer_info - lite mon get peer config
544  * @direction: direction tx/rx
545  * @count: no of peers
546  * @mac: peer macs
547  */
548 struct cdp_lite_mon_peer_info {
549 	uint8_t direction;
550 	uint8_t count;
551 	uint8_t mac[CDP_LITE_MON_PEER_MAX][QDF_MAC_ADDR_SIZE];
552 };
553 #endif
554 /* channel operating width */
555 enum cdp_channel_width {
556 	CHAN_WIDTH_20 = 0,
557 	CHAN_WIDTH_40,
558 	CHAN_WIDTH_80,
559 	CHAN_WIDTH_160,
560 	CHAN_WIDTH_80P80,
561 	CHAN_WIDTH_5,
562 	CHAN_WIDTH_10,
563 	CHAN_WIDTH_165,
564 	CHAN_WIDTH_160P160,
565 	CHAN_WIDTH_320,
566 
567 	CHAN_WIDTH_MAX,
568 };
569 
570 /* struct cdp_rssi_temp_off_param_dp
571  * @rssi_temp_offset: Temperature based rssi offset , send every 30 secs
572  */
573 
574 struct cdp_rssi_temp_off_param_dp {
575 	int32_t rssi_temp_offset;
576 };
577 
578 /*
579  * struct cdp_rssi_dbm_conv_param_dp
580  * @curr_bw: Current bandwidth
581  * @curr_rx_chainmask: Current rx chainmask
582  * @xbar_config: 4 bytes, used for BB to RF Chain mapping
583  * @xlna_bypass_offset: Low noise amplifier bypass offset
584  * @xlna_bypass_threshold: Low noise amplifier bypass threshold
585  * @nfHwDbm: HW noise floor in dBm per chain, per 20MHz subband
586  */
587 struct cdp_rssi_dbm_conv_param_dp {
588 	uint32_t curr_bw;
589 	uint32_t curr_rx_chainmask;
590 	uint32_t xbar_config;
591 	int32_t xlna_bypass_offset;
592 	int32_t xlna_bypass_threshold;
593 	int8_t nf_hw_dbm[CDP_MAX_NUM_ANTENNA][CDP_MAX_20MHZ_SEGS];
594 };
595 
596 /*
597  * struct cdp_rssi_db2dbm_param_dp
598  * @pdev_id: pdev_id
599  * @rssi_temp_off_present: to check temp offset values present or not
600  * @rssi_dbm_info_present: to check rssi dbm conversion parameters
601  *						   present or not
602  * @temp_off_param: cdp_rssi_temp_off_param_dp structure value
603  * @rssi_dbm_param: cdp_rssi_dbm_conv_param_dp staructure value
604  */
605 struct cdp_rssi_db2dbm_param_dp {
606 	uint32_t pdev_id;
607 	bool rssi_temp_off_present;
608 	bool rssi_dbm_info_present;
609 	struct cdp_rssi_temp_off_param_dp temp_off_param;
610 	struct cdp_rssi_dbm_conv_param_dp rssi_dbm_param;
611 };
612 
613 /*
614  * enum cdp_mon_reap_source: trigger source of the reap timer of
615  * monitor status ring
616  * @CDP_MON_REAP_SOURCE_PKTLOG: pktlog
617  * @CDP_MON_REAP_SOURCE_CFR: CFR
618  * @CDP_MON_REAP_SOURCE_EMESH: easy mesh
619  * @CDP_MON_REAP_SOURCE_NUM: total number of the sources
620  * @CDP_MON_REAP_SOURCE_ANY: any of the sources
621  */
622 enum cdp_mon_reap_source {
623 	CDP_MON_REAP_SOURCE_PKTLOG,
624 	CDP_MON_REAP_SOURCE_CFR,
625 	CDP_MON_REAP_SOURCE_EMESH,
626 
627 	/* keep last */
628 	CDP_MON_REAP_SOURCE_NUM,
629 	CDP_MON_REAP_SOURCE_ANY,
630 };
631 #endif
632