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