xref: /wlan-dirver/qca-wifi-host-cmn/dp/inc/cdp_txrx_cmn_struct.h (revision 45c28558a520fd0e975b20c0ad534a0aa7f08021)
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 always 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 - pointer to head of receive packet queue to decap
924  * @list_tail - pointer 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  * @cdp_skel_enable : Enable/Disable skeleton code for Umac reset debug
1292  */
1293 typedef union cdp_config_param_t {
1294 	/* peer params */
1295 	bool cdp_peer_param_nawds;
1296 	bool cdp_peer_param_isolation;
1297 	uint8_t cdp_peer_param_nac;
1298 	bool cdp_peer_param_in_twt;
1299 
1300 	/* vdev params */
1301 	bool cdp_vdev_param_wds;
1302 	bool cdp_vdev_param_mec;
1303 	bool cdp_vdev_param_nawds;
1304 	bool cdp_vdev_param_proxysta;
1305 	bool cdp_vdev_param_tdls_flags;
1306 	bool cdp_vdev_param_ap_brdg_en;
1307 	bool cdp_vdev_param_qwrap_isolation;
1308 	bool cdp_vdev_param_update_multipass;
1309 	uint8_t cdp_vdev_param_da_war;
1310 	uint8_t cdp_vdev_param_mcast_en;
1311 	uint8_t cdp_vdev_param_igmp_mcast_en;
1312 	uint8_t cdp_vdev_param_tidmap_prty;
1313 	uint8_t cdp_vdev_param_tidmap_tbl_id;
1314 	uint32_t cdp_vdev_param_aging_tmr;
1315 	uint32_t cdp_vdev_param_cipher_en;
1316 	uint32_t cdp_vdev_param_tx_encap;
1317 	uint32_t cdp_vdev_param_rx_decap;
1318 	uint32_t cdp_vdev_param_mesh_rx_filter;
1319 	uint32_t cdp_vdev_param_mesh_mode;
1320 	uint32_t cdp_vdev_param_safe_mode;
1321 	uint32_t cdp_vdev_param_drop_unenc;
1322 	uint8_t cdp_vdev_param_hlos_tid_override;
1323 	bool cdp_vdev_param_wds_ext;
1324 	uint8_t cdp_vdev_param_peer_authorize;
1325 	uint8_t cdp_vdev_param_peer_tid_latency_enable;
1326 	uint8_t cdp_vdev_param_mesh_tid;
1327 	uint8_t cdp_vdev_param_dscp_tid_map_id;
1328 	bool cdp_vdev_param_mcast_vdev;
1329 	bool cdp_vdev_param_wrap;
1330 
1331 	/* pdev params */
1332 	bool cdp_pdev_param_cptr_latcy;
1333 	bool cdp_pdev_param_hmmc_tid_ovrd;
1334 	bool cdp_pdev_param_fltr_neigh_peers;
1335 	bool cdp_pdev_param_cfg_vow;
1336 	bool cdp_pdev_param_fltr_mcast;
1337 	bool cdp_pdev_param_fltr_none;
1338 	bool cdp_pdev_param_fltr_ucast;
1339 	uint8_t cdp_pdev_param_primary_radio;
1340 	uint8_t cdp_pdev_param_en_rx_cap;
1341 	uint8_t cdp_pdev_param_en_tx_cap;
1342 	uint8_t cdp_pdev_param_tx_capture;
1343 	uint8_t cdp_pdev_param_hmmc_tid;
1344 	uint8_t cdp_pdev_param_tidmap_prty;
1345 	uint8_t cdp_pdev_param_igmpmld_override;
1346 	uint8_t cdp_pdev_param_igmpmld_tid;
1347 	uint8_t cdp_pdev_param_arp_dbg_conf;
1348 	uint8_t cdp_pdev_param_tidq_override;
1349 	uint8_t cdp_pdev_param_bss_color;
1350 	uint16_t cdp_pdev_param_chn_noise_flr;
1351 	qdf_freq_t cdp_pdev_param_mon_freq;
1352 	int cdp_pdev_param_dbg_snf;
1353 	int cdp_pdev_param_bpr_enable;
1354 	int cdp_pdev_param_monitor_chan;
1355 	uint32_t cdp_pdev_param_ingrs_stats;
1356 	uint32_t cdp_pdev_param_osif_drop;
1357 	uint32_t cdp_pdev_param_en_perpkt_txstats;
1358 	uint32_t cdp_pdev_param_tx_pending;
1359 	bool cdp_pdev_param_atf_stats_enable;
1360 	bool cdp_pdev_param_config_special_vap;
1361 	bool cdp_pdev_param_reset_scan_spcl_vap_stats_enable;
1362 	bool cdp_pdev_param_enhanced_stats_enable;
1363 	bool cdp_pdev_param_isolation;
1364 
1365 	/* psoc params */
1366 	bool cdp_psoc_param_en_rate_stats;
1367 	int cdp_psoc_param_en_nss_cfg;
1368 	int cdp_psoc_param_preferred_hw_mode;
1369 	bool cdp_psoc_param_pext_stats;
1370 
1371 	bool cdp_skip_bar_update;
1372 	bool cdp_ipa_enabled;
1373 	bool cdp_psoc_param_vdev_stats_hw_offload;
1374 	bool cdp_pdev_param_undecoded_metadata_enable;
1375 	bool cdp_sawf_enabled;
1376 	bool cdp_drop_3addr_mcast;
1377 	bool cdp_vdev_param_traffic_end_ind;
1378 	bool cdp_umac_rst_skel;
1379 } cdp_config_param_type;
1380 
1381 /**
1382  * cdp_rx_enh_capture_mode - Rx enhanced capture modes
1383  * @CDP_RX_ENH_CAPTURE_DISABLED: Disable Rx enhance capture
1384  * @CDP_RX_ENH_CAPTURE_MPDU: Enable capture of 128 bytes of each MPDU
1385  * @CDP_RX_ENH_CAPTURE_MPDU_MSDU: Enable capture of 128 bytes of each MSDU
1386  */
1387 enum cdp_rx_enh_capture_mode {
1388 	CDP_RX_ENH_CAPTURE_DISABLED = 0,
1389 	CDP_RX_ENH_CAPTURE_MPDU,
1390 	CDP_RX_ENH_CAPTURE_MPDU_MSDU,
1391 };
1392 
1393 /**
1394  * cdp_rx_enh_capture_peer - Rx enhanced capture peer filtering
1395  * @CDP_RX_ENH_CAPTURE_PEER_DISABLED: Disable Rx ENH capture peer filtering
1396  * @CDP_RX_ENH_CAPTURE_PEER_ENABLED: Enable Rx ENH capture peer filtering
1397  */
1398 enum cdp_rx_enh_capture_peer {
1399 	CDP_RX_ENH_CAPTURE_PEER_DISABLED = 0,
1400 	CDP_RX_ENH_CAPTURE_PEER_ENABLED,
1401 };
1402 
1403 /**
1404  * cdp_tx_enh_capture_mode - Tx enhanced capture modes
1405  * @CDP_TX_ENH_CAPTURE_DISABLED: Disable Tx enhance capture for all peers
1406  * @CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS: Enable tx capture for all peers
1407  * @CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER: Enable/disable per peer as necessary
1408  */
1409 enum cdp_tx_enh_capture_mode {
1410 	CDP_TX_ENH_CAPTURE_DISABLED = 0,
1411 	CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS,
1412 	CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER,
1413 	CDP_TX_ENH_CAPTURE_MAX,
1414 };
1415 
1416 /*
1417  * enum cdp_pdev_bpr_param - different types of parameters
1418  *			     to set value in pdev
1419  * @CDP_BPR_DISABLE: Set bpr to disable state
1420  * @CDP_BPR_ENABLE: set bpr to enable state
1421  *
1422  * Enum indicating bpr state to enable/disable.
1423  */
1424 enum cdp_pdev_bpr_param {
1425 	CDP_BPR_DISABLE,
1426 	CDP_BPR_ENABLE,
1427 };
1428 
1429 /*
1430  * cdp_vdev_param_type: different types of parameters
1431  *			to set values in vdev
1432  * @CDP_ENABLE_NAWDS: set nawds enable/disable
1433  * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement
1434  * @CDP_ENABLE_WDS: wds sta
1435  * @CDP_ENABLE_MEC: MEC enable flags
1436  * @CDP_ENABLE_PROXYSTA: proxy sta
1437  * @CDP_UPDATE_TDLS_FLAGS: tdls link flags
1438  * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable
1439  * @CDP_ENABLE_CIPHER : set cipher type based on security
1440  * @CDP_ENABLE_QWRAP_ISOLATION: qwrap isolation mode
1441  * @CDP_TX_ENCAP_TYPE: tx encap type
1442  * @CDP_RX_DECAP_TYPE: rx decap type
1443  * @CDP_MESH_RX_FILTER: set mesh rx filter
1444  * @CDP_TID_VDEV_PRTY: set tid vdev prty
1445  * @CDP_TIDMAP_TBL_ID: set tidmap table id
1446  * @CDP_MESH_MODE: set mesh mode
1447  * @CDP_SAFEMODE: set safe mode
1448  * @CDP_DROP_UNENC: set drop unencrypted flag
1449  * @CDP_ENABLE_IGMP_MCAST_EN: enable/disable igmp multicast enhancement
1450  * @CDP_ENABLE_HLOS_TID_OVERRIDE: set hlos tid override flag
1451  * @CDP_CFG_WDS_EXT: enable/disable wds ext feature
1452  * @CDP_ENABLE_PEER_AUTHORIZE: enable peer authorize flag
1453  * @CDP_ENABLE_PEER_TID_LATENCY: set peer tid latency enable flag
1454  * @CDP_SET_VAP_MESH_TID : Set latency tid in vap
1455  * @CDP_UPDATE_DSCP_TO_TID_MAP: Set DSCP to TID map id
1456  * @CDP_SET_MCAST_VDEV : Set primary mcast vdev
1457  * @CDP_ENABLE_WRAP: qwrap ap
1458  * @CDP_ENABLE_TRAFFIC_END_INDICATION: enable/disable traffic end indication
1459  */
1460 enum cdp_vdev_param_type {
1461 	CDP_ENABLE_NAWDS,
1462 	CDP_ENABLE_MCAST_EN,
1463 	CDP_ENABLE_WDS,
1464 	CDP_ENABLE_MEC,
1465 	CDP_ENABLE_DA_WAR,
1466 	CDP_ENABLE_PROXYSTA,
1467 	CDP_UPDATE_TDLS_FLAGS,
1468 	CDP_CFG_WDS_AGING_TIMER,
1469 	CDP_ENABLE_AP_BRIDGE,
1470 	CDP_ENABLE_CIPHER,
1471 	CDP_ENABLE_QWRAP_ISOLATION,
1472 	CDP_UPDATE_MULTIPASS,
1473 	CDP_TX_ENCAP_TYPE,
1474 	CDP_RX_DECAP_TYPE,
1475 	CDP_MESH_RX_FILTER,
1476 	CDP_TID_VDEV_PRTY,
1477 	CDP_TIDMAP_TBL_ID,
1478 #ifdef MESH_MODE_SUPPORT
1479 	CDP_MESH_MODE,
1480 #endif
1481 	CDP_SAFEMODE,
1482 	CDP_DROP_UNENC,
1483 	CDP_ENABLE_IGMP_MCAST_EN,
1484 	CDP_ENABLE_HLOS_TID_OVERRIDE,
1485 #ifdef QCA_SUPPORT_WDS_EXTENDED
1486 	CDP_CFG_WDS_EXT,
1487 #endif /* QCA_SUPPORT_WDS_EXTENDED */
1488 	CDP_ENABLE_PEER_AUTHORIZE,
1489 #ifdef WLAN_SUPPORT_MESH_LATENCY
1490 	CDP_ENABLE_PEER_TID_LATENCY,
1491 	CDP_SET_VAP_MESH_TID,
1492 #endif
1493 #ifdef WLAN_VENDOR_SPECIFIC_BAR_UPDATE
1494 	CDP_SKIP_BAR_UPDATE_AP,
1495 #endif
1496 	CDP_UPDATE_DSCP_TO_TID_MAP,
1497 	CDP_SET_MCAST_VDEV,
1498 	CDP_SET_MCAST_VDEV_HW_UPDATE,
1499 	CDP_DROP_3ADDR_MCAST,
1500 	CDP_ENABLE_WRAP,
1501 #ifdef DP_TRAFFIC_END_INDICATION
1502 	CDP_ENABLE_TRAFFIC_END_INDICATION,
1503 #endif
1504 };
1505 
1506 /*
1507  * cdp_psoc_param_type: different types of parameters
1508  *			to set values in psoc
1509  * @CDP_ENABLE_RATE_STATS: set rate stats enable/disable
1510  * @CDP_SET_NSS_CFG: set nss cfg
1511  * @CDP_SET_PREFERRED_HW_MODE: set preferred hw mode
1512  * @CDP_CFG_PEER_EXT_STATS: Peer extended stats mode.
1513  * @CDP_IPA_ENABLE : set IPA enable mode.
1514  * @CDP_CFG_VDEV_STATS_HW_OFFLOAD: HW Vdev stats config
1515  * @CDP_UMAC_RST_SKEL_ENABLE: Enable Umac reset skeleton code for debug
1516  */
1517 enum cdp_psoc_param_type {
1518 	CDP_ENABLE_RATE_STATS,
1519 	CDP_SET_NSS_CFG,
1520 	CDP_SET_PREFERRED_HW_MODE,
1521 	CDP_CFG_PEER_EXT_STATS,
1522 	CDP_IPA_ENABLE,
1523 	CDP_CFG_VDEV_STATS_HW_OFFLOAD,
1524 	CDP_SAWF_ENABLE,
1525 	CDP_UMAC_RST_SKEL_ENABLE,
1526 };
1527 
1528 #define TXRX_FW_STATS_TXSTATS                     1
1529 #define TXRX_FW_STATS_RXSTATS                     2
1530 #define TXRX_FW_STATS_RX_RATE_INFO                3
1531 #define TXRX_FW_STATS_PHYSTATS                    4
1532 #define TXRX_FW_STATS_PHYSTATS_CONCISE            5
1533 #define TXRX_FW_STATS_TX_RATE_INFO                6
1534 #define TXRX_FW_STATS_TID_STATE                   7
1535 #define TXRX_FW_STATS_HOST_STATS                  8
1536 #define TXRX_FW_STATS_CLEAR_HOST_STATS            9
1537 #define TXRX_FW_STATS_CE_STATS                   10
1538 #define TXRX_FW_STATS_VOW_UMAC_COUNTER           11
1539 #define TXRX_FW_STATS_ME_STATS                   12
1540 #define TXRX_FW_STATS_TXBF_INFO                  13
1541 #define TXRX_FW_STATS_SND_INFO                   14
1542 #define TXRX_FW_STATS_ERROR_INFO                 15
1543 #define TXRX_FW_STATS_TX_SELFGEN_INFO            16
1544 #define TXRX_FW_STATS_TX_MU_INFO                 17
1545 #define TXRX_FW_SIFS_RESP_INFO                   18
1546 #define TXRX_FW_RESET_STATS                      19
1547 #define TXRX_FW_MAC_WDOG_STATS                   20
1548 #define TXRX_FW_MAC_DESC_STATS                   21
1549 #define TXRX_FW_MAC_FETCH_MGR_STATS              22
1550 #define TXRX_FW_MAC_PREFETCH_MGR_STATS           23
1551 #define TXRX_FW_STATS_DURATION_INFO              24
1552 #define TXRX_FW_STATS_DURATION_INFO_RESET        25
1553 #define TXRX_FW_HALPHY_STATS                     26
1554 #define TXRX_FW_COEX_STATS                       27
1555 
1556 #define PER_RADIO_FW_STATS_REQUEST 0
1557 #define PER_VDEV_FW_STATS_REQUEST 1
1558 /**
1559  * enum data_stall_log_event_indicator - Module triggering data stall
1560  * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused
1561  * @DATA_STALL_LOG_INDICATOR_HOST_DRIVER: Host driver indicates data stall
1562  * @DATA_STALL_LOG_INDICATOR_FIRMWARE: FW indicates data stall
1563  * @DATA_STALL_LOG_INDICATOR_FRAMEWORK: Framework indicates data stall
1564  *
1565  * Enum indicating the module that indicates data stall event
1566  */
1567 enum data_stall_log_event_indicator {
1568 	DATA_STALL_LOG_INDICATOR_UNUSED,
1569 	DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
1570 	DATA_STALL_LOG_INDICATOR_FIRMWARE,
1571 	DATA_STALL_LOG_INDICATOR_FRAMEWORK,
1572 };
1573 
1574 /**
1575  * enum data_stall_log_event_type - data stall event type
1576  * @DATA_STALL_LOG_NONE
1577  * @DATA_STALL_LOG_FW_VDEV_PAUSE
1578  * @DATA_STALL_LOG_HWSCHED_CMD_FILTER
1579  * @DATA_STALL_LOG_HWSCHED_CMD_FLUSH
1580  * @DATA_STALL_LOG_FW_RX_REFILL_FAILED
1581  * @DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR
1582  * @DATA_STALL_LOG_FW_WDOG_ERRORS
1583  * @DATA_STALL_LOG_BB_WDOG_ERROR
1584  * @DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR
1585  * @DATA_STALL_LOG_HOST_STA_TX_TIMEOUT
1586  * @DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT
1587  * @DATA_STALL_LOG_NUD_FAILURE
1588  *
1589  * Enum indicating data stall event type
1590  */
1591 enum data_stall_log_event_type {
1592 	DATA_STALL_LOG_NONE,
1593 	DATA_STALL_LOG_FW_VDEV_PAUSE,
1594 	DATA_STALL_LOG_HWSCHED_CMD_FILTER,
1595 	DATA_STALL_LOG_HWSCHED_CMD_FLUSH,
1596 	DATA_STALL_LOG_FW_RX_REFILL_FAILED,
1597 	DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR,
1598 	DATA_STALL_LOG_FW_WDOG_ERRORS,
1599 	DATA_STALL_LOG_BB_WDOG_ERROR,
1600 	DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR,
1601 	/* Stall events triggered by host/framework start from 0x100 onwards. */
1602 	DATA_STALL_LOG_HOST_STA_TX_TIMEOUT = 0x100,
1603 	DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,
1604 	DATA_STALL_LOG_NUD_FAILURE,
1605 };
1606 
1607 /**
1608  * enum data_stall_log_recovery_type - data stall recovery type
1609  * @DATA_STALL_LOG_RECOVERY_NONE,
1610  * @DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
1611  * @DATA_STALL_LOG_RECOVERY_TRIGGER_PDR
1612  *
1613  * Enum indicating data stall recovery type
1614  */
1615 enum data_stall_log_recovery_type {
1616 	DATA_STALL_LOG_RECOVERY_NONE = 0,
1617 	DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
1618 	DATA_STALL_LOG_RECOVERY_TRIGGER_PDR,
1619 };
1620 
1621 /**
1622  * struct data_stall_event_info - data stall info
1623  * @indicator: Module triggering data stall
1624  * @data_stall_type: data stall event type
1625  * @vdev_id_bitmap: vdev_id_bitmap
1626  * @pdev_id: pdev id
1627  * @recovery_type: data stall recovery type
1628  */
1629 struct data_stall_event_info {
1630 	uint32_t indicator;
1631 	uint32_t data_stall_type;
1632 	uint32_t vdev_id_bitmap;
1633 	uint32_t pdev_id;
1634 	uint32_t recovery_type;
1635 };
1636 
1637 typedef void (*data_stall_detect_cb)(struct data_stall_event_info *);
1638 
1639 /*
1640  * enum cdp_stats - options for host and firmware
1641  * statistics
1642  * @CDP_TXRX_STATS_1: HTT Pdev tx stats
1643  * @CDP_TXRX_STATS_2: HTT Pdev rx stats
1644  * @CDP_TXRX_STATS_3: HTT Pdev Tx HW Queue stats
1645  * @CDP_TXRX_STATS_4: HTT Pdev Tx HW Sched stats
1646  * @CDP_TXRX_STATS_5: HTT Pdev error stats
1647  * @CDP_TXRX_STATS_6: HTT TQM stats
1648  * @CDP_TXRX_STATS_7: HTT TQM CMDQ stats
1649  * @CDP_TXRX_STATS_8: HTT Tx_de_cmn thread stats
1650  * @CDP_TXRX_STATS_9: HTT Pdev Tx rate stats
1651  * @CDP_TXRX_STATS_10: HTT Pdev Rx rate stats
1652  * @CDP_TXRX_STATS_11: HTT Peer stats
1653  * @CDP_TXRX_STATS_12: HTT Tx Self Gen Info
1654  * @CDP_TXRX_STATS_13: HTT Tx MU HWQ stats
1655  * @CDP_TXRX_STATS_14: HTT Ring interface info stats
1656  * @CDP_TXRX_STATS_15: HTT SRNG info stats
1657  * @CDP_TXRX_STATS_16: HTT SFM info stats
1658  * @CDP_TXRX_STATS_17: HTT Pdev tx mu mimo sched info
1659  * @CDP_TXRX_STATS_18: HTT Peer list details
1660  * @CDP_TXRX_STATS_19: Reserved
1661  * @CDP_TXRX_STATS_20: Reset Host stats
1662  * @CDP_TXRX_STATS_21: Host Rx rate stats
1663  * @CDP_TXRX_STATS_22: Host Tx rate stats
1664  * @CDP_TXRX_STATS_23: Host Tx stats
1665  * @CDP_TXRX_STATS_24: Host Rx stats
1666  * @CDP_TXRX_STATS_25: Host Ast stats
1667  * @CDP_TXRX_STATS_26: Host Head/Tail Pointer stats
1668  * @CDP_TXRX_STATS_27: Host Monitor mode stats
1669  * @CDP_TXRX_STATS_28: Host Peer entry stats
1670  * @CDP_TXRX_STATS_29: Host Soc config params info
1671  * @CDP_TXRX_STATS_30: Host Pdev config params info
1672  * @CDP_TXRX_STATS_31: Host DP Interrupt Stats
1673  */
1674 enum cdp_stats {
1675 	CDP_TXRX_STATS_0  = 0,
1676 	CDP_TXRX_STATS_1,
1677 	CDP_TXRX_STATS_2,
1678 	CDP_TXRX_STATS_3,
1679 	CDP_TXRX_STATS_4,
1680 	CDP_TXRX_STATS_5,
1681 	CDP_TXRX_STATS_6,
1682 	CDP_TXRX_STATS_7,
1683 	CDP_TXRX_STATS_8,
1684 	CDP_TXRX_STATS_9,
1685 	CDP_TXRX_STATS_10,
1686 	CDP_TXRX_STATS_11,
1687 	CDP_TXRX_STATS_12,
1688 	CDP_TXRX_STATS_13,
1689 	CDP_TXRX_STATS_14,
1690 	CDP_TXRX_STATS_15,
1691 	CDP_TXRX_STATS_16,
1692 	CDP_TXRX_STATS_17,
1693 	CDP_TXRX_STATS_18,
1694 	CDP_TXRX_STATS_19,
1695 	CDP_TXRX_STATS_20,
1696 	CDP_TXRX_STATS_21,
1697 	CDP_TXRX_STATS_22,
1698 	CDP_TXRX_STATS_23,
1699 	CDP_TXRX_STATS_24,
1700 	CDP_TXRX_STATS_25,
1701 	CDP_TXRX_STATS_26,
1702 	CDP_TXRX_STATS_27,
1703 	CDP_TXRX_STATS_28,
1704 	CDP_TXRX_STATS_29,
1705 	CDP_TXRX_STATS_30,
1706 	CDP_TXRX_STATS_31,
1707 	CDP_TXRX_STATS_HTT_MAX = 256,
1708 	CDP_TXRX_MAX_STATS = 265,
1709 };
1710 
1711 /*
1712  * Different Stat update types sent to OL_IF
1713  * @UPDATE_PEER_STATS: update peer stats
1714  * @UPDATE_VDEV_STATS: update vdev stats
1715  * @UPDATE_PDE_STATS: Update pdev stats
1716  */
1717 enum cdp_stat_update_type {
1718 	UPDATE_PEER_STATS = 0,
1719 	UPDATE_VDEV_STATS = 1,
1720 	UPDATE_PDEV_STATS = 2,
1721 };
1722 
1723 /*
1724  * struct cdp_tx_sojourn_stats - Tx sojourn stats
1725  * @ppdu_seq_id: ppdu_seq_id from tx completion
1726  * @avg_sojourn_msdu: average sojourn msdu time
1727  * @sum_sojourn_msdu: sum sojourn msdu time
1728  * @num_msdu: number of msdus per ppdu
1729  * @cookie: cookie to be used by upper layer
1730  */
1731 struct cdp_tx_sojourn_stats {
1732 	uint32_t ppdu_seq_id;
1733 	qdf_ewma_tx_lag avg_sojourn_msdu[CDP_DATA_TID_MAX];
1734 	uint32_t sum_sojourn_msdu[CDP_DATA_TID_MAX];
1735 	uint32_t num_msdus[CDP_DATA_TID_MAX];
1736 	struct cdp_stats_cookie *cookie;
1737 };
1738 
1739 /**
1740  * struct cdp_delayed_tx_completion_ppdu_user - Delayed Tx PPDU completion
1741  * per-user information
1742  * @frame_ctrl: frame control field in 802.11 header
1743  * @qos_ctrl: QoS control field in 802.11 header
1744  * @mpdu_tried: number of mpdus tried
1745  * @ltf_size: ltf_size
1746  * @stbc: stbc
1747  * @he_re: he_re (range extension)
1748  * @txbf: txbf
1749  * @bw: Transmission bandwidth
1750  *       <enum 2 transmit_bw_20_MHz>
1751  *       <enum 3 transmit_bw_40_MHz>
1752  *       <enum 4 transmit_bw_80_MHz>
1753  *       <enum 5 transmit_bw_160_MHz>
1754  * @nss: NSS 1,2, ...8
1755  * @mcs: MCS index
1756  * @preamble: preamble
1757  * @gi: guard interval 800/400/1600/3200 ns
1758  * @dcm: dcm
1759  * @ldpc: ldpc
1760  * @ru_start: RU start index
1761  * @ru_tones: RU tones length
1762  * @is_mcast: MCAST or UCAST
1763  * @user_pos: user position
1764  * @mu_group_id: mu group id
1765  * @ppdu_start_timestamp: 64 bits ppdu start timestamp
1766  * @ppdu_end_timestamp: 64 bits ppdu end timestamp
1767  */
1768 struct cdp_delayed_tx_completion_ppdu_user {
1769 	uint32_t frame_ctrl:16,
1770 		 qos_ctrl:16;
1771 	uint32_t mpdu_tried_ucast:16,
1772 		mpdu_tried_mcast:16;
1773 	uint32_t ltf_size:2,
1774 		 stbc:1,
1775 		 he_re:1,
1776 		 txbf:4,
1777 		 bw:4,
1778 		 nss:4,
1779 		 mcs:4,
1780 		 preamble:4,
1781 		 gi:4,
1782 		 dcm:1,
1783 		 ldpc:1,
1784 		 delayed_ba:1;
1785 	uint16_t ru_start;
1786 	uint16_t ru_tones;
1787 	bool is_mcast;
1788 	uint32_t user_pos;
1789 	uint32_t mu_group_id;
1790 	uint64_t ppdu_start_timestamp;
1791 	uint64_t ppdu_end_timestamp;
1792 };
1793 
1794 /**
1795  * struct cdp_tx_completion_ppdu_user - Tx PPDU completion per-user information
1796  * @completion_status: completion status - OK/Filter/Abort/Timeout
1797  * @tid: TID number
1798  * @peer_id: Peer ID
1799  * @ba_size: Block-Ack size
1800  * @frame_ctrl: frame control field in 802.11 header
1801  * @qos_ctrl: QoS control field in 802.11 header
1802  * @mpdu_tried: number of mpdus tried
1803  * @mpdu_success: number of mpdus successfully transmitted
1804  * @long_retries: long retries
1805  * @short_retries: short retries
1806  * @is_ampdu: mpdu aggregate or non-aggregate?
1807  * @success_bytes: bytes successfully transmitted
1808  * @retry_bytes: bytes retried
1809  * @retry_mpdus: mpdus retried
1810  * @failed_msdus: MSDUs failed transmission
1811  * @duration: user duration in ppdu
1812  * @ltf_size: ltf_size
1813  * @stbc: stbc
1814  * @he_re: he_re (range extension)
1815  * @txbf: txbf
1816  * @bw: Transmission bandwidth
1817  *       <enum 2 transmit_bw_20_MHz>
1818  *       <enum 3 transmit_bw_40_MHz>
1819  *       <enum 4 transmit_bw_80_MHz>
1820  *       <enum 5 transmit_bw_160_MHz>
1821  * @nss: NSS 1,2, ...8
1822  * @mcs: MCS index
1823  * @preamble: preamble
1824  * @gi: guard interval 800/400/1600/3200 ns
1825  * @dcm: dcm
1826  * @ldpc: ldpc
1827  * @delayed_ba: delayed ba bit
1828  * @ack_ba_tlv: ack ba recv tlv bit
1829  * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
1830  * @pream_punct: Preamble Punctured PPDU
1831  * UL_BSR_TRIG/UNKNOWN
1832  * @is_seq_num_valid:
1833  *       1 - stats tlv has valid sequence number
1834  *       0 - payload has valid sequence number
1835  * @ba_seq_no: Block Ack sequence number
1836  * @ba_bitmap: Block Ack bitmap
1837  * @start_seqa: Sequence number of first MPDU
1838  * @enq_bitmap: Enqueue MPDU bitmap
1839  * @ru_start: RU start index
1840  * @ru_tones: RU tones length
1841  * @is_mcast: MCAST or UCAST
1842  * @tx_rate: Transmission Rate
1843  * @user_pos: user position
1844  * @mu_group_id: mu group id
1845  * @rix: rate index
1846  * @cookie: cookie to used by upper layer
1847  * @is_ppdu_cookie_valid : Indicates that ppdu_cookie is valid
1848  * @ppdu_cookie: 16-bit ppdu_cookie
1849  * @sa_is_training: smart antenna training packets indication
1850  * @rssi_chain: rssi chain per bandwidth
1851  * @usr_ack_rssi: overall per user ack rssi
1852  * @sa_tx_antenna: antenna in which packet is transmitted
1853  * @sa_max_rates: smart antenna tx feedback info max rates
1854  * @sa_goodput: smart antenna tx feedback info goodput
1855  * @current_rate_per: Moving average per
1856  * @last_enq_seq: last equeue sequence number
1857  * @is_bss_peer: is bss peer check
1858  * @mpdu_q: queue of mpdu in a ppdu
1859  * @mpdus: MPDU list based on enqueue sequence bitmap
1860  * @pending_retries: pending MPDUs (retries)
1861  * @tlv_bitmap: per user tlv bitmap
1862  * @skip: tx capture skip flag
1863  * @mon_procd: to indicate user processed in ppdu of the sched cmd
1864  * @debug_copied: flag to indicate bar frame copied
1865  * @peer_last_delayed_ba: flag to indicate peer last delayed ba
1866  * @phy_tx_time_us: Phy TX duration for the User
1867  * @mpdu_bytes: accumulated bytes per mpdu for mem limit feature
1868  * @punc_mode: puncutured mode to indicate punctured bw
1869  * @punc_pattern_bitmap: bitmap indicating punctured pattern
1870  */
1871 struct cdp_tx_completion_ppdu_user {
1872 	uint32_t completion_status:8,
1873 		 tid:8,
1874 		 peer_id:16;
1875 	uint8_t mac_addr[6];
1876 	uint16_t ba_size;
1877 	uint32_t frame_ctrl:16,
1878 		 qos_ctrl:16;
1879 	uint32_t mpdu_tried_ucast:16,
1880 		mpdu_tried_mcast:16;
1881 	uint16_t mpdu_success:16;
1882 	uint16_t mpdu_failed:16;
1883 	uint32_t long_retries:4,
1884 		 short_retries:4,
1885 		 tx_ratecode:16,
1886 		 is_ampdu:1,
1887 		 ppdu_type:5,
1888 		 pream_punct:1,
1889 		 is_seq_num_valid:1;
1890 	uint32_t success_bytes;
1891 	uint32_t retry_bytes;
1892 	uint32_t failed_bytes;
1893 	uint32_t success_msdus:16,
1894 		 retry_msdus:16;
1895 	uint32_t retry_mpdus;
1896 	uint32_t failed_msdus:16,
1897 		 duration:16;
1898 	uint32_t ltf_size:2,
1899 		 stbc:1,
1900 		 he_re:1,
1901 		 txbf:4,
1902 		 bw:4,
1903 		 nss:4,
1904 		 mcs:4,
1905 		 preamble:4,
1906 		 gi:4,
1907 		 dcm:1,
1908 		 ldpc:1,
1909 		 delayed_ba:1,
1910 		 ack_ba_tlv:1;
1911 	uint32_t ba_seq_no;
1912 	uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
1913 	uint32_t start_seq;
1914 	uint32_t enq_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
1915 	uint32_t failed_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
1916 	uint32_t num_mpdu:9,
1917 		 num_msdu:16;
1918 	uint32_t tx_duration;
1919 	uint16_t ru_start;
1920 	uint16_t ru_tones;
1921 	bool is_mcast;
1922 	uint32_t tx_rate;
1923 	uint32_t tx_ratekbps;
1924 	/*ack rssi for separate chains*/
1925 	uint32_t ack_rssi[CDP_RSSI_CHAIN_LEN];
1926 	bool ack_rssi_valid;
1927 	uint32_t usr_ack_rssi;
1928 	uint32_t user_pos;
1929 	uint32_t mu_group_id;
1930 	uint32_t rix;
1931 	uint8_t is_ppdu_cookie_valid;
1932 	uint16_t ppdu_cookie;
1933 	uint8_t sa_is_training;
1934 	uint32_t rssi_chain[CDP_RSSI_CHAIN_LEN];
1935 	uint32_t sa_tx_antenna;
1936 	/*Max rates for BW: 20MHZ, 40MHZ and 80MHZ and 160MHZ
1937 	 * |---------------------------------------|
1938 	 * | 16 bits | 16 bits | 16 bits | 16 bits |
1939 	 * |   BW-1  |   BW-2  |   BW-3  |   BW-4  |
1940 	 * |      /\  \                            |
1941 	 * |     /  \  \                           |
1942 	 * |    /    \  \                          |
1943 	 * |   /      \  \                         |
1944 	 * |  /        \  \                        |
1945 	 * | /          \  \                       |
1946 	 * |/            \  \                      |
1947 	 * |[11|8]     [5|8] \                     |
1948 	 * | BW1      PADDED  \                    |
1949 	 * |---------------------------------------|
1950 	 */
1951 	uint16_t sa_max_rates[CDP_NUM_SA_BW];
1952 	uint32_t sa_goodput;
1953 	/* below field is used to calculate goodput in non-training period
1954 	 * Note: As host is exposing goodput and hence current_rate_per is
1955 	 * of no use. It is just for Host computation.
1956 	 */
1957 	uint32_t current_rate_per;
1958 	uint32_t last_enq_seq;
1959 
1960 	uint8_t is_bss_peer;
1961 
1962 	qdf_nbuf_queue_t mpdu_q;
1963 	qdf_nbuf_t *mpdus;
1964 	uint32_t pending_retries;
1965 	uint32_t tlv_bitmap;
1966 	bool skip;
1967 	bool mon_procd;
1968 	bool debug_copied;
1969 	bool peer_last_delayed_ba;
1970 
1971 	uint16_t phy_tx_time_us;
1972 	uint32_t mpdu_bytes;
1973 	uint8_t punc_mode;
1974 	uint16_t punc_pattern_bitmap;
1975 };
1976 
1977 /**
1978  * struct cdp_tx_indication_mpdu_info - Tx MPDU completion information
1979  * @ppdu_id: PPDU id
1980  * @duration: user duration in ppdu
1981  * @frame_type: frame type MGMT/CTRL/DATA/BAR
1982  * @frame_ctrl: frame control field in 802.11 header
1983  * @qos_ctrl: QoS control field in 802.11 header
1984  * @tid: TID number
1985  * @num_msdu: number of msdu in MPDU
1986  * @seq_no: Sequence number of first MPDU
1987  * @ltf_size: ltf_size
1988  * @stbc: stbc
1989  * @he_re: he_re (range extension)
1990  * @txbf: txbf
1991  * @bw: Transmission bandwidth
1992  *       <enum 2 transmit_bw_20_MHz>
1993  *       <enum 3 transmit_bw_40_MHz>
1994  *       <enum 4 transmit_bw_80_MHz>
1995  *       <enum 5 transmit_bw_160_MHz>
1996  * @nss: NSS 1,2, ...8
1997  * @mcs: MCS index
1998  * @preamble: preamble
1999  * @gi: guard interval 800/400/1600/3200 ns
2000  * @resp_type: response type
2001  * @mprot_type: medium protection type
2002  * @rts_success: rts success
2003  * @rts failure: rts failure
2004  * @channel: frequency
2005  * @channel_num: channel number
2006  * @ack_rssi: ack rssi
2007  * @ldpc: ldpc
2008  * @tx_rate: Transmission Rate
2009  * @mac_address: peer mac address
2010  * @bss_mac_address: bss mac address
2011  * @ppdu_start_timestamp: TSF at PPDU start
2012  * @ppdu_end_timestamp: TSF at PPDU end
2013  * @ba_start_seq: Block Ack sequence number
2014  * @ba_bitmap: Block Ack bitmap
2015  * @ppdu_cookie: 16-bit ppdu_cookie
2016  * @long_retries: long retries
2017  * @short_retries: short retries
2018  * @completion_status: completion status - OK/Filter/Abort/Timeout
2019  * @usr_idx: user index
2020  */
2021 struct cdp_tx_indication_mpdu_info {
2022 	uint32_t ppdu_id;
2023 	uint32_t tx_duration;
2024 	uint16_t frame_type;
2025 	uint16_t frame_ctrl;
2026 	uint16_t qos_ctrl;
2027 	uint8_t tid;
2028 	uint32_t num_msdu;
2029 	uint32_t seq_no;
2030 	uint32_t ltf_size:2,
2031 		 he_re:1,
2032 		 txbf:4,
2033 		 bw:4,
2034 		 nss:4,
2035 		 mcs:4,
2036 		 preamble:4,
2037 		 gi:4;
2038 	uint32_t channel;
2039 	uint8_t channel_num;
2040 	uint32_t ack_rssi;
2041 	uint32_t ldpc;
2042 	uint32_t tx_rate;
2043 	uint8_t mac_address[QDF_MAC_ADDR_SIZE];
2044 	uint8_t bss_mac_address[QDF_MAC_ADDR_SIZE];
2045 	uint64_t ppdu_start_timestamp;
2046 	uint64_t ppdu_end_timestamp;
2047 	uint32_t ba_start_seq;
2048 	uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
2049 	uint16_t ppdu_cookie;
2050 	uint16_t long_retries:4,
2051 		 short_retries:4,
2052 		 completion_status:8;
2053 	uint16_t resp_type:4,
2054 		 mprot_type:3,
2055 		 rts_success:1,
2056 		 rts_failure:1;
2057 	uint8_t usr_idx;
2058 };
2059 
2060 /**
2061  * struct cdp_tx_indication_info - Tx capture information
2062  * @radiotap_done: Flag to say radiotap already done or not
2063  *			0 - radiotap not updated
2064  *			1 - radiotap header updated
2065  * @mpdu_info: Tx MPDU completion information
2066  * @mpdu_nbuf: reconstructed mpdu packet
2067  * @ppdu_desc: tx completion ppdu
2068  */
2069 struct cdp_tx_indication_info {
2070 	bool radiotap_done;
2071 	struct cdp_tx_indication_mpdu_info mpdu_info;
2072 	qdf_nbuf_t mpdu_nbuf;
2073 	struct cdp_tx_completion_ppdu *ppdu_desc;
2074 #ifdef QCA_SUPPORT_LITE_MONITOR
2075 	ol_osif_vdev_handle osif_vdev;
2076 #endif
2077 };
2078 
2079 /**
2080  * struct cdp_tx_mgmt_comp_info - Tx mgmt comp info
2081  * @ppdu_id: ppdu_id
2082  * @is_sgen_pkt: payload received from wmi or htt path
2083  * @retries_count: retries count
2084  * @tx_tsf: 64 bit timestamp
2085  */
2086 struct cdp_tx_mgmt_comp_info {
2087 	uint32_t ppdu_id;
2088 	bool is_sgen_pkt;
2089 	uint16_t retries_count;
2090 	uint64_t tx_tsf;
2091 };
2092 
2093 /**
2094  * struct cdp_tx_completion_ppdu - Tx PPDU completion information
2095  * @completion_status: completion status - OK/Filter/Abort/Timeout
2096  * @ppdu_id: PPDU Id
2097  * @ppdu_seq_id: ppdu sequence id for sojourn stats
2098  * @vdev_id: VAP Id
2099  * @bar_num_users: BA response user count, based on completion common TLV
2100  * @num_users: Number of users
2101  * @max_users: Number of users from USR_INFO TLV
2102  * @drop_reason: drop reason from flush status
2103  * @is_flush: is_flush is set based on flush tlv
2104  * @flow_type: tx flow type from flush status
2105  * @queue_type: queue type from flush status
2106  * @num_mpdu: Number of MPDUs in PPDU
2107  * @num_msdu: Number of MSDUs in PPDU
2108  * @frame_type: frame SU or MU
2109  * @htt_frame_type: frame type from htt
2110  * @frame_ctrl: frame control of 80211 header
2111  * @channel: Channel informartion
2112  * @resp_type: response type
2113  * @mprot_type: medium protection type
2114  * @rts_success: rts success
2115  * @rts failure: rts failure
2116  * @phymode: phy mode
2117  * @ack_rssi: RSSI value of last ack packet (units=dB above noise floor)
2118  * @tx_duration: PPDU airtime
2119  * @ppdu_start_timestamp: TSF at PPDU start
2120  * @ppdu_end_timestamp: TSF at PPDU end
2121  * @ack_timestamp: TSF at the reception of ACK
2122  * @delayed_ba: Delayed ba flag
2123  * @beam_change: beam change bit in ppdu for he-information
2124  * @bss_color: 6 bit value for full bss color
2125  * @doppler: value for doppler (will be 0 most of the times)
2126  * @spatial_reuse: value for spatial reuse used in radiotap HE header
2127  * @usr_nss_sum: Sum of user nss
2128  * @usr_ru_tones_sum: Sum of user ru_tones
2129  * @bar_ppdu_id: BAR ppdu_id
2130  * @bar_tx_duration: BAR tx duration
2131  * @bar_ppdu_start_timestamp: BAR start timestamp
2132  * @bar_ppdu_end_timestamp: BAR end timestamp
2133  * @tlv_bitmap: tlv_bitmap for the PPDU
2134  * @sched_cmdid: schedule command id
2135  * @phy_ppdu_tx_time_us: Phy per PPDU TX duration
2136  * @ppdu_bytes: accumulated bytes per ppdu for mem limit feature
2137  * @user: per-User stats (array of per-user structures)
2138  */
2139 struct cdp_tx_completion_ppdu {
2140 	uint32_t ppdu_id;
2141 	uint32_t ppdu_seq_id;
2142 	uint16_t vdev_id;
2143 	uint16_t bar_num_users;
2144 	uint32_t num_users;
2145 	uint8_t  max_users;
2146 	uint8_t last_usr_index;
2147 	uint32_t drop_reason;
2148 	uint32_t is_flush:1,
2149 		 flow_type:8,
2150 		 queue_type:8;
2151 	uint32_t num_mpdu:9,
2152 		 num_msdu:16;
2153 	uint16_t frame_type;
2154 	uint16_t htt_frame_type;
2155 	uint16_t frame_ctrl;
2156 	uint16_t channel;
2157 	uint16_t resp_type:4,
2158 		 mprot_type:3,
2159 		 rts_success:1,
2160 		 rts_failure:1;
2161 	uint16_t phy_mode;
2162 	uint32_t ack_rssi;
2163 	uint32_t tx_duration;
2164 	uint64_t ppdu_start_timestamp;
2165 	uint64_t ppdu_end_timestamp;
2166 	uint64_t ack_timestamp;
2167 	bool delayed_ba;
2168 	uint8_t beam_change;
2169 	uint8_t bss_color;
2170 	uint8_t doppler;
2171 	uint8_t spatial_reuse;
2172 	uint8_t usr_nss_sum;
2173 	uint32_t usr_ru_tones_sum;
2174 	uint32_t bar_ppdu_id;
2175 	uint32_t bar_tx_duration;
2176 	uint64_t bar_ppdu_start_timestamp;
2177 	uint64_t bar_ppdu_end_timestamp;
2178 	uint32_t tlv_bitmap;
2179 	uint16_t sched_cmdid;
2180 	uint16_t phy_ppdu_tx_time_us;
2181 	uint32_t ppdu_bytes;
2182 	struct cdp_tx_completion_ppdu_user user[];
2183 };
2184 
2185 /**
2186  * struct cdp_dev_stats - Network device stats structure
2187  * @tx_packets: Tx total packets transmitted
2188  * @tx_errors : Tx error due to FW tx failure, Ring failure DMA etc
2189  * @tx_dropped: Tx dropped is same as tx errors as above
2190  * @rx_packets: Rx total packets transmitted
2191  * @rx_errors : Rx errors
2192  * @rx_dropped: Rx dropped stats
2193  * @tx_bytes  : Tx total bytes transmitted
2194  * @rx_bytes  : Rx total bytes transmitted
2195  */
2196 struct cdp_dev_stats {
2197 	uint32_t tx_packets;
2198 	uint32_t tx_errors;
2199 	uint32_t tx_dropped;
2200 	uint32_t rx_packets;
2201 	uint32_t rx_errors;
2202 	uint32_t rx_dropped;
2203 	uint64_t tx_bytes;
2204 	uint64_t rx_bytes;
2205 };
2206 
2207 /**
2208  * struct cdp_rate_stats - Tx/Rx Rate statistics
2209  * @bw: Indicates the BW of the upcoming transmission -
2210  *       <enum 2 transmit_bw_20_MHz>
2211  *       <enum 3 transmit_bw_40_MHz>
2212  *       <enum 4 transmit_bw_80_MHz>
2213  *       <enum 5 transmit_bw_160_MHz>
2214  * @pkt_type: Transmit Packet Type
2215  * @stbc: When set, STBC transmission rate was used
2216  * @ldpc: When set, use LDPC transmission rates
2217  * @sgi: <enum 0     0_8_us_sgi > Legacy normal GI
2218  *       <enum 1     0_4_us_sgi > Legacy short GI
2219  *       <enum 2     1_6_us_sgi > HE related GI
2220  *       <enum 3     3_2_us_sgi > HE
2221  * @mcs: Transmit MCS Rate
2222  * @ofdma: Set when the transmission was an OFDMA transmission
2223  * @tones_in_ru: The number of tones in the RU used.
2224  * @tsf: Lower 32 bits of the TSF (timestamp when ppdu transmission finished)
2225  * @peer_id: Peer ID of the flow or MPDU queue
2226  * @tid: TID of the flow or MPDU queue
2227  */
2228 struct cdp_rate_stats {
2229 	uint32_t rate_stats_info_valid:1,
2230 		 bw:2,
2231 		 pkt_type:4,
2232 		 stbc:1,
2233 		 ldpc:1,
2234 		 sgi:2,
2235 		 mcs:4,
2236 		 ofdma:1,
2237 		 tones_in_ru:12,
2238 		 resvd0:4;
2239 	uint32_t tsf;
2240 	uint16_t peer_id;
2241 	uint8_t tid;
2242 };
2243 
2244 /**
2245  * struct cdp_tx_completion_msdu - Tx MSDU completion descriptor
2246  * @ppdu_id: PPDU to which this MSDU belongs
2247  * @transmit_cnt: Number of times this frame has been transmitted
2248  * @ack_frame_rssi: RSSI of the received ACK or BA frame
2249  * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
2250  * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
2251  * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
2252  * @extd: Extended structure containing rate statistics
2253  */
2254 struct cdp_tx_completion_msdu {
2255 	uint32_t ppdu_id;
2256 	uint8_t transmit_cnt;
2257 	uint32_t ack_frame_rssi:8,
2258 		 resvd0:1,
2259 		 first_msdu:1,
2260 		 last_msdu:1,
2261 		 msdu_part_of_amsdu:1,
2262 		 resvd1:20;
2263 	struct cdp_rate_stats extd;
2264 };
2265 
2266 /**
2267  * struct cdp_rx_stats_ppdu_user -- per user RX stats
2268  * @peer_id: Peer ID
2269  * @vdev_id: VAP ID
2270  * @is_ampdu: mpdu aggregate or non-aggregate?
2271  * @mu_ul_info_valid: MU UL info valid
2272  * @ofdma_ru_start_index: RU index number(0-73)
2273  * @ofdma_ru_width: size of RU in units of 1(26tone)RU
2274  * @nss: NSS 1,2, ...8
2275  * @mcs: MCS index
2276  * @user_index: user ID in multi-user case
2277  * @is_bss_peer - is bss peer check
2278  * @ast_index: ast index in multi-user case
2279  * @tid: TID number
2280  * @num_msdu: Number of MSDUs in PPDU
2281  * @udp_msdu_count: Number of UDP MSDUs in PPDU
2282  * @tcp_msdu_count: Number of TCP MSDUs in PPDU
2283  * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
2284  * @frame_control: frame control field
2285  * @frame_control_info_valid: frame_control valid
2286  * @qos_control: qos control field
2287  * @qos_control_info_valid: qos_control valid
2288  * @data_sequence_control_info_valid: data_sequence_control_info valid
2289  * @first_data_seq_ctrl: Sequence control field of first data frame
2290  * @preamble: preamble
2291  * @ht_flag: ht flag
2292  * @vht_flag: vht flag
2293  * @he_re: he_re (range extension)
2294  * @mac_addr: Peer MAC Address
2295  * @mpdu_cnt_fcs_ok: Number of MPDUs in PPDU with fcs ok
2296  * @mpdu_cnt_fcs_err: Number of MPDUs in PPDU with fcs err
2297  * @mpdu_fcs_ok_bitmap - MPDU with fcs ok bitmap
2298  * @retries - number of retries
2299  * @rx_ratekpbs - rx rate in kbps
2300  * @rix - rate index
2301  * @mpdu_retries - retries of mpdu in rx
2302  * @rx_time_us - Rx duration
2303  */
2304 struct cdp_rx_stats_ppdu_user {
2305 	uint16_t peer_id;
2306 	uint8_t vdev_id;
2307 	bool is_ampdu;
2308 	uint32_t mu_ul_info_valid:1,
2309 		 ofdma_ru_start_index:7,
2310 		 ofdma_ru_width:7,
2311 		 nss:4,
2312 		 mcs:4;
2313 	/* user id */
2314 	uint8_t  user_index;
2315 	uint8_t is_bss_peer;
2316 	uint32_t ast_index;
2317 	uint32_t tid;
2318 	uint32_t num_msdu;
2319 	uint16_t  tcp_msdu_count;
2320 	uint16_t  udp_msdu_count;
2321 	uint16_t  other_msdu_count;
2322 	uint16_t frame_control;
2323 	uint8_t  frame_control_info_valid;
2324 	uint16_t qos_control;
2325 	uint8_t  qos_control_info_valid;
2326 	uint8_t data_sequence_control_info_valid;
2327 	uint16_t first_data_seq_ctrl;
2328 	uint32_t preamble_type;
2329 	uint16_t ht_flags;
2330 	uint16_t vht_flags;
2331 	uint16_t he_flags;
2332 	uint8_t  mac_addr[QDF_MAC_ADDR_SIZE];
2333 	uint32_t mpdu_cnt_fcs_ok;
2334 	uint32_t mpdu_cnt_fcs_err;
2335 	uint32_t mpdu_fcs_ok_bitmap[QDF_MON_STATUS_MPDU_FCS_BMAP_NWORDS];
2336 	uint32_t mpdu_ok_byte_count;
2337 	uint32_t mpdu_err_byte_count;
2338 	uint32_t retries;
2339 	uint32_t rx_ratekbps;
2340 	uint32_t rix;
2341 	uint32_t mpdu_retries;
2342 	uint16_t rx_time_us;
2343 };
2344 
2345 /**
2346  * struct cdp_rx_indication_ppdu - Rx PPDU indication structure
2347  * @ppdu_id: PPDU Id
2348  * @is_ampdu: mpdu aggregate or non-aggregate?
2349  * @num_mpdu: Number of MPDUs in PPDU
2350  * @reserved: Reserved bits for future use
2351  * @num_msdu: Number of MSDUs in PPDU
2352  * @udp_msdu_count: Number of UDP MSDUs in PPDU
2353  * @tcp_msdu_count: Number of TCP MSDUs in PPDU
2354  * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
2355  * @duration: PPDU duration
2356  * @tid: TID number
2357  * @peer_id: Peer ID
2358  * @vdev_id: VAP ID
2359  * @mac_addr: Peer MAC Address
2360  * @first_data_seq_ctrl: Sequence control field of first data frame
2361  * @ltf_size: ltf_size
2362  * @stbc: When set, STBC rate was used
2363  * @he_re: he_re (range extension)
2364  * @bw: Bandwidth
2365  *       <enum 0 bw_20_MHz>
2366  *       <enum 1 bw_40_MHz>
2367  *       <enum 2 bw_80_MHz>
2368  *       <enum 3 bw_160_MHz>
2369  * @nss: NSS 1,2, ...8
2370  * @mcs: MCS index
2371  * @preamble: preamble
2372  * @gi: <enum 0     0_8_us_sgi > Legacy normal GI
2373  *       <enum 1     0_4_us_sgi > Legacy short GI
2374  *       <enum 2     1_6_us_sgi > HE related GI
2375  *       <enum 3     3_2_us_sgi > HE
2376  * @dcm: dcm
2377  * @ldpc: ldpc
2378  * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
2379  * UL_BSR_TRIG/UNKNOWN
2380  * @rssi: RSSI value (units = dB above noise floor)
2381  * @timestamp: TSF at the reception of PPDU
2382  * @length: PPDU length
2383  * @channel: Channel informartion
2384  * @lsig_A: L-SIG in 802.11 PHY header
2385  * @frame_ctrl: frame control field
2386  * @rix: rate index
2387  * @rssi_chain: rssi chain per nss per bw
2388  * @cookie: cookie to used by upper layer
2389  * @user: per user stats in MU-user case
2390  * @nf: noise floor
2391  * @per_chain_rssi: rssi per antenna
2392  * @punc_bw: punctured bw
2393  * @phyrx_abort: rx aborted undecoded frame indication
2394  * @phyrx_abort_reason: abort reason defined in phyrx_abort_request_info
2395  * @l_sig_length: L SIG A length
2396  * @l_sig_a_parity: L SIG A parity
2397  * @l_sig_a_pkt_type: L SIG A info pkt type
2398  * @l_sig_a_implicit_sounding: L SIG A info captured implicit sounding
2399  * @ht_length: num of bytes in PSDU
2400  * @ht_smoothing: Indicate ht_smoothing
2401  * @ht_not_sounding: Indicate ht not sounding
2402  * @ht_aggregation: Indicate ht aggregation
2403  * @ht_stbc: Indicate ht stbc
2404  * @ht_crc: Indicate ht crc
2405  * @vht_crc: Indicate vht crc
2406  * @vht_no_txop_ps: Indicate TXOP power save mode
2407  * @bss_color_id: Indicate BSS color ID
2408  * @beam_change: Indicates whether spatial mapping is changed
2409  * @dl_ul_flag: Differentiates between DL and UL transmission
2410  * @transmit_mcs: Indicates the data MCS
2411  * @ldpc_extra_sym: LDPC extra symbol
2412  * @special_reuse: Spatial reuse
2413  * @ltf_sym: Indictaes HE NSTS
2414  * @txbf: Indicates whether beamforming is applied
2415  * @pe_disambiguity: packet extension disambiguity
2416  * @pre_fec_pad: packet extension a factor
2417  * @dopplar: Doppler support
2418  * @txop_duration: Indicates the remaining time in the current TXOP
2419  * @sig_b_mcs: MCS of HE-SIG-B
2420  * @sig_b_dcm: DCM of HE-SIG-B
2421  * @sig_b_sym: Number of symbols of HE-SIG-B
2422  * @sig_b_comp: Compression mode of HE-SIG-B
2423  * @he_crc: CRC for HE-SIG contents
2424  * @usr_nss_sum: Sum of user nss
2425  * @usr_ru_tones_sum: Sum of user ru_tones
2426  */
2427 struct cdp_rx_indication_ppdu {
2428 	uint32_t ppdu_id;
2429 	uint16_t is_ampdu:1,
2430 		 num_mpdu:9,
2431 		 reserved:6;
2432 	uint32_t num_msdu;
2433 	uint32_t num_bytes;
2434 	uint16_t udp_msdu_count;
2435 	uint16_t tcp_msdu_count;
2436 	uint16_t other_msdu_count;
2437 	uint16_t duration;
2438 	uint32_t tid:8,
2439 		 peer_id:16;
2440 	uint8_t vdev_id;
2441 	uint8_t mac_addr[6];
2442 	uint16_t first_data_seq_ctrl;
2443 	union {
2444 		uint32_t rate_info;
2445 		struct {
2446 			uint32_t ltf_size:2,
2447 				 stbc:1,
2448 				 he_re:1,
2449 				 bw:4,
2450 				 nss:4,
2451 				 mcs:4,
2452 				 preamble:4,
2453 				 gi:4,
2454 				 dcm:1,
2455 				 ldpc:1,
2456 				 ppdu_type:5;
2457 		};
2458 	} u;
2459 	uint32_t rix;
2460 	uint32_t lsig_a;
2461 	uint32_t rssi;
2462 	uint64_t timestamp;
2463 	uint32_t length;
2464 	uint8_t channel;
2465 	uint8_t beamformed;
2466 
2467 	uint32_t rx_ratekbps;
2468 	uint32_t ppdu_rx_rate;
2469 
2470 	uint32_t retries;
2471 	uint32_t rx_byte_count;
2472 	uint16_t rx_ratecode;
2473 	uint8_t fcs_error_mpdus;
2474 	uint16_t frame_ctrl;
2475 	int8_t rssi_chain[SS_COUNT][MAX_BW];
2476 	struct cdp_rx_su_evm_info evm_info;
2477 	uint32_t rx_antenna;
2478 	uint8_t num_users;
2479 	uint32_t nf;
2480 	uint8_t  per_chain_rssi[MAX_CHAIN];
2481 	uint8_t is_mcast_bcast;
2482 #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
2483 	struct cdp_rx_ppdu_cfr_info cfr_info;
2484 #endif
2485 	uint8_t punc_bw;
2486 #ifdef QCA_UNDECODED_METADATA_SUPPORT
2487 	bool phyrx_abort;
2488 	uint8_t phyrx_abort_reason;
2489 	uint32_t l_sig_length:12,
2490 		 l_sig_a_parity:1,
2491 		 l_sig_a_pkt_type:4,
2492 		 l_sig_a_implicit_sounding:1,
2493 		 vht_crc:8,
2494 		 group_id:6;
2495 	uint32_t ht_length:16,
2496 		 ht_smoothing:1,
2497 		 ht_not_sounding:1,
2498 		 ht_aggregation:1,
2499 		 ht_stbc:2,
2500 		 ht_crc:8,
2501 		 vht_no_txop_ps:1;
2502 	uint32_t bss_color_id:6,
2503 		 beam_change:1,
2504 		 dl_ul_flag:1,
2505 		 transmit_mcs:4,
2506 		 ldpc_extra_sym:1,
2507 		 special_reuse:4,
2508 		 ltf_sym:3,
2509 		 txbf:1,
2510 		 pe_disambiguity:1,
2511 		 pre_fec_pad:4,
2512 		 dopplar:1;
2513 	uint32_t txop_duration:7,
2514 		 sig_b_mcs:3,
2515 		 sig_b_dcm:1,
2516 		 sig_b_sym:4,
2517 		 sig_b_comp:1,
2518 		 he_crc:4;
2519 #endif
2520 	uint8_t usr_nss_sum;
2521 	uint32_t usr_ru_tones_sum;
2522 	struct cdp_rx_stats_ppdu_user user[];
2523 };
2524 
2525 /**
2526  * struct cdp_rx_indication_msdu - Rx MSDU info
2527  * @ppdu_id: PPDU to which the MSDU belongs
2528  * @msdu_len: Length of MSDU in bytes
2529  * @ack_frame_rssi: RSSI of the received ACK or BA frame
2530  * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
2531  * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
2532  * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
2533  * @extd: Extended structure containing rate statistics
2534  */
2535 struct cdp_rx_indication_msdu {
2536 	uint32_t ppdu_id;
2537 	uint16_t msdu_len;
2538 	uint32_t ack_frame_rssi:8,
2539 		 resvd0:1,
2540 		 first_msdu:1,
2541 		 last_msdu:1,
2542 		 msdu_part_of_amsdu:1,
2543 		 msdu_part_of_ampdu:1,
2544 		 resvd1:19;
2545 	struct cdp_rate_stats extd;
2546 };
2547 
2548 /**
2549  * struct cdp_config_params - Propagate configuration parameters to datapath
2550  * @tso_enable: Enable/Disable TSO
2551  * @lro_enable: Enable/Disable LRO
2552  * @gro_enable: Enable/Disable GRO
2553  * @flow_steering_enable: Enable/Disable Rx Hash based flow steering
2554  * @p2p_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for P2P
2555  * @nan_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for NAN
2556  * @tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload
2557  * @legacy_mode_checksumoffload_disable: Disable TCP/UDP Checksum Offload for
2558  *					 legacy modes.
2559  * @napi_enable: Enable/Disable Napi
2560  * @ipa_enable: Flag indicating if IPA is enabled or not
2561  * @tx_flow_stop_queue_threshold: Value to Pause tx queues
2562  * @tx_flow_start_queue_offset: Available Tx descriptors to unpause
2563  *				tx queue
2564  * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
2565  * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
2566  * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
2567  */
2568 struct cdp_config_params {
2569 	unsigned int tso_enable:1;
2570 	unsigned int lro_enable:1;
2571 	unsigned int gro_enable:1;
2572 	unsigned int flow_steering_enable:1;
2573 	unsigned int p2p_tcp_udp_checksumoffload:1;
2574 	unsigned int nan_tcp_udp_checksumoffload:1;
2575 	unsigned int tcp_udp_checksumoffload:1;
2576 	unsigned int legacy_mode_checksumoffload_disable:1;
2577 	unsigned int napi_enable:1;
2578 	unsigned int ipa_enable:1;
2579 	/* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */
2580 	uint8_t tx_flow_stop_queue_threshold;
2581 	uint8_t tx_flow_start_queue_offset;
2582 	uint32_t tx_comp_loop_pkt_limit;
2583 	uint32_t rx_reap_loop_pkt_limit;
2584 	uint32_t rx_hp_oos_update_limit;
2585 
2586 };
2587 
2588 /**
2589  * cdp_txrx_stats_req: stats request wrapper
2590  *	used to pass request information to cdp layer
2591  * @stats: type of stats requested
2592  * @param0: opaque argument 0 to be passed to htt
2593  * @param1: opaque argument 1 to be passed to htt
2594  * @param2: opaque argument 2 to be passed to htt
2595  * @param3: opaque argument 3 to be passed to htt
2596  * @mac id: mac_id
2597  */
2598 struct cdp_txrx_stats_req {
2599 	enum cdp_stats	stats;
2600 	uint32_t	param0;
2601 	uint32_t	param1;
2602 	uint32_t	param2;
2603 	uint32_t	param3;
2604 	uint32_t	cookie_val;
2605 	uint8_t		mac_id;
2606 	char		*peer_addr;
2607 };
2608 
2609 /**
2610  * struct cdp_monitor_filter - monitor filter info
2611  * @mode: set filter mode
2612  * @fp_mgmt: set Filter Pass MGMT Configuration
2613  * @fp_ctrl: set Filter Pass CTRL Configuration
2614  * @fp_data: set Filter Pass DATA Configuration
2615  * @mo_mgmt: set Monitor Other MGMT Configuration
2616  * @mo_ctrl: set Monitor Other CTRL Configuration
2617  * @mo_data: set Monitor other DATA Configuration
2618  *
2619  */
2620 struct cdp_monitor_filter {
2621 	uint16_t mode;
2622 	uint16_t fp_mgmt;
2623 	uint16_t fp_ctrl;
2624 	uint16_t fp_data;
2625 	uint16_t mo_mgmt;
2626 	uint16_t mo_ctrl;
2627 	uint16_t mo_data;
2628 };
2629 
2630 /**
2631  * enum cdp_dp_cfg - CDP ENUMs to get to DP configation
2632  * @cfg_dp_enable_data_stall: context passed to be used by consumer
2633  * @cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload: get P2P checksum config
2634  * @cfg_dp_enable_nan_ip_tcp_udp_checksum_offload: get NAN TX checksum config
2635  * @cfg_dp_enable_ip_tcp_udp_checksum_offload: get TX checksum config for others
2636  * @cfg_dp_tso_enable: get TSO enable config
2637  * @cfg_dp_lro_enable: get LRO enable config
2638  * @cfg_dp_gro_enable: get GRO enable config
2639  * @cfg_dp_tc_based_dyn_gro_enable: get TC based dynamic gro enable config
2640  * @cfg_dp_tc_ingress_prio: priority value to be checked for tc filters
2641  * @cfg_dp_tx_flow_start_queue_offset: get DP TX flow start queue offset
2642  * @cfg_dp_tx_flow_stop_queue_threshold: get DP TX flow stop queue threshold
2643  * @cfg_dp_ipa_uc_tx_buf_size: get IPA TX buf size config
2644  * @cfg_dp_ipa_uc_tx_partition_base: get IPA UC TX partition base config
2645  * @cfg_dp_ipa_uc_rx_ind_ring_count: get IPA rx indication ring count config
2646  * @cfg_dp_enable_flow_steering: get flow steerint enable config
2647  * @cfg_dp_reorder_offload_supported: get reorder offload support config
2648  * @cfg_dp_ce_classify_enable: get CE classify enable config
2649  * @cfg_dp_disable_intra_bss_fwd: get intra bss fwd config
2650  * @cfg_dp_pktlog_buffer_size: get packet log buffer size config
2651  * @cfg_dp_wow_check_rx_pending: get wow rx pending frame check config
2652  */
2653 enum cdp_dp_cfg {
2654 	cfg_dp_enable_data_stall,
2655 	cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload,
2656 	cfg_dp_enable_nan_ip_tcp_udp_checksum_offload,
2657 	cfg_dp_enable_ip_tcp_udp_checksum_offload,
2658 	/* Disable checksum offload for legacy modes */
2659 	cfg_dp_disable_legacy_mode_csum_offload,
2660 	cfg_dp_tso_enable,
2661 	cfg_dp_lro_enable,
2662 	cfg_dp_gro_enable,
2663 	cfg_dp_tc_based_dyn_gro_enable,
2664 	cfg_dp_tc_ingress_prio,
2665 	cfg_dp_sg_enable,
2666 	cfg_dp_tx_flow_start_queue_offset,
2667 	cfg_dp_tx_flow_stop_queue_threshold,
2668 	cfg_dp_ipa_uc_tx_buf_size,
2669 	cfg_dp_ipa_uc_tx_partition_base,
2670 	cfg_dp_ipa_uc_rx_ind_ring_count,
2671 	cfg_dp_enable_flow_steering,
2672 	cfg_dp_reorder_offload_supported,
2673 	cfg_dp_ce_classify_enable,
2674 	cfg_dp_disable_intra_bss_fwd,
2675 	cfg_dp_pktlog_buffer_size,
2676 	cfg_dp_wow_check_rx_pending,
2677 };
2678 
2679 /**
2680  * struct cdp_peer_cookie - cookie used when creating peer
2681  * @ctx: context passed to be used by consumer
2682  * @mac_addr: MAC address of peer
2683  * @peer_id: peer id
2684  * @pdev_id: pdev_id
2685  * @cookie: cookie to be used by consumer
2686  */
2687 struct cdp_peer_cookie {
2688 	struct cdp_stats_cookie *ctx;
2689 	uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
2690 	uint8_t peer_id;
2691 	uint8_t pdev_id;
2692 	uint8_t cookie;
2693 };
2694 
2695 #ifdef WLAN_SUPPORT_RX_FISA
2696 struct cdp_flow_stats {
2697 	uint32_t aggr_count;
2698 	uint32_t curr_aggr_count;
2699 	uint32_t flush_count;
2700 	uint32_t bytes_aggregated;
2701 };
2702 #else
2703 /**
2704  * cdp_flow_stats - Per-Flow (5-tuple) statistics
2705  * @msdu_count: number of rx msdus matching this flow
2706  * @mon_msdu_count: number of msdus matching this flow in mon path
2707  *
2708  * HW also includes msdu_byte_count and timestamp, which
2709  * are not currently tracked in SW.
2710  */
2711 struct cdp_flow_stats {
2712 	uint32_t msdu_count;
2713 	uint32_t mon_msdu_count;
2714 };
2715 #endif
2716 
2717 /**
2718  * cdp_flow_fst_operation - RX FST operations allowed
2719  */
2720 enum cdp_flow_fst_operation {
2721 	CDP_FLOW_FST_ENTRY_ADD,
2722 	CDP_FLOW_FST_ENTRY_DEL,
2723 	CDP_FLOW_FST_RX_BYPASS_ENABLE,
2724 	CDP_FLOW_FST_RX_BYPASS_DISABLE
2725 };
2726 
2727 /**
2728  * cdp_flow_protocol_type - RX FST supported protocol types, mapped to HW spec
2729  */
2730 enum cdp_flow_protocol_type {
2731 	CDP_FLOW_PROTOCOL_TYPE_TCP = 6,
2732 	CDP_FLOW_PROTOCOL_TYPE_UDP = 17,
2733 };
2734 
2735 /**
2736  * cdp_rx_flow_tuple_info - RX flow tuple info used for addition/deletion
2737  * @tuple_populated:
2738  * @is_exception: Flows which are added to flow table but not aggregated.
2739  * @bypass_fisa: Flow which are not added to flow table.
2740  * @dest_ip_127_96: destination IP address bit fields 96-127
2741  * @dest_ip_95_64: destination IP address bit fields 64-95
2742  * @dest_ip_63_32: destination IP address bit fields 32-63
2743  * @dest_ip_31_0: destination IP address bit fields 0-31
2744  * @src_ip_127_96: source IP address bit fields 96-127
2745  * @src_ip_95_64: source IP address bit fields 64-95
2746  * @src_ip_63_32: source IP address bit fields 32-63
2747  * @src_ip_31_0: source IP address bit fields 0-31
2748  * @dest_port: destination port of flow
2749  * @src_port: source port of flow
2750  * @l4_protocol: protocol type in flow (TCP/UDP)
2751  */
2752 struct cdp_rx_flow_tuple_info {
2753 #ifdef WLAN_SUPPORT_RX_FISA
2754 	uint8_t tuple_populated;
2755 	uint8_t is_exception;
2756 	bool bypass_fisa;
2757 #endif
2758 	uint32_t dest_ip_127_96;
2759 	uint32_t dest_ip_95_64;
2760 	uint32_t dest_ip_63_32;
2761 	uint32_t dest_ip_31_0;
2762 	uint32_t src_ip_127_96;
2763 	uint32_t src_ip_95_64;
2764 	uint32_t src_ip_63_32;
2765 	uint32_t src_ip_31_0;
2766 	uint16_t dest_port;
2767 	uint16_t src_port;
2768 	uint16_t l4_protocol;
2769 };
2770 
2771 /**
2772  * cdp_rx_flow_info - RX flow info used for addition/deletion
2773  * @is_addr_ipv4: indicates whether given IP address is IPv4/IPv6
2774  * @op_code: add/delete/enable/disable operation requested
2775  * @flow_tupe_info: structure containing tuple info
2776  * @fse_metadata: metadata to be set in RX flow
2777  */
2778 struct cdp_rx_flow_info {
2779 	bool is_addr_ipv4;
2780 	enum cdp_flow_fst_operation op_code;
2781 	struct cdp_rx_flow_tuple_info flow_tuple_info;
2782 	uint16_t fse_metadata;
2783 };
2784 
2785 #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
2786 /**
2787  * cdp_scan_spcl_vap_stats - Special vap statistics info
2788  * @rx_ok_pkts: rx fcs ok pkts count
2789  * @rx_ok_bytes: rx fcs ok bytes count
2790  * @rx_err_pkts: rx fcs err pkts count
2791  * @rx_err_bytes: rx fcs err bytes count
2792  * @rx_mgmt_pkts: rx mgmt pkts count
2793  * @rx_ctrl_pkts: rx ctrl pkts count
2794  * @rx_data_pkts: rx data pkts count
2795  */
2796 struct cdp_scan_spcl_vap_stats {
2797 	uint64_t rx_ok_pkts;
2798 	uint64_t rx_ok_bytes;
2799 	uint64_t rx_err_pkts;
2800 	uint64_t rx_err_bytes;
2801 	uint64_t rx_mgmt_pkts;
2802 	uint64_t rx_ctrl_pkts;
2803 	uint64_t rx_data_pkts;
2804 };
2805 #endif
2806 
2807 /**
2808  * cdp_soc_attach_params
2809  *
2810  * @hif_handle: Opaque HIF handle
2811  * @htc_handle: Opaque HTC handle
2812  * @qdf_osdev: QDF device
2813  * @ol_ops: Offload Operations
2814  * @device_id: Device ID
2815  * @ml_context: DP ML object context
2816  * @mlo_chip_id: MLO chip id, for legacy SOCs chip_id need to 0
2817  * @mlo_enabled: MLO enable bit
2818  */
2819 struct cdp_soc_attach_params {
2820 	struct hif_opaque_softc *hif_handle;
2821 	HTC_HANDLE htc_handle;
2822 	qdf_device_t qdf_osdev;
2823 	struct ol_if_ops *ol_ops;
2824 	uint16_t device_id;
2825 	struct cdp_mlo_ctxt *ml_context;
2826 	uint8_t mlo_chip_id;
2827 	uint8_t mlo_enabled;
2828 };
2829 
2830 /*
2831  * cdp_pdev_attach_params
2832  *
2833  * @htc_handle: HTC handle for host-target interface
2834  * @qdf_osdev: QDF OS device
2835  * @pdev_id: PDEV ID
2836  * @mlo_link_id: ML link id
2837  */
2838 struct cdp_pdev_attach_params {
2839 	HTC_HANDLE htc_handle;
2840 	qdf_device_t qdf_osdev;
2841 	uint8_t pdev_id;
2842 	uint32_t mlo_link_id;
2843 };
2844 #endif
2845