xref: /wlan-dirver/qca-wifi-host-cmn/dp/inc/cdp_txrx_cmn_struct.h (revision 2888b71da71bce103343119fa1b31f4a0cee07c8)
1 /*
2  * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2022 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_cmn_struct.h
22  * @brief Define the host data path converged API functions
23  * called by the host control SW and the OS interface module
24  */
25 #ifndef _CDP_TXRX_CMN_STRUCT_H_
26 #define _CDP_TXRX_CMN_STRUCT_H_
27 
28 /**
29  * For WIN legacy header compilation
30  * Temporary add dummy definitions
31  * should be removed properly WIN legacy code handle
32  */
33 
34 #include "htc_api.h"
35 #include "qdf_types.h"
36 #include "qdf_nbuf.h"
37 #include "qdf_atomic.h"
38 #ifdef DP_MOB_DEFS
39 #include <cdp_txrx_mob_def.h>
40 #endif
41 #include <cdp_txrx_handle.h>
42 #include <cdp_txrx_stats_struct.h>
43 #ifdef WLAN_RX_PKT_CAPTURE_ENH
44 #include "cdp_txrx_extd_struct.h"
45 #endif
46 
47 #ifdef WLAN_MAX_CLIENTS_ALLOWED
48 #define OL_TXRX_NUM_LOCAL_PEER_IDS (WLAN_MAX_CLIENTS_ALLOWED + 1 + 1 + 1)
49 #endif
50 
51 #ifndef OL_TXRX_NUM_LOCAL_PEER_IDS
52 /*
53  * Each AP will occupy one ID, so it will occupy two IDs for AP-AP mode.
54  * Clients will be assigned max 32 IDs.
55  * STA(associated)/P2P DEV(self-PEER) will get one ID.
56  */
57 #define OL_TXRX_NUM_LOCAL_PEER_IDS (32 + 1 + 1 + 1)
58 #endif
59 
60 #define CDP_BA_256_BIT_MAP_SIZE_DWORDS 8
61 #define CDP_BA_64_BIT_MAP_SIZE_DWORDS 2
62 #define CDP_RSSI_CHAIN_LEN 8
63 
64 #define OL_TXRX_INVALID_PDEV_ID 0xff
65 #define OL_TXRX_INVALID_LOCAL_PEER_ID 0xffff
66 #define CDP_INVALID_VDEV_ID 0xff
67 
68 /* Max vdev_stats_id(48) is as per the max vdevs supported by HW */
69 #define CDP_MAX_VDEV_STATS_ID     0x30
70 /* Invalid vdev_stats_id */
71 #define CDP_INVALID_VDEV_STATS_ID 0xFF
72 
73 /* Options for Dump Statistics */
74 #define CDP_HDD_STATS               0
75 #define CDP_TXRX_PATH_STATS         1
76 #define CDP_TXRX_HIST_STATS         2
77 #define CDP_TXRX_TSO_STATS          3
78 #define CDP_HDD_NETIF_OPER_HISTORY  4
79 #define CDP_DUMP_TX_FLOW_POOL_INFO  5
80 #define CDP_TXRX_DESC_STATS         6
81 #define CDP_HIF_STATS               7
82 #define CDP_LRO_STATS               8
83 #define CDP_NAPI_STATS              9
84 #define CDP_WLAN_RX_BUF_DEBUG_STATS 10
85 #define CDP_RX_RING_STATS          11
86 #define CDP_DP_NAPI_STATS          12
87 #define CDP_DP_RX_THREAD_STATS     13
88 #define CDP_SCHEDULER_STATS        21
89 #define CDP_TX_QUEUE_STATS         22
90 #define CDP_BUNDLE_STATS           23
91 #define CDP_CREDIT_STATS           24
92 #define CDP_DISCONNECT_STATS       25
93 #define CDP_DP_RX_FISA_STATS	   26
94 #define CDP_DP_SWLM_STATS	   27
95 #define CDP_DP_TX_HW_LATENCY_STATS 28
96 
97 #define WME_AC_TO_TID(_ac) (       \
98 		((_ac) == WME_AC_VO) ? 6 : \
99 		((_ac) == WME_AC_VI) ? 5 : \
100 		((_ac) == WME_AC_BK) ? 1 : \
101 		0)
102 
103 #define TID_TO_WME_AC(_tid) (      \
104 		(((_tid) == 0) || ((_tid) == 3)) ? WME_AC_BE : \
105 		(((_tid) == 1) || ((_tid) == 2)) ? WME_AC_BK : \
106 		(((_tid) == 4) || ((_tid) == 5)) ? WME_AC_VI : \
107 		WME_AC_VO)
108 
109 #define CDP_MU_MAX_USERS 37
110 #define CDP_MU_MAX_USER_INDEX (CDP_MU_MAX_USERS - 1)
111 #define CDP_INVALID_PEER 0xffff
112 #define CDP_INVALID_TID	 31
113 #define CDP_INVALID_TX_ENCAP_TYPE	 6
114 #define CDP_INVALID_SEC_TYPE		12
115 
116 #define CDP_DATA_TID_MAX 8
117 #define CDP_DATA_NON_QOS_TID 16
118 
119 #define CDP_NUM_SA_BW 4
120 #define CDP_PERCENT_MACRO 100
121 #define CDP_NUM_KB_IN_MB 1000
122 /*
123  * advance rx monitor filter
124  * */
125 #define MON_FILTER_PASS			0x0001
126 #define MON_FILTER_OTHER		0x0002
127 #define MON_FILTER_ALL			0x0003
128 
129 #define FILTER_MGMT_ALL			0xFFFF
130 #define FILTER_MGMT_ASSOC_REQ		0x0001
131 #define FILTER_MGMT_ASSOC_RES		0x0002
132 #define FILTER_MGMT_REASSOC_REQ		0x0004
133 #define FILTER_MGMT_REASSOC_RES		0x0008
134 #define FILTER_MGMT_PROBE_REQ		0x0010
135 #define FILTER_MGMT_PROBE_RES		0x0020
136 #define FILTER_MGMT_TIM_ADVT		0x0040
137 #define FILTER_MGMT_RESERVED_7		0x0080
138 #define FILTER_MGMT_BEACON		0x0100
139 #define FILTER_MGMT_ATIM		0x0200
140 #define FILTER_MGMT_DISASSOC		0x0400
141 #define FILTER_MGMT_AUTH		0x0800
142 #define FILTER_MGMT_DEAUTH		0x1000
143 #define FILTER_MGMT_ACTION		0x2000
144 #define FILTER_MGMT_ACT_NO_ACK		0x4000
145 #define FILTER_MGMT_RESERVED_15		0x8000
146 
147 #define FILTER_CTRL_ALL			0xFFFF
148 #define FILTER_CTRL_RESERVED_1		0x0001
149 #define FILTER_CTRL_RESERVED_2		0x0002
150 #define FILTER_CTRL_TRIGGER		0x0004
151 #define FILTER_CTRL_RESERVED_4		0x0008
152 #define FILTER_CTRL_BF_REP_POLL		0x0010
153 #define FILTER_CTRL_VHT_NDP		0x0020
154 #define FILTER_CTRL_FRAME_EXT		0x0040
155 #define FILTER_CTRL_CTRLWRAP		0x0080
156 #define FILTER_CTRL_BA_REQ		0x0100
157 #define FILTER_CTRL_BA			0x0200
158 #define FILTER_CTRL_PSPOLL		0x0400
159 #define FILTER_CTRL_RTS			0x0800
160 #define FILTER_CTRL_CTS			0x1000
161 #define FILTER_CTRL_ACK			0x2000
162 #define FILTER_CTRL_CFEND		0x4000
163 #define FILTER_CTRL_CFEND_CFACK		0x8000
164 
165 #define FILTER_DATA_ALL			0xFFFF
166 #define FILTER_DATA_MCAST		0x4000
167 #define FILTER_DATA_UCAST		0x8000
168 #define FILTER_DATA_DATA		0x0001
169 #define FILTER_DATA_NULL		0x0008
170 
171 /*
172  * Multiply rate by 2 to avoid float point
173  * and get rate in units of 500kbps
174  */
175 #define CDP_11B_RATE_0MCS (11 * 2)
176 #define CDP_11B_RATE_1MCS (5.5 * 2)
177 #define CDP_11B_RATE_2MCS (2 * 2)
178 #define CDP_11B_RATE_3MCS (1 * 2)
179 #define CDP_11B_RATE_4MCS (11 * 2)
180 #define CDP_11B_RATE_5MCS (5.5 * 2)
181 #define CDP_11B_RATE_6MCS (2 * 2)
182 
183 #define CDP_11A_RATE_0MCS (48 * 2)
184 #define CDP_11A_RATE_1MCS (24 * 2)
185 #define CDP_11A_RATE_2MCS (12 * 2)
186 #define CDP_11A_RATE_3MCS (6 * 2)
187 #define CDP_11A_RATE_4MCS (54 * 2)
188 #define CDP_11A_RATE_5MCS (36 * 2)
189 #define CDP_11A_RATE_6MCS (18 * 2)
190 #define CDP_11A_RATE_7MCS (9 * 2)
191 
192 #define CDP_LEGACY_MCS0  0
193 #define CDP_LEGACY_MCS1  1
194 #define CDP_LEGACY_MCS2  2
195 #define CDP_LEGACY_MCS3  3
196 #define CDP_LEGACY_MCS4  4
197 #define CDP_LEGACY_MCS5  5
198 #define CDP_LEGACY_MCS6  6
199 #define CDP_LEGACY_MCS7  7
200 
201 QDF_DECLARE_EWMA(tx_lag, 1024, 8)
202 struct cdp_stats_cookie;
203 
204 /*
205  * DP configuration parameters
206  */
207 enum cdp_cfg_param_type {
208 	CDP_CFG_MAX_PEER_ID,
209 	CDP_CFG_CCE_DISABLE,
210 	CDP_CFG_NUM_PARAMS
211 };
212 
213 /*
214  * PPDU TYPE from FW -
215  * @CDP_PPDU_STATS_PPDU_TYPE_SU: single user type
216  * @CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO: multi user mu-mimo
217  * @CDP_PPDU_STATS_PPDU_TYPE_MU_OFDMA: multi user ofdma
218  * @CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA: multi user mu-mimo ofdma
219  * @CDP_PPDU_STATS_PPDU_TYPE_UL_TRIG: ul trigger ppdu
220  * @CDP_PPDU_STATS_PPDU_TYPE_BURST_BCN: burst beacon
221  * @CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP: bsr respond
222  * @CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG: bsr trigger
223  * @CDP_PPDU_STATS_PPDU_TYPE_UL_RESP: ul response
224  * @CDP_PPDU_STATS_PPDU_TYPE_UNKNOWN
225  */
226 enum CDP_PPDU_STATS_PPDU_TYPE {
227 	CDP_PPDU_STATS_PPDU_TYPE_SU = 0,
228 	CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO = 1,
229 	CDP_PPDU_STATS_PPDU_TYPE_MU_OFDMA = 2,
230 	CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA = 4,
231 	CDP_PPDU_STATS_PPDU_TYPE_UL_TRIG = 5,
232 	CDP_PPDU_STATS_PPDU_TYPE_BURST_BCN = 6,
233 	CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP = 7,
234 	CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG = 8,
235 	CDP_PPDU_STATS_PPDU_TYPE_UL_RESP = 9,
236 	CDP_PPDU_STATS_PPDU_TYPE_UNKNOWN = 0x1F,
237 };
238 
239 /*
240  * htt_dbg_stats_type -
241  * bit positions for each stats type within a stats type bitmask
242  * The bitmask contains 24 bits.
243  */
244 enum htt_cmn_dbg_stats_type {
245 	HTT_DBG_CMN_STATS_WAL_PDEV_TXRX      = 0,  /* bit 0 -> 0x1 */
246 	HTT_DBG_CMN_STATS_RX_REORDER         = 1,  /* bit 1 -> 0x2 */
247 	HTT_DBG_CMN_STATS_RX_RATE_INFO       = 2,  /* bit 2 -> 0x4 */
248 	HTT_DBG_CMN_STATS_TX_PPDU_LOG        = 3,  /* bit 3 -> 0x8 */
249 	HTT_DBG_CMN_STATS_TX_RATE_INFO       = 4,  /* bit 4 -> 0x10 */
250 	HTT_DBG_CMN_STATS_TIDQ               = 5,  /* bit 5 -> 0x20 */
251 	HTT_DBG_CMN_STATS_TXBF_INFO          = 6,  /* bit 6 -> 0x40 */
252 	HTT_DBG_CMN_STATS_SND_INFO           = 7,  /* bit 7 -> 0x80 */
253 	HTT_DBG_CMN_STATS_ERROR_INFO         = 8,  /* bit 8  -> 0x100 */
254 	HTT_DBG_CMN_STATS_TX_SELFGEN_INFO    = 9,  /* bit 9  -> 0x200 */
255 	HTT_DBG_CMN_STATS_TX_MU_INFO         = 10, /* bit 10 -> 0x400 */
256 	HTT_DBG_CMN_STATS_SIFS_RESP_INFO     = 11, /* bit 11 -> 0x800 */
257 	HTT_DBG_CMN_STATS_RESET_INFO         = 12, /* bit 12 -> 0x1000 */
258 	HTT_DBG_CMN_STATS_MAC_WDOG_INFO      = 13, /* bit 13 -> 0x2000 */
259 	HTT_DBG_CMN_STATS_TX_DESC_INFO       = 14, /* bit 14 -> 0x4000 */
260 	HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO  = 15, /* bit 15 -> 0x8000 */
261 	HTT_DBG_CMN_STATS_TX_PFSCHED_INFO    = 16, /* bit 16 -> 0x10000 */
262 	HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO = 17, /* bit 17 -> 0x20000 */
263 	/* bits 18-23 currently reserved */
264 
265 	/* keep this last */
266 	HTT_DBG_CMN_NUM_STATS,
267 	HTT_DBG_CMN_NUM_STATS_INVALID        = 31, /* bit 31 -> 0x80000000 */
268 };
269 
270 /*
271  * cdp_host_txrx_stats: Different types of host stats
272  * @TXRX_HOST_STATS_INVALID: Invalid option
273  * @TXRX_RX_RATE_STATS: Rx rate info
274  * @TXRX_TX_RATE_STATS: Tx rate info
275  * @TXRX_TX_HOST_STATS: Print Tx stats
276  * @TXRX_RX_HOST_STATS: Print host Rx stats
277  * @TXRX_CLEAR_STATS: clear all host stats
278  * @TXRX_SRNG_PTR_STATS: Print SRNG pointer stats
279  * @TXRX_RX_MON_STATS: Print monitor mode stats
280  * @TXRX_REO_QUEUE_STATS: Print Per peer REO Queue Stats
281  * @TXRX_SOC_CFG_PARAMS: Print soc cfg params info
282  * @TXRX_PDEV_CFG_PARAMS: Print pdev cfg params info
283  * @TXRX_NAPI_STATS: Print NAPI scheduling statistics
284  * @TXRX_SOC_INTERRUPT_STATS: Print soc interrupt stats
285  * @TXRX_HAL_REG_WRITE_STATS: Hal Reg Write stats
286  * @TXRX_SOC_REO_HW_DESC_DUMP: HW REO queue desc dump
287  * @TXRX_SOC_WBM_IDLE_HPTP_DUMP: WBM idle link desc SRNG HP/TP dump
288  * @TXRX_SRNG_USAGE_WM_STATS: SRNG usage watermark stats
289  */
290 enum cdp_host_txrx_stats {
291 	TXRX_HOST_STATS_INVALID  = -1,
292 	TXRX_CLEAR_STATS     = 0,
293 	TXRX_RX_RATE_STATS   = 1,
294 	TXRX_TX_RATE_STATS   = 2,
295 	TXRX_TX_HOST_STATS   = 3,
296 	TXRX_RX_HOST_STATS   = 4,
297 	TXRX_AST_STATS       = 5,
298 	TXRX_SRNG_PTR_STATS  = 6,
299 	TXRX_RX_MON_STATS    = 7,
300 	TXRX_REO_QUEUE_STATS = 8,
301 	TXRX_SOC_CFG_PARAMS   = 9,
302 	TXRX_PDEV_CFG_PARAMS  = 10,
303 	TXRX_NAPI_STATS       = 11,
304 	TXRX_SOC_INTERRUPT_STATS = 12,
305 	TXRX_SOC_FSE_STATS = 13,
306 	TXRX_HAL_REG_WRITE_STATS = 14,
307 	TXRX_SOC_REO_HW_DESC_DUMP = 15,
308 	TXRX_SOC_WBM_IDLE_HPTP_DUMP = 16,
309 	TXRX_SRNG_USAGE_WM_STATS = 17,
310 	TXRX_HOST_STATS_MAX,
311 };
312 
313 /*
314  * cdp_ppdu_ftype: PPDU Frame Type
315  * @CDP_PPDU_FTYPE_DATA: SU or MU Data Frame
316  * @CDP_PPDU_FTYPE_CTRL: Control/Management Frames
317  * @CDP_PPDU_FTYPE_BAR: SU or MU BAR frames
318 */
319 enum cdp_ppdu_ftype {
320 	CDP_PPDU_FTYPE_CTRL,
321 	CDP_PPDU_FTYPE_DATA,
322 	CDP_PPDU_FTYPE_BAR,
323 	CDP_PPDU_FTYPE_MAX
324 };
325 
326 
327 /**
328  * @brief General specification of the tx frame contents
329  *
330  * @details
331  * for efficiency, the HTT packet type values correspond
332  * to the bit positions of the WAL packet type values, so the
333  * translation is a simple shift operation.
334  */
335 enum htt_cmn_pkt_type {
336 	htt_cmn_pkt_type_raw = 0,
337 	htt_cmn_pkt_type_native_wifi = 1,
338 	htt_cmn_pkt_type_ethernet = 2,
339 	htt_cmn_pkt_type_mgmt = 3,
340 	htt_cmn_pkt_type_eth2 = 4,
341 
342 	/* keep this last */
343 	htt_cmn_pkt_num_types
344 };
345 
346 /**
347  * @General description of HTT received packets status
348  * It is similar to htt_rx_status enum
349  * but is added as a cdp enum can be freely used in OL_IF layer
350  */
351 enum htt_cmn_rx_status {
352 	htt_cmn_rx_status_unknown = 0x0,
353 	htt_cmn_rx_status_ok,
354 	htt_cmn_rx_status_err_fcs,
355 	htt_cmn_rx_status_err_dup,
356 	htt_cmn_rx_status_err_replay,
357 	htt_cmn_rx_status_inv_peer,
358 	htt_cmn_rx_status_ctrl_mgmt_null = 0x08,
359 	htt_cmn_rx_status_tkip_mic_err = 0x09,
360 	htt_cmn_rx_status_decrypt_err = 0x0A,
361 	htt_cmn_rx_status_mpdu_length_err = 0x0B,
362 	htt_cmn_rx_status_err_misc = 0xFF
363 };
364 
365 
366 enum cdp_host_reo_dest_ring {
367     cdp_host_reo_dest_ring_unknown = 0,
368     cdp_host_reo_dest_ring_1 = 1,
369     cdp_host_reo_dest_ring_2 = 2,
370     cdp_host_reo_dest_ring_3 = 3,
371     cdp_host_reo_dest_ring_4 = 4,
372 };
373 
374 enum htt_cmn_t2h_en_stats_type {
375     /* keep this alwyas first */
376     HTT_CMN_T2H_EN_STATS_TYPE_START     = 0,
377 
378     /** ppdu_common_stats is the payload */
379     HTT_CMN_T2H_EN_STATS_TYPE_COMMON    = 1,
380     /** ppdu_sant_stats is the payload */
381     HTT_CMN_T2H_EN_STATS_TYPE_SANT      = 2,
382     /** ppdu_common_stats_v2 is the payload */
383     HTT_CMN_T2H_EN_STATS_TYPE_COMMON_V2 = 3,
384 
385     /* Keep this last */
386     HTT_CMN_T2H_EN_STATS_TYPE_END       = 0x1f,
387 };
388 
389 enum htt_cmn_t2h_en_stats_status {
390     /* Keep this first always */
391     HTT_CMN_T2H_EN_STATS_STATUS_PARTIAL     = 0,
392     HTT_CMN_T2H_EN_STATS_STATUS_PRESENT     = 1,
393     HTT_CMN_T2H_EN_STATS_STATUS_ERROR       = 2,
394     HTT_CMN_T2H_EN_STATS_STATUS_INVALID     = 3,
395 
396 
397     /* keep this always last */
398     HTT_CMN_T2H_EN_STATS_STATUS_SERIES_DONE         = 7,
399 };
400 
401 /**
402  * enum cdp_peer_type - Peer type
403  * @CDP_INVALID_PEER_TYPE: invalid peer type
404  * @CDP_LINK_PEER_TYPE: legacy peer or link peer for MLO connection
405  * @CDP_MLD_PEER_TYPE: MLD peer for MLO connection
406  * @CDP_WILD_PEER_TYPE: used to set peer type for same mld/link mac addr
407  */
408 enum cdp_peer_type {
409 	CDP_INVALID_PEER_TYPE,
410 	CDP_LINK_PEER_TYPE,
411 	CDP_MLD_PEER_TYPE,
412 	CDP_WILD_PEER_TYPE,
413 };
414 
415 /**
416  * struct cdp_peer_setup_info: MLO connection info for cdp_peer_setup()
417  * @mld_peer_mac: mld peer mac address pointer
418  * @is_first_link: set true for first MLO link peer
419  * @is_primary_link: set true for MLO primary link peer
420  * @primary_umac_id: primary umac_id
421  * @num_links: number of links in MLO
422  */
423 struct cdp_peer_setup_info {
424 	uint8_t *mld_peer_mac;
425 	uint8_t is_first_link:1,
426 		is_primary_link:1;
427 	uint8_t primary_umac_id;
428 	uint8_t num_links;
429 };
430 
431 /**
432  * struct cdp_peer_info: peer info for dp hash find
433  * @vdev_id: Vdev ID
434  * @mac_addr: peer mac address to search
435  * @mac_addr_is_aligned: true only if mac_addr type is
436 			"union dp_align_mac_addr", otherwise set false always.
437  * @peer_type: link or MLD peer type
438  */
439 struct cdp_peer_info {
440 	uint8_t vdev_id;
441 	uint8_t *mac_addr;
442 	bool mac_addr_is_aligned;
443 	enum cdp_peer_type peer_type;
444 };
445 
446 /**
447  * struct ol_txrx_peer_state - Peer state information
448  */
449 enum ol_txrx_peer_state {
450 	OL_TXRX_PEER_STATE_INVALID,
451 	OL_TXRX_PEER_STATE_DISC,    /* initial state */
452 	OL_TXRX_PEER_STATE_CONN,    /* authentication in progress */
453 	OL_TXRX_PEER_STATE_AUTH,    /* authentication successful */
454 };
455 
456 /**
457  * struct ol_txrx_ast_type - AST entry type information
458  */
459 enum cdp_txrx_ast_entry_type {
460 	CDP_TXRX_AST_TYPE_NONE,	/* static ast entry for connected peer */
461 	CDP_TXRX_AST_TYPE_STATIC, /* static ast entry for connected peer */
462 	CDP_TXRX_AST_TYPE_SELF, /* static ast entry for self peer (STA mode) */
463 	CDP_TXRX_AST_TYPE_WDS,	/* WDS peer ast entry type*/
464 	CDP_TXRX_AST_TYPE_WDS_HM, /* HM WDS entry */
465 	CDP_TXRX_AST_TYPE_STA_BSS,	 /* BSS entry(STA mode) */
466 	CDP_TXRX_AST_TYPE_DA,	/* AST entry based on Destination address */
467 	CDP_TXRX_AST_TYPE_WDS_HM_SEC, /* HM WDS entry for secondary radio */
468 	CDP_TXRX_AST_TYPE_MLD, /* AST entry type for MLD peer */
469 	CDP_TXRX_AST_TYPE_MAX
470 };
471 
472 /*
473  * cdp_ast_free_status: status passed to callback function before freeing ast
474  * @CDP_TXRX_AST_DELETED - AST is deleted from FW and delete response received
475  * @CDP_TXRX_AST_DELETE_IN_PROGRESS - AST delete command sent to FW and host
476  *                                    is waiting for FW response
477  */
478 enum cdp_ast_free_status {
479 	CDP_TXRX_AST_DELETED,
480 	CDP_TXRX_AST_DELETE_IN_PROGRESS,
481 };
482 
483 /**
484  * txrx_ast_free_cb - callback registered for ast free
485  * @ctrl_soc: control path soc context
486  * @cdp_soc: DP soc context
487  * @cookie: cookie
488  * @cdp_ast_free_status: ast free status
489  */
490 typedef void (*txrx_ast_free_cb)(struct cdp_ctrl_objmgr_psoc *ctrl_soc,
491 				 struct cdp_soc *cdp_soc,
492 				 void *cookie,
493 				 enum cdp_ast_free_status);
494 
495 /**
496  *  struct cdp_ast_entry_info - AST entry information
497  *  @peer_mac_addr: mac address of peer on which AST entry is added
498  *  @type: ast entry type
499  *  @vdev_id: vdev_id
500  *  @pdev_id: pdev_id
501  *  @peer_id: peer_id
502  *
503  *  This structure holds the ast entry information
504  *
505  */
506 struct cdp_ast_entry_info {
507 	uint8_t peer_mac_addr[QDF_MAC_ADDR_SIZE];
508 	enum cdp_txrx_ast_entry_type type;
509 	uint8_t vdev_id;
510 	uint8_t pdev_id;
511 	uint16_t peer_id;
512 };
513 
514 #define MIC_SEQ_CTR_SIZE 6
515 
516 enum cdp_rx_frame_type {
517 	cdp_rx_frame_type_802_11,
518 	cdp_rx_frame_type_802_3,
519 };
520 
521 /**
522  *  struct cdp_rx_mic_err_info - rx mic error information
523  *  @frame_type: frame type - 0 - 802.11 frame
524  *                          - 1 - 802.3 frame
525  *  @data: 802.11 frame
526  *  @ta_mac_addr: transmitter mac address
527  *  @da_mac_addr: destination mac address
528  *  @tsc: sequence number
529  *  @key_id: Key ID
530  *  @multicast: flag for multicast
531  *  @vdev_id: vdev ID
532  *
533  *  This structure holds rx mic error information
534  *
535  */
536 struct cdp_rx_mic_err_info {
537 	uint8_t frame_type;
538 	uint8_t *data;
539 	struct qdf_mac_addr ta_mac_addr;
540 	struct qdf_mac_addr da_mac_addr;
541 	uint8_t tsc[MIC_SEQ_CTR_SIZE];
542 	uint8_t key_id;
543 	bool multicast;
544 	uint16_t vdev_id;
545 };
546 
547 #ifdef WLAN_SUPPORT_MSCS
548 /**
549  * struct cdp_mscs_params - MSCS parameters obtained
550  * from handshake
551  * @user_pri_bitmap - User priority bitmap
552  * @user_pri_limit - User priority limit
553  * @classifier_type - TCLAS Classifier type
554  * @classifier_mask - TCLAS Classifier mask
555  */
556 struct cdp_mscs_params {
557 	uint8_t user_pri_bitmap;
558 	uint8_t user_pri_limit;
559 	uint8_t classifier_type;
560 	uint8_t classifier_mask;
561 };
562 #endif
563 
564 /**
565  * struct cdp_sec_type - security type information
566  */
567 enum cdp_sec_type {
568     cdp_sec_type_none,
569     cdp_sec_type_wep128,
570     cdp_sec_type_wep104,
571     cdp_sec_type_wep40,
572     cdp_sec_type_tkip,
573     cdp_sec_type_tkip_nomic,
574     cdp_sec_type_aes_ccmp,
575     cdp_sec_type_wapi,
576     cdp_sec_type_aes_ccmp_256,
577     cdp_sec_type_aes_gcmp,
578     cdp_sec_type_aes_gcmp_256,
579 
580     /* keep this last! */
581     cdp_num_sec_types
582 };
583 
584 /**
585  *  struct cdp_tx_exception_metadata - Exception path parameters
586  *  @peer_id: Peer id of the peer
587  *  @tid: Transmit Identifier
588  *  @tx_encap_type: Transmit encap type (i.e. Raw, Native Wi-Fi, Ethernet)
589  *  @sec_type: sec_type to be passed to HAL
590  *  @is_tx_sniffer: Indicates if the packet has to be sniffed
591  *  @ppdu_cookie: 16-bit ppdu cookie that has to be replayed back in completions
592  *
593  *  This structure holds the parameters needed in the exception path of tx
594  *
595  */
596 struct cdp_tx_exception_metadata {
597 	uint16_t peer_id;
598 	uint8_t tid;
599 	uint16_t tx_encap_type;
600 	enum cdp_sec_type sec_type;
601 	uint8_t is_tx_sniffer :1,
602 		is_intrabss_fwd :1;
603 	uint16_t ppdu_cookie;
604 #ifdef QCA_SUPPORT_WDS_EXTENDED
605 	uint8_t is_wds_extended;
606 #endif
607 };
608 
609 /**
610  * wlan_op_mode - Virtual device operation mode
611  * @wlan_op_mode_unknown: Unknown mode
612  * @wlan_op_mode_ap: AP mode
613  * @wlan_op_mode_ibss: IBSS mode
614  * @wlan_op_mode_sta: STA (client) mode
615  * @wlan_op_mode_monitor: Monitor mode
616  * @wlan_op_mode_ocb: OCB mode
617  * @wlan_op_mode_ndi: NDI mode
618  */
619 enum wlan_op_mode {
620 	wlan_op_mode_unknown,
621 	wlan_op_mode_ap,
622 	wlan_op_mode_ibss,
623 	wlan_op_mode_sta,
624 	wlan_op_mode_monitor,
625 	wlan_op_mode_ocb,
626 	wlan_op_mode_ndi,
627 };
628 
629 /**
630  * enum wlan_op_subtype - Virtual device subtype
631  * @wlan_op_subtype_none: Subtype not applicable
632  * @wlan_op_subtype_p2p_device: P2P device
633  * @wlan_op_subtye_p2p_cli: P2P Client
634  * @wlan_op_subtype_p2p_go: P2P GO
635  *
636  * This enum lists the subtypes of a particular virtual
637  * device.
638  */
639 enum wlan_op_subtype {
640 	wlan_op_subtype_none,
641 	wlan_op_subtype_p2p_device,
642 	wlan_op_subtype_p2p_cli,
643 	wlan_op_subtype_p2p_go,
644 };
645 
646 /**
647  * struct cdp_vdev_info - Vdev information
648  * @vdev_mac_addr: mac address of the vdev
649  * @vdev_id: ID of the vdev
650  * @vdev_stats_id: Stats ID of the vdev
651  * @op_mode: Operation mode of the vdev
652  * @subtype: subtype of the vdev
653  * @mld_mac_addr: MLD mac addr of the current vdev.
654  */
655 struct cdp_vdev_info {
656 	uint8_t *vdev_mac_addr;
657 	uint8_t vdev_id;
658 	uint8_t vdev_stats_id;
659 	enum wlan_op_mode op_mode;
660 	enum wlan_op_subtype subtype;
661 #ifdef WLAN_FEATURE_11BE_MLO
662 	uint8_t *mld_mac_addr;
663 #endif
664 };
665 
666 typedef struct cdp_soc_t *ol_txrx_soc_handle;
667 
668 /**
669  * ol_txrx_vdev_delete_cb - callback registered during vdev
670  * detach
671  */
672 typedef void (*ol_txrx_vdev_delete_cb)(void *context);
673 
674 /**
675  * ol_txrx_peer_unmap_sync_cb - callback registered during peer detach sync
676  */
677 typedef QDF_STATUS(*ol_txrx_peer_unmap_sync_cb)(uint8_t vdev_id,
678 						 uint32_t peer_id_cnt,
679 						 uint16_t *peer_id_list);
680 
681 /**
682  * ol_txrx_pkt_direction - Packet Direction
683  * @rx_direction: rx path packet
684  * @tx_direction: tx path packet
685  */
686 enum txrx_direction {
687 	rx_direction = 1,
688 	tx_direction = 0,
689 };
690 
691 /**
692  * enum cdp_capabilities- DP capabilities
693  * @CDP_CFG_DP_TSO: TSO capability
694  * @CDP_CFG_DP_LRO: LRO capability
695  * @CDP_CFG_DP_SG: Scatter Gather capability
696  * @CDP_CFG_DP_GRO: GRO capability
697  * @CDP_CFG_DP_OL_TX_CSUM: Hardware based TX checksum capability
698  * @CDP_CFG_DP_OL_RX_CSUM: Hardware based RX checksum capability
699  * @CDP_CFG_DP_RAWMODE: RAW mode capability
700  * @CDP_CFG_DP_PEER_FLOW_CTRL: Peer flow-control capability
701  * @CDP_CFG_DP_MARK_NOTIFY_FRAME_SUPPORT: mark notify frames capability
702  */
703 enum cdp_capabilities {
704 	CDP_CFG_DP_TSO,
705 	CDP_CFG_DP_LRO,
706 	CDP_CFG_DP_SG,
707 	CDP_CFG_DP_GRO,
708 	CDP_CFG_DP_OL_TX_CSUM,
709 	CDP_CFG_DP_OL_RX_CSUM,
710 	CDP_CFG_DP_RAWMODE,
711 	CDP_CFG_DP_PEER_FLOW_CTRL,
712 	CDP_CFG_DP_MARK_NOTIFY_FRAME_SUPPORT,
713 };
714 
715 /**
716  * ol_txrx_nbuf_classify - Packet classification object
717  * @peer_id: unique peer identifier from fw
718  * @tid: traffic identifier(could be overridden)
719  * @pkt_tid: traffic identifier(cannot be overridden)
720  * @pkt_tos: ip header tos value
721  * @pkt_dscp: ip header dscp value
722  * @tos: index value in map
723  * @dscp: DSCP_TID map index
724  * @is_mcast: multicast pkt check
725  * @is_eap: eapol pkt check
726  * @is_arp: arp pkt check
727  * @is_tcp: tcp pkt check
728  * @is_dhcp: dhcp pkt check
729  * @is_igmp: igmp pkt check
730  * @is_ipv4: ip version 4 pkt check
731  * @is_ipv6: ip version 6 pkt check
732  */
733 struct ol_txrx_nbuf_classify {
734 	uint16_t peer_id;
735 	uint8_t tid;
736 	uint8_t pkt_tid;
737 	uint8_t pkt_tos;
738 	uint8_t pkt_dscp;
739 	uint8_t tos;
740 	uint8_t dscp;
741 	uint8_t is_mcast;
742 	uint8_t is_eap;
743 	uint8_t is_arp;
744 	uint8_t is_tcp;
745 	uint8_t is_dhcp;
746 	uint8_t is_igmp;
747 	uint8_t is_ipv4;
748 	uint8_t is_ipv6;
749 };
750 
751 /**
752  * ol_osif_vdev_handle - paque handle for OS shim virtual device
753  * object
754  */
755 struct ol_osif_vdev_t;
756 typedef struct ol_osif_vdev_t *ol_osif_vdev_handle;
757 
758 #ifdef QCA_SUPPORT_WDS_EXTENDED
759 struct ol_osif_peer_t;
760 typedef struct ol_osif_peer_t *ol_osif_peer_handle;
761 #endif
762 
763 /**
764  * connectivity_stats_pkt_status - data pkt type
765  * @PKT_TYPE_REQ: Request packet
766  * @PKT_TYPE_RSP: Response packet
767  * @PKT_TYPE_TX_DROPPED: TX packet dropped
768  * @PKT_TYPE_RX_DROPPED: RX packet dropped
769  * @PKT_TYPE_RX_DELIVERED: RX packet delivered
770  * @PKT_TYPE_RX_REFUSED: RX packet refused
771  * @PKT_TYPE_TX_HOST_FW_SENT: TX packet FW sent
772  * @PKT_TYPE_TX_ACK_CNT:TC packet acked
773  * @PKT_TYPE_NONE: Invalid packet
774  */
775 enum connectivity_stats_pkt_status {
776 	PKT_TYPE_REQ,
777 	PKT_TYPE_RSP,
778 	PKT_TYPE_TX_DROPPED,
779 	PKT_TYPE_RX_DROPPED,
780 	PKT_TYPE_RX_DELIVERED,
781 	PKT_TYPE_RX_REFUSED,
782 	PKT_TYPE_TX_HOST_FW_SENT,
783 	PKT_TYPE_TX_ACK_CNT,
784 	PKT_TYPE_NONE,
785 };
786 
787 /**
788  * ol_txrx_mgmt_tx_cb - tx management delivery notification
789  * callback function
790  */
791 typedef void
792 (*ol_txrx_mgmt_tx_cb)(void *ctxt, qdf_nbuf_t tx_mgmt_frm, int had_error);
793 
794 /**
795  * ol_txrx_data_tx_cb - Function registered with the data path
796  * that is called when tx frames marked as "no free" are
797  * done being transmitted
798  */
799 typedef void
800 (*ol_txrx_data_tx_cb)(void *ctxt, qdf_nbuf_t tx_frm, int had_error);
801 
802 /**
803  * ol_txrx_tx_fp - top-level transmit function
804  * @soc - dp soc handle
805  * @vdev_id - handle to the virtual device object
806  * @msdu_list - list of network buffers
807  */
808 typedef qdf_nbuf_t (*ol_txrx_tx_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
809 				    qdf_nbuf_t msdu_list);
810 
811 /**
812  * ol_txrx_tx_fast_fp - top-level fast transmit function
813  * @soc - dp soc handle
814  * @vdev_id - handle to the virtual device object
815  * @msdu_list - list of network buffers
816  */
817 typedef qdf_nbuf_t (*ol_txrx_tx_fast_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
818 					 qdf_nbuf_t msdu_list);
819 
820 /**
821  * ol_txrx_tx_exc_fp - top-level transmit function on exception path
822  * @soc - dp soc handle
823  * @vdev_id - handle to the virtual device object
824  * @msdu_list - list of network buffers
825  * @tx_exc_metadata - structure that holds parameters to exception path
826  */
827 typedef qdf_nbuf_t (*ol_txrx_tx_exc_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
828 					qdf_nbuf_t msdu_list,
829 					struct cdp_tx_exception_metadata
830 						*tx_exc_metadata);
831 
832 /**
833  * ol_txrx_completion_fp - top-level transmit function
834  * for tx completion
835  * @skb: skb data
836  * @osif_dev: the virtual device's OS shim object
837  * @flag: flag
838  */
839 typedef void (*ol_txrx_completion_fp)(qdf_nbuf_t skb,
840 				      void *osif_dev, uint16_t flag);
841 
842 /**
843  * ol_txrx_classify_critical_pkt_fp - classification cb for critical frames
844  * @osif_dev: the virtual device's OS shim object
845  * @skb: skb data
846  */
847 typedef void (*ol_txrx_classify_critical_pkt_fp)(void *osif_dev,
848 						 qdf_nbuf_t skb);
849 /**
850  * ol_txrx_tx_flow_control_fp - tx flow control notification
851  * function from txrx to OS shim
852  * @osif_dev - the virtual device's OS shim object
853  * @tx_resume - tx os q should be resumed or not
854  */
855 typedef void (*ol_txrx_tx_flow_control_fp)(void *osif_dev,
856 					    bool tx_resume);
857 
858 /**
859  * ol_txrx_tx_flow_control_is_pause_fp - is tx paused by flow control
860  * function from txrx to OS shim
861  * @osif_dev - the virtual device's OS shim object
862  *
863  * Return: true if tx is paused by flow control
864  */
865 typedef bool (*ol_txrx_tx_flow_control_is_pause_fp)(void *osif_dev);
866 
867 /**
868  * ol_txrx_rx_fp - receive function to hand batches of data
869  * frames from txrx to OS shim
870  * @data_vdev - handle to the OSIF virtual device object
871  * @msdu_list - list of network buffers
872  */
873 typedef QDF_STATUS(*ol_txrx_rx_fp)(void *osif_dev, qdf_nbuf_t msdu_list);
874 
875 typedef QDF_STATUS(*ol_txrx_fisa_rx_fp)(void *soc,
876 					void *dp_vdev,
877 					qdf_nbuf_t msdu_list);
878 
879 typedef QDF_STATUS(*ol_txrx_fisa_flush_fp)(void *soc, int ring_num);
880 /**
881  * ol_txrx_rx_flush_fp - receive function to hand batches of data
882  * frames from txrx to OS shim
883  * @osif_dev: handle to the OSIF virtual device object
884  * @vdev_id: vdev_if of the packets to be flushed
885  */
886 typedef QDF_STATUS(*ol_txrx_rx_flush_fp)(void *osif_dev, uint8_t vdev_id);
887 
888 /**
889  * ol_txrx_rx_gro_flush_ind - function to send GRO flush indication to stack
890  * for a given RX Context Id.
891  * @osif_dev - handle to the OSIF virtual device object
892  * @rx_ctx_id - Rx context Id for which gro flush should happen
893  */
894 typedef QDF_STATUS(*ol_txrx_rx_gro_flush_ind_fp)(void *osif_dev,
895 						 int rx_ctx_id);
896 
897 /**
898  * ol_txrx_stats_rx_fp - receive function to hand batches of data
899  * frames from txrx to OS shim
900  * @skb: skb data
901  * @osif_dev: the virtual device's OS shim object
902  * @action: data packet type
903  * @pkt_type: packet data type
904  */
905 typedef void (*ol_txrx_stats_rx_fp)(struct sk_buff *skb,
906 		void *osif_dev, enum connectivity_stats_pkt_status action,
907 		uint8_t *pkt_type);
908 
909 /**
910  * ol_txrx_get_key_fp - function to gey key based on keyix and peer
911  * mac address
912  * @osif_dev - the virtual device's OS shim object
913  * @key_buf - pointer to store key
914  * @mac_addr - pointer to mac address
915  * @keyix - key id
916  */
917 typedef QDF_STATUS(*ol_txrx_get_key_fp)(void *osif_dev, uint8_t *key_buf, uint8_t *mac_addr, uint8_t keyix);
918 
919 /**
920  * ol_txrx_rsim_rx_decap_fp - raw mode simulation function to decap the
921  * packets in receive path.
922  * @osif_dev  - the virtual device's OS shim object
923  * @list_head - poniter to head of receive packet queue to decap
924  * @list_tail - poniter to tail of receive packet queue to decap
925  * @peer_mac  - mac address of peer handler
926  */
927 typedef QDF_STATUS(*ol_txrx_rsim_rx_decap_fp)(void *osif_dev,
928 						qdf_nbuf_t *list_head,
929 						qdf_nbuf_t *list_tail);
930 
931 /* ol_txrx_rx_fp - external tx free function to read per packet stats and
932  *                            free tx buffer externally
933  * @netbuf - tx network buffer
934  */
935 typedef void (*ol_txrx_tx_free_ext_fp)(qdf_nbuf_t netbuf);
936 
937 /**
938  * ol_txrx_rx_check_wai_fp - OSIF WAPI receive function
939 */
940 typedef bool (*ol_txrx_rx_check_wai_fp)(ol_osif_vdev_handle vdev,
941 					    qdf_nbuf_t mpdu_head,
942 					    qdf_nbuf_t mpdu_tail);
943 /**
944  * ol_txrx_rx_mon_fp - OSIF monitor mode receive function for single
945  * MPDU (802.11 format)
946  */
947 typedef void (*ol_txrx_rx_mon_fp)(ol_osif_vdev_handle vdev,
948 					    qdf_nbuf_t mpdu,
949 					    void *rx_status);
950 
951 /**
952  * ol_txrx_proxy_arp_fp - proxy arp function pointer
953 */
954 typedef int (*ol_txrx_proxy_arp_fp)(ol_osif_vdev_handle vdev,
955 					    qdf_nbuf_t netbuf);
956 
957 /*
958  * ol_txrx_mcast_me_fp - function pointer for multicast enhancement
959  */
960 typedef int (*ol_txrx_mcast_me_fp)(ol_osif_vdev_handle vdev,
961 						qdf_nbuf_t netbuf);
962 
963 /**
964  * ol_txrx_stats_callback - statistics notify callback
965  */
966 typedef void (*ol_txrx_stats_callback)(void *ctxt,
967 				       enum htt_cmn_dbg_stats_type type,
968 				       uint8_t *buf, int bytes);
969 
970 /**
971  * ol_txrx_pktdump_cb - callback for packet dump feature
972  */
973 typedef void (*ol_txrx_pktdump_cb)(ol_txrx_soc_handle soc,
974 				   uint8_t pdev_id,
975 				   uint8_t vdev_id,
976 				   qdf_nbuf_t netbuf,
977 				   enum qdf_dp_tx_rx_status status,
978 				   enum qdf_pkt_type type);
979 
980 /**
981  * ol_txrx_get_tsf_time - callback to get tsf time
982  */
983 typedef QDF_STATUS(*ol_txrx_get_tsf_time)(void *osif_dev, uint64_t input_time,
984 					  uint64_t *tsf_time);
985 
986 /**
987  * ol_txrx_ops - (pointers to) the functions used for tx and rx
988  * data xfer
989  *
990  * There are two portions of these txrx operations.
991  * The rx portion is filled in by OSIF SW before calling
992  * ol_txrx_osif_vdev_register; inside the ol_txrx_osif_vdev_register
993  * the txrx SW stores a copy of these rx function pointers, to use
994  * as it delivers rx data frames to the OSIF SW.
995  * The tx portion is filled in by the txrx SW inside
996  * ol_txrx_osif_vdev_register; when the function call returns,
997  * the OSIF SW stores a copy of these tx functions to use as it
998  * delivers tx data frames to the txrx SW.
999  *
1000  * @tx.std -  the tx function pointer for standard data
1001  * frames This function pointer is set by the txrx SW
1002  * perform host-side transmit operations based on
1003  * whether a HL or LL host/target interface is in use.
1004  * @tx.flow_control_cb - the transmit flow control
1005  * function that is registered by the
1006  * OSIF which is called from txrx to
1007  * indicate whether the transmit OS
1008  * queues should be paused/resumed
1009  * @rx.rx - the OS shim rx function to deliver rx data
1010  * frames to. This can have different values for
1011  * different virtual devices, e.g. so one virtual
1012  * device's OS shim directly hands rx frames to the OS,
1013  * but another virtual device's OS shim filters out P2P
1014  * messages before sending the rx frames to the OS. The
1015  * netbufs delivered to the osif_rx function are in the
1016  * format specified by the OS to use for tx and rx
1017  * frames (either 802.3 or native WiFi). In case RX Threads are enabled, pkts
1018  * are given to the thread, instead of the stack via this pointer.
1019  * @rx.rx_eapol - This rx function pointer used to receive only eapol frames
1020  * @rx.stack - function to give packets to the stack. Differs from @rx.rx.
1021  * In case RX Threads are enabled, this pointer holds the callback to give
1022  * packets to the stack.
1023  * @rx.rx_gro_flush - GRO flush indication to stack for a given RX CTX ID
1024  * @rx.wai_check - the tx function pointer for WAPI frames
1025  * @rx.mon - the OS shim rx monitor function to deliver
1026  * monitor data to Though in practice, it is probable
1027  * that the same function will be used for delivering
1028  * rx monitor data for all virtual devices, in theory
1029  * each different virtual device can have a different
1030  * OS shim function for accepting rx monitor data. The
1031  * netbufs delivered to the osif_rx_mon function are in
1032  * 802.11 format.  Each netbuf holds a 802.11 MPDU, not
1033  * an 802.11 MSDU. Depending on compile-time
1034  * configuration, each netbuf may also have a
1035  * monitor-mode encapsulation header such as a radiotap
1036  * header added before the MPDU contents.
1037  * @rx.std - the OS shim rx function to deliver rx data
1038  * @proxy_arp - proxy arp function pointer - specified by
1039  * OS shim, stored by txrx
1040  * @get_key - function pointer to get key of the peer with
1041  * specific key index
1042  */
1043 struct ol_txrx_ops {
1044 	/* tx function pointers - specified by txrx, stored by OS shim */
1045 	struct {
1046 		ol_txrx_tx_fp         tx;
1047 		ol_txrx_tx_fast_fp    tx_fast;
1048 		ol_txrx_tx_exc_fp     tx_exception;
1049 		ol_txrx_tx_free_ext_fp tx_free_ext;
1050 		ol_txrx_completion_fp tx_comp;
1051 		ol_txrx_classify_critical_pkt_fp tx_classify_critical_pkt_cb;
1052 	} tx;
1053 
1054 	/* rx function pointers - specified by OS shim, stored by txrx */
1055 	struct {
1056 		ol_txrx_rx_fp           rx;
1057 #ifdef QCA_SUPPORT_EAPOL_OVER_CONTROL_PORT
1058 		ol_txrx_rx_fp     rx_eapol;
1059 #endif
1060 		ol_txrx_rx_fp           rx_stack;
1061 		ol_txrx_rx_flush_fp     rx_flush;
1062 		ol_txrx_rx_gro_flush_ind_fp           rx_gro_flush;
1063 		ol_txrx_rx_check_wai_fp wai_check;
1064 		ol_txrx_rx_mon_fp       mon;
1065 		ol_txrx_stats_rx_fp           stats_rx;
1066 		ol_txrx_rsim_rx_decap_fp rsim_rx_decap;
1067 		ol_txrx_fisa_rx_fp	osif_fisa_rx;
1068 		ol_txrx_fisa_flush_fp   osif_fisa_flush;
1069 	} rx;
1070 	/* proxy arp function pointer - specified by OS shim, stored by txrx */
1071 	ol_txrx_proxy_arp_fp      proxy_arp;
1072 	ol_txrx_mcast_me_fp          me_convert;
1073 
1074 	ol_txrx_get_key_fp  get_key;
1075 	ol_txrx_get_tsf_time get_tsf_time;
1076 };
1077 
1078 /**
1079  * ol_txrx_hardtart_ctxt - handlers for dp tx path
1080  *
1081  */
1082 struct ol_txrx_hardtart_ctxt {
1083 	ol_txrx_tx_fp         tx;
1084 	ol_txrx_tx_fast_fp    tx_fast;
1085 	ol_txrx_tx_exc_fp     tx_exception;
1086 };
1087 
1088 /**
1089  * ol_txrx_stats_req - specifications of the requested
1090  * statistics
1091  */
1092 struct ol_txrx_stats_req {
1093 	uint32_t stats_type_upload_mask;        /* which stats to upload */
1094 	uint32_t stats_type_reset_mask; /* which stats to reset */
1095 
1096 	/* stats will be printed if either print element is set */
1097 	struct {
1098 		int verbose;    /* verbose stats printout */
1099 		int concise;    /* concise stats printout (takes precedence) */
1100 	} print;                /* print uploaded stats */
1101 
1102 	/* stats notify callback will be invoked if fp is non-NULL */
1103 	struct {
1104 		ol_txrx_stats_callback fp;
1105 		void *ctxt;
1106 	} callback;
1107 
1108 	/* stats will be copied into the specified buffer if buf is non-NULL */
1109 	struct {
1110 		uint8_t *buf;
1111 		int byte_limit; /* don't copy more than this */
1112 	} copy;
1113 
1114 	/*
1115 	 * If blocking is true, the caller will take the specified semaphore
1116 	 * to wait for the stats to be uploaded, and the driver will release
1117 	 * the semaphore when the stats are done being uploaded.
1118 	 */
1119 	struct {
1120 		int blocking;
1121 		/*Note: this needs to change to some qdf_* type */
1122 		qdf_semaphore_t *sem_ptr;
1123 	} wait;
1124 };
1125 
1126 
1127 /* DP soc struct definition */
1128 struct cdp_soc_t {
1129 	struct cdp_ops *ops;
1130 	struct ol_if_ops *ol_ops;
1131 };
1132 
1133 /*
1134  * cdp_peer_param_type: different types of parameters
1135  *			to set values in peer
1136  * @CDP_CONFIG_NAWDS: Enable nawds mode
1137  * @CDP_CONFIG_NAC: Enable nac
1138  * @CDP_CONFIG_ISOLATION : Enable isolation
1139  * @CDP_CONFIG_IN_TWT : In TWT session or not
1140  */
1141 enum cdp_peer_param_type {
1142 	CDP_CONFIG_NAWDS,
1143 	CDP_CONFIG_NAC,
1144 	CDP_CONFIG_ISOLATION,
1145 	CDP_CONFIG_IN_TWT,
1146 };
1147 
1148 /*
1149  * cdp_pdev_param_type: different types of parameters
1150  *			to set values in pdev
1151  * @CDP_CONFIG_DEBUG_SNIFFER: Enable debug sniffer feature
1152  * @CDP_CONFIG_BPR_ENABLE: Enable bcast probe feature
1153  * @CDP_CONFIG_PRIMARY_RADIO: Configure radio as primary
1154  * @CDP_CONFIG_ENABLE_PERPKT_TXSTATS: Enable per packet statistics
1155  * @CDP_CONFIG_IGMPMLD_OVERRIDE: Override IGMP/MLD
1156  * @CDP_CONFIG_IGMPMLD_TID: Configurable TID value when igmmld_override is set
1157  * @CDP_CONFIG_ARP_DBG_CONF: Enable ARP debug
1158  * @CDP_CONFIG_CAPTURE_LATENCY: Capture time latency
1159  * @CDP_INGRESS_STATS: Accumulate ingress statistics
1160  * @CDP_OSIF_DROP: Accumulate drops in OSIF layer
1161  * @CDP_CONFIG_ENH_RX_CAPTURE: Enable enhanced RX capture
1162  * @CDP_CONFIG_ENH_TX_CAPTURE: Enable enhanced TX capture
1163  * @CDP_CONFIG_HMMC_TID_OVERRIDE: Enable hmmc tid override
1164  * @CDP_CONFIG_HMMC_TID_VALUE: set hmmc tid value
1165  * @CDP_CONFIG_TX_CAPTURE: set tx capture
1166  * @CDP_CHAN_NOISE_FLOOR: set channel noise floor
1167  * @CDP_CONFIG_VOW: set/get vow config
1168  * @CDP_TIDQ_OVERRIDE: set/get tid queue override
1169  * @CDP_TIDMAP_PRTY: set/get tid map prty
1170  * @CDP_TX_PENDING: get tx pending
1171  * @CDP_FILTER_NEIGH_PEERS: filter neighbour peers
1172  * @CDP_FILTER_UCAST_DATA: filter unicast data
1173  * @CDP_FILTER_MCAST_DATA: filter multicast data
1174  * @CDP_FILTER_NO_DATA: filter no data
1175  * @CDP_MONITOR_CHANNEL: monitor channel
1176  * @CDP_MONITOR_FREQUENCY: monitor frequency
1177  * @CDP_CONFIG_BSS_COLOR: configure bss color
1178  * @CDP_SET_ATF_STATS_ENABLE: set ATF stats flag
1179  * @CDP_CONFIG_SPECIAL_VAP: Configure Special vap
1180  * @CDP_RESET_SCAN_SPCL_VAP_STATS_ENABLE: Enable scan spcl vap stats reset
1181  * @CDP_ISOLATION: set isolation flag
1182  * @CDP_CONFIG_UNDECODED_METADATA_CAPTURE_ENABLE: Undecoded metadata capture
1183  */
1184 enum cdp_pdev_param_type {
1185 	CDP_CONFIG_DEBUG_SNIFFER,
1186 	CDP_CONFIG_BPR_ENABLE,
1187 	CDP_CONFIG_PRIMARY_RADIO,
1188 	CDP_CONFIG_ENABLE_PERPKT_TXSTATS,
1189 	CDP_CONFIG_IGMPMLD_OVERRIDE,
1190 	CDP_CONFIG_IGMPMLD_TID,
1191 	CDP_CONFIG_ARP_DBG_CONF,
1192 	CDP_CONFIG_CAPTURE_LATENCY,
1193 	CDP_INGRESS_STATS,
1194 	CDP_OSIF_DROP,
1195 	CDP_CONFIG_ENH_RX_CAPTURE,
1196 	CDP_CONFIG_ENH_TX_CAPTURE,
1197 	CDP_CONFIG_HMMC_TID_OVERRIDE,
1198 	CDP_CONFIG_HMMC_TID_VALUE,
1199 	CDP_CONFIG_TX_CAPTURE,
1200 	CDP_CHAN_NOISE_FLOOR,
1201 	CDP_CONFIG_VOW,
1202 	CDP_TIDQ_OVERRIDE,
1203 	CDP_TIDMAP_PRTY,
1204 	CDP_TX_PENDING,
1205 	CDP_FILTER_NEIGH_PEERS,
1206 	CDP_FILTER_UCAST_DATA,
1207 	CDP_FILTER_MCAST_DATA,
1208 	CDP_FILTER_NO_DATA,
1209 	CDP_MONITOR_CHANNEL,
1210 	CDP_MONITOR_FREQUENCY,
1211 	CDP_CONFIG_BSS_COLOR,
1212 	CDP_SET_ATF_STATS_ENABLE,
1213 	CDP_CONFIG_SPECIAL_VAP,
1214 	CDP_RESET_SCAN_SPCL_VAP_STATS_ENABLE,
1215 	CDP_CONFIG_ENHANCED_STATS_ENABLE,
1216 	CDP_ISOLATION,
1217 	CDP_CONFIG_UNDECODED_METADATA_CAPTURE_ENABLE,
1218 };
1219 
1220 /*
1221  * cdp_config_param_type: union of different types of parameters
1222  *			to set values into dp handles.
1223  *
1224  * @cdp_peer_param_nawds: Enable nawds mode
1225  * @cdp_peer_param_isolation: Enable isolation
1226  * @cdp_peer_param_in_twt: in TWT session or not
1227  * @cdp_peer_param_nac: Enable nac
1228  *
1229  * @cdp_vdev_param_nawds: set nawds enable/disable
1230  * @cdp_vdev_param_mcast_en: enable/disable multicast enhancement
1231  * @cdp_vdev_param_wds: wds sta
1232  * @cdp_vdev_param_mec: MEC enable flags
1233  * @cdp_vdev_param_proxysta: proxy sta
1234  * @cdp_vdev_param_tdls_flags: tdls link flags
1235  * @cdp_vdev_param_ap_brdg_en: set ap_bridging enable/disable
1236  * @cdp_vdev_param_cipher_en: set cipher type based on security
1237  * @cdp_vdev_param_qwrap_isolation: qwrap isolation mode
1238  * @cdp_vdev_param_tx_encap: tx encap type
1239  * @cdp_vdev_param_rx_decap: rx decap type
1240  * @cdp_vdev_param_mesh_rx_filter: set mesh rx filter
1241  * @cdp_vdev_param_tidmap_prty: set tid vdev prty
1242  * @cdp_vdev_param_tidmap_tbl_id: set tidmap table id
1243  * @cdp_vdev_param_mesh_mode: set mesh mode
1244  * @cdp_vdev_param_safe_mode: set safe mode
1245  * @cdp_vdev_param_drop_unenc: set drop unencrypted flag
1246  * @cdp_vdev_param_hlos_tid_override: set hlos tid override
1247  * @cdp_vdev_param_peer_authorize: set peer authorize
1248  * @cdp_vdev_param_peer_tid_latency_enable: set peer tid latency enable flag
1249  * @cdp_vdev_param_mesh_tid: config tatency tid on vdev
1250  * @cdp_vdev_param_dscp_tid_map_id: set dscp to tid map id
1251  * @cdp_vdev_param_mcast_vdev: set mcast vdev params
1252  * @cdp_vdev_param_wrap: qwrap ap vap
1253  *
1254  * @cdp_pdev_param_dbg_snf: Enable debug sniffer feature
1255  * @cdp_pdev_param_bpr_enable: Enable bcast probe feature
1256  * @cdp_pdev_param_primary_radio: Configure radio as primary
1257  * @cdp_pdev_param_en_perpkt_txstats: Enable per packet statistics
1258  * @cdp_pdev_param_igmpmld_override: Override IGMP/MLD
1259  * @cdp_pdev_param_igmpmld_tid: TID value when igmmld_override is set
1260  * @cdp_pdev_param_arp_dbg_conf: Enable ARP debug
1261  * @cdp_pdev_param_cptr_latcy: Capture time latency
1262  * @cdp_pdev_param_ingrs_stats: Accumulate ingress statistics
1263  * @cdp_pdev_param_osif_drop: Accumulate drops in OSIF layer
1264  * @cdp_pdev_param_en_rx_cap: Enable enhanced RX capture
1265  * @cdp_pdev_param_en_tx_cap: Enable enhanced TX capture
1266  * @cdp_pdev_param_hmmc_tid_ovrd: Enable hmmc tid override
1267  * @cdp_pdev_param_hmmc_tid: set hmmc tid value
1268  * @cdp_pdev_param_tx_capture: set tx capture
1269  * @cdp_pdev_param_chn_noise_flr: set channel noise floor
1270  * @cdp_pdev_param_cfg_vow: set/get vow config
1271  * @cdp_pdev_param_tidq_override: set/get tid queue override
1272  * @cdp_pdev_param_mon_freq: set monitor frequency
1273  * @cdp_pdev_param_bss_color: configure bss color
1274  * @cdp_pdev_param_tidmap_prty: set/get tid map prty
1275  * @cdp_pdev_param_tx_pending: get tx pending
1276  * @cdp_pdev_param_fltr_neigh_peers: filter neighbour peers
1277  * @cdp_pdev_param_fltr_ucast: filter unicast data
1278  * @cdp_pdev_param_fltr_mcast: filter multicast data
1279  * @cdp_pdev_param_fltr_none: filter no data
1280  * @cdp_pdev_param_monitor_chan: monitor channel
1281  * @cdp_pdev_param_atf_stats_enable: ATF stats enable
1282  * @cdp_pdev_param_config_special_vap: Configure Special vap
1283  * @cdp_pdev_param_isolation : set isolation mode
1284  *
1285  * @cdp_psoc_param_en_rate_stats: set rate stats enable/disable
1286  * @cdp_psoc_param_en_nss_cfg: set nss cfg
1287  * @cdp_ipa_enabled : set ipa mode
1288  * @cdp_psoc_param_vdev_stats_hw_offload: Configure HW vdev stats offload
1289  * @cdp_pdev_param_undecoded_metadata_enable: Undecoded metadata capture enable
1290  * @cdp_vdev_param_traffic_end_ind: Traffic end indication enable/disable
1291  */
1292 typedef union cdp_config_param_t {
1293 	/* peer params */
1294 	bool cdp_peer_param_nawds;
1295 	bool cdp_peer_param_isolation;
1296 	uint8_t cdp_peer_param_nac;
1297 	bool cdp_peer_param_in_twt;
1298 
1299 	/* vdev params */
1300 	bool cdp_vdev_param_wds;
1301 	bool cdp_vdev_param_mec;
1302 	bool cdp_vdev_param_nawds;
1303 	bool cdp_vdev_param_proxysta;
1304 	bool cdp_vdev_param_tdls_flags;
1305 	bool cdp_vdev_param_ap_brdg_en;
1306 	bool cdp_vdev_param_qwrap_isolation;
1307 	bool cdp_vdev_param_update_multipass;
1308 	uint8_t cdp_vdev_param_da_war;
1309 	uint8_t cdp_vdev_param_mcast_en;
1310 	uint8_t cdp_vdev_param_igmp_mcast_en;
1311 	uint8_t cdp_vdev_param_tidmap_prty;
1312 	uint8_t cdp_vdev_param_tidmap_tbl_id;
1313 	uint32_t cdp_vdev_param_aging_tmr;
1314 	uint32_t cdp_vdev_param_cipher_en;
1315 	uint32_t cdp_vdev_param_tx_encap;
1316 	uint32_t cdp_vdev_param_rx_decap;
1317 	uint32_t cdp_vdev_param_mesh_rx_filter;
1318 	uint32_t cdp_vdev_param_mesh_mode;
1319 	uint32_t cdp_vdev_param_safe_mode;
1320 	uint32_t cdp_vdev_param_drop_unenc;
1321 	uint8_t cdp_vdev_param_hlos_tid_override;
1322 	bool cdp_vdev_param_wds_ext;
1323 	uint8_t cdp_vdev_param_peer_authorize;
1324 	uint8_t cdp_vdev_param_peer_tid_latency_enable;
1325 	uint8_t cdp_vdev_param_mesh_tid;
1326 	uint8_t cdp_vdev_param_dscp_tid_map_id;
1327 	bool cdp_vdev_param_mcast_vdev;
1328 	bool cdp_vdev_param_wrap;
1329 
1330 	/* pdev params */
1331 	bool cdp_pdev_param_cptr_latcy;
1332 	bool cdp_pdev_param_hmmc_tid_ovrd;
1333 	bool cdp_pdev_param_fltr_neigh_peers;
1334 	bool cdp_pdev_param_cfg_vow;
1335 	bool cdp_pdev_param_fltr_mcast;
1336 	bool cdp_pdev_param_fltr_none;
1337 	bool cdp_pdev_param_fltr_ucast;
1338 	uint8_t cdp_pdev_param_primary_radio;
1339 	uint8_t cdp_pdev_param_en_rx_cap;
1340 	uint8_t cdp_pdev_param_en_tx_cap;
1341 	uint8_t cdp_pdev_param_tx_capture;
1342 	uint8_t cdp_pdev_param_hmmc_tid;
1343 	uint8_t cdp_pdev_param_tidmap_prty;
1344 	uint8_t cdp_pdev_param_igmpmld_override;
1345 	uint8_t cdp_pdev_param_igmpmld_tid;
1346 	uint8_t cdp_pdev_param_arp_dbg_conf;
1347 	uint8_t cdp_pdev_param_tidq_override;
1348 	uint8_t cdp_pdev_param_bss_color;
1349 	uint16_t cdp_pdev_param_chn_noise_flr;
1350 	qdf_freq_t cdp_pdev_param_mon_freq;
1351 	int cdp_pdev_param_dbg_snf;
1352 	int cdp_pdev_param_bpr_enable;
1353 	int cdp_pdev_param_monitor_chan;
1354 	uint32_t cdp_pdev_param_ingrs_stats;
1355 	uint32_t cdp_pdev_param_osif_drop;
1356 	uint32_t cdp_pdev_param_en_perpkt_txstats;
1357 	uint32_t cdp_pdev_param_tx_pending;
1358 	bool cdp_pdev_param_atf_stats_enable;
1359 	bool cdp_pdev_param_config_special_vap;
1360 	bool cdp_pdev_param_reset_scan_spcl_vap_stats_enable;
1361 	bool cdp_pdev_param_enhanced_stats_enable;
1362 	bool cdp_pdev_param_isolation;
1363 
1364 	/* psoc params */
1365 	bool cdp_psoc_param_en_rate_stats;
1366 	int cdp_psoc_param_en_nss_cfg;
1367 	int cdp_psoc_param_preferred_hw_mode;
1368 	bool cdp_psoc_param_pext_stats;
1369 
1370 	bool cdp_skip_bar_update;
1371 	bool cdp_ipa_enabled;
1372 	bool cdp_psoc_param_vdev_stats_hw_offload;
1373 	bool cdp_pdev_param_undecoded_metadata_enable;
1374 	bool cdp_sawf_enabled;
1375 	bool cdp_drop_3addr_mcast;
1376 	bool cdp_vdev_param_traffic_end_ind;
1377 } cdp_config_param_type;
1378 
1379 /**
1380  * cdp_rx_enh_capture_mode - Rx enhanced capture modes
1381  * @CDP_RX_ENH_CAPTURE_DISABLED: Disable Rx enhance capture
1382  * @CDP_RX_ENH_CAPTURE_MPDU: Enable capture of 128 bytes of each MPDU
1383  * @CDP_RX_ENH_CAPTURE_MPDU_MSDU: Enable capture of 128 bytes of each MSDU
1384  */
1385 enum cdp_rx_enh_capture_mode {
1386 	CDP_RX_ENH_CAPTURE_DISABLED = 0,
1387 	CDP_RX_ENH_CAPTURE_MPDU,
1388 	CDP_RX_ENH_CAPTURE_MPDU_MSDU,
1389 };
1390 
1391 /**
1392  * cdp_rx_enh_capture_peer - Rx enhanced capture peer filtering
1393  * @CDP_RX_ENH_CAPTURE_PEER_DISABLED: Disable Rx ENH capture peer filtering
1394  * @CDP_RX_ENH_CAPTURE_PEER_ENABLED: Enable Rx ENH capture peer filtering
1395  */
1396 enum cdp_rx_enh_capture_peer {
1397 	CDP_RX_ENH_CAPTURE_PEER_DISABLED = 0,
1398 	CDP_RX_ENH_CAPTURE_PEER_ENABLED,
1399 };
1400 
1401 /**
1402  * cdp_tx_enh_capture_mode - Tx enhanced capture modes
1403  * @CDP_TX_ENH_CAPTURE_DISABLED: Disable Tx enhance capture for all peers
1404  * @CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS: Enable tx capture for all peers
1405  * @CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER: Enable/disable per peer as necessary
1406  */
1407 enum cdp_tx_enh_capture_mode {
1408 	CDP_TX_ENH_CAPTURE_DISABLED = 0,
1409 	CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS,
1410 	CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER,
1411 	CDP_TX_ENH_CAPTURE_MAX,
1412 };
1413 
1414 /*
1415  * enum cdp_pdev_bpr_param - different types of parameters
1416  *			     to set value in pdev
1417  * @CDP_BPR_DISABLE: Set bpr to disable state
1418  * @CDP_BPR_ENABLE: set bpr to enable state
1419  *
1420  * Enum indicating bpr state to enable/disable.
1421  */
1422 enum cdp_pdev_bpr_param {
1423 	CDP_BPR_DISABLE,
1424 	CDP_BPR_ENABLE,
1425 };
1426 
1427 /*
1428  * cdp_vdev_param_type: different types of parameters
1429  *			to set values in vdev
1430  * @CDP_ENABLE_NAWDS: set nawds enable/disable
1431  * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement
1432  * @CDP_ENABLE_WDS: wds sta
1433  * @CDP_ENABLE_MEC: MEC enable flags
1434  * @CDP_ENABLE_PROXYSTA: proxy sta
1435  * @CDP_UPDATE_TDLS_FLAGS: tdls link flags
1436  * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable
1437  * @CDP_ENABLE_CIPHER : set cipher type based on security
1438  * @CDP_ENABLE_QWRAP_ISOLATION: qwrap isolation mode
1439  * @CDP_TX_ENCAP_TYPE: tx encap type
1440  * @CDP_RX_DECAP_TYPE: rx decap type
1441  * @CDP_MESH_RX_FILTER: set mesh rx filter
1442  * @CDP_TID_VDEV_PRTY: set tid vdev prty
1443  * @CDP_TIDMAP_TBL_ID: set tidmap table id
1444  * @CDP_MESH_MODE: set mesh mode
1445  * @CDP_SAFEMODE: set safe mode
1446  * @CDP_DROP_UNENC: set drop unencrypted flag
1447  * @CDP_ENABLE_IGMP_MCAST_EN: enable/disable igmp multicast enhancement
1448  * @CDP_ENABLE_HLOS_TID_OVERRIDE: set hlos tid override flag
1449  * @CDP_CFG_WDS_EXT: enable/disable wds ext feature
1450  * @CDP_ENABLE_PEER_AUTHORIZE: enable peer authorize flag
1451  * @CDP_ENABLE_PEER_TID_LATENCY: set peer tid latency enable flag
1452  * @CDP_SET_VAP_MESH_TID : Set latency tid in vap
1453  * @CDP_UPDATE_DSCP_TO_TID_MAP: Set DSCP to TID map id
1454  * @CDP_SET_MCAST_VDEV : Set primary mcast vdev
1455  * @CDP_ENABLE_WRAP: qwrap ap
1456  * @CDP_ENABLE_TRAFFIC_END_INDICATION: enable/disable traffic end indication
1457  */
1458 enum cdp_vdev_param_type {
1459 	CDP_ENABLE_NAWDS,
1460 	CDP_ENABLE_MCAST_EN,
1461 	CDP_ENABLE_WDS,
1462 	CDP_ENABLE_MEC,
1463 	CDP_ENABLE_DA_WAR,
1464 	CDP_ENABLE_PROXYSTA,
1465 	CDP_UPDATE_TDLS_FLAGS,
1466 	CDP_CFG_WDS_AGING_TIMER,
1467 	CDP_ENABLE_AP_BRIDGE,
1468 	CDP_ENABLE_CIPHER,
1469 	CDP_ENABLE_QWRAP_ISOLATION,
1470 	CDP_UPDATE_MULTIPASS,
1471 	CDP_TX_ENCAP_TYPE,
1472 	CDP_RX_DECAP_TYPE,
1473 	CDP_MESH_RX_FILTER,
1474 	CDP_TID_VDEV_PRTY,
1475 	CDP_TIDMAP_TBL_ID,
1476 #ifdef MESH_MODE_SUPPORT
1477 	CDP_MESH_MODE,
1478 #endif
1479 	CDP_SAFEMODE,
1480 	CDP_DROP_UNENC,
1481 	CDP_ENABLE_IGMP_MCAST_EN,
1482 	CDP_ENABLE_HLOS_TID_OVERRIDE,
1483 #ifdef QCA_SUPPORT_WDS_EXTENDED
1484 	CDP_CFG_WDS_EXT,
1485 #endif /* QCA_SUPPORT_WDS_EXTENDED */
1486 	CDP_ENABLE_PEER_AUTHORIZE,
1487 #ifdef WLAN_SUPPORT_MESH_LATENCY
1488 	CDP_ENABLE_PEER_TID_LATENCY,
1489 	CDP_SET_VAP_MESH_TID,
1490 #endif
1491 #ifdef WLAN_VENDOR_SPECIFIC_BAR_UPDATE
1492 	CDP_SKIP_BAR_UPDATE_AP,
1493 #endif
1494 	CDP_UPDATE_DSCP_TO_TID_MAP,
1495 	CDP_SET_MCAST_VDEV,
1496 	CDP_SET_MCAST_VDEV_HW_UPDATE,
1497 	CDP_DROP_3ADDR_MCAST,
1498 	CDP_ENABLE_WRAP,
1499 #ifdef DP_TRAFFIC_END_INDICATION
1500 	CDP_ENABLE_TRAFFIC_END_INDICATION,
1501 #endif
1502 };
1503 
1504 /*
1505  * cdp_psoc_param_type: different types of parameters
1506  *			to set values in psoc
1507  * @CDP_ENABLE_RATE_STATS: set rate stats enable/disable
1508  * @CDP_SET_NSS_CFG: set nss cfg
1509  * @CDP_SET_PREFERRED_HW_MODE: set preferred hw mode
1510  * @CDP_CFG_PEER_EXT_STATS: Peer extended stats mode.
1511  * @CDP_IPA_ENABLE : set IPA enable mode.
1512  * @CDP_CFG_VDEV_STATS_HW_OFFLOAD: HW Vdev stats config
1513  */
1514 enum cdp_psoc_param_type {
1515 	CDP_ENABLE_RATE_STATS,
1516 	CDP_SET_NSS_CFG,
1517 	CDP_SET_PREFERRED_HW_MODE,
1518 	CDP_CFG_PEER_EXT_STATS,
1519 	CDP_IPA_ENABLE,
1520 	CDP_CFG_VDEV_STATS_HW_OFFLOAD,
1521 	CDP_SAWF_ENABLE,
1522 };
1523 
1524 #define TXRX_FW_STATS_TXSTATS                     1
1525 #define TXRX_FW_STATS_RXSTATS                     2
1526 #define TXRX_FW_STATS_RX_RATE_INFO                3
1527 #define TXRX_FW_STATS_PHYSTATS                    4
1528 #define TXRX_FW_STATS_PHYSTATS_CONCISE            5
1529 #define TXRX_FW_STATS_TX_RATE_INFO                6
1530 #define TXRX_FW_STATS_TID_STATE                   7
1531 #define TXRX_FW_STATS_HOST_STATS                  8
1532 #define TXRX_FW_STATS_CLEAR_HOST_STATS            9
1533 #define TXRX_FW_STATS_CE_STATS                   10
1534 #define TXRX_FW_STATS_VOW_UMAC_COUNTER           11
1535 #define TXRX_FW_STATS_ME_STATS                   12
1536 #define TXRX_FW_STATS_TXBF_INFO                  13
1537 #define TXRX_FW_STATS_SND_INFO                   14
1538 #define TXRX_FW_STATS_ERROR_INFO                 15
1539 #define TXRX_FW_STATS_TX_SELFGEN_INFO            16
1540 #define TXRX_FW_STATS_TX_MU_INFO                 17
1541 #define TXRX_FW_SIFS_RESP_INFO                   18
1542 #define TXRX_FW_RESET_STATS                      19
1543 #define TXRX_FW_MAC_WDOG_STATS                   20
1544 #define TXRX_FW_MAC_DESC_STATS                   21
1545 #define TXRX_FW_MAC_FETCH_MGR_STATS              22
1546 #define TXRX_FW_MAC_PREFETCH_MGR_STATS           23
1547 #define TXRX_FW_STATS_DURATION_INFO              24
1548 #define TXRX_FW_STATS_DURATION_INFO_RESET        25
1549 #define TXRX_FW_HALPHY_STATS                     26
1550 #define TXRX_FW_COEX_STATS                       27
1551 
1552 #define PER_RADIO_FW_STATS_REQUEST 0
1553 #define PER_VDEV_FW_STATS_REQUEST 1
1554 /**
1555  * enum data_stall_log_event_indicator - Module triggering data stall
1556  * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused
1557  * @DATA_STALL_LOG_INDICATOR_HOST_DRIVER: Host driver indicates data stall
1558  * @DATA_STALL_LOG_INDICATOR_FIRMWARE: FW indicates data stall
1559  * @DATA_STALL_LOG_INDICATOR_FRAMEWORK: Framework indicates data stall
1560  *
1561  * Enum indicating the module that indicates data stall event
1562  */
1563 enum data_stall_log_event_indicator {
1564 	DATA_STALL_LOG_INDICATOR_UNUSED,
1565 	DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
1566 	DATA_STALL_LOG_INDICATOR_FIRMWARE,
1567 	DATA_STALL_LOG_INDICATOR_FRAMEWORK,
1568 };
1569 
1570 /**
1571  * enum data_stall_log_event_type - data stall event type
1572  * @DATA_STALL_LOG_NONE
1573  * @DATA_STALL_LOG_FW_VDEV_PAUSE
1574  * @DATA_STALL_LOG_HWSCHED_CMD_FILTER
1575  * @DATA_STALL_LOG_HWSCHED_CMD_FLUSH
1576  * @DATA_STALL_LOG_FW_RX_REFILL_FAILED
1577  * @DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR
1578  * @DATA_STALL_LOG_FW_WDOG_ERRORS
1579  * @DATA_STALL_LOG_BB_WDOG_ERROR
1580  * @DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR
1581  * @DATA_STALL_LOG_HOST_STA_TX_TIMEOUT
1582  * @DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT
1583  * @DATA_STALL_LOG_NUD_FAILURE
1584  *
1585  * Enum indicating data stall event type
1586  */
1587 enum data_stall_log_event_type {
1588 	DATA_STALL_LOG_NONE,
1589 	DATA_STALL_LOG_FW_VDEV_PAUSE,
1590 	DATA_STALL_LOG_HWSCHED_CMD_FILTER,
1591 	DATA_STALL_LOG_HWSCHED_CMD_FLUSH,
1592 	DATA_STALL_LOG_FW_RX_REFILL_FAILED,
1593 	DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR,
1594 	DATA_STALL_LOG_FW_WDOG_ERRORS,
1595 	DATA_STALL_LOG_BB_WDOG_ERROR,
1596 	DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR,
1597 	/* Stall events triggered by host/framework start from 0x100 onwards. */
1598 	DATA_STALL_LOG_HOST_STA_TX_TIMEOUT = 0x100,
1599 	DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,
1600 	DATA_STALL_LOG_NUD_FAILURE,
1601 };
1602 
1603 /**
1604  * enum data_stall_log_recovery_type - data stall recovery type
1605  * @DATA_STALL_LOG_RECOVERY_NONE,
1606  * @DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
1607  * @DATA_STALL_LOG_RECOVERY_TRIGGER_PDR
1608  *
1609  * Enum indicating data stall recovery type
1610  */
1611 enum data_stall_log_recovery_type {
1612 	DATA_STALL_LOG_RECOVERY_NONE = 0,
1613 	DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
1614 	DATA_STALL_LOG_RECOVERY_TRIGGER_PDR,
1615 };
1616 
1617 /**
1618  * struct data_stall_event_info - data stall info
1619  * @indicator: Module triggering data stall
1620  * @data_stall_type: data stall event type
1621  * @vdev_id_bitmap: vdev_id_bitmap
1622  * @pdev_id: pdev id
1623  * @recovery_type: data stall recovery type
1624  */
1625 struct data_stall_event_info {
1626 	uint32_t indicator;
1627 	uint32_t data_stall_type;
1628 	uint32_t vdev_id_bitmap;
1629 	uint32_t pdev_id;
1630 	uint32_t recovery_type;
1631 };
1632 
1633 typedef void (*data_stall_detect_cb)(struct data_stall_event_info *);
1634 
1635 /*
1636  * enum cdp_stats - options for host and firmware
1637  * statistics
1638  * @CDP_TXRX_STATS_1: HTT Pdev tx stats
1639  * @CDP_TXRX_STATS_2: HTT Pdev rx stats
1640  * @CDP_TXRX_STATS_3: HTT Pdev Tx HW Queue stats
1641  * @CDP_TXRX_STATS_4: HTT Pdev Tx HW Sched stats
1642  * @CDP_TXRX_STATS_5: HTT Pdev error stats
1643  * @CDP_TXRX_STATS_6: HTT TQM stats
1644  * @CDP_TXRX_STATS_7: HTT TQM CMDQ stats
1645  * @CDP_TXRX_STATS_8: HTT Tx_de_cmn thread stats
1646  * @CDP_TXRX_STATS_9: HTT Pdev Tx rate stats
1647  * @CDP_TXRX_STATS_10: HTT Pdev Rx rate stats
1648  * @CDP_TXRX_STATS_11: HTT Peer stats
1649  * @CDP_TXRX_STATS_12: HTT Tx Self Gen Info
1650  * @CDP_TXRX_STATS_13: HTT Tx MU HWQ stats
1651  * @CDP_TXRX_STATS_14: HTT Ring interface info stats
1652  * @CDP_TXRX_STATS_15: HTT SRNG info stats
1653  * @CDP_TXRX_STATS_16: HTT SFM info stats
1654  * @CDP_TXRX_STATS_17: HTT Pdev tx mu mimo sched info
1655  * @CDP_TXRX_STATS_18: HTT Peer list details
1656  * @CDP_TXRX_STATS_19: Reserved
1657  * @CDP_TXRX_STATS_20: Reset Host stats
1658  * @CDP_TXRX_STATS_21: Host Rx rate stats
1659  * @CDP_TXRX_STATS_22: Host Tx rate stats
1660  * @CDP_TXRX_STATS_23: Host Tx stats
1661  * @CDP_TXRX_STATS_24: Host Rx stats
1662  * @CDP_TXRX_STATS_25: Host Ast stats
1663  * @CDP_TXRX_STATS_26: Host Head/Tail Pointer stats
1664  * @CDP_TXRX_STATS_27: Host Monitor mode stats
1665  * @CDP_TXRX_STATS_28: Host Peer entry stats
1666  * @CDP_TXRX_STATS_29: Host Soc config params info
1667  * @CDP_TXRX_STATS_30: Host Pdev config params info
1668  * @CDP_TXRX_STATS_31: Host DP Interrupt Stats
1669  */
1670 enum cdp_stats {
1671 	CDP_TXRX_STATS_0  = 0,
1672 	CDP_TXRX_STATS_1,
1673 	CDP_TXRX_STATS_2,
1674 	CDP_TXRX_STATS_3,
1675 	CDP_TXRX_STATS_4,
1676 	CDP_TXRX_STATS_5,
1677 	CDP_TXRX_STATS_6,
1678 	CDP_TXRX_STATS_7,
1679 	CDP_TXRX_STATS_8,
1680 	CDP_TXRX_STATS_9,
1681 	CDP_TXRX_STATS_10,
1682 	CDP_TXRX_STATS_11,
1683 	CDP_TXRX_STATS_12,
1684 	CDP_TXRX_STATS_13,
1685 	CDP_TXRX_STATS_14,
1686 	CDP_TXRX_STATS_15,
1687 	CDP_TXRX_STATS_16,
1688 	CDP_TXRX_STATS_17,
1689 	CDP_TXRX_STATS_18,
1690 	CDP_TXRX_STATS_19,
1691 	CDP_TXRX_STATS_20,
1692 	CDP_TXRX_STATS_21,
1693 	CDP_TXRX_STATS_22,
1694 	CDP_TXRX_STATS_23,
1695 	CDP_TXRX_STATS_24,
1696 	CDP_TXRX_STATS_25,
1697 	CDP_TXRX_STATS_26,
1698 	CDP_TXRX_STATS_27,
1699 	CDP_TXRX_STATS_28,
1700 	CDP_TXRX_STATS_29,
1701 	CDP_TXRX_STATS_30,
1702 	CDP_TXRX_STATS_31,
1703 	CDP_TXRX_STATS_HTT_MAX = 256,
1704 	CDP_TXRX_MAX_STATS = 265,
1705 };
1706 
1707 /*
1708  * Different Stat update types sent to OL_IF
1709  * @UPDATE_PEER_STATS: update peer stats
1710  * @UPDATE_VDEV_STATS: update vdev stats
1711  * @UPDATE_PDE_STATS: Update pdev stats
1712  */
1713 enum cdp_stat_update_type {
1714 	UPDATE_PEER_STATS = 0,
1715 	UPDATE_VDEV_STATS = 1,
1716 	UPDATE_PDEV_STATS = 2,
1717 };
1718 
1719 /*
1720  * struct cdp_tx_sojourn_stats - Tx sojourn stats
1721  * @ppdu_seq_id: ppdu_seq_id from tx completion
1722  * @avg_sojourn_msdu: average sojourn msdu time
1723  * @sum_sojourn_msdu: sum sojourn msdu time
1724  * @num_msdu: number of msdus per ppdu
1725  * @cookie: cookie to be used by upper layer
1726  */
1727 struct cdp_tx_sojourn_stats {
1728 	uint32_t ppdu_seq_id;
1729 	qdf_ewma_tx_lag avg_sojourn_msdu[CDP_DATA_TID_MAX];
1730 	uint32_t sum_sojourn_msdu[CDP_DATA_TID_MAX];
1731 	uint32_t num_msdus[CDP_DATA_TID_MAX];
1732 	struct cdp_stats_cookie *cookie;
1733 };
1734 
1735 /**
1736  * struct cdp_delayed_tx_completion_ppdu_user - Delayed Tx PPDU completion
1737  * per-user information
1738  * @frame_ctrl: frame control field in 802.11 header
1739  * @qos_ctrl: QoS control field in 802.11 header
1740  * @mpdu_tried: number of mpdus tried
1741  * @ltf_size: ltf_size
1742  * @stbc: stbc
1743  * @he_re: he_re (range extension)
1744  * @txbf: txbf
1745  * @bw: Transmission bandwidth
1746  *       <enum 2 transmit_bw_20_MHz>
1747  *       <enum 3 transmit_bw_40_MHz>
1748  *       <enum 4 transmit_bw_80_MHz>
1749  *       <enum 5 transmit_bw_160_MHz>
1750  * @nss: NSS 1,2, ...8
1751  * @mcs: MCS index
1752  * @preamble: preamble
1753  * @gi: guard interval 800/400/1600/3200 ns
1754  * @dcm: dcm
1755  * @ldpc: ldpc
1756  * @ru_start: RU start index
1757  * @ru_tones: RU tones length
1758  * @is_mcast: MCAST or UCAST
1759  * @user_pos: user position
1760  * @mu_group_id: mu group id
1761  * @ppdu_start_timestamp: 64 bits ppdu start timestamp
1762  * @ppdu_end_timestamp: 64 bits ppdu end timestamp
1763  */
1764 struct cdp_delayed_tx_completion_ppdu_user {
1765 	uint32_t frame_ctrl:16,
1766 		 qos_ctrl:16;
1767 	uint32_t mpdu_tried_ucast:16,
1768 		mpdu_tried_mcast:16;
1769 	uint32_t ltf_size:2,
1770 		 stbc:1,
1771 		 he_re:1,
1772 		 txbf:4,
1773 		 bw:4,
1774 		 nss:4,
1775 		 mcs:4,
1776 		 preamble:4,
1777 		 gi:4,
1778 		 dcm:1,
1779 		 ldpc:1,
1780 		 delayed_ba:1;
1781 	uint16_t ru_start;
1782 	uint16_t ru_tones;
1783 	bool is_mcast;
1784 	uint32_t user_pos;
1785 	uint32_t mu_group_id;
1786 	uint64_t ppdu_start_timestamp;
1787 	uint64_t ppdu_end_timestamp;
1788 };
1789 
1790 /**
1791  * struct cdp_tx_completion_ppdu_user - Tx PPDU completion per-user information
1792  * @completion_status: completion status - OK/Filter/Abort/Timeout
1793  * @tid: TID number
1794  * @peer_id: Peer ID
1795  * @ba_size: Block-Ack size
1796  * @frame_ctrl: frame control field in 802.11 header
1797  * @qos_ctrl: QoS control field in 802.11 header
1798  * @mpdu_tried: number of mpdus tried
1799  * @mpdu_success: number of mpdus successfully transmitted
1800  * @long_retries: long retries
1801  * @short_retries: short retries
1802  * @is_ampdu: mpdu aggregate or non-aggregate?
1803  * @success_bytes: bytes successfully transmitted
1804  * @retry_bytes: bytes retried
1805  * @retry_mpdus: mpdus retried
1806  * @failed_msdus: MSDUs failed transmission
1807  * @duration: user duration in ppdu
1808  * @ltf_size: ltf_size
1809  * @stbc: stbc
1810  * @he_re: he_re (range extension)
1811  * @txbf: txbf
1812  * @bw: Transmission bandwidth
1813  *       <enum 2 transmit_bw_20_MHz>
1814  *       <enum 3 transmit_bw_40_MHz>
1815  *       <enum 4 transmit_bw_80_MHz>
1816  *       <enum 5 transmit_bw_160_MHz>
1817  * @nss: NSS 1,2, ...8
1818  * @mcs: MCS index
1819  * @preamble: preamble
1820  * @gi: guard interval 800/400/1600/3200 ns
1821  * @dcm: dcm
1822  * @ldpc: ldpc
1823  * @delayed_ba: delayed ba bit
1824  * @ack_ba_tlv: ack ba recv tlv bit
1825  * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
1826  * @pream_punct: Preamble Punctured PPDU
1827  * UL_BSR_TRIG/UNKNOWN
1828  * @is_seq_num_valid:
1829  *       1 - stats tlv has valid sequence number
1830  *       0 - payload has valid sequence number
1831  * @ba_seq_no: Block Ack sequence number
1832  * @ba_bitmap: Block Ack bitmap
1833  * @start_seqa: Sequence number of first MPDU
1834  * @enq_bitmap: Enqueue MPDU bitmap
1835  * @ru_start: RU start index
1836  * @ru_tones: RU tones length
1837  * @is_mcast: MCAST or UCAST
1838  * @tx_rate: Transmission Rate
1839  * @user_pos: user position
1840  * @mu_group_id: mu group id
1841  * @rix: rate index
1842  * @cookie: cookie to used by upper layer
1843  * @is_ppdu_cookie_valid : Indicates that ppdu_cookie is valid
1844  * @ppdu_cookie: 16-bit ppdu_cookie
1845  * @sa_is_training: smart antenna training packets indication
1846  * @rssi_chain: rssi chain per bandwidth
1847  * @usr_ack_rssi: overall per user ack rssi
1848  * @sa_tx_antenna: antenna in which packet is transmitted
1849  * @sa_max_rates: smart antenna tx feedback info max rates
1850  * @sa_goodput: smart antenna tx feedback info goodput
1851  * @current_rate_per: Moving average per
1852  * @last_enq_seq: last equeue sequence number
1853  * @is_bss_peer: is bss peer check
1854  * @mpdu_q: queue of mpdu in a ppdu
1855  * @mpdus: MPDU list based on enqueue sequence bitmap
1856  * @pending_retries: pending MPDUs (retries)
1857  * @tlv_bitmap: per user tlv bitmap
1858  * @skip: tx capture skip flag
1859  * @mon_procd: to indicate user processed in ppdu of the sched cmd
1860  * @debug_copied: flag to indicate bar frame copied
1861  * @peer_last_delayed_ba: flag to indicate peer last delayed ba
1862  * @phy_tx_time_us: Phy TX duration for the User
1863  * @mpdu_bytes: accumulated bytes per mpdu for mem limit feature
1864  * @punc_mode: puncutured mode to indicate punctured bw
1865  * @punc_pattern_bitmap: bitmap indicating punctured pattern
1866  */
1867 struct cdp_tx_completion_ppdu_user {
1868 	uint32_t completion_status:8,
1869 		 tid:8,
1870 		 peer_id:16;
1871 	uint8_t mac_addr[6];
1872 	uint16_t ba_size;
1873 	uint32_t frame_ctrl:16,
1874 		 qos_ctrl:16;
1875 	uint32_t mpdu_tried_ucast:16,
1876 		mpdu_tried_mcast:16;
1877 	uint16_t mpdu_success:16;
1878 	uint16_t mpdu_failed:16;
1879 	uint32_t long_retries:4,
1880 		 short_retries:4,
1881 		 tx_ratecode:16,
1882 		 is_ampdu:1,
1883 		 ppdu_type:5,
1884 		 pream_punct:1,
1885 		 is_seq_num_valid:1;
1886 	uint32_t success_bytes;
1887 	uint32_t retry_bytes;
1888 	uint32_t failed_bytes;
1889 	uint32_t success_msdus:16,
1890 		 retry_msdus:16;
1891 	uint32_t retry_mpdus;
1892 	uint32_t failed_msdus:16,
1893 		 duration:16;
1894 	uint32_t ltf_size:2,
1895 		 stbc:1,
1896 		 he_re:1,
1897 		 txbf:4,
1898 		 bw:4,
1899 		 nss:4,
1900 		 mcs:4,
1901 		 preamble:4,
1902 		 gi:4,
1903 		 dcm:1,
1904 		 ldpc:1,
1905 		 delayed_ba:1,
1906 		 ack_ba_tlv:1;
1907 	uint32_t ba_seq_no;
1908 	uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
1909 	uint32_t start_seq;
1910 	uint32_t enq_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
1911 	uint32_t failed_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
1912 	uint32_t num_mpdu:9,
1913 		 num_msdu:16;
1914 	uint32_t tx_duration;
1915 	uint16_t ru_start;
1916 	uint16_t ru_tones;
1917 	bool is_mcast;
1918 	uint32_t tx_rate;
1919 	uint32_t tx_ratekbps;
1920 	/*ack rssi for separate chains*/
1921 	uint32_t ack_rssi[CDP_RSSI_CHAIN_LEN];
1922 	bool ack_rssi_valid;
1923 	uint32_t usr_ack_rssi;
1924 	uint32_t user_pos;
1925 	uint32_t mu_group_id;
1926 	uint32_t rix;
1927 	uint8_t is_ppdu_cookie_valid;
1928 	uint16_t ppdu_cookie;
1929 	uint8_t sa_is_training;
1930 	uint32_t rssi_chain[CDP_RSSI_CHAIN_LEN];
1931 	uint32_t sa_tx_antenna;
1932 	/*Max rates for BW: 20MHZ, 40MHZ and 80MHZ and 160MHZ
1933 	 * |---------------------------------------|
1934 	 * | 16 bits | 16 bits | 16 bits | 16 bits |
1935 	 * |   BW-1  |   BW-2  |   BW-3  |   BW-4  |
1936 	 * |      /\  \                            |
1937 	 * |     /  \  \                           |
1938 	 * |    /    \  \                          |
1939 	 * |   /      \  \                         |
1940 	 * |  /        \  \                        |
1941 	 * | /          \  \                       |
1942 	 * |/            \  \                      |
1943 	 * |[11|8]     [5|8] \                     |
1944 	 * | BW1      PADDED  \                    |
1945 	 * |---------------------------------------|
1946 	 */
1947 	uint16_t sa_max_rates[CDP_NUM_SA_BW];
1948 	uint32_t sa_goodput;
1949 	/* below field is used to calculate goodput in non-training period
1950 	 * Note: As host is exposing goodput and hence current_rate_per is
1951 	 * of no use. It is just for Host computation.
1952 	 */
1953 	uint32_t current_rate_per;
1954 	uint32_t last_enq_seq;
1955 
1956 	uint8_t is_bss_peer;
1957 
1958 	qdf_nbuf_queue_t mpdu_q;
1959 	qdf_nbuf_t *mpdus;
1960 	uint32_t pending_retries;
1961 	uint32_t tlv_bitmap;
1962 	bool skip;
1963 	bool mon_procd;
1964 	bool debug_copied;
1965 	bool peer_last_delayed_ba;
1966 
1967 	uint16_t phy_tx_time_us;
1968 	uint32_t mpdu_bytes;
1969 	uint8_t punc_mode;
1970 	uint16_t punc_pattern_bitmap;
1971 };
1972 
1973 /**
1974  * struct cdp_tx_indication_mpdu_info - Tx MPDU completion information
1975  * @ppdu_id: PPDU id
1976  * @duration: user duration in ppdu
1977  * @frame_type: frame type MGMT/CTRL/DATA/BAR
1978  * @frame_ctrl: frame control field in 802.11 header
1979  * @qos_ctrl: QoS control field in 802.11 header
1980  * @tid: TID number
1981  * @num_msdu: number of msdu in MPDU
1982  * @seq_no: Sequence number of first MPDU
1983  * @ltf_size: ltf_size
1984  * @stbc: stbc
1985  * @he_re: he_re (range extension)
1986  * @txbf: txbf
1987  * @bw: Transmission bandwidth
1988  *       <enum 2 transmit_bw_20_MHz>
1989  *       <enum 3 transmit_bw_40_MHz>
1990  *       <enum 4 transmit_bw_80_MHz>
1991  *       <enum 5 transmit_bw_160_MHz>
1992  * @nss: NSS 1,2, ...8
1993  * @mcs: MCS index
1994  * @preamble: preamble
1995  * @gi: guard interval 800/400/1600/3200 ns
1996  * @resp_type: response type
1997  * @mprot_type: medium protection type
1998  * @rts_success: rts success
1999  * @rts failure: rts failure
2000  * @channel: frequency
2001  * @channel_num: channel number
2002  * @ack_rssi: ack rssi
2003  * @ldpc: ldpc
2004  * @tx_rate: Transmission Rate
2005  * @mac_address: peer mac address
2006  * @bss_mac_address: bss mac address
2007  * @ppdu_start_timestamp: TSF at PPDU start
2008  * @ppdu_end_timestamp: TSF at PPDU end
2009  * @ba_start_seq: Block Ack sequence number
2010  * @ba_bitmap: Block Ack bitmap
2011  * @ppdu_cookie: 16-bit ppdu_cookie
2012  * @long_retries: long retries
2013  * @short_retries: short retries
2014  * @completion_status: completion status - OK/Filter/Abort/Timeout
2015  * @usr_idx: user index
2016  */
2017 struct cdp_tx_indication_mpdu_info {
2018 	uint32_t ppdu_id;
2019 	uint32_t tx_duration;
2020 	uint16_t frame_type;
2021 	uint16_t frame_ctrl;
2022 	uint16_t qos_ctrl;
2023 	uint8_t tid;
2024 	uint32_t num_msdu;
2025 	uint32_t seq_no;
2026 	uint32_t ltf_size:2,
2027 		 he_re:1,
2028 		 txbf:4,
2029 		 bw:4,
2030 		 nss:4,
2031 		 mcs:4,
2032 		 preamble:4,
2033 		 gi:4;
2034 	uint32_t channel;
2035 	uint8_t channel_num;
2036 	uint32_t ack_rssi;
2037 	uint32_t ldpc;
2038 	uint32_t tx_rate;
2039 	uint8_t mac_address[QDF_MAC_ADDR_SIZE];
2040 	uint8_t bss_mac_address[QDF_MAC_ADDR_SIZE];
2041 	uint64_t ppdu_start_timestamp;
2042 	uint64_t ppdu_end_timestamp;
2043 	uint32_t ba_start_seq;
2044 	uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
2045 	uint16_t ppdu_cookie;
2046 	uint16_t long_retries:4,
2047 		 short_retries:4,
2048 		 completion_status:8;
2049 	uint16_t resp_type:4,
2050 		 mprot_type:3,
2051 		 rts_success:1,
2052 		 rts_failure:1;
2053 	uint8_t usr_idx;
2054 };
2055 
2056 /**
2057  * struct cdp_tx_indication_info - Tx capture information
2058  * @radiotap_done: Flag to say radiotap already done or not
2059  *			0 - radiotap not updated
2060  *			1 - radiotap header updated
2061  * @mpdu_info: Tx MPDU completion information
2062  * @mpdu_nbuf: reconstructed mpdu packet
2063  * @ppdu_desc: tx completion ppdu
2064  */
2065 struct cdp_tx_indication_info {
2066 	bool radiotap_done;
2067 	struct cdp_tx_indication_mpdu_info mpdu_info;
2068 	qdf_nbuf_t mpdu_nbuf;
2069 	struct cdp_tx_completion_ppdu *ppdu_desc;
2070 #ifdef QCA_SUPPORT_LITE_MONITOR
2071 	ol_osif_vdev_handle osif_vdev;
2072 #endif
2073 };
2074 
2075 /**
2076  * struct cdp_tx_mgmt_comp_info - Tx mgmt comp info
2077  * @ppdu_id: ppdu_id
2078  * @is_sgen_pkt: payload received from wmi or htt path
2079  * @retries_count: retries count
2080  * @tx_tsf: 64 bit timestamp
2081  */
2082 struct cdp_tx_mgmt_comp_info {
2083 	uint32_t ppdu_id;
2084 	bool is_sgen_pkt;
2085 	uint16_t retries_count;
2086 	uint64_t tx_tsf;
2087 };
2088 
2089 /**
2090  * struct cdp_tx_completion_ppdu - Tx PPDU completion information
2091  * @completion_status: completion status - OK/Filter/Abort/Timeout
2092  * @ppdu_id: PPDU Id
2093  * @ppdu_seq_id: ppdu sequence id for sojourn stats
2094  * @vdev_id: VAP Id
2095  * @bar_num_users: BA response user count, based on completion common TLV
2096  * @num_users: Number of users
2097  * @max_users: Number of users from USR_INFO TLV
2098  * @drop_reason: drop reason from flush status
2099  * @is_flush: is_flush is set based on flush tlv
2100  * @flow_type: tx flow type from flush status
2101  * @queue_type: queue type from flush status
2102  * @num_mpdu: Number of MPDUs in PPDU
2103  * @num_msdu: Number of MSDUs in PPDU
2104  * @frame_type: frame SU or MU
2105  * @htt_frame_type: frame type from htt
2106  * @frame_ctrl: frame control of 80211 header
2107  * @channel: Channel informartion
2108  * @resp_type: response type
2109  * @mprot_type: medium protection type
2110  * @rts_success: rts success
2111  * @rts failure: rts failure
2112  * @phymode: phy mode
2113  * @ack_rssi: RSSI value of last ack packet (units=dB above noise floor)
2114  * @tx_duration: PPDU airtime
2115  * @ppdu_start_timestamp: TSF at PPDU start
2116  * @ppdu_end_timestamp: TSF at PPDU end
2117  * @ack_timestamp: TSF at the reception of ACK
2118  * @delayed_ba: Delayed ba flag
2119  * @beam_change: beam change bit in ppdu for he-information
2120  * @bss_color: 6 bit value for full bss color
2121  * @doppler: value for doppler (will be 0 most of the times)
2122  * @spatial_reuse: value for spatial reuse used in radiotap HE header
2123  * @usr_nss_sum: Sum of user nss
2124  * @usr_ru_tones_sum: Sum of user ru_tones
2125  * @bar_ppdu_id: BAR ppdu_id
2126  * @bar_tx_duration: BAR tx duration
2127  * @bar_ppdu_start_timestamp: BAR start timestamp
2128  * @bar_ppdu_end_timestamp: BAR end timestamp
2129  * @tlv_bitmap: tlv_bitmap for the PPDU
2130  * @sched_cmdid: schedule command id
2131  * @phy_ppdu_tx_time_us: Phy per PPDU TX duration
2132  * @ppdu_bytes: accumulated bytes per ppdu for mem limit feature
2133  * @user: per-User stats (array of per-user structures)
2134  */
2135 struct cdp_tx_completion_ppdu {
2136 	uint32_t ppdu_id;
2137 	uint32_t ppdu_seq_id;
2138 	uint16_t vdev_id;
2139 	uint16_t bar_num_users;
2140 	uint32_t num_users;
2141 	uint8_t  max_users;
2142 	uint8_t last_usr_index;
2143 	uint32_t drop_reason;
2144 	uint32_t is_flush:1,
2145 		 flow_type:8,
2146 		 queue_type:8;
2147 	uint32_t num_mpdu:9,
2148 		 num_msdu:16;
2149 	uint16_t frame_type;
2150 	uint16_t htt_frame_type;
2151 	uint16_t frame_ctrl;
2152 	uint16_t channel;
2153 	uint16_t resp_type:4,
2154 		 mprot_type:3,
2155 		 rts_success:1,
2156 		 rts_failure:1;
2157 	uint16_t phy_mode;
2158 	uint32_t ack_rssi;
2159 	uint32_t tx_duration;
2160 	uint64_t ppdu_start_timestamp;
2161 	uint64_t ppdu_end_timestamp;
2162 	uint64_t ack_timestamp;
2163 	bool delayed_ba;
2164 	uint8_t beam_change;
2165 	uint8_t bss_color;
2166 	uint8_t doppler;
2167 	uint8_t spatial_reuse;
2168 	uint8_t usr_nss_sum;
2169 	uint32_t usr_ru_tones_sum;
2170 	uint32_t bar_ppdu_id;
2171 	uint32_t bar_tx_duration;
2172 	uint64_t bar_ppdu_start_timestamp;
2173 	uint64_t bar_ppdu_end_timestamp;
2174 	uint32_t tlv_bitmap;
2175 	uint16_t sched_cmdid;
2176 	uint16_t phy_ppdu_tx_time_us;
2177 	uint32_t ppdu_bytes;
2178 	struct cdp_tx_completion_ppdu_user user[];
2179 };
2180 
2181 /**
2182  * struct cdp_dev_stats - Network device stats structure
2183  * @tx_packets: Tx total packets transmitted
2184  * @tx_errors : Tx error due to FW tx failure, Ring failure DMA etc
2185  * @tx_dropped: Tx dropped is same as tx errors as above
2186  * @rx_packets: Rx total packets transmitted
2187  * @rx_errors : Rx erros
2188  * @rx_dropped: Rx dropped stats
2189  * @tx_bytes  : Tx total bytes transmitted
2190  * @rx_bytes  : Rx total bytes transmitted
2191  */
2192 struct cdp_dev_stats {
2193 	uint32_t tx_packets;
2194 	uint32_t tx_errors;
2195 	uint32_t tx_dropped;
2196 	uint32_t rx_packets;
2197 	uint32_t rx_errors;
2198 	uint32_t rx_dropped;
2199 	uint64_t tx_bytes;
2200 	uint64_t rx_bytes;
2201 };
2202 
2203 /**
2204  * struct cdp_rate_stats - Tx/Rx Rate statistics
2205  * @bw: Indicates the BW of the upcoming transmission -
2206  *       <enum 2 transmit_bw_20_MHz>
2207  *       <enum 3 transmit_bw_40_MHz>
2208  *       <enum 4 transmit_bw_80_MHz>
2209  *       <enum 5 transmit_bw_160_MHz>
2210  * @pkt_type: Transmit Packet Type
2211  * @stbc: When set, STBC transmission rate was used
2212  * @ldpc: When set, use LDPC transmission rates
2213  * @sgi: <enum 0     0_8_us_sgi > Legacy normal GI
2214  *       <enum 1     0_4_us_sgi > Legacy short GI
2215  *       <enum 2     1_6_us_sgi > HE related GI
2216  *       <enum 3     3_2_us_sgi > HE
2217  * @mcs: Transmit MCS Rate
2218  * @ofdma: Set when the transmission was an OFDMA transmission
2219  * @tones_in_ru: The number of tones in the RU used.
2220  * @tsf: Lower 32 bits of the TSF (timestamp when ppdu transmission finished)
2221  * @peer_id: Peer ID of the flow or MPDU queue
2222  * @tid: TID of the flow or MPDU queue
2223  */
2224 struct cdp_rate_stats {
2225 	uint32_t rate_stats_info_valid:1,
2226 		 bw:2,
2227 		 pkt_type:4,
2228 		 stbc:1,
2229 		 ldpc:1,
2230 		 sgi:2,
2231 		 mcs:4,
2232 		 ofdma:1,
2233 		 tones_in_ru:12,
2234 		 resvd0:4;
2235 	uint32_t tsf;
2236 	uint16_t peer_id;
2237 	uint8_t tid;
2238 };
2239 
2240 /**
2241  * struct cdp_tx_completion_msdu - Tx MSDU completion descriptor
2242  * @ppdu_id: PPDU to which this MSDU belongs
2243  * @transmit_cnt: Number of times this frame has been transmitted
2244  * @ack_frame_rssi: RSSI of the received ACK or BA frame
2245  * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
2246  * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
2247  * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
2248  * @extd: Extended structure containing rate statistics
2249  */
2250 struct cdp_tx_completion_msdu {
2251 	uint32_t ppdu_id;
2252 	uint8_t transmit_cnt;
2253 	uint32_t ack_frame_rssi:8,
2254 		 resvd0:1,
2255 		 first_msdu:1,
2256 		 last_msdu:1,
2257 		 msdu_part_of_amsdu:1,
2258 		 resvd1:20;
2259 	struct cdp_rate_stats extd;
2260 };
2261 
2262 /**
2263  * struct cdp_rx_stats_ppdu_user -- per user RX stats
2264  * @peer_id: Peer ID
2265  * @vdev_id: VAP ID
2266  * @is_ampdu: mpdu aggregate or non-aggregate?
2267  * @mu_ul_info_valid: MU UL info valid
2268  * @ofdma_ru_start_index: RU index number(0-73)
2269  * @ofdma_ru_width: size of RU in units of 1(26tone)RU
2270  * @nss: NSS 1,2, ...8
2271  * @mcs: MCS index
2272  * @user_index: user ID in multi-user case
2273  * @is_bss_peer - is bss peer check
2274  * @ast_index: ast index in multi-user case
2275  * @tid: TID number
2276  * @num_msdu: Number of MSDUs in PPDU
2277  * @udp_msdu_count: Number of UDP MSDUs in PPDU
2278  * @tcp_msdu_count: Number of TCP MSDUs in PPDU
2279  * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
2280  * @frame_control: frame control field
2281  * @frame_control_info_valid: frame_control valid
2282  * @qos_control: qos control field
2283  * @qos_control_info_valid: qos_control valid
2284  * @data_sequence_control_info_valid: data_sequence_control_info valid
2285  * @first_data_seq_ctrl: Sequence control field of first data frame
2286  * @preamble: preamble
2287  * @ht_flag: ht flag
2288  * @vht_flag: vht flag
2289  * @he_re: he_re (range extension)
2290  * @mac_addr: Peer MAC Address
2291  * @mpdu_cnt_fcs_ok: Number of MPDUs in PPDU with fcs ok
2292  * @mpdu_cnt_fcs_err: Number of MPDUs in PPDU with fcs err
2293  * @mpdu_fcs_ok_bitmap - MPDU with fcs ok bitmap
2294  * @retries - number of retries
2295  * @rx_ratekpbs - rx rate in kbps
2296  * @rix - rate index
2297  * @mpdu_retries - retries of mpdu in rx
2298  * @rx_time_us - Rx duration
2299  */
2300 struct cdp_rx_stats_ppdu_user {
2301 	uint16_t peer_id;
2302 	uint8_t vdev_id;
2303 	bool is_ampdu;
2304 	uint32_t mu_ul_info_valid:1,
2305 		 ofdma_ru_start_index:7,
2306 		 ofdma_ru_width:7,
2307 		 nss:4,
2308 		 mcs:4;
2309 	/* user id */
2310 	uint8_t  user_index;
2311 	uint8_t is_bss_peer;
2312 	uint32_t ast_index;
2313 	uint32_t tid;
2314 	uint32_t num_msdu;
2315 	uint16_t  tcp_msdu_count;
2316 	uint16_t  udp_msdu_count;
2317 	uint16_t  other_msdu_count;
2318 	uint16_t frame_control;
2319 	uint8_t  frame_control_info_valid;
2320 	uint16_t qos_control;
2321 	uint8_t  qos_control_info_valid;
2322 	uint8_t data_sequence_control_info_valid;
2323 	uint16_t first_data_seq_ctrl;
2324 	uint32_t preamble_type;
2325 	uint16_t ht_flags;
2326 	uint16_t vht_flags;
2327 	uint16_t he_flags;
2328 	uint8_t  mac_addr[QDF_MAC_ADDR_SIZE];
2329 	uint32_t mpdu_cnt_fcs_ok;
2330 	uint32_t mpdu_cnt_fcs_err;
2331 	uint32_t mpdu_fcs_ok_bitmap[QDF_MON_STATUS_MPDU_FCS_BMAP_NWORDS];
2332 	uint32_t mpdu_ok_byte_count;
2333 	uint32_t mpdu_err_byte_count;
2334 	uint32_t retries;
2335 	uint32_t rx_ratekbps;
2336 	uint32_t rix;
2337 	uint32_t mpdu_retries;
2338 	uint16_t rx_time_us;
2339 };
2340 
2341 /**
2342  * struct cdp_rx_indication_ppdu - Rx PPDU indication structure
2343  * @ppdu_id: PPDU Id
2344  * @is_ampdu: mpdu aggregate or non-aggregate?
2345  * @num_mpdu: Number of MPDUs in PPDU
2346  * @reserved: Reserved bits for future use
2347  * @num_msdu: Number of MSDUs in PPDU
2348  * @udp_msdu_count: Number of UDP MSDUs in PPDU
2349  * @tcp_msdu_count: Number of TCP MSDUs in PPDU
2350  * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
2351  * @duration: PPDU duration
2352  * @tid: TID number
2353  * @peer_id: Peer ID
2354  * @vdev_id: VAP ID
2355  * @mac_addr: Peer MAC Address
2356  * @first_data_seq_ctrl: Sequence control field of first data frame
2357  * @ltf_size: ltf_size
2358  * @stbc: When set, STBC rate was used
2359  * @he_re: he_re (range extension)
2360  * @bw: Bandwidth
2361  *       <enum 0 bw_20_MHz>
2362  *       <enum 1 bw_40_MHz>
2363  *       <enum 2 bw_80_MHz>
2364  *       <enum 3 bw_160_MHz>
2365  * @nss: NSS 1,2, ...8
2366  * @mcs: MCS index
2367  * @preamble: preamble
2368  * @gi: <enum 0     0_8_us_sgi > Legacy normal GI
2369  *       <enum 1     0_4_us_sgi > Legacy short GI
2370  *       <enum 2     1_6_us_sgi > HE related GI
2371  *       <enum 3     3_2_us_sgi > HE
2372  * @dcm: dcm
2373  * @ldpc: ldpc
2374  * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
2375  * UL_BSR_TRIG/UNKNOWN
2376  * @rssi: RSSI value (units = dB above noise floor)
2377  * @timestamp: TSF at the reception of PPDU
2378  * @length: PPDU length
2379  * @channel: Channel informartion
2380  * @lsig_A: L-SIG in 802.11 PHY header
2381  * @frame_ctrl: frame control field
2382  * @rix: rate index
2383  * @rssi_chain: rssi chain per nss per bw
2384  * @cookie: cookie to used by upper layer
2385  * @user: per user stats in MU-user case
2386  * @nf: noise floor
2387  * @per_chain_rssi: rssi per antenna
2388  * @punc_bw: punctured bw
2389  * @phyrx_abort: rx aborted undecoded frame indication
2390  * @phyrx_abort_reason: abort reason defined in phyrx_abort_request_info
2391  * @l_sig_length: L SIG A length
2392  * @l_sig_a_parity: L SIG A parity
2393  * @l_sig_a_pkt_type: L SIG A info pkt type
2394  * @l_sig_a_implicit_sounding: L SIG A info captured implicit sounding
2395  * @ht_length: num of bytes in PSDU
2396  * @ht_smoothing: Indicate ht_smoothing
2397  * @ht_not_sounding: Indicate ht not sounding
2398  * @ht_aggregation: Indicate ht aggregation
2399  * @ht_stbc: Indicate ht stbc
2400  * @ht_crc: Indicate ht crc
2401  * @vht_crc: Indicate vht crc
2402  * @vht_no_txop_ps: Indicate TXOP power save mode
2403  * @bss_color_id: Indicate BSS color ID
2404  * @beam_change: Indicates whether spatial mapping is changed
2405  * @dl_ul_flag: Differentiates between DL and UL transmission
2406  * @transmit_mcs: Indicates the data MCS
2407  * @ldpc_extra_sym: LDPC extra symbol
2408  * @special_reuse: Spatial reuse
2409  * @ltf_sym: Indictaes HE NSTS
2410  * @txbf: Indicates whether beamforming is applied
2411  * @pe_disambiguity: packet extension disambiguity
2412  * @pre_fec_pad: packet extension a factor
2413  * @dopplar: Doppler support
2414  * @txop_duration: Indicates the remaining time in the current TXOP
2415  * @sig_b_mcs: MCS of HE-SIG-B
2416  * @sig_b_dcm: DCM of HE-SIG-B
2417  * @sig_b_sym: Number of symbols of HE-SIG-B
2418  * @sig_b_comp: Compression mode of HE-SIG-B
2419  * @he_crc: CRC for HE-SIG contents
2420  * @usr_nss_sum: Sum of user nss
2421  * @usr_ru_tones_sum: Sum of user ru_tones
2422  */
2423 struct cdp_rx_indication_ppdu {
2424 	uint32_t ppdu_id;
2425 	uint16_t is_ampdu:1,
2426 		 num_mpdu:9,
2427 		 reserved:6;
2428 	uint32_t num_msdu;
2429 	uint32_t num_bytes;
2430 	uint16_t udp_msdu_count;
2431 	uint16_t tcp_msdu_count;
2432 	uint16_t other_msdu_count;
2433 	uint16_t duration;
2434 	uint32_t tid:8,
2435 		 peer_id:16;
2436 	uint8_t vdev_id;
2437 	uint8_t mac_addr[6];
2438 	uint16_t first_data_seq_ctrl;
2439 	union {
2440 		uint32_t rate_info;
2441 		struct {
2442 			uint32_t ltf_size:2,
2443 				 stbc:1,
2444 				 he_re:1,
2445 				 bw:4,
2446 				 nss:4,
2447 				 mcs:4,
2448 				 preamble:4,
2449 				 gi:4,
2450 				 dcm:1,
2451 				 ldpc:1,
2452 				 ppdu_type:5;
2453 		};
2454 	} u;
2455 	uint32_t rix;
2456 	uint32_t lsig_a;
2457 	uint32_t rssi;
2458 	uint64_t timestamp;
2459 	uint32_t length;
2460 	uint8_t channel;
2461 	uint8_t beamformed;
2462 
2463 	uint32_t rx_ratekbps;
2464 	uint32_t ppdu_rx_rate;
2465 
2466 	uint32_t retries;
2467 	uint32_t rx_byte_count;
2468 	uint16_t rx_ratecode;
2469 	uint8_t fcs_error_mpdus;
2470 	uint16_t frame_ctrl;
2471 	int8_t rssi_chain[SS_COUNT][MAX_BW];
2472 	struct cdp_rx_su_evm_info evm_info;
2473 	uint32_t rx_antenna;
2474 	uint8_t num_users;
2475 	uint32_t nf;
2476 	uint8_t  per_chain_rssi[MAX_CHAIN];
2477 	uint8_t is_mcast_bcast;
2478 #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
2479 	struct cdp_rx_ppdu_cfr_info cfr_info;
2480 #endif
2481 	uint8_t punc_bw;
2482 #ifdef QCA_UNDECODED_METADATA_SUPPORT
2483 	bool phyrx_abort;
2484 	uint8_t phyrx_abort_reason;
2485 	uint32_t l_sig_length:12,
2486 		 l_sig_a_parity:1,
2487 		 l_sig_a_pkt_type:4,
2488 		 l_sig_a_implicit_sounding:1,
2489 		 vht_crc:8,
2490 		 group_id:6;
2491 	uint32_t ht_length:16,
2492 		 ht_smoothing:1,
2493 		 ht_not_sounding:1,
2494 		 ht_aggregation:1,
2495 		 ht_stbc:2,
2496 		 ht_crc:8,
2497 		 vht_no_txop_ps:1;
2498 	uint32_t bss_color_id:6,
2499 		 beam_change:1,
2500 		 dl_ul_flag:1,
2501 		 transmit_mcs:4,
2502 		 ldpc_extra_sym:1,
2503 		 special_reuse:4,
2504 		 ltf_sym:3,
2505 		 txbf:1,
2506 		 pe_disambiguity:1,
2507 		 pre_fec_pad:4,
2508 		 dopplar:1;
2509 	uint32_t txop_duration:7,
2510 		 sig_b_mcs:3,
2511 		 sig_b_dcm:1,
2512 		 sig_b_sym:4,
2513 		 sig_b_comp:1,
2514 		 he_crc:4;
2515 #endif
2516 	uint8_t usr_nss_sum;
2517 	uint32_t usr_ru_tones_sum;
2518 	struct cdp_rx_stats_ppdu_user user[];
2519 };
2520 
2521 /**
2522  * struct cdp_rx_indication_msdu - Rx MSDU info
2523  * @ppdu_id: PPDU to which the MSDU belongs
2524  * @msdu_len: Length of MSDU in bytes
2525  * @ack_frame_rssi: RSSI of the received ACK or BA frame
2526  * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
2527  * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
2528  * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
2529  * @extd: Extended structure containing rate statistics
2530  */
2531 struct cdp_rx_indication_msdu {
2532 	uint32_t ppdu_id;
2533 	uint16_t msdu_len;
2534 	uint32_t ack_frame_rssi:8,
2535 		 resvd0:1,
2536 		 first_msdu:1,
2537 		 last_msdu:1,
2538 		 msdu_part_of_amsdu:1,
2539 		 msdu_part_of_ampdu:1,
2540 		 resvd1:19;
2541 	struct cdp_rate_stats extd;
2542 };
2543 
2544 /**
2545  * struct cdp_config_params - Propagate configuration parameters to datapath
2546  * @tso_enable: Enable/Disable TSO
2547  * @lro_enable: Enable/Disable LRO
2548  * @gro_enable: Enable/Disable GRO
2549  * @flow_steering_enable: Enable/Disable Rx Hash based flow steering
2550  * @p2p_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for P2P
2551  * @nan_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for NAN
2552  * @tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload
2553  * @legacy_mode_checksumoffload_disable: Disable TCP/UDP Checksum Offload for
2554  *					 legacy modes.
2555  * @napi_enable: Enable/Disable Napi
2556  * @ipa_enable: Flag indicating if IPA is enabled or not
2557  * @tx_flow_stop_queue_threshold: Value to Pause tx queues
2558  * @tx_flow_start_queue_offset: Available Tx descriptors to unpause
2559  *				tx queue
2560  * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
2561  * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
2562  * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
2563  */
2564 struct cdp_config_params {
2565 	unsigned int tso_enable:1;
2566 	unsigned int lro_enable:1;
2567 	unsigned int gro_enable:1;
2568 	unsigned int flow_steering_enable:1;
2569 	unsigned int p2p_tcp_udp_checksumoffload:1;
2570 	unsigned int nan_tcp_udp_checksumoffload:1;
2571 	unsigned int tcp_udp_checksumoffload:1;
2572 	unsigned int legacy_mode_checksumoffload_disable:1;
2573 	unsigned int napi_enable:1;
2574 	unsigned int ipa_enable:1;
2575 	/* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */
2576 	uint8_t tx_flow_stop_queue_threshold;
2577 	uint8_t tx_flow_start_queue_offset;
2578 	uint32_t tx_comp_loop_pkt_limit;
2579 	uint32_t rx_reap_loop_pkt_limit;
2580 	uint32_t rx_hp_oos_update_limit;
2581 
2582 };
2583 
2584 /**
2585  * cdp_txrx_stats_req: stats request wrapper
2586  *	used to pass request information to cdp layer
2587  * @stats: type of stats requested
2588  * @param0: opaque argument 0 to be passed to htt
2589  * @param1: opaque argument 1 to be passed to htt
2590  * @param2: opaque argument 2 to be passed to htt
2591  * @param3: opaque argument 3 to be passed to htt
2592  * @mac id: mac_id
2593  */
2594 struct cdp_txrx_stats_req {
2595 	enum cdp_stats	stats;
2596 	uint32_t	param0;
2597 	uint32_t	param1;
2598 	uint32_t	param2;
2599 	uint32_t	param3;
2600 	uint32_t	cookie_val;
2601 	uint8_t		mac_id;
2602 	char		*peer_addr;
2603 };
2604 
2605 /**
2606  * struct cdp_monitor_filter - monitor filter info
2607  * @mode: set filter mode
2608  * @fp_mgmt: set Filter Pass MGMT Configuration
2609  * @fp_ctrl: set Filter Pass CTRL Configuration
2610  * @fp_data: set Filter Pass DATA Configuration
2611  * @mo_mgmt: set Monitor Other MGMT Configuration
2612  * @mo_ctrl: set Monitor Other CTRL Configuration
2613  * @mo_data: set Monitor other DATA Configuration
2614  *
2615  */
2616 struct cdp_monitor_filter {
2617 	uint16_t mode;
2618 	uint16_t fp_mgmt;
2619 	uint16_t fp_ctrl;
2620 	uint16_t fp_data;
2621 	uint16_t mo_mgmt;
2622 	uint16_t mo_ctrl;
2623 	uint16_t mo_data;
2624 };
2625 
2626 /**
2627  * enum cdp_dp_cfg - CDP ENUMs to get to DP configation
2628  * @cfg_dp_enable_data_stall: context passed to be used by consumer
2629  * @cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload: get P2P checksum config
2630  * @cfg_dp_enable_nan_ip_tcp_udp_checksum_offload: get NAN TX checksum config
2631  * @cfg_dp_enable_ip_tcp_udp_checksum_offload: get TX checksum config for others
2632  * @cfg_dp_tso_enable: get TSO enable config
2633  * @cfg_dp_lro_enable: get LRO enable config
2634  * @cfg_dp_gro_enable: get GRO enable config
2635  * @cfg_dp_tc_based_dyn_gro_enable: get TC based dynamic gro enable config
2636  * @cfg_dp_tc_ingress_prio: priority value to be checked for tc filters
2637  * @cfg_dp_tx_flow_start_queue_offset: get DP TX flow start queue offset
2638  * @cfg_dp_tx_flow_stop_queue_threshold: get DP TX flow stop queue threshold
2639  * @cfg_dp_ipa_uc_tx_buf_size: get IPA TX buf size config
2640  * @cfg_dp_ipa_uc_tx_partition_base: get IPA UC TX partition base config
2641  * @cfg_dp_ipa_uc_rx_ind_ring_count: get IPA rx indication ring count config
2642  * @cfg_dp_enable_flow_steering: get flow steerint enable config
2643  * @cfg_dp_reorder_offload_supported: get reorder offload support config
2644  * @cfg_dp_ce_classify_enable: get CE classify enable config
2645  * @cfg_dp_disable_intra_bss_fwd: get intra bss fwd config
2646  * @cfg_dp_pktlog_buffer_size: get packet log buffer size config
2647  * @cfg_dp_wow_check_rx_pending: get wow rx pending frame check config
2648  */
2649 enum cdp_dp_cfg {
2650 	cfg_dp_enable_data_stall,
2651 	cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload,
2652 	cfg_dp_enable_nan_ip_tcp_udp_checksum_offload,
2653 	cfg_dp_enable_ip_tcp_udp_checksum_offload,
2654 	/* Disable checksum offload for legacy modes */
2655 	cfg_dp_disable_legacy_mode_csum_offload,
2656 	cfg_dp_tso_enable,
2657 	cfg_dp_lro_enable,
2658 	cfg_dp_gro_enable,
2659 	cfg_dp_tc_based_dyn_gro_enable,
2660 	cfg_dp_tc_ingress_prio,
2661 	cfg_dp_sg_enable,
2662 	cfg_dp_tx_flow_start_queue_offset,
2663 	cfg_dp_tx_flow_stop_queue_threshold,
2664 	cfg_dp_ipa_uc_tx_buf_size,
2665 	cfg_dp_ipa_uc_tx_partition_base,
2666 	cfg_dp_ipa_uc_rx_ind_ring_count,
2667 	cfg_dp_enable_flow_steering,
2668 	cfg_dp_reorder_offload_supported,
2669 	cfg_dp_ce_classify_enable,
2670 	cfg_dp_disable_intra_bss_fwd,
2671 	cfg_dp_pktlog_buffer_size,
2672 	cfg_dp_wow_check_rx_pending,
2673 };
2674 
2675 /**
2676  * struct cdp_peer_cookie - cookie used when creating peer
2677  * @ctx: context passed to be used by consumer
2678  * @mac_addr: MAC address of peer
2679  * @peer_id: peer id
2680  * @pdev_id: pdev_id
2681  * @cookie: cookie to be used by consumer
2682  */
2683 struct cdp_peer_cookie {
2684 	struct cdp_stats_cookie *ctx;
2685 	uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
2686 	uint8_t peer_id;
2687 	uint8_t pdev_id;
2688 	uint8_t cookie;
2689 };
2690 
2691 #ifdef WLAN_SUPPORT_RX_FISA
2692 struct cdp_flow_stats {
2693 	uint32_t aggr_count;
2694 	uint32_t curr_aggr_count;
2695 	uint32_t flush_count;
2696 	uint32_t bytes_aggregated;
2697 };
2698 #else
2699 /**
2700  * cdp_flow_stats - Per-Flow (5-tuple) statistics
2701  * @msdu_count: number of rx msdus matching this flow
2702  * @mon_msdu_count: number of msdus matching this flow in mon path
2703  *
2704  * HW also includes msdu_byte_count and timestamp, which
2705  * are not currently tracked in SW.
2706  */
2707 struct cdp_flow_stats {
2708 	uint32_t msdu_count;
2709 	uint32_t mon_msdu_count;
2710 };
2711 #endif
2712 
2713 /**
2714  * cdp_flow_fst_operation - RX FST operations allowed
2715  */
2716 enum cdp_flow_fst_operation {
2717 	CDP_FLOW_FST_ENTRY_ADD,
2718 	CDP_FLOW_FST_ENTRY_DEL,
2719 	CDP_FLOW_FST_RX_BYPASS_ENABLE,
2720 	CDP_FLOW_FST_RX_BYPASS_DISABLE
2721 };
2722 
2723 /**
2724  * cdp_flow_protocol_type - RX FST supported protocol types, mapped to HW spec
2725  */
2726 enum cdp_flow_protocol_type {
2727 	CDP_FLOW_PROTOCOL_TYPE_TCP = 6,
2728 	CDP_FLOW_PROTOCOL_TYPE_UDP = 17,
2729 };
2730 
2731 /**
2732  * cdp_rx_flow_tuple_info - RX flow tuple info used for addition/deletion
2733  * @tuple_populated:
2734  * @is_exception: Flows which are added to flow table but not aggregated.
2735  * @bypass_fisa: Flow which are not added to flow table.
2736  * @dest_ip_127_96: destination IP address bit fields 96-127
2737  * @dest_ip_95_64: destination IP address bit fields 64-95
2738  * @dest_ip_63_32: destination IP address bit fields 32-63
2739  * @dest_ip_31_0: destination IP address bit fields 0-31
2740  * @src_ip_127_96: source IP address bit fields 96-127
2741  * @src_ip_95_64: source IP address bit fields 64-95
2742  * @src_ip_63_32: source IP address bit fields 32-63
2743  * @src_ip_31_0: source IP address bit fields 0-31
2744  * @dest_port: destination port of flow
2745  * @src_port: source port of flow
2746  * @l4_protocol: protocol type in flow (TCP/UDP)
2747  */
2748 struct cdp_rx_flow_tuple_info {
2749 #ifdef WLAN_SUPPORT_RX_FISA
2750 	uint8_t tuple_populated;
2751 	uint8_t is_exception;
2752 	bool bypass_fisa;
2753 #endif
2754 	uint32_t dest_ip_127_96;
2755 	uint32_t dest_ip_95_64;
2756 	uint32_t dest_ip_63_32;
2757 	uint32_t dest_ip_31_0;
2758 	uint32_t src_ip_127_96;
2759 	uint32_t src_ip_95_64;
2760 	uint32_t src_ip_63_32;
2761 	uint32_t src_ip_31_0;
2762 	uint16_t dest_port;
2763 	uint16_t src_port;
2764 	uint16_t l4_protocol;
2765 };
2766 
2767 /**
2768  * cdp_rx_flow_info - RX flow info used for addition/deletion
2769  * @is_addr_ipv4: indicates whether given IP address is IPv4/IPv6
2770  * @op_code: add/delete/enable/disable operation requested
2771  * @flow_tupe_info: structure containing tuple info
2772  * @fse_metadata: metadata to be set in RX flow
2773  */
2774 struct cdp_rx_flow_info {
2775 	bool is_addr_ipv4;
2776 	enum cdp_flow_fst_operation op_code;
2777 	struct cdp_rx_flow_tuple_info flow_tuple_info;
2778 	uint16_t fse_metadata;
2779 };
2780 
2781 #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
2782 /**
2783  * cdp_scan_spcl_vap_stats - Special vap statistics info
2784  * @rx_ok_pkts: rx fcs ok pkts count
2785  * @rx_ok_bytes: rx fcs ok bytes count
2786  * @rx_err_pkts: rx fcs err pkts count
2787  * @rx_err_bytes: rx fcs err bytes count
2788  * @rx_mgmt_pkts: rx mgmt pkts count
2789  * @rx_ctrl_pkts: rx ctrl pkts count
2790  * @rx_data_pkts: rx data pkts count
2791  */
2792 struct cdp_scan_spcl_vap_stats {
2793 	uint64_t rx_ok_pkts;
2794 	uint64_t rx_ok_bytes;
2795 	uint64_t rx_err_pkts;
2796 	uint64_t rx_err_bytes;
2797 	uint64_t rx_mgmt_pkts;
2798 	uint64_t rx_ctrl_pkts;
2799 	uint64_t rx_data_pkts;
2800 };
2801 #endif
2802 
2803 /**
2804  * cdp_soc_attach_params
2805  *
2806  * @hif_handle: Opaque HIF handle
2807  * @htc_handle: Opaque HTC handle
2808  * @qdf_osdev: QDF device
2809  * @ol_ops: Offload Operations
2810  * @device_id: Device ID
2811  * @ml_context: DP ML object conext
2812  * @mlo_chip_id: MLO chip id, for legacy SOCs chip_id need to 0
2813  * @mlo_enabled: MLO enable bit
2814  */
2815 struct cdp_soc_attach_params {
2816 	struct hif_opaque_softc *hif_handle;
2817 	HTC_HANDLE htc_handle;
2818 	qdf_device_t qdf_osdev;
2819 	struct ol_if_ops *ol_ops;
2820 	uint16_t device_id;
2821 	struct cdp_mlo_ctxt *ml_context;
2822 	uint8_t mlo_chip_id;
2823 	uint8_t mlo_enabled;
2824 };
2825 
2826 /*
2827  * cdp_pdev_attach_params
2828  *
2829  * @htc_handle: HTC handle for host-target interface
2830  * @qdf_osdev: QDF OS device
2831  * @pdev_id: PDEV ID
2832  * @mlo_link_id: ML link id
2833  */
2834 struct cdp_pdev_attach_params {
2835 	HTC_HANDLE htc_handle;
2836 	qdf_device_t qdf_osdev;
2837 	uint8_t pdev_id;
2838 	uint32_t mlo_link_id;
2839 };
2840 #endif
2841