xref: /wlan-driver/qca-wifi-host-cmn/dp/inc/cdp_txrx_cmn_struct.h (revision 5113495b16420b49004c444715d2daae2066e7dc) !
1 /*
2  * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2024 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  * @vdev_del_notify: vdev delete notifier
1199  */
1200 struct ol_txrx_ops {
1201 	struct {
1202 		ol_txrx_tx_fp         tx;
1203 		ol_txrx_tx_fast_fp    tx_fast;
1204 		ol_txrx_tx_exc_fp     tx_exception;
1205 		ol_txrx_tx_free_ext_fp tx_free_ext;
1206 		ol_txrx_completion_fp tx_comp;
1207 		ol_txrx_classify_critical_pkt_fp tx_classify_critical_pkt_cb;
1208 	} tx;
1209 
1210 	struct {
1211 		ol_txrx_rx_fp           rx;
1212 #ifdef QCA_SUPPORT_EAPOL_OVER_CONTROL_PORT
1213 		ol_txrx_rx_fp     rx_eapol;
1214 #endif
1215 		ol_txrx_rx_fp           rx_stack;
1216 		ol_txrx_rx_flush_fp     rx_flush;
1217 		ol_txrx_rx_gro_flush_ind_fp           rx_gro_flush;
1218 		ol_txrx_rx_check_wai_fp wai_check;
1219 		ol_txrx_rx_mon_fp       mon;
1220 		ol_txrx_stats_rx_fp           stats_rx;
1221 		ol_txrx_rsim_rx_decap_fp rsim_rx_decap;
1222 		ol_txrx_fisa_rx_fp	osif_fisa_rx;
1223 		ol_txrx_fisa_flush_fp   osif_fisa_flush;
1224 	} rx;
1225 	/* proxy arp function pointer - specified by OS shim, stored by txrx */
1226 	ol_txrx_proxy_arp_fp      proxy_arp;
1227 	ol_txrx_mcast_me_fp          me_convert;
1228 
1229 	ol_txrx_get_key_fp  get_key;
1230 	ol_txrx_get_tsf_time get_tsf_time;
1231 	ol_txrx_vdev_delete_cb vdev_del_notify;
1232 };
1233 
1234 /**
1235  * struct ol_txrx_hardtart_ctxt - handlers for dp tx path
1236  * @tx: normal tx function
1237  * @tx_fast: fast tx function
1238  * @tx_exception: exception tx function
1239  */
1240 struct ol_txrx_hardtart_ctxt {
1241 	ol_txrx_tx_fp         tx;
1242 	ol_txrx_tx_fast_fp    tx_fast;
1243 	ol_txrx_tx_exc_fp     tx_exception;
1244 };
1245 
1246 /**
1247  * struct ol_txrx_stats_req - specifications of the requested
1248  *                            statistics
1249  * @stats_type_upload_mask: which stats to upload
1250  * @stats_type_reset_mask: which stats to reset
1251  * @print: control to print uploaded stats. stats will be printed if
1252  *         either print element is set
1253  * @print.verbose: verbose stats printout
1254  * @print.concise: concise stats printout (takes precedence)
1255  * @callback: callback context
1256  * @callback.fp: function pointer to call. stats notify callback will
1257  *               be invoked if fp is non-NULL
1258  * @callback.ctxt: opaque context to pass to callback function
1259  * @copy: copy context
1260  * @copy.buf: stats will be copied into the specified buffer if buf is
1261  *            non-NULL
1262  * @byte_limit: don't copy more than this
1263  * @wait: wait context
1264  * @wait.blocking: If true, the caller will take the specified
1265  *                 semaphore to wait for the stats to be uploaded, and
1266  *                 the driver will release the semaphore when the
1267  *                 stats are done being uploaded.
1268  * @wait.sem_ptr: Semaphore to use for blocking
1269  */
1270 struct ol_txrx_stats_req {
1271 	uint32_t stats_type_upload_mask;
1272 	uint32_t stats_type_reset_mask;
1273 
1274 	struct {
1275 		int verbose;
1276 		int concise;
1277 	} print;
1278 
1279 	struct {
1280 		ol_txrx_stats_callback fp;
1281 		void *ctxt;
1282 	} callback;
1283 
1284 	struct {
1285 		uint8_t *buf;
1286 		int byte_limit;
1287 	} copy;
1288 
1289 	struct {
1290 		int blocking;
1291 		qdf_semaphore_t *sem_ptr;
1292 	} wait;
1293 };
1294 
1295 
1296 /* DP soc struct definition */
1297 struct cdp_soc_t {
1298 	struct cdp_ops *ops;
1299 	struct ol_if_ops *ol_ops;
1300 };
1301 
1302 /**
1303  * enum cdp_peer_param_type - different types of parameters
1304  *			      to set values in peer
1305  * @CDP_CONFIG_NAWDS: Enable nawds mode
1306  * @CDP_CONFIG_NAC: Enable nac
1307  * @CDP_CONFIG_ISOLATION: Enable isolation
1308  * @CDP_CONFIG_IN_TWT: In TWT session or not
1309  * @CDP_CONFIG_MLD_PEER_VDEV: Change MLD peer's vdev
1310  * @CDP_CONFIG_PEER_FREQ: Set peer frequency
1311  */
1312 enum cdp_peer_param_type {
1313 	CDP_CONFIG_NAWDS,
1314 	CDP_CONFIG_NAC,
1315 	CDP_CONFIG_ISOLATION,
1316 	CDP_CONFIG_IN_TWT,
1317 	CDP_CONFIG_MLD_PEER_VDEV,
1318 	CDP_CONFIG_PEER_FREQ,
1319 };
1320 
1321 /**
1322  * enum cdp_pdev_param_type - different types of parameters
1323  *			      to set values in pdev
1324  * @CDP_CONFIG_DEBUG_SNIFFER: Enable debug sniffer feature
1325  * @CDP_CONFIG_BPR_ENABLE: Enable bcast probe feature
1326  * @CDP_CONFIG_PRIMARY_RADIO: Configure radio as primary
1327  * @CDP_CONFIG_ENABLE_PERPKT_TXSTATS: Enable per packet statistics
1328  * @CDP_CONFIG_IGMPMLD_OVERRIDE: Override IGMP/MLD
1329  * @CDP_CONFIG_IGMPMLD_TID: Configurable TID value when igmmld_override is set
1330  * @CDP_CONFIG_ARP_DBG_CONF: Enable ARP debug
1331  * @CDP_CONFIG_CAPTURE_LATENCY: Capture time latency
1332  * @CDP_INGRESS_STATS: Accumulate ingress statistics
1333  * @CDP_OSIF_DROP: Accumulate drops in OSIF layer
1334  * @CDP_CONFIG_ENH_RX_CAPTURE: Enable enhanced RX capture
1335  * @CDP_CONFIG_ENH_TX_CAPTURE: Enable enhanced TX capture
1336  * @CDP_CONFIG_HMMC_TID_OVERRIDE: Enable hmmc tid override
1337  * @CDP_CONFIG_HMMC_TID_VALUE: set hmmc tid value
1338  * @CDP_CONFIG_TX_CAPTURE: set tx capture
1339  * @CDP_CHAN_NOISE_FLOOR: set channel noise floor
1340  * @CDP_CONFIG_VOW: set/get vow config
1341  * @CDP_TIDQ_OVERRIDE: set/get tid queue override
1342  * @CDP_TIDMAP_PRTY: set/get tid map prty
1343  * @CDP_TX_PENDING: get tx pending
1344  * @CDP_FILTER_NEIGH_PEERS: filter neighbour peers
1345  * @CDP_FILTER_UCAST_DATA: filter unicast data
1346  * @CDP_FILTER_MCAST_DATA: filter multicast data
1347  * @CDP_FILTER_NO_DATA: filter no data
1348  * @CDP_MONITOR_CHANNEL: monitor channel
1349  * @CDP_MONITOR_FREQUENCY: monitor frequency
1350  * @CDP_CONFIG_BSS_COLOR: configure bss color
1351  * @CDP_SET_ATF_STATS_ENABLE: set ATF stats flag
1352  * @CDP_CONFIG_SPECIAL_VAP: Configure Special vap
1353  * @CDP_RESET_SCAN_SPCL_VAP_STATS_ENABLE: Enable scan spcl vap stats reset
1354  * @CDP_CONFIG_ENHANCED_STATS_ENABLE:
1355  * @CDP_ISOLATION: set isolation flag
1356  * @CDP_CONFIG_UNDECODED_METADATA_CAPTURE_ENABLE: Undecoded metadata capture
1357  * @CDP_CONFIG_RXDMA_BUF_RING_SIZE: RXDMA buffer ring size configure
1358  * @CDP_CONFIG_DELAY_STATS: set/get delay stats
1359  */
1360 enum cdp_pdev_param_type {
1361 	CDP_CONFIG_DEBUG_SNIFFER,
1362 	CDP_CONFIG_BPR_ENABLE,
1363 	CDP_CONFIG_PRIMARY_RADIO,
1364 	CDP_CONFIG_ENABLE_PERPKT_TXSTATS,
1365 	CDP_CONFIG_IGMPMLD_OVERRIDE,
1366 	CDP_CONFIG_IGMPMLD_TID,
1367 	CDP_CONFIG_ARP_DBG_CONF,
1368 	CDP_CONFIG_CAPTURE_LATENCY,
1369 	CDP_INGRESS_STATS,
1370 	CDP_OSIF_DROP,
1371 	CDP_CONFIG_ENH_RX_CAPTURE,
1372 	CDP_CONFIG_ENH_TX_CAPTURE,
1373 	CDP_CONFIG_HMMC_TID_OVERRIDE,
1374 	CDP_CONFIG_HMMC_TID_VALUE,
1375 	CDP_CONFIG_TX_CAPTURE,
1376 	CDP_CHAN_NOISE_FLOOR,
1377 	CDP_CONFIG_VOW,
1378 	CDP_TIDQ_OVERRIDE,
1379 	CDP_TIDMAP_PRTY,
1380 	CDP_TX_PENDING,
1381 	CDP_FILTER_NEIGH_PEERS,
1382 	CDP_FILTER_UCAST_DATA,
1383 	CDP_FILTER_MCAST_DATA,
1384 	CDP_FILTER_NO_DATA,
1385 	CDP_MONITOR_CHANNEL,
1386 	CDP_MONITOR_FREQUENCY,
1387 	CDP_CONFIG_BSS_COLOR,
1388 	CDP_SET_ATF_STATS_ENABLE,
1389 	CDP_CONFIG_SPECIAL_VAP,
1390 	CDP_RESET_SCAN_SPCL_VAP_STATS_ENABLE,
1391 	CDP_CONFIG_ENHANCED_STATS_ENABLE,
1392 	CDP_ISOLATION,
1393 	CDP_CONFIG_UNDECODED_METADATA_CAPTURE_ENABLE,
1394 	CDP_CONFIG_RXDMA_BUF_RING_SIZE,
1395 	CDP_CONFIG_DELAY_STATS,
1396 };
1397 
1398 /**
1399  * typedef cdp_config_param_type - union of different types of parameters
1400  *			to set values into dp handles.
1401  *
1402  * @cdp_peer_param_nawds: Enable nawds mode
1403  * @cdp_peer_param_isolation: Enable isolation
1404  * @cdp_peer_param_in_twt: in TWT session or not
1405  * @cdp_peer_param_nac: Enable nac
1406  * @cdp_peer_param_freq: Peer frequency
1407  *
1408  * @cdp_vdev_param_nawds: set nawds enable/disable
1409  * @cdp_vdev_param_mcast_en: enable/disable multicast enhancement
1410  * @cdp_vdev_param_wds: wds sta
1411  * @cdp_vdev_param_mec: MEC enable flags
1412  * @cdp_vdev_param_proxysta: proxy sta
1413  * @cdp_vdev_param_tdls_flags: tdls link flags
1414  * @cdp_vdev_param_ap_brdg_en: set ap_bridging enable/disable
1415  * @cdp_vdev_param_cipher_en: set cipher type based on security
1416  * @cdp_vdev_param_qwrap_isolation: qwrap isolation mode
1417  * @cdp_vdev_param_tx_encap: tx encap type
1418  * @cdp_vdev_param_rx_decap: rx decap type
1419  * @cdp_vdev_param_mesh_rx_filter: set mesh rx filter
1420  * @cdp_vdev_param_tidmap_prty: set tid vdev prty
1421  * @cdp_vdev_param_tidmap_tbl_id: set tidmap table id
1422  * @cdp_vdev_param_mesh_mode: set mesh mode
1423  * @cdp_vdev_param_safe_mode: set safe mode
1424  * @cdp_vdev_param_drop_unenc: set drop unencrypted flag
1425  * @cdp_vdev_param_hlos_tid_override: set hlos tid override
1426  * @cdp_vdev_param_peer_authorize: set peer authorize
1427  * @cdp_vdev_param_peer_tid_latency_enable: set peer tid latency enable flag
1428  * @cdp_vdev_param_mesh_tid: config tatency tid on vdev
1429  * @cdp_vdev_param_dscp_tid_map_id: set dscp to tid map id
1430  * @cdp_vdev_param_mcast_vdev: set mcast vdev params
1431  * @cdp_vdev_param_wrap: qwrap ap vap
1432  *
1433  * @cdp_pdev_param_dbg_snf: Enable debug sniffer feature
1434  * @cdp_pdev_param_bpr_enable: Enable bcast probe feature
1435  * @cdp_pdev_param_primary_radio: Configure radio as primary
1436  * @cdp_pdev_param_en_perpkt_txstats: Enable per packet statistics
1437  * @cdp_pdev_param_igmpmld_override: Override IGMP/MLD
1438  * @cdp_pdev_param_igmpmld_tid: TID value when igmmld_override is set
1439  * @cdp_pdev_param_arp_dbg_conf: Enable ARP debug
1440  * @cdp_pdev_param_cptr_latcy: Capture time latency
1441  * @cdp_pdev_param_ingrs_stats: Accumulate ingress statistics
1442  * @cdp_pdev_param_osif_drop: Accumulate drops in OSIF layer
1443  * @cdp_pdev_param_en_rx_cap: Enable enhanced RX capture
1444  * @cdp_pdev_param_en_tx_cap: Enable enhanced TX capture
1445  * @cdp_pdev_param_hmmc_tid_ovrd: Enable hmmc tid override
1446  * @cdp_pdev_param_hmmc_tid: set hmmc tid value
1447  * @cdp_pdev_param_tx_capture: set tx capture
1448  * @cdp_pdev_param_chn_noise_flr: set channel noise floor
1449  * @cdp_pdev_param_cfg_vow: set/get vow config
1450  * @cdp_pdev_param_cfg_delay_stats: set/get delayed stats
1451  * @cdp_pdev_param_tidq_override: set/get tid queue override
1452  * @cdp_pdev_param_mon_freq: set monitor frequency
1453  * @cdp_pdev_param_bss_color: configure bss color
1454  * @cdp_pdev_param_tidmap_prty: set/get tid map prty
1455  * @cdp_pdev_param_tx_pending: get tx pending
1456  * @cdp_pdev_param_fltr_neigh_peers: filter neighbour peers
1457  * @cdp_pdev_param_fltr_ucast: filter unicast data
1458  * @cdp_pdev_param_fltr_mcast: filter multicast data
1459  * @cdp_pdev_param_fltr_none: filter no data
1460  * @cdp_pdev_param_monitor_chan: monitor channel
1461  * @cdp_pdev_param_atf_stats_enable: ATF stats enable
1462  * @cdp_pdev_param_config_special_vap: Configure Special vap
1463  * @cdp_pdev_param_isolation : set isolation mode
1464  *
1465  * @cdp_psoc_param_en_rate_stats: set rate stats enable/disable
1466  * @cdp_psoc_param_en_nss_cfg: set nss cfg
1467  * @cdp_ipa_enabled : set ipa mode
1468  * @cdp_psoc_param_vdev_stats_hw_offload: Configure HW vdev stats offload
1469  * @cdp_pdev_param_undecoded_metadata_enable: Undecoded metadata capture enable
1470  * @cdp_sawf_enabled: SAWF enable/disable
1471  * @cdp_sawf_stats: SAWF stats config
1472  * @cdp_vdev_param_traffic_end_ind: Traffic end indication enable/disable
1473  * @cdp_skel_enable : Enable/Disable skeleton code for Umac reset debug
1474  * @cdp_drop_tx_mcast: Enable/Disable tx mcast drop
1475  * @cdp_vdev_tx_to_fw: Set to_fw bit for all tx packets for the vdev
1476  * @cdp_peer_metadata_ver: DP rx peer metadata version configuration
1477  * @hal_soc_hdl: DP HAL soc handle
1478  * @cdp_tx_desc_num: DP TX desc number config
1479  * @cdp_tx_ext_desc_num: number of TX EXT desc config
1480  * @cdp_tx_ring_size: TX ring size config
1481  * @cdp_tx_comp_ring_size: TX completion ring size config
1482  * @cdp_rx_sw_desc_num: RX SW descriptor number config
1483  * @cdp_reo_dst_ring_size: REO destination ring size config
1484  * @cdp_rxdma_refill_ring_size: RXDMA refill ring size config
1485  * @cdp_rx_refill_buf_pool_size: RX refill ring size config
1486  * @cdp_rxdma_buf_ring_size: RXDMA buf ring size config
1487  * @mac_addr: vdev mac address
1488  * @new_vdev_id: New vdev id to which MLD peer is to be moved
1489  * @fisa_params.fisa_fst_size: FISA table size
1490  * @fisa_params.rx_flow_max_search: max FST entries
1491  * @fisa_params.rx_toeplitz_hash_key: RX hash key
1492  * @rx_pkt_tlv_size: RX packet TLV size
1493  * @cdp_ast_indication_disable: AST indication disable
1494  * @cdp_psoc_param_mlo_oper_mode: mlo operation mode
1495  * @cdp_monitor_flag: monitor interface flags
1496  */
1497 typedef union cdp_config_param_t {
1498 	/* peer params */
1499 	bool cdp_peer_param_nawds;
1500 	bool cdp_peer_param_isolation;
1501 	uint8_t cdp_peer_param_nac;
1502 	bool cdp_peer_param_in_twt;
1503 	uint32_t cdp_peer_param_freq;
1504 
1505 	/* vdev params */
1506 	bool cdp_vdev_param_wds;
1507 	bool cdp_vdev_param_mec;
1508 	bool cdp_vdev_param_nawds;
1509 	bool cdp_vdev_param_proxysta;
1510 	bool cdp_vdev_param_tdls_flags;
1511 	bool cdp_vdev_param_ap_brdg_en;
1512 	bool cdp_vdev_param_qwrap_isolation;
1513 	bool cdp_vdev_param_update_multipass;
1514 	uint8_t cdp_vdev_param_da_war;
1515 	uint8_t cdp_vdev_param_mcast_en;
1516 	uint8_t cdp_vdev_param_igmp_mcast_en;
1517 	uint8_t cdp_vdev_param_tidmap_prty;
1518 	uint8_t cdp_vdev_param_tidmap_tbl_id;
1519 	uint32_t cdp_vdev_param_aging_tmr;
1520 	uint32_t cdp_vdev_param_cipher_en;
1521 	uint32_t cdp_vdev_param_tx_encap;
1522 	uint32_t cdp_vdev_param_rx_decap;
1523 	uint32_t cdp_vdev_param_mesh_rx_filter;
1524 	uint32_t cdp_vdev_param_mesh_mode;
1525 	uint32_t cdp_vdev_param_safe_mode;
1526 	uint32_t cdp_vdev_param_drop_unenc;
1527 	uint8_t cdp_vdev_param_hlos_tid_override;
1528 	bool cdp_vdev_param_wds_ext;
1529 	uint8_t cdp_vdev_param_peer_authorize;
1530 	uint8_t cdp_vdev_param_peer_tid_latency_enable;
1531 	uint8_t cdp_vdev_param_mesh_tid;
1532 	uint8_t cdp_vdev_param_dscp_tid_map_id;
1533 	bool cdp_vdev_param_mcast_vdev;
1534 	bool cdp_vdev_param_wrap;
1535 
1536 	/* pdev params */
1537 	bool cdp_pdev_param_cptr_latcy;
1538 	bool cdp_pdev_param_hmmc_tid_ovrd;
1539 	bool cdp_pdev_param_fltr_neigh_peers;
1540 	bool cdp_pdev_param_cfg_vow;
1541 	bool cdp_pdev_param_cfg_delay_stats;
1542 	bool cdp_pdev_param_fltr_mcast;
1543 	bool cdp_pdev_param_fltr_none;
1544 	bool cdp_pdev_param_fltr_ucast;
1545 	uint8_t cdp_pdev_param_primary_radio;
1546 	uint8_t cdp_pdev_param_en_rx_cap;
1547 	uint8_t cdp_pdev_param_en_tx_cap;
1548 	uint8_t cdp_pdev_param_tx_capture;
1549 	uint8_t cdp_pdev_param_hmmc_tid;
1550 	uint8_t cdp_pdev_param_tidmap_prty;
1551 	uint8_t cdp_pdev_param_igmpmld_override;
1552 	uint8_t cdp_pdev_param_igmpmld_tid;
1553 	uint8_t cdp_pdev_param_arp_dbg_conf;
1554 	uint8_t cdp_pdev_param_tidq_override;
1555 	uint8_t cdp_pdev_param_bss_color;
1556 	uint16_t cdp_pdev_param_chn_noise_flr;
1557 	qdf_freq_t cdp_pdev_param_mon_freq;
1558 	int cdp_pdev_param_dbg_snf;
1559 	int cdp_pdev_param_bpr_enable;
1560 	int cdp_pdev_param_monitor_chan;
1561 	uint32_t cdp_pdev_param_ingrs_stats;
1562 	uint32_t cdp_pdev_param_osif_drop;
1563 	uint32_t cdp_pdev_param_en_perpkt_txstats;
1564 	uint32_t cdp_pdev_param_tx_pending;
1565 	bool cdp_pdev_param_atf_stats_enable;
1566 	bool cdp_pdev_param_config_special_vap;
1567 	bool cdp_pdev_param_reset_scan_spcl_vap_stats_enable;
1568 	bool cdp_pdev_param_enhanced_stats_enable;
1569 	bool cdp_pdev_param_isolation;
1570 
1571 	/* psoc params */
1572 	bool cdp_psoc_param_en_rate_stats;
1573 	int cdp_psoc_param_en_nss_cfg;
1574 	int cdp_psoc_param_preferred_hw_mode;
1575 	bool cdp_psoc_param_pext_stats;
1576 	bool cdp_psoc_param_jitter_stats;
1577 	bool cdp_psoc_param_dp_debug_log;
1578 
1579 	bool cdp_skip_bar_update;
1580 	bool cdp_ipa_enabled;
1581 	bool cdp_psoc_param_vdev_stats_hw_offload;
1582 	bool cdp_pdev_param_undecoded_metadata_enable;
1583 	bool cdp_sawf_enabled;
1584 	uint8_t cdp_sawf_stats;
1585 	bool cdp_drop_3addr_mcast;
1586 	bool cdp_vdev_param_traffic_end_ind;
1587 	bool cdp_umac_rst_skel;
1588 	bool cdp_drop_tx_mcast;
1589 	bool cdp_vdev_tx_to_fw;
1590 	uint8_t cdp_peer_metadata_ver;
1591 	void *hal_soc_hdl;
1592 
1593 	int cdp_tx_desc_num;
1594 	int cdp_tx_ext_desc_num;
1595 	int cdp_tx_ring_size;
1596 	int cdp_tx_comp_ring_size;
1597 	int cdp_rx_sw_desc_num;
1598 	int cdp_reo_dst_ring_size;
1599 	int cdp_rxdma_refill_ring_size;
1600 	int cdp_rx_refill_buf_pool_size;
1601 	int cdp_rxdma_buf_ring_size;
1602 
1603 	uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
1604 	uint8_t new_vdev_id;
1605 	struct {
1606 		uint32_t fisa_fst_size;
1607 		uint16_t rx_flow_max_search;
1608 		uint8_t *rx_toeplitz_hash_key;
1609 	} fisa_params;
1610 	uint16_t rx_pkt_tlv_size;
1611 	bool cdp_ast_indication_disable;
1612 	uint8_t cdp_psoc_param_mlo_oper_mode;
1613 	uint8_t cdp_monitor_flag;
1614 } cdp_config_param_type;
1615 
1616 /**
1617  * enum cdp_rx_enh_capture_mode - Rx enhanced capture modes
1618  * @CDP_RX_ENH_CAPTURE_DISABLED: Disable Rx enhance capture
1619  * @CDP_RX_ENH_CAPTURE_MPDU: Enable capture of 128 bytes of each MPDU
1620  * @CDP_RX_ENH_CAPTURE_MPDU_MSDU: Enable capture of 128 bytes of each MSDU
1621  */
1622 enum cdp_rx_enh_capture_mode {
1623 	CDP_RX_ENH_CAPTURE_DISABLED = 0,
1624 	CDP_RX_ENH_CAPTURE_MPDU,
1625 	CDP_RX_ENH_CAPTURE_MPDU_MSDU,
1626 };
1627 
1628 /**
1629  * enum cdp_rx_enh_capture_peer - Rx enhanced capture peer filtering
1630  * @CDP_RX_ENH_CAPTURE_PEER_DISABLED: Disable Rx ENH capture peer filtering
1631  * @CDP_RX_ENH_CAPTURE_PEER_ENABLED: Enable Rx ENH capture peer filtering
1632  */
1633 enum cdp_rx_enh_capture_peer {
1634 	CDP_RX_ENH_CAPTURE_PEER_DISABLED = 0,
1635 	CDP_RX_ENH_CAPTURE_PEER_ENABLED,
1636 };
1637 
1638 /**
1639  * enum cdp_tx_enh_capture_mode - Tx enhanced capture modes
1640  * @CDP_TX_ENH_CAPTURE_DISABLED: Disable Tx enhance capture for all peers
1641  * @CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS: Enable tx capture for all peers
1642  * @CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER: Enable/disable per peer as necessary
1643  * @CDP_TX_ENH_CAPTURE_MAX: Max value
1644  */
1645 enum cdp_tx_enh_capture_mode {
1646 	CDP_TX_ENH_CAPTURE_DISABLED = 0,
1647 	CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS,
1648 	CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER,
1649 	CDP_TX_ENH_CAPTURE_MAX,
1650 };
1651 
1652 /**
1653  * enum cdp_pdev_bpr_param - different types of parameters
1654  *			     to set value in pdev
1655  * @CDP_BPR_DISABLE: Set bpr to disable state
1656  * @CDP_BPR_ENABLE: set bpr to enable state
1657  *
1658  * Enum indicating bpr state to enable/disable.
1659  */
1660 enum cdp_pdev_bpr_param {
1661 	CDP_BPR_DISABLE,
1662 	CDP_BPR_ENABLE,
1663 };
1664 
1665 /**
1666  * enum cdp_vdev_param_type - different types of parameters
1667  *			      to set values in vdev
1668  * @CDP_ENABLE_NAWDS: set nawds enable/disable
1669  * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement
1670  * @CDP_ENABLE_WDS: wds sta
1671  * @CDP_ENABLE_MEC: MEC enable flags
1672  * @CDP_ENABLE_DA_WAR:
1673  * @CDP_ENABLE_PROXYSTA: proxy sta
1674  * @CDP_UPDATE_TDLS_FLAGS: tdls link flags
1675  * @CDP_CFG_WDS_AGING_TIMER: modify/stop wds aging timer
1676  * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable
1677  * @CDP_ENABLE_CIPHER: set cipher type based on security
1678  * @CDP_ENABLE_QWRAP_ISOLATION: qwrap isolation mode
1679  * @CDP_UPDATE_MULTIPASS: enable/disable multipass
1680  * @CDP_TX_ENCAP_TYPE: tx encap type
1681  * @CDP_RX_DECAP_TYPE: rx decap type
1682  * @CDP_MESH_RX_FILTER: set mesh rx filter
1683  * @CDP_TID_VDEV_PRTY: set tid vdev prty
1684  * @CDP_TIDMAP_TBL_ID: set tidmap table id
1685  * @CDP_MESH_MODE: set mesh mode
1686  * @CDP_SAFEMODE: set safe mode
1687  * @CDP_DROP_UNENC: set drop unencrypted flag
1688  * @CDP_ENABLE_IGMP_MCAST_EN: enable/disable igmp multicast enhancement
1689  * @CDP_ENABLE_HLOS_TID_OVERRIDE: set hlos tid override flag
1690  * @CDP_CFG_WDS_EXT: enable/disable wds ext feature
1691  * @CDP_DROP_TX_MCAST: enable/disable tx mcast drop
1692  * @CDP_ENABLE_PEER_AUTHORIZE: enable peer authorize flag
1693  * @CDP_ENABLE_PEER_TID_LATENCY: set peer tid latency enable flag
1694  * @CDP_SET_VAP_MESH_TID: Set latency tid in vap
1695  * @CDP_SKIP_BAR_UPDATE_AP: enable/disable bar
1696  * @CDP_UPDATE_DSCP_TO_TID_MAP: Set DSCP to TID map id
1697  * @CDP_SET_MCAST_VDEV: Set primary mcast vdev
1698  * @CDP_RESET_MLO_MCAST_VDEV: Reset mlo mcast vdev settings
1699  * @CDP_SET_MCAST_VDEV_HW_UPDATE: Not in use
1700  * @CDP_DROP_3ADDR_MCAST: enable/disable drop 3addr multicast flag
1701  * @CDP_ENABLE_WRAP: qwrap ap
1702  * @CDP_ENABLE_TRAFFIC_END_INDICATION: enable/disable traffic end indication
1703  * @CDP_VDEV_TX_TO_FW: Set to_fw bit for tx packets for the vdev
1704  * @CDP_VDEV_SET_MAC_ADDR: Set mac address for vdev
1705  */
1706 enum cdp_vdev_param_type {
1707 	CDP_ENABLE_NAWDS,
1708 	CDP_ENABLE_MCAST_EN,
1709 	CDP_ENABLE_WDS,
1710 	CDP_ENABLE_MEC,
1711 	CDP_ENABLE_DA_WAR,
1712 	CDP_ENABLE_PROXYSTA,
1713 	CDP_UPDATE_TDLS_FLAGS,
1714 	CDP_CFG_WDS_AGING_TIMER,
1715 	CDP_ENABLE_AP_BRIDGE,
1716 	CDP_ENABLE_CIPHER,
1717 	CDP_ENABLE_QWRAP_ISOLATION,
1718 	CDP_UPDATE_MULTIPASS,
1719 	CDP_TX_ENCAP_TYPE,
1720 	CDP_RX_DECAP_TYPE,
1721 	CDP_MESH_RX_FILTER,
1722 	CDP_TID_VDEV_PRTY,
1723 	CDP_TIDMAP_TBL_ID,
1724 #ifdef MESH_MODE_SUPPORT
1725 	CDP_MESH_MODE,
1726 #endif
1727 	CDP_SAFEMODE,
1728 	CDP_DROP_UNENC,
1729 	CDP_ENABLE_IGMP_MCAST_EN,
1730 	CDP_ENABLE_HLOS_TID_OVERRIDE,
1731 #ifdef QCA_SUPPORT_WDS_EXTENDED
1732 	CDP_CFG_WDS_EXT,
1733 	CDP_DROP_TX_MCAST,
1734 #endif /* QCA_SUPPORT_WDS_EXTENDED */
1735 	CDP_ENABLE_PEER_AUTHORIZE,
1736 #ifdef WLAN_SUPPORT_MESH_LATENCY
1737 	CDP_ENABLE_PEER_TID_LATENCY,
1738 	CDP_SET_VAP_MESH_TID,
1739 #endif
1740 #ifdef WLAN_VENDOR_SPECIFIC_BAR_UPDATE
1741 	CDP_SKIP_BAR_UPDATE_AP,
1742 #endif
1743 	CDP_UPDATE_DSCP_TO_TID_MAP,
1744 	CDP_SET_MCAST_VDEV,
1745 	CDP_RESET_MLO_MCAST_VDEV,
1746 	CDP_SET_MCAST_VDEV_HW_UPDATE,
1747 	CDP_DROP_3ADDR_MCAST,
1748 	CDP_ENABLE_WRAP,
1749 #ifdef DP_TRAFFIC_END_INDICATION
1750 	CDP_ENABLE_TRAFFIC_END_INDICATION,
1751 #endif
1752 #ifdef FEATURE_DIRECT_LINK
1753 	CDP_VDEV_TX_TO_FW,
1754 #endif
1755 	CDP_VDEV_SET_MAC_ADDR,
1756 };
1757 
1758 /**
1759  * enum cdp_psoc_param_type - different types of parameters
1760  *			      to set values in psoc
1761  * @CDP_ENABLE_RATE_STATS: set rate stats enable/disable
1762  * @CDP_SET_NSS_CFG: set nss cfg
1763  * @CDP_SET_PREFERRED_HW_MODE: set preferred hw mode
1764  * @CDP_CFG_PEER_EXT_STATS: Peer extended stats mode.
1765  * @CDP_IPA_ENABLE : set IPA enable mode.
1766  * @CDP_CFG_VDEV_STATS_HW_OFFLOAD: HW Vdev stats config
1767  * @CDP_SAWF_ENABLE:
1768  * @CDP_UMAC_RST_SKEL_ENABLE: Enable Umac reset skeleton code for debug
1769  * @CDP_SAWF_STATS: set SAWF stats config
1770  * @CDP_UMAC_RESET_STATS: UMAC reset stats
1771  * @CDP_CFG_RX_PEER_METADATA_VER: RX peer metadata configuration
1772  * @CDP_TXRX_HAL_SOC_HDL: HAL soc handle
1773  * @CDP_CFG_TX_DESC_NUM: number of TX descriptors config
1774  * @CDP_CFG_TX_EXT_DESC_NUM: number of TX EXT descriptors config
1775  * @CDP_CFG_TX_RING_SIZE: TX ring size config param
1776  * @CDP_CFG_TX_COMPL_RING_SIZE: TX completion ring size param
1777  * @CDP_CFG_RX_SW_DESC_NUM: RX SW descriptor number
1778  * @CDP_CFG_REO_DST_RING_SIZE: REO destination ring size config
1779  * @CDP_CFG_RXDMA_REFILL_RING_SIZE: RXDMA refill ring size config
1780  * @CDP_CFG_RX_REFILL_POOL_NUM: RX refill pool size config param
1781  * @CDP_CFG_FISA_PARAMS: FISA params
1782  * @CDP_RX_PKT_TLV_SIZE: RX pkt tlv size
1783  * @CDP_CFG_AST_INDICATION_DISABLE: AST indication disable
1784  * @CDP_CFG_GET_MLO_OPER_MODE: Get MLO operation mode
1785  * @CDP_CFG_PEER_JITTER_STATS: Peer Jitter Stats
1786  * @CDP_CONFIG_DP_DEBUG_LOG: set/get dp debug logging
1787  * @CDP_MONITOR_FLAG: Monitor interface configuration
1788  */
1789 enum cdp_psoc_param_type {
1790 	CDP_ENABLE_RATE_STATS,
1791 	CDP_SET_NSS_CFG,
1792 	CDP_SET_PREFERRED_HW_MODE,
1793 	CDP_CFG_PEER_EXT_STATS,
1794 	CDP_IPA_ENABLE,
1795 	CDP_CFG_VDEV_STATS_HW_OFFLOAD,
1796 	CDP_SAWF_ENABLE,
1797 	CDP_UMAC_RST_SKEL_ENABLE,
1798 	CDP_SAWF_STATS,
1799 	CDP_UMAC_RESET_STATS,
1800 	CDP_CFG_RX_PEER_METADATA_VER,
1801 	CDP_TXRX_HAL_SOC_HDL,
1802 	CDP_CFG_TX_DESC_NUM,
1803 	CDP_CFG_TX_EXT_DESC_NUM,
1804 	CDP_CFG_TX_RING_SIZE,
1805 	CDP_CFG_TX_COMPL_RING_SIZE,
1806 	CDP_CFG_RX_SW_DESC_NUM,
1807 	CDP_CFG_REO_DST_RING_SIZE,
1808 	CDP_CFG_RXDMA_REFILL_RING_SIZE,
1809 #ifdef WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL
1810 	CDP_CFG_RX_REFILL_POOL_NUM,
1811 #endif
1812 	CDP_CFG_FISA_PARAMS,
1813 	CDP_RX_PKT_TLV_SIZE,
1814 	CDP_CFG_AST_INDICATION_DISABLE,
1815 	CDP_CFG_GET_MLO_OPER_MODE,
1816 	CDP_CFG_PEER_JITTER_STATS,
1817 	CDP_CONFIG_DP_DEBUG_LOG,
1818 	CDP_MONITOR_FLAG,
1819 };
1820 
1821 #ifdef CONFIG_AP_PLATFORM
1822 /* RX peer metadata version if v1a_v1b is supported */
1823 #define CDP_RX_PEER_METADATA_V1_A_B 3
1824 #else
1825 #define CDP_RX_PEER_METADATA_V1_A_B 2
1826 #endif
1827 
1828 #define TXRX_FW_STATS_TXSTATS                     1
1829 #define TXRX_FW_STATS_RXSTATS                     2
1830 #define TXRX_FW_STATS_RX_RATE_INFO                3
1831 #define TXRX_FW_STATS_PHYSTATS                    4
1832 #define TXRX_FW_STATS_PHYSTATS_CONCISE            5
1833 #define TXRX_FW_STATS_TX_RATE_INFO                6
1834 #define TXRX_FW_STATS_TID_STATE                   7
1835 #define TXRX_FW_STATS_HOST_STATS                  8
1836 #define TXRX_FW_STATS_CLEAR_HOST_STATS            9
1837 #define TXRX_FW_STATS_CE_STATS                   10
1838 #define TXRX_FW_STATS_VOW_UMAC_COUNTER           11
1839 #define TXRX_FW_STATS_ME_STATS                   12
1840 #define TXRX_FW_STATS_TXBF_INFO                  13
1841 #define TXRX_FW_STATS_SND_INFO                   14
1842 #define TXRX_FW_STATS_ERROR_INFO                 15
1843 #define TXRX_FW_STATS_TX_SELFGEN_INFO            16
1844 #define TXRX_FW_STATS_TX_MU_INFO                 17
1845 #define TXRX_FW_SIFS_RESP_INFO                   18
1846 #define TXRX_FW_RESET_STATS                      19
1847 #define TXRX_FW_MAC_WDOG_STATS                   20
1848 #define TXRX_FW_MAC_DESC_STATS                   21
1849 #define TXRX_FW_MAC_FETCH_MGR_STATS              22
1850 #define TXRX_FW_MAC_PREFETCH_MGR_STATS           23
1851 #define TXRX_FW_STATS_DURATION_INFO              24
1852 #define TXRX_FW_STATS_DURATION_INFO_RESET        25
1853 #define TXRX_FW_HALPHY_STATS                     26
1854 #define TXRX_FW_COEX_STATS                       27
1855 
1856 #define PER_RADIO_FW_STATS_REQUEST 0
1857 #define PER_VDEV_FW_STATS_REQUEST 1
1858 /**
1859  * enum data_stall_log_event_indicator - Module triggering data stall
1860  * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused
1861  * @DATA_STALL_LOG_INDICATOR_HOST_DRIVER: Host driver indicates data stall
1862  * @DATA_STALL_LOG_INDICATOR_FIRMWARE: FW indicates data stall
1863  * @DATA_STALL_LOG_INDICATOR_FRAMEWORK: Framework indicates data stall
1864  *
1865  * Enum indicating the module that indicates data stall event
1866  */
1867 enum data_stall_log_event_indicator {
1868 	DATA_STALL_LOG_INDICATOR_UNUSED,
1869 	DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
1870 	DATA_STALL_LOG_INDICATOR_FIRMWARE,
1871 	DATA_STALL_LOG_INDICATOR_FRAMEWORK,
1872 };
1873 
1874 /**
1875  * enum data_stall_log_event_type - data stall event type
1876  * @DATA_STALL_LOG_NONE:
1877  * @DATA_STALL_LOG_FW_VDEV_PAUSE:
1878  * @DATA_STALL_LOG_HWSCHED_CMD_FILTER:
1879  * @DATA_STALL_LOG_HWSCHED_CMD_FLUSH:
1880  * @DATA_STALL_LOG_FW_RX_REFILL_FAILED:
1881  * @DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR:
1882  * @DATA_STALL_LOG_FW_WDOG_ERRORS:
1883  * @DATA_STALL_LOG_BB_WDOG_ERROR:
1884  * @DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR:
1885  * @DATA_STALL_LOG_HOST_STA_TX_TIMEOUT:
1886  * @DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT:
1887  * @DATA_STALL_LOG_NUD_FAILURE:
1888  *
1889  * Enum indicating data stall event type
1890  */
1891 enum data_stall_log_event_type {
1892 	DATA_STALL_LOG_NONE,
1893 	DATA_STALL_LOG_FW_VDEV_PAUSE,
1894 	DATA_STALL_LOG_HWSCHED_CMD_FILTER,
1895 	DATA_STALL_LOG_HWSCHED_CMD_FLUSH,
1896 	DATA_STALL_LOG_FW_RX_REFILL_FAILED,
1897 	DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR,
1898 	DATA_STALL_LOG_FW_WDOG_ERRORS,
1899 	DATA_STALL_LOG_BB_WDOG_ERROR,
1900 	DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR,
1901 	/* Stall events triggered by host/framework start from 0x100 onwards. */
1902 	DATA_STALL_LOG_HOST_STA_TX_TIMEOUT = 0x100,
1903 	DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,
1904 	DATA_STALL_LOG_NUD_FAILURE,
1905 };
1906 
1907 /**
1908  * enum data_stall_log_recovery_type - data stall recovery type
1909  * @DATA_STALL_LOG_RECOVERY_NONE:
1910  * @DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT:
1911  * @DATA_STALL_LOG_RECOVERY_TRIGGER_PDR:
1912  *
1913  * Enum indicating data stall recovery type
1914  */
1915 enum data_stall_log_recovery_type {
1916 	DATA_STALL_LOG_RECOVERY_NONE = 0,
1917 	DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
1918 	DATA_STALL_LOG_RECOVERY_TRIGGER_PDR,
1919 };
1920 
1921 /**
1922  * struct data_stall_event_info - data stall info
1923  * @indicator: Module triggering data stall
1924  * @data_stall_type: data stall event type
1925  * @vdev_id_bitmap: vdev_id_bitmap
1926  * @pdev_id: pdev id
1927  * @recovery_type: data stall recovery type
1928  */
1929 struct data_stall_event_info {
1930 	uint32_t indicator;
1931 	uint32_t data_stall_type;
1932 	uint32_t vdev_id_bitmap;
1933 	uint32_t pdev_id;
1934 	uint32_t recovery_type;
1935 };
1936 
1937 typedef void (*data_stall_detect_cb)(struct data_stall_event_info *);
1938 
1939 /**
1940  * enum cdp_stats - options for host and firmware statistics
1941  * @CDP_TXRX_STATS_0:
1942  * @CDP_TXRX_STATS_1: HTT Pdev tx stats
1943  * @CDP_TXRX_STATS_2: HTT Pdev rx stats
1944  * @CDP_TXRX_STATS_3: HTT Pdev Tx HW Queue stats
1945  * @CDP_TXRX_STATS_4: HTT Pdev Tx HW Sched stats
1946  * @CDP_TXRX_STATS_5: HTT Pdev error stats
1947  * @CDP_TXRX_STATS_6: HTT TQM stats
1948  * @CDP_TXRX_STATS_7: HTT TQM CMDQ stats
1949  * @CDP_TXRX_STATS_8: HTT Tx_de_cmn thread stats
1950  * @CDP_TXRX_STATS_9: HTT Pdev Tx rate stats
1951  * @CDP_TXRX_STATS_10: HTT Pdev Rx rate stats
1952  * @CDP_TXRX_STATS_11: HTT Peer stats
1953  * @CDP_TXRX_STATS_12: HTT Tx Self Gen Info
1954  * @CDP_TXRX_STATS_13: HTT Tx MU HWQ stats
1955  * @CDP_TXRX_STATS_14: HTT Ring interface info stats
1956  * @CDP_TXRX_STATS_15: HTT SRNG info stats
1957  * @CDP_TXRX_STATS_16: HTT SFM info stats
1958  * @CDP_TXRX_STATS_17: HTT Pdev tx mu mimo sched info
1959  * @CDP_TXRX_STATS_18: HTT Peer list details
1960  * @CDP_TXRX_STATS_19: Reserved
1961  * @CDP_TXRX_STATS_20: Reset Host stats
1962  * @CDP_TXRX_STATS_21: Host Rx rate stats
1963  * @CDP_TXRX_STATS_22: Host Tx rate stats
1964  * @CDP_TXRX_STATS_23: Host Tx stats
1965  * @CDP_TXRX_STATS_24: Host Rx stats
1966  * @CDP_TXRX_STATS_25: Host Ast stats
1967  * @CDP_TXRX_STATS_26: Host Head/Tail Pointer stats
1968  * @CDP_TXRX_STATS_27: Host Monitor mode stats
1969  * @CDP_TXRX_STATS_28: Host Peer entry stats
1970  * @CDP_TXRX_STATS_29: Host Soc config params info
1971  * @CDP_TXRX_STATS_30: Host Pdev config params info
1972  * @CDP_TXRX_STATS_31: Host DP Interrupt Stats
1973  * @CDP_TXRX_STATS_HTT_MAX:
1974  * @CDP_TXRX_MAX_STATS:
1975  */
1976 enum cdp_stats {
1977 	CDP_TXRX_STATS_0  = 0,
1978 	CDP_TXRX_STATS_1,
1979 	CDP_TXRX_STATS_2,
1980 	CDP_TXRX_STATS_3,
1981 	CDP_TXRX_STATS_4,
1982 	CDP_TXRX_STATS_5,
1983 	CDP_TXRX_STATS_6,
1984 	CDP_TXRX_STATS_7,
1985 	CDP_TXRX_STATS_8,
1986 	CDP_TXRX_STATS_9,
1987 	CDP_TXRX_STATS_10,
1988 	CDP_TXRX_STATS_11,
1989 	CDP_TXRX_STATS_12,
1990 	CDP_TXRX_STATS_13,
1991 	CDP_TXRX_STATS_14,
1992 	CDP_TXRX_STATS_15,
1993 	CDP_TXRX_STATS_16,
1994 	CDP_TXRX_STATS_17,
1995 	CDP_TXRX_STATS_18,
1996 	CDP_TXRX_STATS_19,
1997 	CDP_TXRX_STATS_20,
1998 	CDP_TXRX_STATS_21,
1999 	CDP_TXRX_STATS_22,
2000 	CDP_TXRX_STATS_23,
2001 	CDP_TXRX_STATS_24,
2002 	CDP_TXRX_STATS_25,
2003 	CDP_TXRX_STATS_26,
2004 	CDP_TXRX_STATS_27,
2005 	CDP_TXRX_STATS_28,
2006 	CDP_TXRX_STATS_29,
2007 	CDP_TXRX_STATS_30,
2008 	CDP_TXRX_STATS_31,
2009 	CDP_TXRX_STATS_HTT_MAX = 256,
2010 	CDP_TXRX_MAX_STATS = 265,
2011 };
2012 
2013 /**
2014  * enum cdp_stat_update_type - Different Stat update types sent to
2015  *                             OL_IF
2016  * @UPDATE_PEER_STATS: update peer stats
2017  * @UPDATE_VDEV_STATS: update vdev stats
2018  * @UPDATE_PDEV_STATS: Update pdev stats
2019  * @UPDATE_VDEV_STATS_MLD: Update mld vdev stats
2020  */
2021 enum cdp_stat_update_type {
2022 	UPDATE_PEER_STATS = 0,
2023 	UPDATE_VDEV_STATS = 1,
2024 	UPDATE_PDEV_STATS = 2,
2025 	UPDATE_VDEV_STATS_MLD = 3,
2026 };
2027 
2028 /**
2029  * struct cdp_tx_sojourn_stats - Tx sojourn stats
2030  * @ppdu_seq_id: ppdu_seq_id from tx completion
2031  * @avg_sojourn_msdu: average sojourn msdu time
2032  * @sum_sojourn_msdu: sum sojourn msdu time
2033  * @num_msdus: number of msdus per ppdu
2034  * @cookie: cookie to be used by upper layer
2035  */
2036 struct cdp_tx_sojourn_stats {
2037 	uint32_t ppdu_seq_id;
2038 	qdf_ewma_tx_lag avg_sojourn_msdu[CDP_DATA_TID_MAX];
2039 	uint32_t sum_sojourn_msdu[CDP_DATA_TID_MAX];
2040 	uint32_t num_msdus[CDP_DATA_TID_MAX];
2041 	struct cdp_stats_cookie *cookie;
2042 };
2043 
2044 /**
2045  * struct cdp_delayed_tx_completion_ppdu_user - Delayed Tx PPDU completion
2046  *                                              per-user information
2047  * @frame_ctrl: frame control field in 802.11 header
2048  * @qos_ctrl: QoS control field in 802.11 header
2049  * @mpdu_tried_ucast: number of unicast mpdus tried
2050  * @mpdu_tried_mcast: number of multicastmpdus tried
2051  * @ltf_size: ltf_size
2052  * @stbc: stbc
2053  * @he_re: he_re (range extension)
2054  * @txbf: txbf
2055  * @bw: Transmission bandwidth
2056  *       <enum 2 transmit_bw_20_MHz>
2057  *       <enum 3 transmit_bw_40_MHz>
2058  *       <enum 4 transmit_bw_80_MHz>
2059  *       <enum 5 transmit_bw_160_MHz>
2060  * @nss: NSS 1,2, ...8
2061  * @mcs: MCS index
2062  * @preamble: preamble
2063  * @gi: guard interval 800/400/1600/3200 ns
2064  * @dcm: dcm
2065  * @ldpc: ldpc
2066  * @delayed_ba:
2067  * @ru_start: RU start index
2068  * @ru_tones: RU tones length
2069  * @is_mcast: MCAST or UCAST
2070  * @user_pos: user position
2071  * @mu_group_id: mu group id
2072  * @ppdu_start_timestamp: 64 bits ppdu start timestamp
2073  * @ppdu_end_timestamp: 64 bits ppdu end timestamp
2074  */
2075 struct cdp_delayed_tx_completion_ppdu_user {
2076 	uint32_t frame_ctrl:16,
2077 		 qos_ctrl:16;
2078 	uint32_t mpdu_tried_ucast:16,
2079 		mpdu_tried_mcast:16;
2080 	uint32_t ltf_size:2,
2081 		 stbc:1,
2082 		 he_re:1,
2083 		 txbf:4,
2084 		 bw:4,
2085 		 nss:4,
2086 		 mcs:4,
2087 		 preamble:4,
2088 		 gi:4,
2089 		 dcm:1,
2090 		 ldpc:1,
2091 		 delayed_ba:1;
2092 	uint16_t ru_start;
2093 	uint16_t ru_tones;
2094 	bool is_mcast;
2095 	uint32_t user_pos;
2096 	uint32_t mu_group_id;
2097 	uint64_t ppdu_start_timestamp;
2098 	uint64_t ppdu_end_timestamp;
2099 };
2100 
2101 /**
2102  * struct cdp_tx_completion_ppdu_user - Tx PPDU completion per-user information
2103  * @completion_status: completion status - OK/Filter/Abort/Timeout
2104  * @tid: TID number
2105  * @peer_id: Peer ID
2106  * @mac_addr:
2107  * @ba_size: Block-Ack size
2108  * @frame_ctrl: frame control field in 802.11 header
2109  * @qos_ctrl: QoS control field in 802.11 header
2110  * @mpdu_tried_ucast: number of unicast mpdus tried
2111  * @mpdu_tried_mcast: number of multicast mpdus tried
2112  * @mpdu_success: number of mpdus successfully transmitted
2113  * @mpdu_failed:
2114  * @long_retries: long retries
2115  * @short_retries: short retries
2116  * @tx_ratecode:
2117  * @is_ampdu: mpdu aggregate or non-aggregate?
2118  * @ppdu_type:
2119  * @pream_punct:
2120  * @is_seq_num_valid:
2121  * @success_bytes: bytes successfully transmitted
2122  * @retry_bytes: bytes retried
2123  * @failed_bytes:
2124  * @success_msdus: MSDUs successfully transmitted
2125  * @retry_msdus: MSDUs retried
2126  * @retry_mpdus: MPDUs retried
2127  * @failed_msdus: MSDUs failed transmission
2128  * @duration: user duration in ppdu
2129  * @ltf_size: ltf_size
2130  * @stbc: stbc
2131  * @he_re: he_re (range extension)
2132  * @txbf: txbf
2133  * @bw: Transmission bandwidth
2134  *       <enum 2 transmit_bw_20_MHz>
2135  *       <enum 3 transmit_bw_40_MHz>
2136  *       <enum 4 transmit_bw_80_MHz>
2137  *       <enum 5 transmit_bw_160_MHz>
2138  * @nss: NSS 1,2, ...8
2139  * @mcs: MCS index
2140  * @preamble: preamble
2141  * @gi: guard interval 800/400/1600/3200 ns
2142  * @dcm: dcm
2143  * @ldpc: ldpc
2144  * @delayed_ba: delayed ba bit
2145  * @ack_ba_tlv: ack ba recv tlv bit
2146  * @ba_seq_no: Block Ack sequence number
2147  * @ba_bitmap: Block Ack bitmap
2148  * @start_seq: Sequence number of first MPDU
2149  * @enq_bitmap: Enqueue MPDU bitmap
2150  * @failed_bitmap:
2151  * @num_mpdu:
2152  * @num_msdu:
2153  * @tx_duration:
2154  * @ru_start: RU start index
2155  * @ru_tones: RU tones length
2156  * @is_mcast: MCAST or UCAST
2157  * @tx_rate: Transmission Rate
2158  * @tx_ratekbps:
2159  * @ack_rssi: ack rssi for separate chains
2160  * @ack_rssi_valid:
2161  * @usr_ack_rssi:
2162  * @user_pos: user position
2163  * @mu_group_id: mu group id
2164  * @rix: rate index
2165  * @is_ppdu_cookie_valid : Indicates that ppdu_cookie is valid
2166  * @ppdu_cookie: 16-bit ppdu_cookie
2167  * @sa_is_training: smart antenna training packets indication
2168  * @rssi_chain: rssi chain per bandwidth
2169  * @sa_tx_antenna: antenna in which packet is transmitted
2170  * @sa_max_rates: smart antenna tx feedback info max rates
2171  * @sa_goodput: smart antenna tx feedback info goodput
2172  * @current_rate_per: Moving average per
2173  * @last_enq_seq: last equeue sequence number
2174  * @is_bss_peer: is bss peer check
2175  * @mpdu_q: queue of mpdu in a ppdu
2176  * @mpdus: MPDU list based on enqueue sequence bitmap
2177  * @pending_retries: pending MPDUs (retries)
2178  * @tlv_bitmap: per user tlv bitmap
2179  * @skip: tx capture skip flag
2180  * @mon_procd: to indicate user processed in ppdu of the sched cmd
2181  * @debug_copied: flag to indicate bar frame copied
2182  * @peer_last_delayed_ba: flag to indicate peer last delayed ba
2183  * @phy_tx_time_us: Phy TX duration for the User
2184  * @mpdu_bytes: accumulated bytes per mpdu for mem limit feature
2185  * @punc_mode: puncutured mode to indicate punctured bw
2186  * @punc_pattern_bitmap: bitmap indicating punctured pattern
2187  * @fixed_rate_used: flag to indicate fixed rate TX
2188  * @mprot_type: medium protection type
2189  * @msduq_bitmap: msduq bitmap
2190  * @rts_success: rts success
2191  * @rts_failure: rts failure
2192  */
2193 struct cdp_tx_completion_ppdu_user {
2194 	uint32_t completion_status:8,
2195 		 tid:8,
2196 		 peer_id:16;
2197 	uint8_t mac_addr[6];
2198 	uint16_t ba_size;
2199 	uint32_t frame_ctrl:16,
2200 		 qos_ctrl:16;
2201 	uint32_t mpdu_tried_ucast:16,
2202 		mpdu_tried_mcast:16;
2203 	uint16_t mpdu_success:16;
2204 	uint16_t mpdu_failed:16;
2205 	uint32_t long_retries:4,
2206 		 short_retries:4,
2207 		 tx_ratecode:16,
2208 		 is_ampdu:1,
2209 		 ppdu_type:5,
2210 		 pream_punct:1,
2211 		 is_seq_num_valid:1;
2212 	uint32_t success_bytes;
2213 	uint32_t retry_bytes;
2214 	uint32_t failed_bytes;
2215 	uint32_t success_msdus:16,
2216 		 retry_msdus:16;
2217 	uint32_t retry_mpdus;
2218 	uint32_t failed_msdus:16,
2219 		 duration:16;
2220 	uint32_t ltf_size:2,
2221 		 stbc:1,
2222 		 he_re:1,
2223 		 txbf:4,
2224 		 bw:4,
2225 		 nss:4,
2226 		 mcs:4,
2227 		 preamble:4,
2228 		 gi:4,
2229 		 dcm:1,
2230 		 ldpc:1,
2231 		 delayed_ba:1,
2232 		 ack_ba_tlv:1;
2233 	uint32_t ba_seq_no;
2234 	uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
2235 	uint32_t start_seq;
2236 	uint32_t enq_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
2237 	uint32_t failed_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
2238 	uint32_t num_mpdu:9,
2239 		 num_msdu:16;
2240 	uint32_t tx_duration;
2241 	uint16_t ru_start;
2242 	uint16_t ru_tones;
2243 	bool is_mcast;
2244 	uint32_t tx_rate;
2245 	uint32_t tx_ratekbps;
2246 	uint32_t ack_rssi[CDP_RSSI_CHAIN_LEN];
2247 	bool ack_rssi_valid;
2248 	uint32_t usr_ack_rssi;
2249 	uint32_t user_pos;
2250 	uint32_t mu_group_id;
2251 	uint32_t rix;
2252 	uint8_t is_ppdu_cookie_valid;
2253 	uint16_t ppdu_cookie;
2254 	uint8_t sa_is_training;
2255 	int32_t rssi_chain[CDP_RSSI_CHAIN_LEN];
2256 	uint32_t sa_tx_antenna;
2257 	/*Max rates for BW: 20MHZ, 40MHZ and 80MHZ and 160MHZ and 320MHZ
2258 	 * |-------------------------------------------------|
2259 	 * | 16 bits | 16 bits | 16 bits | 16 bits | 16 bits |
2260 	 * |   BW-1  |   BW-2  |   BW-3  |   BW-4  |   BW-5  |
2261 	 * |      /\  \                                      |
2262 	 * |     /  \  \                                     |
2263 	 * |    /    \  \                                    |
2264 	 * |   /      \  \                                   |
2265 	 * |  /        \  \                                  |
2266 	 * | /          \  \                                 |
2267 	 * |/            \  \                                |
2268 	 * |[11|8]     [5|8] \                               |
2269 	 * | BW1      PADDED  \                              |
2270 	 * |-------------------------------------------------|
2271 	 */
2272 	uint16_t sa_max_rates[CDP_NUM_SA_BW + 1];
2273 	uint32_t sa_goodput;
2274 	/* below field is used to calculate goodput in non-training period
2275 	 * Note: As host is exposing goodput and hence current_rate_per is
2276 	 * of no use. It is just for Host computation.
2277 	 */
2278 	uint32_t current_rate_per;
2279 	uint32_t last_enq_seq;
2280 
2281 	uint8_t is_bss_peer;
2282 
2283 	qdf_nbuf_queue_t mpdu_q;
2284 	qdf_nbuf_t *mpdus;
2285 	uint32_t pending_retries;
2286 	uint32_t tlv_bitmap;
2287 	bool skip;
2288 	bool mon_procd;
2289 	bool debug_copied;
2290 	bool peer_last_delayed_ba;
2291 
2292 	uint16_t phy_tx_time_us;
2293 	uint32_t mpdu_bytes;
2294 	uint8_t punc_mode;
2295 	uint32_t punc_pattern_bitmap:16,
2296 		fixed_rate_used:1;
2297 	uint32_t msduq_bitmap;
2298 	uint8_t mprot_type:3,
2299 		rts_success:1,
2300 		rts_failure:1;
2301 };
2302 
2303 /**
2304  * struct cdp_tx_indication_mpdu_info - Tx MPDU completion information
2305  * @ppdu_id: PPDU id
2306  * @tx_duration: user duration in ppdu
2307  * @frame_type: frame type MGMT/CTRL/DATA/BAR
2308  * @frame_ctrl: frame control field in 802.11 header
2309  * @qos_ctrl: QoS control field in 802.11 header
2310  * @tid: TID number
2311  * @num_msdu: number of msdu in MPDU
2312  * @seq_no: Sequence number of first MPDU
2313  * @ltf_size: ltf_size
2314  * @he_re: he_re (range extension)
2315  * @txbf: txbf
2316  * @bw: Transmission bandwidth
2317  *       <enum 2 transmit_bw_20_MHz>
2318  *       <enum 3 transmit_bw_40_MHz>
2319  *       <enum 4 transmit_bw_80_MHz>
2320  *       <enum 5 transmit_bw_160_MHz>
2321  * @nss: NSS 1,2, ...8
2322  * @mcs: MCS index
2323  * @preamble: preamble
2324  * @gi: guard interval 800/400/1600/3200 ns
2325  * @channel: frequency
2326  * @channel_num: channel number
2327  * @ack_rssi: ack rssi
2328  * @ldpc: ldpc
2329  * @tx_rate: Transmission Rate
2330  * @mac_address: peer mac address
2331  * @bss_mac_address: bss mac address
2332  * @ppdu_start_timestamp: TSF at PPDU start
2333  * @ppdu_end_timestamp: TSF at PPDU end
2334  * @ba_start_seq: Block Ack sequence number
2335  * @ba_bitmap: Block Ack bitmap
2336  * @ppdu_cookie: 16-bit ppdu_cookie
2337  * @long_retries: long retries
2338  * @short_retries: short retries
2339  * @completion_status: completion status - OK/Filter/Abort/Timeout
2340  * @resp_type: response type
2341  * @mprot_type: medium protection type
2342  * @rts_success: rts success
2343  * @rts_failure: rts failure
2344  * @usr_idx: user index
2345  */
2346 struct cdp_tx_indication_mpdu_info {
2347 	uint32_t ppdu_id;
2348 	uint32_t tx_duration;
2349 	uint16_t frame_type;
2350 	uint16_t frame_ctrl;
2351 	uint16_t qos_ctrl;
2352 	uint8_t tid;
2353 	uint32_t num_msdu;
2354 	uint32_t seq_no;
2355 	uint32_t ltf_size:2,
2356 		 he_re:1,
2357 		 txbf:4,
2358 		 bw:4,
2359 		 nss:4,
2360 		 mcs:4,
2361 		 preamble:4,
2362 		 gi:4;
2363 	uint32_t channel;
2364 	uint8_t channel_num;
2365 	uint32_t ack_rssi;
2366 	uint32_t ldpc;
2367 	uint32_t tx_rate;
2368 	uint8_t mac_address[QDF_MAC_ADDR_SIZE];
2369 	uint8_t bss_mac_address[QDF_MAC_ADDR_SIZE];
2370 	uint64_t ppdu_start_timestamp;
2371 	uint64_t ppdu_end_timestamp;
2372 	uint32_t ba_start_seq;
2373 	uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
2374 	uint16_t ppdu_cookie;
2375 	uint16_t long_retries:4,
2376 		 short_retries:4,
2377 		 completion_status:8;
2378 	uint16_t resp_type:4,
2379 		 mprot_type:3,
2380 		 rts_success:1,
2381 		 rts_failure:1;
2382 	uint8_t usr_idx;
2383 };
2384 
2385 /**
2386  * struct cdp_tx_indication_info - Tx capture information
2387  * @radiotap_done: Flag to say radiotap already done or not
2388  *			0 - radiotap not updated
2389  *			1 - radiotap header updated
2390  * @mpdu_info: Tx MPDU completion information
2391  * @mpdu_nbuf: reconstructed mpdu packet
2392  * @ppdu_desc: tx completion ppdu
2393  * @osif_vdev: OS IF vdev handle
2394  */
2395 struct cdp_tx_indication_info {
2396 	bool radiotap_done;
2397 	struct cdp_tx_indication_mpdu_info mpdu_info;
2398 	qdf_nbuf_t mpdu_nbuf;
2399 	struct cdp_tx_completion_ppdu *ppdu_desc;
2400 #ifdef QCA_SUPPORT_LITE_MONITOR
2401 	ol_osif_vdev_handle osif_vdev;
2402 #endif
2403 };
2404 
2405 /**
2406  * struct cdp_tx_mgmt_comp_info - Tx mgmt comp info
2407  * @ppdu_id: ppdu_id
2408  * @is_sgen_pkt: payload received from wmi or htt path
2409  * @retries_count: retries count
2410  * @tx_tsf: 64 bit timestamp
2411  */
2412 struct cdp_tx_mgmt_comp_info {
2413 	uint32_t ppdu_id;
2414 	bool is_sgen_pkt;
2415 	uint16_t retries_count;
2416 	uint64_t tx_tsf;
2417 };
2418 
2419 /**
2420  * struct cdp_tx_completion_ppdu - Tx PPDU completion information
2421  * @completion_status: completion status - OK/Filter/Abort/Timeout
2422  * @ppdu_id: PPDU Id
2423  * @ppdu_seq_id: ppdu sequence id for sojourn stats
2424  * @vdev_id: VAP Id
2425  * @bar_num_users: BA response user count, based on completion common TLV
2426  * @num_users: Number of users
2427  * @max_users: Number of users from USR_INFO TLV
2428  * @last_usr_index:
2429  * @drop_reason: drop reason from flush status
2430  * @is_flush: is_flush is set based on flush tlv
2431  * @flow_type: tx flow type from flush status
2432  * @queue_type: queue type from flush status
2433  * @num_mpdu: Number of MPDUs in PPDU
2434  * @num_msdu: Number of MSDUs in PPDU
2435  * @frame_type: frame SU or MU
2436  * @htt_frame_type: frame type from htt
2437  * @frame_ctrl: frame control of 80211 header
2438  * @channel: Channel informartion
2439  * @resp_type: response type
2440  * @mprot_type: medium protection type
2441  * @rts_success: rts success
2442  * @rts_failure: rts failure
2443  * @phy_mode: phy mode
2444  * @ack_rssi: RSSI value of last ack packet (units=dB above noise floor)
2445  * @tx_duration: PPDU airtime
2446  * @ppdu_start_timestamp: TSF at PPDU start
2447  * @ppdu_end_timestamp: TSF at PPDU end
2448  * @ack_timestamp: TSF at the reception of ACK
2449  * @delayed_ba: Delayed ba flag
2450  * @beam_change: beam change bit in ppdu for he-information
2451  * @bss_color: 6 bit value for full bss color
2452  * @doppler: value for doppler (will be 0 most of the times)
2453  * @spatial_reuse: value for spatial reuse used in radiotap HE header
2454  * @usr_nss_sum: Sum of user nss
2455  * @usr_ru_tones_sum: Sum of user ru_tones
2456  * @bar_ppdu_id: BAR ppdu_id
2457  * @bar_tx_duration: BAR tx duration
2458  * @bar_ppdu_start_timestamp: BAR start timestamp
2459  * @bar_ppdu_end_timestamp: BAR end timestamp
2460  * @tlv_bitmap: tlv_bitmap for the PPDU
2461  * @sched_cmdid: schedule command id
2462  * @phy_ppdu_tx_time_us: Phy per PPDU TX duration
2463  * @ppdu_bytes: accumulated bytes per ppdu for mem limit feature
2464  * @htt_seq_type: Seq type
2465  * @txmode_type: tx mode type UL/DL
2466  * @txmode: tx mode
2467  * @num_ul_users: Number of UL expected users
2468  * @ch_access_delay: Channel access delay
2469  * @backoff_ac_valid: Backoff AC valid
2470  * @backoff_ac: Backoff AC
2471  * @num_ul_user_resp_valid: Number of UL users response valid
2472  * @num_ul_user_resp: Number of UL users response
2473  * @user: per-User stats (array of per-user structures)
2474  */
2475 struct cdp_tx_completion_ppdu {
2476 	uint32_t ppdu_id;
2477 	uint32_t ppdu_seq_id;
2478 	uint16_t vdev_id;
2479 	uint16_t bar_num_users;
2480 	uint32_t num_users;
2481 	uint8_t  max_users;
2482 	uint8_t last_usr_index;
2483 	uint32_t drop_reason;
2484 	uint32_t is_flush:1,
2485 		 flow_type:8,
2486 		 queue_type:8;
2487 	uint32_t num_mpdu:9,
2488 		 num_msdu:16;
2489 	uint16_t frame_type;
2490 	uint16_t htt_frame_type;
2491 	uint16_t frame_ctrl;
2492 	uint16_t channel;
2493 	uint16_t resp_type:4,
2494 		 mprot_type:3,
2495 		 rts_success:1,
2496 		 rts_failure:1;
2497 	uint16_t phy_mode;
2498 	uint32_t ack_rssi;
2499 	uint32_t tx_duration;
2500 	uint64_t ppdu_start_timestamp;
2501 	uint64_t ppdu_end_timestamp;
2502 	uint64_t ack_timestamp;
2503 	bool delayed_ba;
2504 	uint8_t beam_change;
2505 	uint8_t bss_color;
2506 	uint8_t doppler;
2507 	uint8_t spatial_reuse;
2508 	uint8_t usr_nss_sum;
2509 	uint32_t usr_ru_tones_sum;
2510 	uint32_t bar_ppdu_id;
2511 	uint32_t bar_tx_duration;
2512 	uint64_t bar_ppdu_start_timestamp;
2513 	uint64_t bar_ppdu_end_timestamp;
2514 	uint32_t tlv_bitmap;
2515 	uint16_t sched_cmdid;
2516 	uint16_t phy_ppdu_tx_time_us;
2517 	uint32_t ppdu_bytes;
2518 	uint8_t htt_seq_type;
2519 	uint8_t txmode_type;
2520 	uint8_t txmode;
2521 	uint32_t num_ul_users;
2522 	uint32_t ch_access_delay;
2523 	uint32_t backoff_ac_valid;
2524 	uint32_t backoff_ac;
2525 	uint32_t num_ul_user_resp_valid;
2526 	uint32_t num_ul_user_resp;
2527 	struct cdp_tx_completion_ppdu_user user[];
2528 };
2529 
2530 /**
2531  * struct cdp_dev_stats - Network device stats structure
2532  * @tx_packets: Tx total packets transmitted
2533  * @tx_errors : Tx error due to FW tx failure, Ring failure DMA etc
2534  * @tx_dropped: Tx dropped is same as tx errors as above
2535  * @rx_packets: Rx total packets transmitted
2536  * @rx_errors : Rx errors
2537  * @rx_dropped: Rx dropped stats
2538  * @tx_bytes  : Tx total bytes transmitted
2539  * @rx_bytes  : Rx total bytes transmitted
2540  */
2541 struct cdp_dev_stats {
2542 	uint32_t tx_packets;
2543 	uint32_t tx_errors;
2544 	uint32_t tx_dropped;
2545 	uint32_t rx_packets;
2546 	uint32_t rx_errors;
2547 	uint32_t rx_dropped;
2548 	uint64_t tx_bytes;
2549 	uint64_t rx_bytes;
2550 };
2551 
2552 /**
2553  * struct cdp_rate_stats - Tx/Rx Rate statistics
2554  * @rate_stats_info_valid: set if the stats are valid
2555  * @bw: Indicates the BW of the upcoming transmission -
2556  *       <enum 2 transmit_bw_20_MHz>
2557  *       <enum 3 transmit_bw_40_MHz>
2558  *       <enum 4 transmit_bw_80_MHz>
2559  *       <enum 5 transmit_bw_160_MHz>
2560  * @pkt_type: Transmit Packet Type
2561  * @stbc: When set, STBC transmission rate was used
2562  * @ldpc: When set, use LDPC transmission rates
2563  * @sgi: <enum 0     0_8_us_sgi > Legacy normal GI
2564  *       <enum 1     0_4_us_sgi > Legacy short GI
2565  *       <enum 2     1_6_us_sgi > HE related GI
2566  *       <enum 3     3_2_us_sgi > HE
2567  * @mcs: Transmit MCS Rate
2568  * @ofdma: Set when the transmission was an OFDMA transmission
2569  * @tones_in_ru: The number of tones in the RU used.
2570  * @resvd0: reserved bits
2571  * @tsf: Lower 32 bits of the TSF (timestamp when ppdu transmission finished)
2572  * @peer_id: Peer ID of the flow or MPDU queue
2573  * @tid: TID of the flow or MPDU queue
2574  */
2575 struct cdp_rate_stats {
2576 	uint32_t rate_stats_info_valid:1,
2577 		 bw:2,
2578 		 pkt_type:4,
2579 		 stbc:1,
2580 		 ldpc:1,
2581 		 sgi:2,
2582 		 mcs:4,
2583 		 ofdma:1,
2584 		 tones_in_ru:12,
2585 		 resvd0:4;
2586 	uint32_t tsf;
2587 	uint16_t peer_id;
2588 	uint8_t tid;
2589 };
2590 
2591 /**
2592  * struct cdp_tx_completion_msdu - Tx MSDU completion descriptor
2593  * @ppdu_id: PPDU to which this MSDU belongs
2594  * @transmit_cnt: Number of times this frame has been transmitted
2595  * @ack_frame_rssi: RSSI of the received ACK or BA frame
2596  * @resvd0: reserved bit
2597  * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
2598  * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
2599  * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
2600  * @extd: Extended structure containing rate statistics
2601  * @resvd1: reserved bits
2602  */
2603 struct cdp_tx_completion_msdu {
2604 	uint32_t ppdu_id;
2605 	uint8_t transmit_cnt;
2606 	uint32_t ack_frame_rssi:8,
2607 		 resvd0:1,
2608 		 first_msdu:1,
2609 		 last_msdu:1,
2610 		 msdu_part_of_amsdu:1,
2611 		 resvd1:20;
2612 	struct cdp_rate_stats extd;
2613 };
2614 
2615 /**
2616  * struct cdp_rx_stats_ppdu_user -- per user RX stats
2617  * @peer_id: Peer ID
2618  * @vdev_id: VAP ID
2619  * @is_ampdu: mpdu aggregate or non-aggregate?
2620  * @mu_ul_info_valid: MU UL info valid
2621  * @ofdma_ru_start_index: RU index number(0-73)
2622  * @ofdma_ru_width: size of RU in units of 1(26tone)RU
2623  * @nss: NSS 1,2, ...8
2624  * @mcs: MCS index
2625  * @user_index: user ID in multi-user case
2626  * @is_bss_peer: is bss peer check
2627  * @ast_index: ast index in multi-user case
2628  * @tid: TID number
2629  * @num_msdu: Number of MSDUs in PPDU
2630  * @tcp_msdu_count: Number of TCP MSDUs in PPDU
2631  * @udp_msdu_count: Number of UDP MSDUs in PPDU
2632  * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
2633  * @frame_control: frame control field
2634  * @frame_control_info_valid: frame_control valid
2635  * @qos_control: qos control field
2636  * @qos_control_info_valid: qos_control valid
2637  * @data_sequence_control_info_valid: data_sequence_control_info valid
2638  * @first_data_seq_ctrl: Sequence control field of first data frame
2639  * @preamble_type: preamble
2640  * @ht_flags: HT flags
2641  * @vht_flags: VHT flags
2642  * @he_flags: HE flags
2643  * @mac_addr: Peer MAC Address
2644  * @mpdu_cnt_fcs_ok: Number of MPDUs in PPDU with fcs ok
2645  * @mpdu_cnt_fcs_err: Number of MPDUs in PPDU with fcs err
2646  * @mpdu_fcs_ok_bitmap: MPDU with fcs ok bitmap
2647  * @mpdu_ok_byte_count:
2648  * @mpdu_err_byte_count:
2649  * @retries: number of retries
2650  * @rx_ratekbps: rx rate in kbps
2651  * @rix: rate index
2652  * @mpdu_retries: retries of mpdu in rx
2653  * @rx_time_us: Rx duration
2654  */
2655 struct cdp_rx_stats_ppdu_user {
2656 	uint16_t peer_id;
2657 	uint8_t vdev_id;
2658 	bool is_ampdu;
2659 	uint32_t mu_ul_info_valid:1,
2660 		 ofdma_ru_start_index:7,
2661 		 ofdma_ru_width:7,
2662 		 nss:4,
2663 		 mcs:4;
2664 	/* user id */
2665 	uint8_t  user_index;
2666 	uint8_t is_bss_peer;
2667 	uint32_t ast_index;
2668 	uint32_t tid;
2669 	uint32_t num_msdu;
2670 	uint16_t  tcp_msdu_count;
2671 	uint16_t  udp_msdu_count;
2672 	uint16_t  other_msdu_count;
2673 	uint16_t frame_control;
2674 	uint8_t  frame_control_info_valid;
2675 	uint16_t qos_control;
2676 	uint8_t  qos_control_info_valid;
2677 	uint8_t data_sequence_control_info_valid;
2678 	uint16_t first_data_seq_ctrl;
2679 	uint32_t preamble_type;
2680 	uint16_t ht_flags;
2681 	uint16_t vht_flags;
2682 	uint16_t he_flags;
2683 	uint8_t  mac_addr[QDF_MAC_ADDR_SIZE];
2684 	uint32_t mpdu_cnt_fcs_ok;
2685 	uint32_t mpdu_cnt_fcs_err;
2686 	uint32_t mpdu_fcs_ok_bitmap[QDF_MON_STATUS_MPDU_FCS_BMAP_NWORDS];
2687 	uint32_t mpdu_ok_byte_count;
2688 	uint32_t mpdu_err_byte_count;
2689 	uint32_t retries;
2690 	uint32_t rx_ratekbps;
2691 	uint32_t rix;
2692 	uint32_t mpdu_retries;
2693 	uint16_t rx_time_us;
2694 };
2695 
2696 /**
2697  * struct cdp_rx_indication_ppdu - Rx PPDU indication structure
2698  * @ppdu_id: PPDU Id
2699  * @is_ampdu: mpdu aggregate or non-aggregate?
2700  * @num_mpdu: Number of MPDUs in PPDU
2701  * @reserved: Reserved bits for future use
2702  * @num_msdu: Number of MSDUs in PPDU
2703  * @num_bytes: Number of bytes
2704  * @udp_msdu_count: Number of UDP MSDUs in PPDU
2705  * @tcp_msdu_count: Number of TCP MSDUs in PPDU
2706  * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
2707  * @duration: PPDU duration
2708  * @tid: TID number
2709  * @peer_id: Peer ID
2710  * @vdev_id: VAP ID
2711  * @mac_addr: Peer MAC Address
2712  * @first_data_seq_ctrl: Sequence control field of first data frame
2713  * @u: union of rate information representations
2714  * @rate_info: consolidated rate fields
2715  * @ltf_size: ltf_size
2716  * @stbc: When set, STBC rate was used
2717  * @he_re: he_re (range extension)
2718  * @bw: Bandwidth
2719  *       <enum 0 bw_20_MHz>
2720  *       <enum 1 bw_40_MHz>
2721  *       <enum 2 bw_80_MHz>
2722  *       <enum 3 bw_160_MHz>
2723  * @nss: NSS 1,2, ...8
2724  * @mcs: MCS index
2725  * @preamble: preamble
2726  * @gi: <enum 0     0_8_us_sgi > Legacy normal GI
2727  *       <enum 1     0_4_us_sgi > Legacy short GI
2728  *       <enum 2     1_6_us_sgi > HE related GI
2729  *       <enum 3     3_2_us_sgi > HE
2730  * @dcm: dcm
2731  * @ldpc: ldpc
2732  * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
2733  * UL_BSR_TRIG/UNKNOWN
2734  * @rix: rate index
2735  * @lsig_a: L-SIG in 802.11 PHY header
2736  * @rssi: RSSI value (units = dB above noise floor)
2737  * @timestamp: TSF at the reception of PPDU
2738  * @length: PPDU length
2739  * @channel: Channel information
2740  * @beamformed:
2741  * @rx_ratekbps:
2742  * @ppdu_rx_rate:
2743  * @retries:
2744  * @rx_byte_count:
2745  * @rx_ratecode:
2746  * @fcs_error_mpdus:
2747  * @frame_ctrl: frame control field
2748  * @rssi_chain: rssi chain per nss per bw
2749  * @evm_info:
2750  * @rx_antenna:
2751  * @num_users:
2752  * @nf: noise floor
2753  * @per_chain_rssi: rssi per antenna
2754  * @is_mcast_bcast:
2755  * @cfr_info:
2756  * @punc_bw: punctured bw
2757  * @phyrx_abort: rx aborted undecoded frame indication
2758  * @phyrx_abort_reason: abort reason defined in phyrx_abort_request_info
2759  * @l_sig_length: L SIG A length
2760  * @l_sig_a_parity: L SIG A parity
2761  * @l_sig_a_pkt_type: L SIG A info pkt type
2762  * @l_sig_a_implicit_sounding: L SIG A info captured implicit sounding
2763  * @vht_crc: Indicate vht crc
2764  * @group_id:
2765  * @ht_length: num of bytes in PSDU
2766  * @ht_smoothing: Indicate ht_smoothing
2767  * @ht_not_sounding: Indicate ht not sounding
2768  * @ht_aggregation: Indicate ht aggregation
2769  * @ht_stbc: Indicate ht stbc
2770  * @ht_crc: Indicate ht crc
2771  * @vht_no_txop_ps: Indicate TXOP power save mode
2772  * @bss_color_id: Indicate BSS color ID
2773  * @beam_change: Indicates whether spatial mapping is changed
2774  * @dl_ul_flag: Differentiates between DL and UL transmission
2775  * @transmit_mcs: Indicates the data MCS
2776  * @ldpc_extra_sym: LDPC extra symbol
2777  * @special_reuse: Spatial reuse
2778  * @ltf_sym: Indictaes HE NSTS
2779  * @txbf: Indicates whether beamforming is applied
2780  * @pe_disambiguity: packet extension disambiguity
2781  * @pre_fec_pad: packet extension a factor
2782  * @dopplar: Doppler support
2783  * @txop_duration: Indicates the remaining time in the current TXOP
2784  * @sig_b_mcs: MCS of HE-SIG-B
2785  * @sig_b_dcm: DCM of HE-SIG-B
2786  * @sig_b_sym: Number of symbols of HE-SIG-B
2787  * @sig_b_comp: Compression mode of HE-SIG-B
2788  * @he_crc: CRC for HE-SIG contents
2789  * @usr_nss_sum: Sum of user nss
2790  * @usr_ru_tones_sum: Sum of user ru_tones
2791  * @user: per user stats in MU-user case
2792  */
2793 struct cdp_rx_indication_ppdu {
2794 	uint32_t ppdu_id;
2795 	uint16_t is_ampdu:1,
2796 		 num_mpdu:9,
2797 		 reserved:6;
2798 	uint32_t num_msdu;
2799 	uint32_t num_bytes;
2800 	uint16_t udp_msdu_count;
2801 	uint16_t tcp_msdu_count;
2802 	uint16_t other_msdu_count;
2803 	uint16_t duration;
2804 	uint32_t tid:8,
2805 		 peer_id:16;
2806 	uint8_t vdev_id;
2807 	uint8_t mac_addr[6];
2808 	uint16_t first_data_seq_ctrl;
2809 	union {
2810 		uint32_t rate_info;
2811 		struct {
2812 			uint32_t ltf_size:2,
2813 				 stbc:1,
2814 				 he_re:1,
2815 				 bw:4,
2816 				 nss:4,
2817 				 mcs:4,
2818 				 preamble:4,
2819 				 gi:4,
2820 				 dcm:1,
2821 				 ldpc:1,
2822 				 ppdu_type:5;
2823 		};
2824 	} u;
2825 	uint32_t rix;
2826 	uint32_t lsig_a;
2827 	uint32_t rssi;
2828 	uint64_t timestamp;
2829 	uint32_t length;
2830 	uint8_t channel;
2831 	uint8_t beamformed;
2832 
2833 	uint32_t rx_ratekbps;
2834 	uint32_t ppdu_rx_rate;
2835 
2836 	uint32_t retries;
2837 	uint32_t rx_byte_count;
2838 	uint16_t rx_ratecode;
2839 	uint8_t fcs_error_mpdus;
2840 	uint16_t frame_ctrl;
2841 	int8_t rssi_chain[SS_COUNT][MAX_BW];
2842 	struct cdp_rx_su_evm_info evm_info;
2843 	uint32_t rx_antenna;
2844 	uint8_t num_users;
2845 	uint32_t nf;
2846 	uint8_t  per_chain_rssi[MAX_CHAIN];
2847 	uint8_t is_mcast_bcast;
2848 #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
2849 	struct cdp_rx_ppdu_cfr_info cfr_info;
2850 #endif
2851 	uint8_t punc_bw;
2852 #ifdef QCA_UNDECODED_METADATA_SUPPORT
2853 	bool phyrx_abort;
2854 	uint8_t phyrx_abort_reason;
2855 	uint32_t l_sig_length:12,
2856 		 l_sig_a_parity:1,
2857 		 l_sig_a_pkt_type:4,
2858 		 l_sig_a_implicit_sounding:1,
2859 		 vht_crc:8,
2860 		 group_id:6;
2861 	uint32_t ht_length:16,
2862 		 ht_smoothing:1,
2863 		 ht_not_sounding:1,
2864 		 ht_aggregation:1,
2865 		 ht_stbc:2,
2866 		 ht_crc:8,
2867 		 vht_no_txop_ps:1;
2868 	uint32_t bss_color_id:6,
2869 		 beam_change:1,
2870 		 dl_ul_flag:1,
2871 		 transmit_mcs:4,
2872 		 ldpc_extra_sym:1,
2873 		 special_reuse:4,
2874 		 ltf_sym:3,
2875 		 txbf:1,
2876 		 pe_disambiguity:1,
2877 		 pre_fec_pad:4,
2878 		 dopplar:1;
2879 	uint32_t txop_duration:7,
2880 		 sig_b_mcs:3,
2881 		 sig_b_dcm:1,
2882 		 sig_b_sym:4,
2883 		 sig_b_comp:1,
2884 		 he_crc:4;
2885 #endif
2886 	uint8_t usr_nss_sum;
2887 	uint32_t usr_ru_tones_sum;
2888 	struct cdp_rx_stats_ppdu_user user[];
2889 };
2890 
2891 /**
2892  * struct cdp_rx_indication_msdu - Rx MSDU info
2893  * @ppdu_id: PPDU to which the MSDU belongs
2894  * @msdu_len: Length of MSDU in bytes
2895  * @ack_frame_rssi: RSSI of the received ACK or BA frame
2896  * @resvd0: reserved bit
2897  * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
2898  * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
2899  * @msdu_part_of_amsdu: Indicates this MSDU was part of an A-MSDU in MPDU
2900  * @msdu_part_of_ampdu:
2901  * @resvd1: reserved bit
2902  * @extd: Extended structure containing rate statistics
2903  */
2904 struct cdp_rx_indication_msdu {
2905 	uint32_t ppdu_id;
2906 	uint16_t msdu_len;
2907 	uint32_t ack_frame_rssi:8,
2908 		 resvd0:1,
2909 		 first_msdu:1,
2910 		 last_msdu:1,
2911 		 msdu_part_of_amsdu:1,
2912 		 msdu_part_of_ampdu:1,
2913 		 resvd1:19;
2914 	struct cdp_rate_stats extd;
2915 };
2916 
2917 /**
2918  * struct cdp_config_params - Propagate configuration parameters to datapath
2919  * @tso_enable: Enable/Disable TSO
2920  * @lro_enable: Enable/Disable LRO
2921  * @gro_enable: Enable/Disable GRO
2922  * @flow_steering_enable: Enable/Disable Rx Hash based flow steering
2923  * @p2p_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for P2P
2924  * @nan_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for NAN
2925  * @tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload
2926  * @legacy_mode_checksumoffload_disable: Disable TCP/UDP Checksum Offload for
2927  *					 legacy modes.
2928  * @napi_enable: Enable/Disable Napi
2929  * @ipa_enable: Flag indicating if IPA is enabled or not
2930  * @tx_flow_stop_queue_threshold: Value to Pause tx queues
2931  * @tx_flow_start_queue_offset: Available Tx descriptors to unpause
2932  *				tx queue
2933  * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
2934  * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
2935  * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
2936  */
2937 struct cdp_config_params {
2938 	unsigned int tso_enable:1;
2939 	unsigned int lro_enable:1;
2940 	unsigned int gro_enable:1;
2941 	unsigned int flow_steering_enable:1;
2942 	unsigned int p2p_tcp_udp_checksumoffload:1;
2943 	unsigned int nan_tcp_udp_checksumoffload:1;
2944 	unsigned int tcp_udp_checksumoffload:1;
2945 	unsigned int legacy_mode_checksumoffload_disable:1;
2946 	unsigned int napi_enable:1;
2947 	unsigned int ipa_enable:1;
2948 	/* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */
2949 	uint8_t tx_flow_stop_queue_threshold;
2950 	uint8_t tx_flow_start_queue_offset;
2951 	uint32_t tx_comp_loop_pkt_limit;
2952 	uint32_t rx_reap_loop_pkt_limit;
2953 	uint32_t rx_hp_oos_update_limit;
2954 
2955 };
2956 
2957 /**
2958  * struct cdp_txrx_stats_req - stats request wrapper
2959  *	used to pass request information to cdp layer
2960  * @stats: type of stats requested
2961  * @param0: opaque argument 0 to be passed to htt
2962  * @param1: opaque argument 1 to be passed to htt
2963  * @param2: opaque argument 2 to be passed to htt
2964  * @param3: opaque argument 3 to be passed to htt
2965  * @cookie_val: cookie
2966  * @mac_id: mac id
2967  * @peer_addr: peer address
2968  */
2969 struct cdp_txrx_stats_req {
2970 	enum cdp_stats	stats;
2971 	uint32_t	param0;
2972 	uint32_t	param1;
2973 	uint32_t	param2;
2974 	uint32_t	param3;
2975 	uint32_t	cookie_val;
2976 	uint8_t		mac_id;
2977 	char		*peer_addr;
2978 };
2979 
2980 /**
2981  * struct cdp_monitor_filter - monitor filter info
2982  * @mode: set filter mode
2983  * @fp_mgmt: set Filter Pass MGMT Configuration
2984  * @fp_ctrl: set Filter Pass CTRL Configuration
2985  * @fp_data: set Filter Pass DATA Configuration
2986  * @mo_mgmt: set Monitor Other MGMT Configuration
2987  * @mo_ctrl: set Monitor Other CTRL Configuration
2988  * @mo_data: set Monitor other DATA Configuration
2989  *
2990  */
2991 struct cdp_monitor_filter {
2992 	uint16_t mode;
2993 	uint16_t fp_mgmt;
2994 	uint16_t fp_ctrl;
2995 	uint16_t fp_data;
2996 	uint16_t mo_mgmt;
2997 	uint16_t mo_ctrl;
2998 	uint16_t mo_data;
2999 };
3000 
3001 /**
3002  * enum cdp_dp_cfg - CDP ENUMs to get to DP configation
3003  * @cfg_dp_enable_data_stall: context passed to be used by consumer
3004  * @cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload: get P2P checksum config
3005  * @cfg_dp_enable_nan_ip_tcp_udp_checksum_offload: get NAN TX checksum config
3006  * @cfg_dp_enable_ip_tcp_udp_checksum_offload: get TX checksum config for others
3007  * @cfg_dp_disable_legacy_mode_csum_offload: Disable checksum offload for
3008  *                                           legacy modes
3009  * @cfg_dp_tso_enable: get TSO enable config
3010  * @cfg_dp_lro_enable: get LRO enable config
3011  * @cfg_dp_gro_enable: get GRO enable config
3012  * @cfg_dp_tc_based_dyn_gro_enable: get TC based dynamic gro enable config
3013  * @cfg_dp_tc_ingress_prio: priority value to be checked for tc filters
3014  * @cfg_dp_sg_enable:
3015  * @cfg_dp_tx_flow_start_queue_offset: get DP TX flow start queue offset
3016  * @cfg_dp_tx_flow_stop_queue_threshold: get DP TX flow stop queue threshold
3017  * @cfg_dp_ipa_uc_tx_buf_size: get IPA TX buf size config
3018  * @cfg_dp_ipa_uc_tx_partition_base: get IPA UC TX partition base config
3019  * @cfg_dp_ipa_uc_rx_ind_ring_count: get IPA rx indication ring count config
3020  * @cfg_dp_enable_flow_steering: get flow steerint enable config
3021  * @cfg_dp_reorder_offload_supported: get reorder offload support config
3022  * @cfg_dp_ce_classify_enable: get CE classify enable config
3023  * @cfg_dp_disable_intra_bss_fwd: get intra bss fwd config
3024  * @cfg_dp_pktlog_buffer_size: get packet log buffer size config
3025  * @cfg_dp_wow_check_rx_pending: get wow rx pending frame check config
3026  * @cfg_dp_local_pkt_capture: get local packet capture config
3027  */
3028 enum cdp_dp_cfg {
3029 	cfg_dp_enable_data_stall,
3030 	cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload,
3031 	cfg_dp_enable_nan_ip_tcp_udp_checksum_offload,
3032 	cfg_dp_enable_ip_tcp_udp_checksum_offload,
3033 	cfg_dp_disable_legacy_mode_csum_offload,
3034 	cfg_dp_tso_enable,
3035 	cfg_dp_lro_enable,
3036 	cfg_dp_gro_enable,
3037 	cfg_dp_tc_based_dyn_gro_enable,
3038 	cfg_dp_tc_ingress_prio,
3039 	cfg_dp_sg_enable,
3040 	cfg_dp_tx_flow_start_queue_offset,
3041 	cfg_dp_tx_flow_stop_queue_threshold,
3042 	cfg_dp_ipa_uc_tx_buf_size,
3043 	cfg_dp_ipa_uc_tx_partition_base,
3044 	cfg_dp_ipa_uc_rx_ind_ring_count,
3045 	cfg_dp_enable_flow_steering,
3046 	cfg_dp_reorder_offload_supported,
3047 	cfg_dp_ce_classify_enable,
3048 	cfg_dp_disable_intra_bss_fwd,
3049 	cfg_dp_pktlog_buffer_size,
3050 	cfg_dp_wow_check_rx_pending,
3051 	cfg_dp_local_pkt_capture,
3052 };
3053 
3054 /**
3055  * struct cdp_peer_cookie - cookie used when creating peer
3056  * @ctx: context passed to be used by consumer
3057  * @mac_addr: MAC address of peer
3058  * @peer_id: peer id
3059  * @pdev_id: pdev_id
3060  * @cookie: cookie to be used by consumer
3061  */
3062 struct cdp_peer_cookie {
3063 	struct cdp_stats_cookie *ctx;
3064 	uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
3065 	uint8_t peer_id;
3066 	uint8_t pdev_id;
3067 	uint8_t cookie;
3068 };
3069 
3070 /**
3071  * enum cdp_fisa_stats_id - ID to query FISA stats
3072  * @CDP_FISA_STATS_ID_ERR_STATS: FISA error stats
3073  * @CDP_FISA_STATS_ID_DUMP_HW_FST: HW FST dump
3074  * @CDP_FISA_STATS_ID_DUMP_SW_FST: SW FST dump
3075  */
3076 enum cdp_fisa_stats_id {
3077 	CDP_FISA_STATS_ID_ERR_STATS,
3078 	CDP_FISA_STATS_ID_DUMP_HW_FST,
3079 	CDP_FISA_STATS_ID_DUMP_SW_FST,
3080 };
3081 
3082 #ifdef WLAN_SUPPORT_RX_FISA
3083 /**
3084  * enum cdp_fisa_config_id - FISA config ID
3085  * @CDP_FISA_HTT_RX_FISA_CFG: FISA config HTT message
3086  * @CDP_FISA_HTT_RX_FSE_OP_CFG: FSE operation HTT message
3087  * @CDP_FISA_HTT_RX_FSE_SETUP_CFG: FSE setup HTT message
3088  */
3089 enum cdp_fisa_config_id {
3090 	CDP_FISA_HTT_RX_FISA_CFG,
3091 	CDP_FISA_HTT_RX_FSE_OP_CFG,
3092 	CDP_FISA_HTT_RX_FSE_SETUP_CFG,
3093 };
3094 
3095 /**
3096  * union cdp_fisa_config - FISA HTT message data
3097  * @fisa_config: FISA config HTT msg data
3098  * @fse_op_cmd: FSE operation HTT msg data
3099  * @fse_setup_info: FSE setup HTT msg data
3100  */
3101 union cdp_fisa_config {
3102 	struct dp_htt_rx_fisa_cfg *fisa_config;
3103 	struct dp_htt_rx_flow_fst_operation *fse_op_cmd;
3104 	struct dp_htt_rx_flow_fst_setup *fse_setup_info;
3105 };
3106 
3107 struct cdp_flow_stats {
3108 	uint32_t aggr_count;
3109 	uint32_t curr_aggr_count;
3110 	uint32_t flush_count;
3111 	uint32_t bytes_aggregated;
3112 };
3113 #else
3114 /**
3115  * struct cdp_flow_stats - Per-Flow (5-tuple) statistics
3116  * @msdu_count: number of rx msdus matching this flow
3117  * @mon_msdu_count: number of msdus matching this flow in mon path
3118  *
3119  * HW also includes msdu_byte_count and timestamp, which
3120  * are not currently tracked in SW.
3121  */
3122 struct cdp_flow_stats {
3123 	uint32_t msdu_count;
3124 	uint32_t mon_msdu_count;
3125 };
3126 #endif
3127 
3128 /**
3129  * enum cdp_flow_fst_operation - RX FST operations allowed
3130  * @CDP_FLOW_FST_ENTRY_ADD: Add entry
3131  * @CDP_FLOW_FST_ENTRY_DEL: Delete entry
3132  * @CDP_FLOW_FST_RX_BYPASS_ENABLE: RX bypass enable
3133  * @CDP_FLOW_FST_RX_BYPASS_DISABLE: RX bypass disable
3134  */
3135 enum cdp_flow_fst_operation {
3136 	CDP_FLOW_FST_ENTRY_ADD,
3137 	CDP_FLOW_FST_ENTRY_DEL,
3138 	CDP_FLOW_FST_RX_BYPASS_ENABLE,
3139 	CDP_FLOW_FST_RX_BYPASS_DISABLE
3140 };
3141 
3142 /**
3143  * enum cdp_flow_protocol_type - RX FST supported protocol types,
3144  *                               mapped to HW spec
3145  * @CDP_FLOW_PROTOCOL_TYPE_TCP: TCP
3146  * @CDP_FLOW_PROTOCOL_TYPE_UDP: UDP
3147  */
3148 enum cdp_flow_protocol_type {
3149 	CDP_FLOW_PROTOCOL_TYPE_TCP = 6,
3150 	CDP_FLOW_PROTOCOL_TYPE_UDP = 17,
3151 };
3152 
3153 /**
3154  * struct cdp_rx_flow_tuple_info - RX flow tuple info used for addition/deletion
3155  * @tuple_populated:
3156  * @is_exception: Flows which are added to flow table but not aggregated.
3157  * @bypass_fisa: Flow which are not added to flow table.
3158  * @dest_ip_127_96: destination IP address bit fields 96-127
3159  * @dest_ip_95_64: destination IP address bit fields 64-95
3160  * @dest_ip_63_32: destination IP address bit fields 32-63
3161  * @dest_ip_31_0: destination IP address bit fields 0-31
3162  * @src_ip_127_96: source IP address bit fields 96-127
3163  * @src_ip_95_64: source IP address bit fields 64-95
3164  * @src_ip_63_32: source IP address bit fields 32-63
3165  * @src_ip_31_0: source IP address bit fields 0-31
3166  * @dest_port: destination port of flow
3167  * @src_port: source port of flow
3168  * @l4_protocol: protocol type in flow (TCP/UDP)
3169  */
3170 struct cdp_rx_flow_tuple_info {
3171 #ifdef WLAN_SUPPORT_RX_FISA
3172 	uint8_t tuple_populated;
3173 	uint8_t is_exception;
3174 	bool bypass_fisa;
3175 #endif
3176 	uint32_t dest_ip_127_96;
3177 	uint32_t dest_ip_95_64;
3178 	uint32_t dest_ip_63_32;
3179 	uint32_t dest_ip_31_0;
3180 	uint32_t src_ip_127_96;
3181 	uint32_t src_ip_95_64;
3182 	uint32_t src_ip_63_32;
3183 	uint32_t src_ip_31_0;
3184 	uint16_t dest_port;
3185 	uint16_t src_port;
3186 	uint16_t l4_protocol;
3187 };
3188 
3189 /**
3190  * struct cdp_rx_flow_info - RX flow info used for addition/deletion
3191  * @is_addr_ipv4: indicates whether given IP address is IPv4/IPv6
3192  * @op_code: add/delete/enable/disable operation requested
3193  * @flow_tuple_info: structure containing tuple info
3194  * @fse_metadata: metadata to be set in RX flow
3195  * @use_ppe_ds: use DS mode
3196  * @priority_vld: is priority valid
3197  * @service_code: service code for DS
3198  */
3199 struct cdp_rx_flow_info {
3200 	bool is_addr_ipv4;
3201 	enum cdp_flow_fst_operation op_code;
3202 	struct cdp_rx_flow_tuple_info flow_tuple_info;
3203 	uint16_t fse_metadata;
3204 	uint8_t use_ppe_ds;
3205 	uint8_t priority_vld;
3206 	uint16_t service_code;
3207 };
3208 
3209 #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
3210 /**
3211  * struct cdp_scan_spcl_vap_stats - Special vap statistics info
3212  * @rx_ok_pkts: rx fcs ok pkts count
3213  * @rx_ok_bytes: rx fcs ok bytes count
3214  * @rx_err_pkts: rx fcs err pkts count
3215  * @rx_err_bytes: rx fcs err bytes count
3216  * @rx_mgmt_pkts: rx mgmt pkts count
3217  * @rx_ctrl_pkts: rx ctrl pkts count
3218  * @rx_data_pkts: rx data pkts count
3219  */
3220 struct cdp_scan_spcl_vap_stats {
3221 	uint64_t rx_ok_pkts;
3222 	uint64_t rx_ok_bytes;
3223 	uint64_t rx_err_pkts;
3224 	uint64_t rx_err_bytes;
3225 	uint64_t rx_mgmt_pkts;
3226 	uint64_t rx_ctrl_pkts;
3227 	uint64_t rx_data_pkts;
3228 };
3229 #endif
3230 
3231 /**
3232  * struct cdp_soc_attach_params
3233  *
3234  * @hif_handle: Opaque HIF handle
3235  * @htc_handle: Opaque HTC handle
3236  * @qdf_osdev: QDF device
3237  * @ol_ops: Offload Operations
3238  * @device_id: Device ID
3239  * @ml_context: DP ML object context
3240  * @mlo_chip_id: MLO chip id, for legacy SOCs chip_id need to 0
3241  * @mlo_enabled: MLO enable bit
3242  */
3243 struct cdp_soc_attach_params {
3244 	struct hif_opaque_softc *hif_handle;
3245 	HTC_HANDLE htc_handle;
3246 	qdf_device_t qdf_osdev;
3247 	struct ol_if_ops *ol_ops;
3248 	uint16_t device_id;
3249 	struct cdp_mlo_ctxt *ml_context;
3250 	uint8_t mlo_chip_id;
3251 	uint8_t mlo_enabled;
3252 };
3253 
3254 /**
3255  * struct cdp_pdev_attach_params - params for pdev attach
3256  *
3257  * @htc_handle: HTC handle for host-target interface
3258  * @qdf_osdev: QDF OS device
3259  * @pdev_id: PDEV ID
3260  * @mlo_link_id: ML link id
3261  */
3262 struct cdp_pdev_attach_params {
3263 	HTC_HANDLE htc_handle;
3264 	qdf_device_t qdf_osdev;
3265 	uint8_t pdev_id;
3266 	uint32_t mlo_link_id;
3267 };
3268 
3269 /*
3270  * cdp_txrx_peer_params_update
3271  *
3272  * @vdev_id: VDEV ID
3273  * @peer_mac: Peer mac address
3274  * @chip_id: CHIP ID
3275  * @pdev_id: PDEV ID
3276  */
3277 struct cdp_txrx_peer_params_update {
3278 	uint8_t	vdev_id;
3279 	uint8_t	*peer_mac;
3280 	uint8_t	chip_id;
3281 	uint8_t	pdev_id;
3282 };
3283 
3284 /**
3285  * enum cdp_umac_reset_state - umac reset in progress state
3286  * @CDP_UMAC_RESET_NOT_IN_PROGRESS: Umac reset is not in progress
3287  * @CDP_UMAC_RESET_IN_PROGRESS: Umac reset is in progress
3288  * @CDP_UMAC_RESET_IN_PROGRESS_DURING_BUFFER_WINDOW: Umac reset was in progress
3289  *                                                   during this buffer window.
3290  * @CDP_UMAC_RESET_INVALID_STATE: Umac reset invalid state
3291  */
3292 enum cdp_umac_reset_state {
3293 	CDP_UMAC_RESET_NOT_IN_PROGRESS,
3294 	CDP_UMAC_RESET_IN_PROGRESS,
3295 	CDP_UMAC_RESET_IN_PROGRESS_DURING_BUFFER_WINDOW,
3296 	CDP_UMAC_RESET_INVALID_STATE
3297 };
3298 
3299 #ifdef WLAN_FEATURE_TX_LATENCY_STATS
3300 /* the maximum distribution level of tx latency stats */
3301 #define CDP_TX_LATENCY_DISTR_LV_MAX 4
3302 
3303 /**
3304  * enum cdp_tx_latency_type - transmit latency types
3305  * @CDP_TX_LATENCY_TYPE_DRIVER: Per MSDU latency
3306  *  from: A MSDU is presented to the driver
3307  *  to: the MSDU is queued into TCL SRNG
3308  * @CDP_TX_LATENCY_TYPE_RING_BUF: Per MSDU latency
3309  *  from: the MSDU is queued into TCL SRNG
3310  *  to: the MSDU is released by the driver
3311  * @CDP_TX_LATENCY_TYPE_HW: Per MSDU latency
3312  *  from: the MSDU is presented to the hardware
3313  *  to: the MSDU is released by the hardware
3314  * @CDP_TX_LATENCY_TYPE_CCA: Per PPDU latency
3315  *  The time spent on Clear Channel Assessment, the maximum value is 50000(us)
3316  *  from: A PPDU is presented to the hardware LMAC
3317  *  to: over-the-air transmission is started for the PPDU
3318  * @CDP_TX_LATENCY_TYPE_MAX: maximum number of types
3319  */
3320 enum cdp_tx_latency_type {
3321 	CDP_TX_LATENCY_TYPE_DRIVER,
3322 	CDP_TX_LATENCY_TYPE_RING_BUF,
3323 	CDP_TX_LATENCY_TYPE_HW,
3324 	CDP_TX_LATENCY_TYPE_CCA,
3325 
3326 	/* keep last */
3327 	CDP_TX_LATENCY_TYPE_MAX,
3328 };
3329 
3330 /**
3331  * struct cdp_tx_latency_config - configuration for per-link transmit latency
3332  * statistics
3333  * @enable: enable/disable the feature
3334  * @report: enable/disable async report
3335  * @period: statistical period(in ms)
3336  * @granularity: granularity(in microseconds) of the distribution for the types
3337  */
3338 struct cdp_tx_latency_config {
3339 	bool enable;
3340 	bool report;
3341 	uint32_t period;
3342 	uint32_t granularity[CDP_TX_LATENCY_TYPE_MAX];
3343 };
3344 
3345 /**
3346  * struct cdp_tx_latency_stats - per-type transmit latency statistics
3347  * @average: average of the latency(in us) for the type within a cycle
3348  * @granularity: granularity(in us) of the distribution for the type
3349  * @distribution: latency distribution for the type
3350  */
3351 struct cdp_tx_latency_stats {
3352 	uint32_t average;
3353 	uint32_t granularity;
3354 	uint32_t distribution[CDP_TX_LATENCY_DISTR_LV_MAX];
3355 };
3356 
3357 /**
3358  * struct cdp_tx_latency - per-link transmit latency statistics
3359  * @node: list node for membership in the stats list
3360  * @mac_remote: link mac address of remote peer
3361  * @stats: transmit latency statistics for types
3362  */
3363 struct cdp_tx_latency {
3364 	qdf_list_node_t node;
3365 	struct qdf_mac_addr mac_remote;
3366 	struct cdp_tx_latency_stats stats[CDP_TX_LATENCY_TYPE_MAX];
3367 };
3368 
3369 /**
3370  * typedef cdp_tx_latency_cb() - callback for transmit latency
3371  * @vdev_id: vdev id
3372  * @stats_list: list of per-link transmit latency statistics
3373  */
3374 typedef QDF_STATUS(*cdp_tx_latency_cb)(uint8_t vdev_id,
3375 				       qdf_list_t *stats_list);
3376 #endif
3377 #endif
3378