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