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