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