xref: /wlan-dirver/qca-wifi-host-cmn/dp/inc/cdp_txrx_cmn_struct.h (revision 503663c6daafffe652fa360bde17243568cd6d2a)
1 /*
2  * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19  /**
20  * @file cdp_txrx_cmn_struct.h
21  * @brief Define the host data path converged API functions
22  * called by the host control SW and the OS interface module
23  */
24 #ifndef _CDP_TXRX_CMN_STRUCT_H_
25 #define _CDP_TXRX_CMN_STRUCT_H_
26 
27 /**
28  * For WIN legacy header compilation
29  * Temporary add dummy definitions
30  * should be removed properly WIN legacy code handle
31  */
32 
33 #include "htc_api.h"
34 #include "qdf_types.h"
35 #include "qdf_nbuf.h"
36 #include "qdf_atomic.h"
37 #ifdef DP_MOB_DEFS
38 #include <cdp_txrx_mob_def.h>
39 #endif
40 #include <cdp_txrx_handle.h>
41 #include <cdp_txrx_stats_struct.h>
42 #ifdef WLAN_RX_PKT_CAPTURE_ENH
43 #include "cdp_txrx_extd_struct.h"
44 #endif
45 
46 #ifndef OL_TXRX_NUM_LOCAL_PEER_IDS
47 /*
48  * Each AP will occupy one ID, so it will occupy two IDs for AP-AP mode.
49  * Clients will be assigned max 32 IDs.
50  * STA(associated)/P2P DEV(self-PEER) will get one ID.
51  */
52 #define OL_TXRX_NUM_LOCAL_PEER_IDS (32 + 1 + 1 + 1)
53 #endif
54 
55 #define CDP_BA_256_BIT_MAP_SIZE_DWORDS 8
56 #define CDP_BA_64_BIT_MAP_SIZE_DWORDS 2
57 #define CDP_RSSI_CHAIN_LEN 8
58 
59 #define OL_TXRX_INVALID_PDEV_ID 0xff
60 #define OL_TXRX_INVALID_LOCAL_PEER_ID 0xffff
61 #define CDP_INVALID_VDEV_ID 0xff
62 /* Options for Dump Statistics */
63 #define CDP_HDD_STATS               0
64 #define CDP_TXRX_PATH_STATS         1
65 #define CDP_TXRX_HIST_STATS         2
66 #define CDP_TXRX_TSO_STATS          3
67 #define CDP_HDD_NETIF_OPER_HISTORY  4
68 #define CDP_DUMP_TX_FLOW_POOL_INFO  5
69 #define CDP_TXRX_DESC_STATS         6
70 #define CDP_HIF_STATS               7
71 #define CDP_LRO_STATS               8
72 #define CDP_NAPI_STATS              9
73 #define CDP_WLAN_RX_BUF_DEBUG_STATS 10
74 #define CDP_RX_RING_STATS          11
75 #define CDP_DP_NAPI_STATS          12
76 #define CDP_DP_RX_THREAD_STATS     13
77 #define CDP_SCHEDULER_STATS        21
78 #define CDP_TX_QUEUE_STATS         22
79 #define CDP_BUNDLE_STATS           23
80 #define CDP_CREDIT_STATS           24
81 #define CDP_DISCONNECT_STATS       25
82 
83 #define WME_AC_TO_TID(_ac) (       \
84 		((_ac) == WME_AC_VO) ? 6 : \
85 		((_ac) == WME_AC_VI) ? 5 : \
86 		((_ac) == WME_AC_BK) ? 1 : \
87 		0)
88 
89 #define TID_TO_WME_AC(_tid) (      \
90 		(((_tid) == 0) || ((_tid) == 3)) ? WME_AC_BE : \
91 		(((_tid) == 1) || ((_tid) == 2)) ? WME_AC_BK : \
92 		(((_tid) == 4) || ((_tid) == 5)) ? WME_AC_VI : \
93 		WME_AC_VO)
94 
95 #define CDP_MU_MAX_USERS 37
96 #define CDP_MU_MAX_USER_INDEX (CDP_MU_MAX_USERS - 1)
97 #define CDP_INVALID_PEER 0xffff
98 #define CDP_INVALID_TID	 31
99 #define CDP_INVALID_TX_ENCAP_TYPE	 6
100 #define CDP_INVALID_SEC_TYPE		12
101 
102 #define CDP_DATA_TID_MAX 8
103 #define CDP_DATA_NON_QOS_TID 16
104 
105 #define CDP_NUM_SA_BW 4
106 #define CDP_PERCENT_MACRO 100
107 #define CDP_NUM_KB_IN_MB 1000
108 /*
109  * advance rx monitor filter
110  * */
111 #define MON_FILTER_PASS			0x0001
112 #define MON_FILTER_OTHER		0x0002
113 #define MON_FILTER_ALL			0x0003
114 
115 #define FILTER_MGMT_ALL			0xFFFF
116 #define FILTER_MGMT_ASSOC_REQ		0x0001
117 #define FILTER_MGMT_ASSOC_RES		0x0002
118 #define FILTER_MGMT_REASSOC_REQ		0x0004
119 #define FILTER_MGMT_REASSOC_RES		0x0008
120 #define FILTER_MGMT_PROBE_REQ		0x0010
121 #define FILTER_MGMT_PROBE_RES		0x0020
122 #define FILTER_MGMT_TIM_ADVT		0x0040
123 #define FILTER_MGMT_RESERVED_7		0x0080
124 #define FILTER_MGMT_BEACON		0x0100
125 #define FILTER_MGMT_ATIM		0x0200
126 #define FILTER_MGMT_DISASSOC		0x0400
127 #define FILTER_MGMT_AUTH		0x0800
128 #define FILTER_MGMT_DEAUTH		0x1000
129 #define FILTER_MGMT_ACTION		0x2000
130 #define FILTER_MGMT_ACT_NO_ACK		0x4000
131 #define FILTER_MGMT_RESERVED_15		0x8000
132 
133 #define FILTER_CTRL_ALL			0xFFFF
134 #define FILTER_CTRL_RESERVED_1		0x0001
135 #define FILTER_CTRL_RESERVED_2		0x0002
136 #define FILTER_CTRL_TRIGGER		0x0004
137 #define FILTER_CTRL_RESERVED_4		0x0008
138 #define FILTER_CTRL_BF_REP_POLL		0x0010
139 #define FILTER_CTRL_VHT_NDP		0x0020
140 #define FILTER_CTRL_FRAME_EXT		0x0040
141 #define FILTER_CTRL_CTRLWRAP		0x0080
142 #define FILTER_CTRL_BA_REQ		0x0100
143 #define FILTER_CTRL_BA			0x0200
144 #define FILTER_CTRL_PSPOLL		0x0400
145 #define FILTER_CTRL_RTS			0x0800
146 #define FILTER_CTRL_CTS			0x1000
147 #define FILTER_CTRL_ACK			0x2000
148 #define FILTER_CTRL_CFEND		0x4000
149 #define FILTER_CTRL_CFEND_CFACK		0x8000
150 
151 #define FILTER_DATA_ALL			0xFFFF
152 #define FILTER_DATA_MCAST		0x4000
153 #define FILTER_DATA_UCAST		0x8000
154 #define FILTER_DATA_DATA		0x0001
155 #define FILTER_DATA_NULL		0x0008
156 
157 /*
158  * Multiply rate by 2 to avoid float point
159  * and get rate in units of 500kbps
160  */
161 #define CDP_11B_RATE_0MCS (11 * 2)
162 #define CDP_11B_RATE_1MCS (5.5 * 2)
163 #define CDP_11B_RATE_2MCS (2 * 2)
164 #define CDP_11B_RATE_3MCS (1 * 2)
165 #define CDP_11B_RATE_4MCS (11 * 2)
166 #define CDP_11B_RATE_5MCS (5.5 * 2)
167 #define CDP_11B_RATE_6MCS (2 * 2)
168 
169 #define CDP_11A_RATE_0MCS (48 * 2)
170 #define CDP_11A_RATE_1MCS (24 * 2)
171 #define CDP_11A_RATE_2MCS (12 * 2)
172 #define CDP_11A_RATE_3MCS (6 * 2)
173 #define CDP_11A_RATE_4MCS (54 * 2)
174 #define CDP_11A_RATE_5MCS (36 * 2)
175 #define CDP_11A_RATE_6MCS (18 * 2)
176 #define CDP_11A_RATE_7MCS (9 * 2)
177 
178 #define CDP_LEGACY_MCS0  0
179 #define CDP_LEGACY_MCS1  1
180 #define CDP_LEGACY_MCS2  2
181 #define CDP_LEGACY_MCS3  3
182 #define CDP_LEGACY_MCS4  4
183 #define CDP_LEGACY_MCS5  5
184 #define CDP_LEGACY_MCS6  6
185 #define CDP_LEGACY_MCS7  7
186 
187 QDF_DECLARE_EWMA(tx_lag, 1024, 8)
188 struct cdp_stats_cookie;
189 
190 /*
191  * DP configuration parameters
192  */
193 enum cdp_cfg_param_type {
194 	CDP_CFG_MAX_PEER_ID,
195 	CDP_CFG_CCE_DISABLE,
196 	CDP_CFG_NUM_PARAMS
197 };
198 
199 /*
200  * PPDU TYPE from FW -
201  * @CDP_PPDU_STATS_PPDU_TYPE_SU: single user type
202  * @CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO: multi user mu-mimo
203  * @CDP_PPDU_STATS_PPDU_TYPE_MU_OFDMA: multi user ofdma
204  * @CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA: multi user mu-mimo ofdma
205  * @CDP_PPDU_STATS_PPDU_TYPE_UL_TRIG: ul trigger ppdu
206  * @CDP_PPDU_STATS_PPDU_TYPE_BURST_BCN: burst beacon
207  * @CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP: bsr respond
208  * @CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG: bsr trigger
209  * @CDP_PPDU_STATS_PPDU_TYPE_UL_RESP: ul response
210  * @CDP_PPDU_STATS_PPDU_TYPE_UNKNOWN
211  */
212 enum CDP_PPDU_STATS_PPDU_TYPE {
213 	CDP_PPDU_STATS_PPDU_TYPE_SU = 0,
214 	CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO = 1,
215 	CDP_PPDU_STATS_PPDU_TYPE_MU_OFDMA = 2,
216 	CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA = 4,
217 	CDP_PPDU_STATS_PPDU_TYPE_UL_TRIG = 5,
218 	CDP_PPDU_STATS_PPDU_TYPE_BURST_BCN = 6,
219 	CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP = 7,
220 	CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG = 8,
221 	CDP_PPDU_STATS_PPDU_TYPE_UL_RESP = 9,
222 	CDP_PPDU_STATS_PPDU_TYPE_UNKNOWN = 0x1F,
223 };
224 
225 /*
226  * htt_dbg_stats_type -
227  * bit positions for each stats type within a stats type bitmask
228  * The bitmask contains 24 bits.
229  */
230 enum htt_cmn_dbg_stats_type {
231 	HTT_DBG_CMN_STATS_WAL_PDEV_TXRX      = 0,  /* bit 0 -> 0x1 */
232 	HTT_DBG_CMN_STATS_RX_REORDER         = 1,  /* bit 1 -> 0x2 */
233 	HTT_DBG_CMN_STATS_RX_RATE_INFO       = 2,  /* bit 2 -> 0x4 */
234 	HTT_DBG_CMN_STATS_TX_PPDU_LOG        = 3,  /* bit 3 -> 0x8 */
235 	HTT_DBG_CMN_STATS_TX_RATE_INFO       = 4,  /* bit 4 -> 0x10 */
236 	HTT_DBG_CMN_STATS_TIDQ               = 5,  /* bit 5 -> 0x20 */
237 	HTT_DBG_CMN_STATS_TXBF_INFO          = 6,  /* bit 6 -> 0x40 */
238 	HTT_DBG_CMN_STATS_SND_INFO           = 7,  /* bit 7 -> 0x80 */
239 	HTT_DBG_CMN_STATS_ERROR_INFO         = 8,  /* bit 8  -> 0x100 */
240 	HTT_DBG_CMN_STATS_TX_SELFGEN_INFO    = 9,  /* bit 9  -> 0x200 */
241 	HTT_DBG_CMN_STATS_TX_MU_INFO         = 10, /* bit 10 -> 0x400 */
242 	HTT_DBG_CMN_STATS_SIFS_RESP_INFO     = 11, /* bit 11 -> 0x800 */
243 	HTT_DBG_CMN_STATS_RESET_INFO         = 12, /* bit 12 -> 0x1000 */
244 	HTT_DBG_CMN_STATS_MAC_WDOG_INFO      = 13, /* bit 13 -> 0x2000 */
245 	HTT_DBG_CMN_STATS_TX_DESC_INFO       = 14, /* bit 14 -> 0x4000 */
246 	HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO  = 15, /* bit 15 -> 0x8000 */
247 	HTT_DBG_CMN_STATS_TX_PFSCHED_INFO    = 16, /* bit 16 -> 0x10000 */
248 	HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO = 17, /* bit 17 -> 0x20000 */
249 	/* bits 18-23 currently reserved */
250 
251 	/* keep this last */
252 	HTT_DBG_CMN_NUM_STATS,
253 	HTT_DBG_CMN_NUM_STATS_INVALID        = 31, /* bit 31 -> 0x80000000 */
254 };
255 
256 /*
257  * cdp_host_txrx_stats: Different types of host stats
258  * @TXRX_HOST_STATS_INVALID: Invalid option
259  * @TXRX_RX_RATE_STATS: Rx rate info
260  * @TXRX_TX_RATE_STATS: Tx rate info
261  * @TXRX_TX_HOST_STATS: Print Tx stats
262  * @TXRX_RX_HOST_STATS: Print host Rx stats
263  * @TXRX_CLEAR_STATS: clear all host stats
264  * @TXRX_SRNG_PTR_STATS: Print SRNG pointer stats
265  * @TXRX_RX_MON_STATS: Print monitor mode stats
266  * @TXRX_REO_QUEUE_STATS: Print Per peer REO Queue Stats
267  * @TXRX_SOC_CFG_PARAMS: Print soc cfg params info
268  * @TXRX_PDEV_CFG_PARAMS: Print pdev cfg params info
269  * @TXRX_NAPI_STATS: Print NAPI scheduling statistics
270  * @TXRX_SOC_INTERRUPT_STATS: Print soc interrupt stats
271  */
272 enum cdp_host_txrx_stats {
273 	TXRX_HOST_STATS_INVALID  = -1,
274 	TXRX_CLEAR_STATS     = 0,
275 	TXRX_RX_RATE_STATS   = 1,
276 	TXRX_TX_RATE_STATS   = 2,
277 	TXRX_TX_HOST_STATS   = 3,
278 	TXRX_RX_HOST_STATS   = 4,
279 	TXRX_AST_STATS       = 5,
280 	TXRX_SRNG_PTR_STATS  = 6,
281 	TXRX_RX_MON_STATS    = 7,
282 	TXRX_REO_QUEUE_STATS = 8,
283 	TXRX_SOC_CFG_PARAMS   = 9,
284 	TXRX_PDEV_CFG_PARAMS  = 10,
285 	TXRX_NAPI_STATS       = 11,
286 	TXRX_SOC_INTERRUPT_STATS = 12,
287 	TXRX_HOST_STATS_MAX,
288 };
289 
290 /*
291  * cdp_ppdu_ftype: PPDU Frame Type
292  * @CDP_PPDU_FTYPE_DATA: SU or MU Data Frame
293  * @CDP_PPDU_FTYPE_CTRL: Control/Management Frames
294  * @CDP_PPDU_FTYPE_BAR: SU or MU BAR frames
295 */
296 enum cdp_ppdu_ftype {
297 	CDP_PPDU_FTYPE_CTRL,
298 	CDP_PPDU_FTYPE_DATA,
299 	CDP_PPDU_FTYPE_BAR,
300 	CDP_PPDU_FTYPE_MAX
301 };
302 
303 
304 /**
305  * @brief General specification of the tx frame contents
306  *
307  * @details
308  * for efficiency, the HTT packet type values correspond
309  * to the bit positions of the WAL packet type values, so the
310  * translation is a simple shift operation.
311  */
312 enum htt_cmn_pkt_type {
313 	htt_cmn_pkt_type_raw = 0,
314 	htt_cmn_pkt_type_native_wifi = 1,
315 	htt_cmn_pkt_type_ethernet = 2,
316 	htt_cmn_pkt_type_mgmt = 3,
317 	htt_cmn_pkt_type_eth2 = 4,
318 
319 	/* keep this last */
320 	htt_cmn_pkt_num_types
321 };
322 
323 /**
324  * @General description of HTT received packets status
325  * It is similar to htt_rx_status enum
326  * but is added as a cdp enum can be freely used in OL_IF layer
327  */
328 enum htt_cmn_rx_status {
329 	htt_cmn_rx_status_unknown = 0x0,
330 	htt_cmn_rx_status_ok,
331 	htt_cmn_rx_status_err_fcs,
332 	htt_cmn_rx_status_err_dup,
333 	htt_cmn_rx_status_err_replay,
334 	htt_cmn_rx_status_inv_peer,
335 	htt_cmn_rx_status_ctrl_mgmt_null = 0x08,
336 	htt_cmn_rx_status_tkip_mic_err = 0x09,
337 	htt_cmn_rx_status_decrypt_err = 0x0A,
338 	htt_cmn_rx_status_mpdu_length_err = 0x0B,
339 	htt_cmn_rx_status_err_misc = 0xFF
340 };
341 
342 
343 enum cdp_host_reo_dest_ring {
344     cdp_host_reo_dest_ring_unknown = 0,
345     cdp_host_reo_dest_ring_1 = 1,
346     cdp_host_reo_dest_ring_2 = 2,
347     cdp_host_reo_dest_ring_3 = 3,
348     cdp_host_reo_dest_ring_4 = 4,
349 };
350 
351 enum htt_cmn_t2h_en_stats_type {
352     /* keep this alwyas first */
353     HTT_CMN_T2H_EN_STATS_TYPE_START     = 0,
354 
355     /** ppdu_common_stats is the payload */
356     HTT_CMN_T2H_EN_STATS_TYPE_COMMON    = 1,
357     /** ppdu_sant_stats is the payload */
358     HTT_CMN_T2H_EN_STATS_TYPE_SANT      = 2,
359     /** ppdu_common_stats_v2 is the payload */
360     HTT_CMN_T2H_EN_STATS_TYPE_COMMON_V2 = 3,
361 
362     /* Keep this last */
363     HTT_CMN_T2H_EN_STATS_TYPE_END       = 0x1f,
364 };
365 
366 enum htt_cmn_t2h_en_stats_status {
367     /* Keep this first always */
368     HTT_CMN_T2H_EN_STATS_STATUS_PARTIAL     = 0,
369     HTT_CMN_T2H_EN_STATS_STATUS_PRESENT     = 1,
370     HTT_CMN_T2H_EN_STATS_STATUS_ERROR       = 2,
371     HTT_CMN_T2H_EN_STATS_STATUS_INVALID     = 3,
372 
373 
374     /* keep this always last */
375     HTT_CMN_T2H_EN_STATS_STATUS_SERIES_DONE         = 7,
376 };
377 
378 /**
379  * struct ol_txrx_peer_state - Peer state information
380  */
381 enum ol_txrx_peer_state {
382 	OL_TXRX_PEER_STATE_INVALID,
383 	OL_TXRX_PEER_STATE_DISC,    /* initial state */
384 	OL_TXRX_PEER_STATE_CONN,    /* authentication in progress */
385 	OL_TXRX_PEER_STATE_AUTH,    /* authentication successful */
386 };
387 
388 /**
389  * struct ol_txrx_ast_type - AST entry type information
390  */
391 enum cdp_txrx_ast_entry_type {
392 	CDP_TXRX_AST_TYPE_NONE,	/* static ast entry for connected peer */
393 	CDP_TXRX_AST_TYPE_STATIC, /* static ast entry for connected peer */
394 	CDP_TXRX_AST_TYPE_SELF, /* static ast entry for self peer (STA mode) */
395 	CDP_TXRX_AST_TYPE_WDS,	/* WDS peer ast entry type*/
396 	CDP_TXRX_AST_TYPE_MEC,	/* Multicast echo ast entry type */
397 	CDP_TXRX_AST_TYPE_WDS_HM, /* HM WDS entry */
398 	CDP_TXRX_AST_TYPE_STA_BSS,	 /* BSS entry(STA mode) */
399 	CDP_TXRX_AST_TYPE_DA,	/* AST entry based on Destination address */
400 	CDP_TXRX_AST_TYPE_WDS_HM_SEC, /* HM WDS entry for secondary radio */
401 	CDP_TXRX_AST_TYPE_MAX
402 };
403 
404 /*
405  * cdp_ast_free_status: status passed to callback function before freeing ast
406  * @CDP_TXRX_AST_DELETED - AST is deleted from FW and delete response received
407  * @CDP_TXRX_AST_DELETE_IN_PROGRESS - AST delete command sent to FW and host
408  *                                    is waiting for FW response
409  */
410 enum cdp_ast_free_status {
411 	CDP_TXRX_AST_DELETED,
412 	CDP_TXRX_AST_DELETE_IN_PROGRESS,
413 };
414 
415 /**
416  * txrx_ast_free_cb - callback registered for ast free
417  * @ctrl_soc: control path soc context
418  * @cdp_soc: DP soc context
419  * @cookie: cookie
420  * @cdp_ast_free_status: ast free status
421  */
422 typedef void (*txrx_ast_free_cb)(struct cdp_ctrl_objmgr_psoc *ctrl_soc,
423 				 struct cdp_soc *cdp_soc,
424 				 void *cookie,
425 				 enum cdp_ast_free_status);
426 
427 /**
428  *  struct cdp_ast_entry_info - AST entry information
429  *  @peer_mac_addr: mac address of peer on which AST entry is added
430  *  @type: ast entry type
431  *  @vdev_id: vdev_id
432  *  @pdev_id: pdev_id
433  *  @peer_id: peer_id
434  *
435  *  This structure holds the ast entry information
436  *
437  */
438 struct cdp_ast_entry_info {
439 	uint8_t peer_mac_addr[QDF_MAC_ADDR_SIZE];
440 	enum cdp_txrx_ast_entry_type type;
441 	uint8_t vdev_id;
442 	uint8_t pdev_id;
443 	uint16_t peer_id;
444 };
445 
446 #define MIC_SEQ_CTR_SIZE 6
447 
448 enum cdp_rx_frame_type {
449 	cdp_rx_frame_type_802_11,
450 	cdp_rx_frame_type_802_3,
451 };
452 
453 /**
454  *  struct cdp_rx_mic_err_info - rx mic error information
455  *  @frame_type: frame type - 0 - 802.11 frame
456  *                          - 1 - 802.3 frame
457  *  @data: 802.11 frame
458  *  @ta_mac_addr: transmitter mac address
459  *  @da_mac_addr: destination mac address
460  *  @tsc: sequence number
461  *  @key_id: Key ID
462  *  @multicast: flag for multicast
463  *  @vdev_id: vdev ID
464  *
465  *  This structure holds rx mic error information
466  *
467  */
468 struct cdp_rx_mic_err_info {
469 	uint8_t frame_type;
470 	uint8_t *data;
471 	struct qdf_mac_addr ta_mac_addr;
472 	struct qdf_mac_addr da_mac_addr;
473 	uint8_t tsc[MIC_SEQ_CTR_SIZE];
474 	uint8_t key_id;
475 	bool multicast;
476 	uint16_t vdev_id;
477 };
478 
479 /**
480  * struct cdp_sec_type - security type information
481  */
482 enum cdp_sec_type {
483     cdp_sec_type_none,
484     cdp_sec_type_wep128,
485     cdp_sec_type_wep104,
486     cdp_sec_type_wep40,
487     cdp_sec_type_tkip,
488     cdp_sec_type_tkip_nomic,
489     cdp_sec_type_aes_ccmp,
490     cdp_sec_type_wapi,
491     cdp_sec_type_aes_ccmp_256,
492     cdp_sec_type_aes_gcmp,
493     cdp_sec_type_aes_gcmp_256,
494 
495     /* keep this last! */
496     cdp_num_sec_types
497 };
498 
499 /**
500  *  struct cdp_tx_exception_metadata - Exception path parameters
501  *  @peer_id: Peer id of the peer
502  *  @tid: Transmit Identifier
503  *  @tx_encap_type: Transmit encap type (i.e. Raw, Native Wi-Fi, Ethernet)
504  *  @sec_type: sec_type to be passed to HAL
505  *  @is_tx_sniffer: Indicates if the packet has to be sniffed
506  *  @ppdu_cookie: 16-bit ppdu cookie that has to be replayed back in completions
507  *
508  *  This structure holds the parameters needed in the exception path of tx
509  *
510  */
511 struct cdp_tx_exception_metadata {
512 	uint16_t peer_id;
513 	uint8_t tid;
514 	uint16_t tx_encap_type;
515 	enum cdp_sec_type sec_type;
516 	uint8_t is_tx_sniffer;
517 	uint16_t ppdu_cookie;
518 };
519 
520 typedef struct cdp_soc_t *ol_txrx_soc_handle;
521 
522 /**
523  * ol_txrx_vdev_delete_cb - callback registered during vdev
524  * detach
525  */
526 typedef void (*ol_txrx_vdev_delete_cb)(void *context);
527 
528 /**
529  * ol_txrx_peer_unmap_sync_cb - callback registered during peer detach sync
530  */
531 typedef QDF_STATUS(*ol_txrx_peer_unmap_sync_cb)(uint8_t vdev_id,
532 						 uint32_t peer_id_cnt,
533 						 uint16_t *peer_id_list);
534 
535 /**
536  * ol_txrx_pkt_direction - Packet Direction
537  * @rx_direction: rx path packet
538  * @tx_direction: tx path packet
539  */
540 enum txrx_direction {
541 	rx_direction = 1,
542 	tx_direction = 0,
543 };
544 
545 /**
546  * cdp_capabilities- DP capabilities
547  */
548 enum cdp_capabilities {
549 	CDP_CFG_DP_TSO,
550 	CDP_CFG_DP_LRO,
551 	CDP_CFG_DP_SG,
552 	CDP_CFG_DP_GRO,
553 	CDP_CFG_DP_OL_TX_CSUM,
554 	CDP_CFG_DP_OL_RX_CSUM,
555 	CDP_CFG_DP_RAWMODE,
556 	CDP_CFG_DP_PEER_FLOW_CTRL,
557 };
558 
559 /**
560  * ol_txrx_nbuf_classify - Packet classification object
561  * @peer_id: unique peer identifier from fw
562  * @tid: traffic identifier(could be overridden)
563  * @pkt_tid: traffic identifier(cannot be overridden)
564  * @pkt_tos: ip header tos value
565  * @pkt_dscp: ip header dscp value
566  * @tos: index value in map
567  * @dscp: DSCP_TID map index
568  * @is_mcast: multicast pkt check
569  * @is_eap: eapol pkt check
570  * @is_arp: arp pkt check
571  * @is_tcp: tcp pkt check
572  * @is_dhcp: dhcp pkt check
573  * @is_igmp: igmp pkt check
574  * @is_ipv4: ip version 4 pkt check
575  * @is_ipv6: ip version 6 pkt check
576  */
577 struct ol_txrx_nbuf_classify {
578 	uint16_t peer_id;
579 	uint8_t tid;
580 	uint8_t pkt_tid;
581 	uint8_t pkt_tos;
582 	uint8_t pkt_dscp;
583 	uint8_t tos;
584 	uint8_t dscp;
585 	uint8_t is_mcast;
586 	uint8_t is_eap;
587 	uint8_t is_arp;
588 	uint8_t is_tcp;
589 	uint8_t is_dhcp;
590 	uint8_t is_igmp;
591 	uint8_t is_ipv4;
592 	uint8_t is_ipv6;
593 };
594 
595 /**
596  * ol_osif_vdev_handle - paque handle for OS shim virtual device
597  * object
598  */
599 struct ol_osif_vdev_t;
600 typedef struct ol_osif_vdev_t *ol_osif_vdev_handle;
601 
602 /**
603  * wlan_op_mode - Virtual device operation mode
604  * @wlan_op_mode_unknown: Unknown mode
605  * @wlan_op_mode_ap: AP mode
606  * @wlan_op_mode_ibss: IBSS mode
607  * @wlan_op_mode_sta: STA (client) mode
608  * @wlan_op_mode_monitor: Monitor mode
609  * @wlan_op_mode_ocb: OCB mode
610  */
611 enum wlan_op_mode {
612 	wlan_op_mode_unknown,
613 	wlan_op_mode_ap,
614 	wlan_op_mode_ibss,
615 	wlan_op_mode_sta,
616 	wlan_op_mode_monitor,
617 	wlan_op_mode_ocb,
618 	wlan_op_mode_ndi,
619 };
620 
621 /**
622  * enum wlan_op_subtype - Virtual device subtype
623  * @wlan_op_subtype_none: Subtype not applicable
624  * @wlan_op_subtype_p2p_device: P2P device
625  * @wlan_op_subtye_p2p_cli: P2P Client
626  * @wlan_op_subtype_p2p_go: P2P GO
627  *
628  * This enum lists the subtypes of a particular virtual
629  * device.
630  */
631 enum wlan_op_subtype {
632 	wlan_op_subtype_none,
633 	wlan_op_subtype_p2p_device,
634 	wlan_op_subtype_p2p_cli,
635 	wlan_op_subtype_p2p_go,
636 };
637 
638 /**
639  * connectivity_stats_pkt_status - data pkt type
640  * @PKT_TYPE_REQ: Request packet
641  * @PKT_TYPE_RSP: Response packet
642  * @PKT_TYPE_TX_DROPPED: TX packet dropped
643  * @PKT_TYPE_RX_DROPPED: RX packet dropped
644  * @PKT_TYPE_RX_DELIVERED: RX packet delivered
645  * @PKT_TYPE_RX_REFUSED: RX packet refused
646  * @PKT_TYPE_TX_HOST_FW_SENT: TX packet FW sent
647  * @PKT_TYPE_TX_ACK_CNT:TC packet acked
648  * @PKT_TYPE_NONE: Invalid packet
649  */
650 enum connectivity_stats_pkt_status {
651 	PKT_TYPE_REQ,
652 	PKT_TYPE_RSP,
653 	PKT_TYPE_TX_DROPPED,
654 	PKT_TYPE_RX_DROPPED,
655 	PKT_TYPE_RX_DELIVERED,
656 	PKT_TYPE_RX_REFUSED,
657 	PKT_TYPE_TX_HOST_FW_SENT,
658 	PKT_TYPE_TX_ACK_CNT,
659 	PKT_TYPE_NONE,
660 };
661 
662 /**
663  * ol_txrx_mgmt_tx_cb - tx management delivery notification
664  * callback function
665  */
666 typedef void
667 (*ol_txrx_mgmt_tx_cb)(void *ctxt, qdf_nbuf_t tx_mgmt_frm, int had_error);
668 
669 /**
670  * ol_txrx_data_tx_cb - Function registered with the data path
671  * that is called when tx frames marked as "no free" are
672  * done being transmitted
673  */
674 typedef void
675 (*ol_txrx_data_tx_cb)(void *ctxt, qdf_nbuf_t tx_frm, int had_error);
676 
677 /**
678  * ol_txrx_tx_fp - top-level transmit function
679  * @soc - dp soc handle
680  * @vdev_id - handle to the virtual device object
681  * @msdu_list - list of network buffers
682  */
683 typedef qdf_nbuf_t (*ol_txrx_tx_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
684 				    qdf_nbuf_t msdu_list);
685 
686 /**
687  * ol_txrx_tx_exc_fp - top-level transmit function on exception path
688  * @data_vdev - handle to the virtual device object
689  * @msdu_list - list of network buffers
690  * @tx_exc_metadata - structure that holds parameters to exception path
691  */
692 typedef qdf_nbuf_t (*ol_txrx_tx_exc_fp)(struct cdp_vdev *data_vdev,
693 					qdf_nbuf_t msdu_list,
694 					struct cdp_tx_exception_metadata
695 						*tx_exc_metadata);
696 
697 /**
698  * ol_txrx_completion_fp - top-level transmit function
699  * for tx completion
700  * @skb: skb data
701  * @osif_dev: the virtual device's OS shim object
702  */
703 typedef void (*ol_txrx_completion_fp)(qdf_nbuf_t skb,
704 				      void *osif_dev);
705 /**
706  * ol_txrx_tx_flow_control_fp - tx flow control notification
707  * function from txrx to OS shim
708  * @osif_dev - the virtual device's OS shim object
709  * @tx_resume - tx os q should be resumed or not
710  */
711 typedef void (*ol_txrx_tx_flow_control_fp)(void *osif_dev,
712 					    bool tx_resume);
713 
714 /**
715  * ol_txrx_tx_flow_control_is_pause_fp - is tx paused by flow control
716  * function from txrx to OS shim
717  * @osif_dev - the virtual device's OS shim object
718  *
719  * Return: true if tx is paused by flow control
720  */
721 typedef bool (*ol_txrx_tx_flow_control_is_pause_fp)(void *osif_dev);
722 
723 /**
724  * ol_txrx_rx_fp - receive function to hand batches of data
725  * frames from txrx to OS shim
726  * @data_vdev - handle to the OSIF virtual device object
727  * @msdu_list - list of network buffers
728  */
729 typedef QDF_STATUS(*ol_txrx_rx_fp)(void *osif_dev, qdf_nbuf_t msdu_list);
730 
731 /**
732  * ol_txrx_rx_flush_fp - receive function to hand batches of data
733  * frames from txrx to OS shim
734  * @osif_dev: handle to the OSIF virtual device object
735  * @vdev_id: vdev_if of the packets to be flushed
736  */
737 typedef QDF_STATUS(*ol_txrx_rx_flush_fp)(void *osif_dev, uint8_t vdev_id);
738 
739 /**
740  * ol_txrx_rx_gro_flush_ind - function to send GRO flush indication to stack
741  * for a given RX Context Id.
742  * @osif_dev - handle to the OSIF virtual device object
743  * @rx_ctx_id - Rx context Id for which gro flush should happen
744  */
745 typedef QDF_STATUS(*ol_txrx_rx_gro_flush_ind_fp)(void *osif_dev,
746 						 int rx_ctx_id);
747 
748 /**
749  * ol_txrx_stats_rx_fp - receive function to hand batches of data
750  * frames from txrx to OS shim
751  * @skb: skb data
752  * @osif_dev: the virtual device's OS shim object
753  * @action: data packet type
754  * @pkt_type: packet data type
755  */
756 typedef void (*ol_txrx_stats_rx_fp)(struct sk_buff *skb,
757 		void *osif_dev, enum connectivity_stats_pkt_status action,
758 		uint8_t *pkt_type);
759 
760 /**
761  * ol_txrx_get_key_fp - function to gey key based on keyix and peer
762  * mac address
763  * @osif_dev - the virtual device's OS shim object
764  * @key_buf - pointer to store key
765  * @mac_addr - pointer to mac address
766  * @keyix - key id
767  */
768 typedef QDF_STATUS(*ol_txrx_get_key_fp)(void *osif_dev, uint8_t *key_buf, uint8_t *mac_addr, uint8_t keyix);
769 
770 /**
771  * ol_txrx_rsim_rx_decap_fp - raw mode simulation function to decap the
772  * packets in receive path.
773  * @osif_dev  - the virtual device's OS shim object
774  * @list_head - poniter to head of receive packet queue to decap
775  * @list_tail - poniter to tail of receive packet queue to decap
776  * @peer      - Peer handler
777  */
778 typedef QDF_STATUS(*ol_txrx_rsim_rx_decap_fp)(void *osif_dev,
779 						qdf_nbuf_t *list_head,
780 						qdf_nbuf_t *list_tail,
781 						struct cdp_peer *peer);
782 
783 /* ol_txrx_rx_fp - external tx free function to read per packet stats and
784  *                            free tx buffer externally
785  * @netbuf - tx network buffer
786  */
787 typedef void (*ol_txrx_tx_free_ext_fp)(qdf_nbuf_t netbuf);
788 
789 /**
790  * ol_txrx_rx_check_wai_fp - OSIF WAPI receive function
791 */
792 typedef bool (*ol_txrx_rx_check_wai_fp)(ol_osif_vdev_handle vdev,
793 					    qdf_nbuf_t mpdu_head,
794 					    qdf_nbuf_t mpdu_tail);
795 /**
796  * ol_txrx_rx_mon_fp - OSIF monitor mode receive function for single
797  * MPDU (802.11 format)
798  */
799 typedef void (*ol_txrx_rx_mon_fp)(ol_osif_vdev_handle vdev,
800 					    qdf_nbuf_t mpdu,
801 					    void *rx_status);
802 
803 /**
804  * ol_txrx_proxy_arp_fp - proxy arp function pointer
805 */
806 typedef int (*ol_txrx_proxy_arp_fp)(ol_osif_vdev_handle vdev,
807 					    qdf_nbuf_t netbuf);
808 
809 /*
810  * ol_txrx_mcast_me_fp - function pointer for multicast enhancement
811  */
812 typedef int (*ol_txrx_mcast_me_fp)(ol_osif_vdev_handle vdev,
813 						qdf_nbuf_t netbuf);
814 
815 /**
816  * ol_txrx_stats_callback - statistics notify callback
817  */
818 typedef void (*ol_txrx_stats_callback)(void *ctxt,
819 				       enum htt_cmn_dbg_stats_type type,
820 				       uint8_t *buf, int bytes);
821 
822 /**
823  * ol_txrx_pktdump_cb - callback for packet dump feature
824  */
825 typedef void (*ol_txrx_pktdump_cb)(ol_txrx_soc_handle soc,
826 				   uint8_t pdev_id,
827 				   uint8_t vdev_id,
828 				   qdf_nbuf_t netbuf,
829 				   uint8_t status,
830 				   uint8_t type);
831 
832 /**
833  * ol_txrx_ops - (pointers to) the functions used for tx and rx
834  * data xfer
835  *
836  * There are two portions of these txrx operations.
837  * The rx portion is filled in by OSIF SW before calling
838  * ol_txrx_osif_vdev_register; inside the ol_txrx_osif_vdev_register
839  * the txrx SW stores a copy of these rx function pointers, to use
840  * as it delivers rx data frames to the OSIF SW.
841  * The tx portion is filled in by the txrx SW inside
842  * ol_txrx_osif_vdev_register; when the function call returns,
843  * the OSIF SW stores a copy of these tx functions to use as it
844  * delivers tx data frames to the txrx SW.
845  *
846  * @tx.std -  the tx function pointer for standard data
847  * frames This function pointer is set by the txrx SW
848  * perform host-side transmit operations based on
849  * whether a HL or LL host/target interface is in use.
850  * @tx.flow_control_cb - the transmit flow control
851  * function that is registered by the
852  * OSIF which is called from txrx to
853  * indicate whether the transmit OS
854  * queues should be paused/resumed
855  * @rx.rx - the OS shim rx function to deliver rx data
856  * frames to. This can have different values for
857  * different virtual devices, e.g. so one virtual
858  * device's OS shim directly hands rx frames to the OS,
859  * but another virtual device's OS shim filters out P2P
860  * messages before sending the rx frames to the OS. The
861  * netbufs delivered to the osif_rx function are in the
862  * format specified by the OS to use for tx and rx
863  * frames (either 802.3 or native WiFi). In case RX Threads are enabled, pkts
864  * are given to the thread, instead of the stack via this pointer.
865  * @rx.stack - function to give packets to the stack. Differs from @rx.rx.
866  * In case RX Threads are enabled, this pointer holds the callback to give
867  * packets to the stack.
868  * @rx.rx_gro_flush - GRO flush indication to stack for a given RX CTX ID
869  * @rx.wai_check - the tx function pointer for WAPI frames
870  * @rx.mon - the OS shim rx monitor function to deliver
871  * monitor data to Though in practice, it is probable
872  * that the same function will be used for delivering
873  * rx monitor data for all virtual devices, in theory
874  * each different virtual device can have a different
875  * OS shim function for accepting rx monitor data. The
876  * netbufs delivered to the osif_rx_mon function are in
877  * 802.11 format.  Each netbuf holds a 802.11 MPDU, not
878  * an 802.11 MSDU. Depending on compile-time
879  * configuration, each netbuf may also have a
880  * monitor-mode encapsulation header such as a radiotap
881  * header added before the MPDU contents.
882  * @rx.std - the OS shim rx function to deliver rx data
883  * @proxy_arp - proxy arp function pointer - specified by
884  * OS shim, stored by txrx
885  * @get_key - function pointer to get key of the peer with
886  * specific key index
887  */
888 struct ol_txrx_ops {
889 	/* tx function pointers - specified by txrx, stored by OS shim */
890 	struct {
891 		ol_txrx_tx_fp         tx;
892 		ol_txrx_tx_exc_fp     tx_exception;
893 		ol_txrx_tx_free_ext_fp tx_free_ext;
894 		ol_txrx_completion_fp tx_comp;
895 	} tx;
896 
897 	/* rx function pointers - specified by OS shim, stored by txrx */
898 	struct {
899 		ol_txrx_rx_fp           rx;
900 		ol_txrx_rx_fp           rx_stack;
901 		ol_txrx_rx_flush_fp     rx_flush;
902 		ol_txrx_rx_gro_flush_ind_fp           rx_gro_flush;
903 		ol_txrx_rx_check_wai_fp wai_check;
904 		ol_txrx_rx_mon_fp       mon;
905 		ol_txrx_stats_rx_fp           stats_rx;
906 		ol_txrx_rsim_rx_decap_fp rsim_rx_decap;
907 	} rx;
908 	/* proxy arp function pointer - specified by OS shim, stored by txrx */
909 	ol_txrx_proxy_arp_fp      proxy_arp;
910 	ol_txrx_mcast_me_fp          me_convert;
911 
912 	ol_txrx_get_key_fp  get_key;
913 };
914 
915 /**
916  * ol_txrx_stats_req - specifications of the requested
917  * statistics
918  */
919 struct ol_txrx_stats_req {
920 	uint32_t stats_type_upload_mask;        /* which stats to upload */
921 	uint32_t stats_type_reset_mask; /* which stats to reset */
922 
923 	/* stats will be printed if either print element is set */
924 	struct {
925 		int verbose;    /* verbose stats printout */
926 		int concise;    /* concise stats printout (takes precedence) */
927 	} print;                /* print uploaded stats */
928 
929 	/* stats notify callback will be invoked if fp is non-NULL */
930 	struct {
931 		ol_txrx_stats_callback fp;
932 		void *ctxt;
933 	} callback;
934 
935 	/* stats will be copied into the specified buffer if buf is non-NULL */
936 	struct {
937 		uint8_t *buf;
938 		int byte_limit; /* don't copy more than this */
939 	} copy;
940 
941 	/*
942 	 * If blocking is true, the caller will take the specified semaphore
943 	 * to wait for the stats to be uploaded, and the driver will release
944 	 * the semaphore when the stats are done being uploaded.
945 	 */
946 	struct {
947 		int blocking;
948 		/*Note: this needs to change to some qdf_* type */
949 		qdf_semaphore_t *sem_ptr;
950 	} wait;
951 };
952 
953 
954 /* DP soc struct definition */
955 struct cdp_soc_t {
956 	struct cdp_ops *ops;
957 	struct ol_if_ops *ol_ops;
958 };
959 
960 /*
961  * cdp_pdev_param_type: different types of parameters
962  *			to set values in pdev
963  * @CDP_CONFIG_DEBUG_SNIFFER: Enable debug sniffer feature
964  * @CDP_CONFIG_BPR_ENABLE: Enable bcast probe feature
965  * @CDP_CONFIG_PRIMARY_RADIO: Configure radio as primary
966  * @CDP_CONFIG_ENABLE_PERPKT_TXSTATS: Enable per packet statistics
967  * @CDP_CONFIG_IGMPMLD_OVERRIDE: Override IGMP/MLD
968  * @CDP_CONFIG_IGMPMLD_TID: Configurable TID value when igmmld_override is set
969  * @CDP_CONFIG_ARP_DBG_CONF: Enable ARP debug
970  * @CDP_CONFIG_CAPTURE_LATENCY: Capture time latency
971  * @CDP_INGRESS_STATS: Accumulate ingress statistics
972  * @CDP_OSIF_DROP: Accumulate drops in OSIF layer
973  * @CDP_CONFIG_ENH_RX_CAPTURE: Enable enhanced RX capture
974  */
975 enum cdp_pdev_param_type {
976 	CDP_CONFIG_DEBUG_SNIFFER,
977 	CDP_CONFIG_BPR_ENABLE,
978 	CDP_CONFIG_PRIMARY_RADIO,
979 	CDP_CONFIG_ENABLE_PERPKT_TXSTATS,
980 	CDP_CONFIG_IGMPMLD_OVERRIDE,
981 	CDP_CONFIG_IGMPMLD_TID,
982 	CDP_CONFIG_ARP_DBG_CONF,
983 	CDP_CONFIG_CAPTURE_LATENCY,
984 	CDP_INGRESS_STATS,
985 	CDP_OSIF_DROP,
986 	CDP_CONFIG_ENH_RX_CAPTURE,
987 	CDP_CONFIG_TX_CAPTURE,
988 };
989 
990 /**
991  * cdp_rx_enh_capture_mode - Rx enhanced capture modes
992  * @CDP_RX_ENH_CAPTURE_DISABLED: Disable Rx enhance capture
993  * @CDP_RX_ENH_CAPTURE_MPDU: Enable capture of 128 bytes of each MPDU
994  * @CDP_RX_ENH_CAPTURE_MPDU_MSDU: Enable capture of 128 bytes of each MSDU
995  */
996 enum cdp_rx_enh_capture_mode {
997 	CDP_RX_ENH_CAPTURE_DISABLED = 0,
998 	CDP_RX_ENH_CAPTURE_MPDU,
999 	CDP_RX_ENH_CAPTURE_MPDU_MSDU,
1000 };
1001 
1002 /**
1003  * cdp_rx_enh_capture_peer - Rx enhanced capture peer filtering
1004  * @CDP_RX_ENH_CAPTURE_PEER_DISABLED: Disable Rx ENH capture peer filtering
1005  * @CDP_RX_ENH_CAPTURE_PEER_ENABLED: Enable Rx ENH capture peer filtering
1006  */
1007 enum cdp_rx_enh_capture_peer {
1008 	CDP_RX_ENH_CAPTURE_PEER_DISABLED = 0,
1009 	CDP_RX_ENH_CAPTURE_PEER_ENABLED,
1010 };
1011 
1012 /**
1013  * cdp_tx_enh_capture_mode - Tx enhanced capture modes
1014  * @CDP_TX_ENH_CAPTURE_DISABLED: Disable Tx enhance capture for all peers
1015  * @CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS: Enable tx capture for all peers
1016  * @CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER: Enable/disable per peer as necessary
1017  */
1018 enum cdp_tx_enh_capture_mode {
1019 	CDP_TX_ENH_CAPTURE_DISABLED = 0,
1020 	CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS,
1021 	CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER,
1022 };
1023 
1024 /*
1025  * enum cdp_pdev_bpr_param - different types of parameters
1026  *			     to set value in pdev
1027  * @CDP_BPR_DISABLE: Set bpr to disable state
1028  * @CDP_BPR_ENABLE: set bpr to enable state
1029  *
1030  * Enum indicating bpr state to enable/disable.
1031  */
1032 enum cdp_pdev_bpr_param {
1033 	CDP_BPR_DISABLE,
1034 	CDP_BPR_ENABLE,
1035 };
1036 
1037 /*
1038  * cdp_vdev_param_type: different types of parameters
1039  *			to set values in vdev
1040  * @CDP_ENABLE_NAWDS: set nawds enable/disable
1041  * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement
1042  * @CDP_ENABLE_WDS: wds sta
1043  * @CDP_ENABLE_MEC: MEC enable flags
1044  * @CDP_ENABLE_PROXYSTA: proxy sta
1045  * @CDP_UPDATE_TDLS_FLAGS: tdls link flags
1046  * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable
1047  * @CDP_ENABLE_CIPHER : set cipher type based on security
1048  * @CDP_ENABLE_QWRAP_ISOLATION: qwrap isolation mode
1049  */
1050 enum cdp_vdev_param_type {
1051 	CDP_ENABLE_NAWDS,
1052 	CDP_ENABLE_MCAST_EN,
1053 	CDP_ENABLE_WDS,
1054 	CDP_ENABLE_MEC,
1055 	CDP_ENABLE_DA_WAR,
1056 	CDP_ENABLE_PROXYSTA,
1057 	CDP_UPDATE_TDLS_FLAGS,
1058 	CDP_CFG_WDS_AGING_TIMER,
1059 	CDP_ENABLE_AP_BRIDGE,
1060 	CDP_ENABLE_CIPHER,
1061 	CDP_ENABLE_QWRAP_ISOLATION,
1062 	CDP_UPDATE_MULTIPASS
1063 };
1064 
1065 #define TXRX_FW_STATS_TXSTATS                     1
1066 #define TXRX_FW_STATS_RXSTATS                     2
1067 #define TXRX_FW_STATS_RX_RATE_INFO                3
1068 #define TXRX_FW_STATS_PHYSTATS                    4
1069 #define TXRX_FW_STATS_PHYSTATS_CONCISE            5
1070 #define TXRX_FW_STATS_TX_RATE_INFO                6
1071 #define TXRX_FW_STATS_TID_STATE                   7
1072 #define TXRX_FW_STATS_HOST_STATS                  8
1073 #define TXRX_FW_STATS_CLEAR_HOST_STATS            9
1074 #define TXRX_FW_STATS_CE_STATS                   10
1075 #define TXRX_FW_STATS_VOW_UMAC_COUNTER           11
1076 #define TXRX_FW_STATS_ME_STATS                   12
1077 #define TXRX_FW_STATS_TXBF_INFO                  13
1078 #define TXRX_FW_STATS_SND_INFO                   14
1079 #define TXRX_FW_STATS_ERROR_INFO                 15
1080 #define TXRX_FW_STATS_TX_SELFGEN_INFO            16
1081 #define TXRX_FW_STATS_TX_MU_INFO                 17
1082 #define TXRX_FW_SIFS_RESP_INFO                   18
1083 #define TXRX_FW_RESET_STATS                      19
1084 #define TXRX_FW_MAC_WDOG_STATS                   20
1085 #define TXRX_FW_MAC_DESC_STATS                   21
1086 #define TXRX_FW_MAC_FETCH_MGR_STATS              22
1087 #define TXRX_FW_MAC_PREFETCH_MGR_STATS           23
1088 #define TXRX_FW_STATS_DURATION_INFO              24
1089 #define TXRX_FW_STATS_DURATION_INFO_RESET        25
1090 #define TXRX_FW_HALPHY_STATS                     26
1091 #define TXRX_FW_COEX_STATS                       27
1092 
1093 #define PER_RADIO_FW_STATS_REQUEST 0
1094 #define PER_VDEV_FW_STATS_REQUEST 1
1095 /**
1096  * enum data_stall_log_event_indicator - Module triggering data stall
1097  * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused
1098  * @DATA_STALL_LOG_INDICATOR_HOST_DRIVER: Host driver indicates data stall
1099  * @DATA_STALL_LOG_INDICATOR_FIRMWARE: FW indicates data stall
1100  * @DATA_STALL_LOG_INDICATOR_FRAMEWORK: Framework indicates data stall
1101  *
1102  * Enum indicating the module that indicates data stall event
1103  */
1104 enum data_stall_log_event_indicator {
1105 	DATA_STALL_LOG_INDICATOR_UNUSED,
1106 	DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
1107 	DATA_STALL_LOG_INDICATOR_FIRMWARE,
1108 	DATA_STALL_LOG_INDICATOR_FRAMEWORK,
1109 };
1110 
1111 /**
1112  * enum data_stall_log_event_type - data stall event type
1113  * @DATA_STALL_LOG_NONE
1114  * @DATA_STALL_LOG_FW_VDEV_PAUSE
1115  * @DATA_STALL_LOG_HWSCHED_CMD_FILTER
1116  * @DATA_STALL_LOG_HWSCHED_CMD_FLUSH
1117  * @DATA_STALL_LOG_FW_RX_REFILL_FAILED
1118  * @DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR
1119  * @DATA_STALL_LOG_FW_WDOG_ERRORS
1120  * @DATA_STALL_LOG_BB_WDOG_ERROR
1121  * @DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR
1122  * @DATA_STALL_LOG_HOST_STA_TX_TIMEOUT
1123  * @DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT
1124  * @DATA_STALL_LOG_NUD_FAILURE
1125  *
1126  * Enum indicating data stall event type
1127  */
1128 enum data_stall_log_event_type {
1129 	DATA_STALL_LOG_NONE,
1130 	DATA_STALL_LOG_FW_VDEV_PAUSE,
1131 	DATA_STALL_LOG_HWSCHED_CMD_FILTER,
1132 	DATA_STALL_LOG_HWSCHED_CMD_FLUSH,
1133 	DATA_STALL_LOG_FW_RX_REFILL_FAILED,
1134 	DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR,
1135 	DATA_STALL_LOG_FW_WDOG_ERRORS,
1136 	DATA_STALL_LOG_BB_WDOG_ERROR,
1137 	DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR,
1138 	/* Stall events triggered by host/framework start from 0x100 onwards. */
1139 	DATA_STALL_LOG_HOST_STA_TX_TIMEOUT = 0x100,
1140 	DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,
1141 	DATA_STALL_LOG_NUD_FAILURE,
1142 };
1143 
1144 /**
1145  * enum data_stall_log_recovery_type - data stall recovery type
1146  * @DATA_STALL_LOG_RECOVERY_NONE,
1147  * @DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
1148  * @DATA_STALL_LOG_RECOVERY_TRIGGER_PDR
1149  *
1150  * Enum indicating data stall recovery type
1151  */
1152 enum data_stall_log_recovery_type {
1153 	DATA_STALL_LOG_RECOVERY_NONE = 0,
1154 	DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
1155 	DATA_STALL_LOG_RECOVERY_TRIGGER_PDR,
1156 };
1157 
1158 /**
1159  * struct data_stall_event_info - data stall info
1160  * @indicator: Module triggering data stall
1161  * @data_stall_type: data stall event type
1162  * @vdev_id_bitmap: vdev_id_bitmap
1163  * @pdev_id: pdev id
1164  * @recovery_type: data stall recovery type
1165  */
1166 struct data_stall_event_info {
1167 	uint32_t indicator;
1168 	uint32_t data_stall_type;
1169 	uint32_t vdev_id_bitmap;
1170 	uint32_t pdev_id;
1171 	uint32_t recovery_type;
1172 };
1173 
1174 typedef void (*data_stall_detect_cb)(struct data_stall_event_info *);
1175 
1176 /*
1177  * enum cdp_stats - options for host and firmware
1178  * statistics
1179  * @CDP_TXRX_STATS_1: HTT Pdev tx stats
1180  * @CDP_TXRX_STATS_2: HTT Pdev rx stats
1181  * @CDP_TXRX_STATS_3: HTT Pdev Tx HW Queue stats
1182  * @CDP_TXRX_STATS_4: HTT Pdev Tx HW Sched stats
1183  * @CDP_TXRX_STATS_5: HTT Pdev error stats
1184  * @CDP_TXRX_STATS_6: HTT TQM stats
1185  * @CDP_TXRX_STATS_7: HTT TQM CMDQ stats
1186  * @CDP_TXRX_STATS_8: HTT Tx_de_cmn thread stats
1187  * @CDP_TXRX_STATS_9: HTT Pdev Tx rate stats
1188  * @CDP_TXRX_STATS_10: HTT Pdev Rx rate stats
1189  * @CDP_TXRX_STATS_11: HTT Peer stats
1190  * @CDP_TXRX_STATS_12: HTT Tx Self Gen Info
1191  * @CDP_TXRX_STATS_13: HTT Tx MU HWQ stats
1192  * @CDP_TXRX_STATS_14: HTT Ring interface info stats
1193  * @CDP_TXRX_STATS_15: HTT SRNG info stats
1194  * @CDP_TXRX_STATS_16: HTT SFM info stats
1195  * @CDP_TXRX_STATS_17: HTT Pdev tx mu mimo sched info
1196  * @CDP_TXRX_STATS_18: HTT Peer list details
1197  * @CDP_TXRX_STATS_19: Reserved
1198  * @CDP_TXRX_STATS_20: Reset Host stats
1199  * @CDP_TXRX_STATS_21: Host Rx rate stats
1200  * @CDP_TXRX_STATS_22: Host Tx rate stats
1201  * @CDP_TXRX_STATS_23: Host Tx stats
1202  * @CDP_TXRX_STATS_24: Host Rx stats
1203  * @CDP_TXRX_STATS_25: Host Ast stats
1204  * @CDP_TXRX_STATS_26: Host Head/Tail Pointer stats
1205  * @CDP_TXRX_STATS_27: Host Monitor mode stats
1206  * @CDP_TXRX_STATS_28: Host Peer entry stats
1207  * @CDP_TXRX_STATS_29: Host Soc config params info
1208  * @CDP_TXRX_STATS_30: Host Pdev config params info
1209  * @CDP_TXRX_STATS_31: Host DP Interrupt Stats
1210  */
1211 enum cdp_stats {
1212 	CDP_TXRX_STATS_0  = 0,
1213 	CDP_TXRX_STATS_1,
1214 	CDP_TXRX_STATS_2,
1215 	CDP_TXRX_STATS_3,
1216 	CDP_TXRX_STATS_4,
1217 	CDP_TXRX_STATS_5,
1218 	CDP_TXRX_STATS_6,
1219 	CDP_TXRX_STATS_7,
1220 	CDP_TXRX_STATS_8,
1221 	CDP_TXRX_STATS_9,
1222 	CDP_TXRX_STATS_10,
1223 	CDP_TXRX_STATS_11,
1224 	CDP_TXRX_STATS_12,
1225 	CDP_TXRX_STATS_13,
1226 	CDP_TXRX_STATS_14,
1227 	CDP_TXRX_STATS_15,
1228 	CDP_TXRX_STATS_16,
1229 	CDP_TXRX_STATS_17,
1230 	CDP_TXRX_STATS_18,
1231 	CDP_TXRX_STATS_19,
1232 	CDP_TXRX_STATS_20,
1233 	CDP_TXRX_STATS_21,
1234 	CDP_TXRX_STATS_22,
1235 	CDP_TXRX_STATS_23,
1236 	CDP_TXRX_STATS_24,
1237 	CDP_TXRX_STATS_25,
1238 	CDP_TXRX_STATS_26,
1239 	CDP_TXRX_STATS_27,
1240 	CDP_TXRX_STATS_28,
1241 	CDP_TXRX_STATS_29,
1242 	CDP_TXRX_STATS_30,
1243 	CDP_TXRX_STATS_31,
1244 	CDP_TXRX_STATS_HTT_MAX = 256,
1245 	CDP_TXRX_MAX_STATS = 265,
1246 };
1247 
1248 /*
1249  * Different Stat update types sent to OL_IF
1250  * @UPDATE_PEER_STATS: update peer stats
1251  * @UPDATE_VDEV_STATS: update vdev stats
1252  * @UPDATE_PDE_STATS: Update pdev stats
1253  */
1254 enum cdp_stat_update_type {
1255 	UPDATE_PEER_STATS = 0,
1256 	UPDATE_VDEV_STATS = 1,
1257 	UPDATE_PDEV_STATS = 2,
1258 };
1259 
1260 /*
1261  * struct cdp_tx_sojourn_stats - Tx sojourn stats
1262  * @ppdu_seq_id: ppdu_seq_id from tx completion
1263  * @avg_sojourn_msdu: average sojourn msdu time
1264  * @sum_sojourn_msdu: sum sojourn msdu time
1265  * @num_msdu: number of msdus per ppdu
1266  * @cookie: cookie to be used by upper layer
1267  */
1268 struct cdp_tx_sojourn_stats {
1269 	uint32_t ppdu_seq_id;
1270 	qdf_ewma_tx_lag avg_sojourn_msdu[CDP_DATA_TID_MAX];
1271 	uint32_t sum_sojourn_msdu[CDP_DATA_TID_MAX];
1272 	uint32_t num_msdus[CDP_DATA_TID_MAX];
1273 	struct cdp_stats_cookie *cookie;
1274 };
1275 
1276 /**
1277  * struct cdp_delayed_tx_completion_ppdu_user - Delayed Tx PPDU completion
1278  * per-user information
1279  * @frame_ctrl: frame control field in 802.11 header
1280  * @qos_ctrl: QoS control field in 802.11 header
1281  * @mpdu_tried: number of mpdus tried
1282  * @ltf_size: ltf_size
1283  * @stbc: stbc
1284  * @he_re: he_re (range extension)
1285  * @txbf: txbf
1286  * @bw: Transmission bandwidth
1287  *       <enum 2 transmit_bw_20_MHz>
1288  *       <enum 3 transmit_bw_40_MHz>
1289  *       <enum 4 transmit_bw_80_MHz>
1290  *       <enum 5 transmit_bw_160_MHz>
1291  * @nss: NSS 1,2, ...8
1292  * @mcs: MCS index
1293  * @preamble: preamble
1294  * @gi: guard interval 800/400/1600/3200 ns
1295  * @dcm: dcm
1296  * @ldpc: ldpc
1297  * @ru_start: RU start index
1298  * @ru_tones: RU tones length
1299  * @is_mcast: MCAST or UCAST
1300  * @user_pos: user position
1301  * @mu_group_id: mu group id
1302  */
1303 struct cdp_delayed_tx_completion_ppdu_user {
1304 	uint32_t frame_ctrl:16,
1305 		 qos_ctrl:16;
1306 	uint32_t mpdu_tried_ucast:16,
1307 		mpdu_tried_mcast:16;
1308 	uint32_t ltf_size:2,
1309 		 stbc:1,
1310 		 he_re:1,
1311 		 txbf:4,
1312 		 bw:4,
1313 		 nss:4,
1314 		 mcs:4,
1315 		 preamble:4,
1316 		 gi:4,
1317 		 dcm:1,
1318 		 ldpc:1,
1319 		 delayed_ba:1;
1320 	uint16_t ru_start;
1321 	uint16_t ru_tones;
1322 	bool is_mcast;
1323 	uint32_t user_pos;
1324 	uint32_t mu_group_id;
1325 };
1326 
1327 /**
1328  * struct cdp_tx_completion_ppdu_user - Tx PPDU completion per-user information
1329  * @completion_status: completion status - OK/Filter/Abort/Timeout
1330  * @tid: TID number
1331  * @peer_id: Peer ID
1332  * @ba_size: Block-Ack size
1333  * @frame_ctrl: frame control field in 802.11 header
1334  * @qos_ctrl: QoS control field in 802.11 header
1335  * @mpdu_tried: number of mpdus tried
1336  * @mpdu_success: number of mpdus successfully transmitted
1337  * @long_retries: long retries
1338  * @short_retries: short retries
1339  * @is_ampdu: mpdu aggregate or non-aggregate?
1340  * @success_bytes: bytes successfully transmitted
1341  * @retry_bytes: bytes retried
1342  * @failed_msdus: MSDUs failed transmission
1343  * @duration: user duration in ppdu
1344  * @ltf_size: ltf_size
1345  * @stbc: stbc
1346  * @he_re: he_re (range extension)
1347  * @txbf: txbf
1348  * @bw: Transmission bandwidth
1349  *       <enum 2 transmit_bw_20_MHz>
1350  *       <enum 3 transmit_bw_40_MHz>
1351  *       <enum 4 transmit_bw_80_MHz>
1352  *       <enum 5 transmit_bw_160_MHz>
1353  * @nss: NSS 1,2, ...8
1354  * @mcs: MCS index
1355  * @preamble: preamble
1356  * @gi: guard interval 800/400/1600/3200 ns
1357  * @dcm: dcm
1358  * @ldpc: ldpc
1359  * @delayed_ba: delayed ba bit
1360  * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
1361  * UL_BSR_TRIG/UNKNOWN
1362  * @ba_seq_no: Block Ack sequence number
1363  * @ba_bitmap: Block Ack bitmap
1364  * @start_seqa: Sequence number of first MPDU
1365  * @enq_bitmap: Enqueue MPDU bitmap
1366  * @ru_start: RU start index
1367  * @ru_tones: RU tones length
1368  * @is_mcast: MCAST or UCAST
1369  * @tx_rate: Transmission Rate
1370  * @user_pos: user position
1371  * @mu_group_id: mu group id
1372  * @rix: rate index
1373  * @cookie: cookie to used by upper layer
1374  * @is_ppdu_cookie_valid : Indicates that ppdu_cookie is valid
1375  * @ppdu_cookie: 16-bit ppdu_cookie
1376  * @sa_is_training: smart antenna training packets indication
1377  * @rssi_chain: rssi chain per bandwidth
1378  * @sa_tx_antenna: antenna in which packet is transmitted
1379  * @sa_max_rates: smart antenna tx feedback info max rates
1380  * @sa_goodput: smart antenna tx feedback info goodput
1381  * @current_rate_per: Moving average per
1382  * @last_enq_seq: last equeue sequence number
1383  */
1384 struct cdp_tx_completion_ppdu_user {
1385 	uint32_t completion_status:8,
1386 		 tid:8,
1387 		 peer_id:16;
1388 	uint8_t mac_addr[6];
1389 	uint16_t ba_size;
1390 	uint32_t frame_ctrl:16,
1391 		 qos_ctrl:16;
1392 	uint32_t mpdu_tried_ucast:16,
1393 		mpdu_tried_mcast:16;
1394 	uint16_t mpdu_success:16;
1395 	uint16_t mpdu_failed:16;
1396 	uint32_t long_retries:4,
1397 		 short_retries:4,
1398 		 tx_ratecode:16,
1399 		 is_ampdu:1,
1400 		 ppdu_type:5;
1401 	uint32_t success_bytes;
1402 	uint32_t retry_bytes;
1403 	uint32_t failed_bytes;
1404 	uint32_t success_msdus:16,
1405 		 retry_msdus:16;
1406 	uint32_t failed_msdus:16,
1407 		 duration:16;
1408 	uint32_t ltf_size:2,
1409 		 stbc:1,
1410 		 he_re:1,
1411 		 txbf:4,
1412 		 bw:4,
1413 		 nss:4,
1414 		 mcs:4,
1415 		 preamble:4,
1416 		 gi:4,
1417 		 dcm:1,
1418 		 ldpc:1,
1419 		 delayed_ba:1;
1420 	uint32_t ba_seq_no;
1421 	uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
1422 	uint32_t start_seq;
1423 	uint32_t enq_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
1424 	uint32_t failed_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
1425 	uint32_t num_mpdu:9,
1426 		 num_msdu:16;
1427 	uint32_t tx_duration;
1428 	uint16_t ru_start;
1429 	uint16_t ru_tones;
1430 	bool is_mcast;
1431 	uint32_t tx_rate;
1432 	uint32_t tx_ratekbps;
1433 	/*ack rssi for separate chains*/
1434 	uint32_t ack_rssi[CDP_RSSI_CHAIN_LEN];
1435 	bool ack_rssi_valid;
1436 	uint32_t user_pos;
1437 	uint32_t mu_group_id;
1438 	uint32_t rix;
1439 	struct cdp_stats_cookie *cookie;
1440 	uint8_t is_ppdu_cookie_valid;
1441 	uint16_t ppdu_cookie;
1442 	uint8_t sa_is_training;
1443 	uint32_t rssi_chain[CDP_RSSI_CHAIN_LEN];
1444 	uint32_t sa_tx_antenna;
1445 	/*Max rates for BW: 20MHZ, 40MHZ and 80MHZ and 160MHZ
1446 	 * |---------------------------------------|
1447 	 * | 16 bits | 16 bits | 16 bits | 16 bits |
1448 	 * |   BW-1  |   BW-2  |   BW-3  |   BW-4  |
1449 	 * |      /\  \                            |
1450 	 * |     /  \  \                           |
1451 	 * |    /    \  \                          |
1452 	 * |   /      \  \                         |
1453 	 * |  /        \  \                        |
1454 	 * | /          \  \                       |
1455 	 * |/            \  \                      |
1456 	 * |[11|8]     [5|8] \                     |
1457 	 * | BW1      PADDED  \                    |
1458 	 * |---------------------------------------|
1459 	 */
1460 	uint16_t sa_max_rates[CDP_NUM_SA_BW];
1461 	uint32_t sa_goodput;
1462 	/* below field is used to calculate goodput in non-training period
1463 	 * Note: As host is exposing goodput and hence current_rate_per is
1464 	 * of no use. It is just for Host computation.
1465 	 */
1466 	uint32_t current_rate_per;
1467 	uint32_t last_enq_seq;
1468 };
1469 
1470 /**
1471  * struct cdp_tx_indication_mpdu_info - Tx MPDU completion information
1472  * @ppdu_id: PPDU id
1473  * @duration: user duration in ppdu
1474  * @frame_type: frame type MGMT/CTRL/DATA/BAR
1475  * @frame_ctrl: frame control field in 802.11 header
1476  * @qos_ctrl: QoS control field in 802.11 header
1477  * @tid: TID number
1478  * @num_msdu: number of msdu in MPDU
1479  * @seq_no: Sequence number of first MPDU
1480  * @ltf_size: ltf_size
1481  * @stbc: stbc
1482  * @he_re: he_re (range extension)
1483  * @txbf: txbf
1484  * @bw: Transmission bandwidth
1485  *       <enum 2 transmit_bw_20_MHz>
1486  *       <enum 3 transmit_bw_40_MHz>
1487  *       <enum 4 transmit_bw_80_MHz>
1488  *       <enum 5 transmit_bw_160_MHz>
1489  * @nss: NSS 1,2, ...8
1490  * @mcs: MCS index
1491  * @preamble: preamble
1492  * @gi: guard interval 800/400/1600/3200 ns
1493  * @resp_type: response type
1494  * @mprot_type: medium protection type
1495  * @rts_success: rts success
1496  * @rts failure: rts failure
1497  * @channel: frequency
1498  * @channel_num: channel number
1499  * @ack_rssi: ack rssi
1500  * @ldpc: ldpc
1501  * @tx_rate: Transmission Rate
1502  * @mac_address: peer mac address
1503  * @bss_mac_address: bss mac address
1504  * @ppdu_start_timestamp: TSF at PPDU start
1505  * @ppdu_end_timestamp: TSF at PPDU end
1506  * @ba_start_seq: Block Ack sequence number
1507  * @ba_bitmap: Block Ack bitmap
1508  * @ppdu_cookie: 16-bit ppdu_cookie
1509  * @long_retries: long retries
1510  * @short_retries: short retries
1511  * @completion_status: completion status - OK/Filter/Abort/Timeout
1512  */
1513 struct cdp_tx_indication_mpdu_info {
1514 	uint32_t ppdu_id;
1515 	uint32_t tx_duration;
1516 	uint16_t frame_type;
1517 	uint16_t frame_ctrl;
1518 	uint16_t qos_ctrl;
1519 	uint8_t tid;
1520 	uint32_t num_msdu;
1521 	uint32_t seq_no;
1522 	uint32_t ltf_size:2,
1523 		 he_re:1,
1524 		 txbf:4,
1525 		 bw:4,
1526 		 nss:4,
1527 		 mcs:4,
1528 		 preamble:4,
1529 		 gi:4;
1530 	uint32_t channel;
1531 	uint8_t channel_num;
1532 	uint32_t ack_rssi;
1533 	uint32_t ldpc;
1534 	uint32_t tx_rate;
1535 	uint8_t mac_address[QDF_MAC_ADDR_SIZE];
1536 	uint8_t bss_mac_address[QDF_MAC_ADDR_SIZE];
1537 	uint64_t ppdu_start_timestamp;
1538 	uint64_t ppdu_end_timestamp;
1539 	uint32_t ba_start_seq;
1540 	uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
1541 	uint16_t ppdu_cookie;
1542 	uint16_t long_retries:4,
1543 		 short_retries:4,
1544 		 completion_status:8;
1545 	uint16_t resp_type:4,
1546 		 mprot_type:3,
1547 		 rts_success:1,
1548 		 rts_failure:1;
1549 };
1550 
1551 /**
1552  * struct cdp_tx_indication_info - Tx capture information
1553  * @mpdu_info: Tx MPDU completion information
1554  * @mpdu_nbuf: reconstructed mpdu packet
1555  * @ppdu_desc: tx completion ppdu
1556  */
1557 struct cdp_tx_indication_info {
1558 	struct cdp_tx_indication_mpdu_info mpdu_info;
1559 	qdf_nbuf_t mpdu_nbuf;
1560 	struct cdp_tx_completion_ppdu *ppdu_desc;
1561 };
1562 
1563 /**
1564  * struct cdp_tx_mgmt_comp_info - Tx mgmt comp info
1565  * @ppdu_id: ppdu_id
1566  * @is_sgen_pkt: payload recevied from wmi or htt path
1567  * @retries_count: retries count
1568  * @tx_tsf: 64 bit timestamp
1569  */
1570 struct cdp_tx_mgmt_comp_info {
1571 	uint32_t ppdu_id;
1572 	bool is_sgen_pkt;
1573 	uint16_t retries_count;
1574 	uint64_t tx_tsf;
1575 };
1576 
1577 /**
1578  * struct cdp_tx_completion_ppdu - Tx PPDU completion information
1579  * @completion_status: completion status - OK/Filter/Abort/Timeout
1580  * @ppdu_id: PPDU Id
1581  * @ppdu_seq_id: ppdu sequence id for sojourn stats
1582  * @vdev_id: VAP Id
1583  * @bar_num_users: BA response user count, based on completion common TLV
1584  * @num_users: Number of users
1585  * @pending_retries: pending MPDUs (retries)
1586  * @drop_reason: drop reason from flush status
1587  * @is_flush: is_flush is set based on flush tlv
1588  * @flow_type: tx flow type from flush status
1589  * @queue_type: queue type from flush status
1590  * @num_mpdu: Number of MPDUs in PPDU
1591  * @num_msdu: Number of MSDUs in PPDU
1592  * @frame_type: frame SU or MU
1593  * @htt_frame_type: frame type from htt
1594  * @frame_ctrl: frame control of 80211 header
1595  * @channel: Channel informartion
1596  * @resp_type: response type
1597  * @mprot_type: medium protection type
1598  * @rts_success: rts success
1599  * @rts failure: rts failure
1600  * @phymode: phy mode
1601  * @ack_rssi: RSSI value of last ack packet (units=dB above noise floor)
1602  * @tx_duration: PPDU airtime
1603  * @ppdu_start_timestamp: TSF at PPDU start
1604  * @ppdu_end_timestamp: TSF at PPDU end
1605  * @ack_timestamp: TSF at the reception of ACK
1606  * @delayed_ba: Delayed ba flag
1607  * @beam_change: beam change bit in ppdu for he-information
1608  * @bss_color: 6 bit value for full bss color
1609  * @user: per-User stats (array of per-user structures)
1610  * @mpdu_q: queue of mpdu in a ppdu
1611  * @mpdus: MPDU list based on enqueue sequence bitmap
1612  * @bar_ppdu_id: BAR ppdu_id
1613  * @bar_tx_duration: BAR tx duration
1614  * @bar_ppdu_start_timestamp: BAR start timestamp
1615  * @bar_ppdu_end_timestamp: BAR end timestamp
1616  */
1617 struct cdp_tx_completion_ppdu {
1618 	uint32_t ppdu_id;
1619 	uint32_t ppdu_seq_id;
1620 	uint16_t vdev_id;
1621 	uint16_t bar_num_users;
1622 	uint32_t num_users;
1623 	uint8_t last_usr_index;
1624 	uint32_t pending_retries;
1625 	uint32_t drop_reason;
1626 	uint32_t is_flush:1,
1627 		 flow_type:8,
1628 		 queue_type:8;
1629 	uint32_t num_mpdu:9,
1630 		 num_msdu:16;
1631 	uint16_t frame_type;
1632 	uint16_t htt_frame_type;
1633 	uint16_t frame_ctrl;
1634 	uint16_t channel;
1635 	uint16_t resp_type:4,
1636 		 mprot_type:3,
1637 		 rts_success:1,
1638 		 rts_failure:1;
1639 	uint16_t phy_mode;
1640 	uint32_t ack_rssi;
1641 	uint32_t tx_duration;
1642 	uint64_t ppdu_start_timestamp;
1643 	uint64_t ppdu_end_timestamp;
1644 	uint64_t ack_timestamp;
1645 	bool delayed_ba;
1646 	uint8_t beam_change;
1647 	uint8_t bss_color;
1648 	struct cdp_tx_completion_ppdu_user user[CDP_MU_MAX_USERS];
1649 	qdf_nbuf_queue_t mpdu_q;
1650 	qdf_nbuf_t *mpdus;
1651 	uint32_t bar_ppdu_id;
1652 	uint32_t bar_tx_duration;
1653 	uint32_t bar_ppdu_start_timestamp;
1654 	uint32_t bar_ppdu_end_timestamp;
1655 };
1656 
1657 /**
1658  * struct cdp_dev_stats - Network device stats structure
1659  * @tx_packets: Tx total packets transmitted
1660  * @tx_bytes  : Tx total bytes transmitted
1661  * @tx_errors : Tx error due to FW tx failure, Ring failure DMA etc
1662  * @tx_dropped: Tx dropped is same as tx errors as above
1663  * @rx_packets: Rx total packets transmitted
1664  * @rx_bytes  : Rx total bytes transmitted
1665  * @rx_errors : Rx erros
1666  * @rx_dropped: Rx dropped stats
1667  */
1668 struct cdp_dev_stats {
1669 	uint32_t tx_packets;
1670 	uint32_t tx_bytes;
1671 	uint32_t tx_errors;
1672 	uint32_t tx_dropped;
1673 	uint32_t rx_packets;
1674 	uint32_t rx_bytes;
1675 	uint32_t rx_errors;
1676 	uint32_t rx_dropped;
1677 };
1678 
1679 /**
1680  * struct cdp_rate_stats - Tx/Rx Rate statistics
1681  * @bw: Indicates the BW of the upcoming transmission -
1682  *       <enum 2 transmit_bw_20_MHz>
1683  *       <enum 3 transmit_bw_40_MHz>
1684  *       <enum 4 transmit_bw_80_MHz>
1685  *       <enum 5 transmit_bw_160_MHz>
1686  * @pkt_type: Transmit Packet Type
1687  * @stbc: When set, STBC transmission rate was used
1688  * @ldpc: When set, use LDPC transmission rates
1689  * @sgi: <enum 0     0_8_us_sgi > Legacy normal GI
1690  *       <enum 1     0_4_us_sgi > Legacy short GI
1691  *       <enum 2     1_6_us_sgi > HE related GI
1692  *       <enum 3     3_2_us_sgi > HE
1693  * @mcs: Transmit MCS Rate
1694  * @ofdma: Set when the transmission was an OFDMA transmission
1695  * @tones_in_ru: The number of tones in the RU used.
1696  * @tsf: Lower 32 bits of the TSF (timestamp when ppdu transmission finished)
1697  * @peer_id: Peer ID of the flow or MPDU queue
1698  * @tid: TID of the flow or MPDU queue
1699  */
1700 struct cdp_rate_stats {
1701 	uint32_t rate_stats_info_valid:1,
1702 		 bw:2,
1703 		 pkt_type:4,
1704 		 stbc:1,
1705 		 ldpc:1,
1706 		 sgi:2,
1707 		 mcs:4,
1708 		 ofdma:1,
1709 		 tones_in_ru:12,
1710 		 resvd0:4;
1711 	uint32_t tsf;
1712 	uint16_t peer_id;
1713 	uint8_t tid;
1714 };
1715 
1716 /**
1717  * struct cdp_tx_completion_msdu - Tx MSDU completion descriptor
1718  * @ppdu_id: PPDU to which this MSDU belongs
1719  * @transmit_cnt: Number of times this frame has been transmitted
1720  * @ack_frame_rssi: RSSI of the received ACK or BA frame
1721  * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
1722  * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
1723  * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
1724  * @extd: Extended structure containing rate statistics
1725  */
1726 struct cdp_tx_completion_msdu {
1727 	uint32_t ppdu_id;
1728 	uint8_t transmit_cnt;
1729 	uint32_t ack_frame_rssi:8,
1730 		 resvd0:1,
1731 		 first_msdu:1,
1732 		 last_msdu:1,
1733 		 msdu_part_of_amsdu:1,
1734 		 resvd1:20;
1735 	struct cdp_rate_stats extd;
1736 };
1737 
1738 /**
1739  * struct cdp_rx_stats_ppdu_user -- per user RX stats
1740  * @peer_id: Peer ID
1741  * @vdev_id: VAP ID
1742  * @is_ampdu: mpdu aggregate or non-aggregate?
1743  * @mu_ul_info_valid: MU UL info valid
1744  * @ofdma_ru_start_index: RU index number(0-73)
1745  * @ofdma_ru_width: size of RU in units of 1(26tone)RU
1746  * @nss: NSS 1,2, ...8
1747  * @mcs: MCS index
1748  * @user_index: user ID in multi-user case
1749  * @ast_index: ast index in multi-user case
1750  * @tid: TID number
1751  * @num_msdu: Number of MSDUs in PPDU
1752  * @udp_msdu_count: Number of UDP MSDUs in PPDU
1753  * @tcp_msdu_count: Number of TCP MSDUs in PPDU
1754  * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
1755  * @frame_control: frame control field
1756  * @frame_control_info_valid: frame_control valid
1757  * @data_sequence_control_info_valid: data_sequence_control_info valid
1758  * @first_data_seq_ctrl: Sequence control field of first data frame
1759  * @preamble: preamble
1760  * @ht_flag: ht flag
1761  * @vht_flag: vht flag
1762  * @he_re: he_re (range extension)
1763  * @mpdu_cnt_fcs_ok: Number of MPDUs in PPDU with fcs ok
1764  * @mpdu_cnt_fcs_err: Number of MPDUs in PPDU with fcs err
1765  * @mpdu_fcs_ok_bitmap - MPDU with fcs ok bitmap
1766  * @retried - number of retries
1767  * @mac_addr: Peer MAC Address
1768  */
1769 struct cdp_rx_stats_ppdu_user {
1770 	uint16_t peer_id;
1771 	uint8_t vdev_id;
1772 	bool is_ampdu;
1773 	uint32_t mu_ul_info_valid:1,
1774 		 ofdma_ru_start_index:7,
1775 		 ofdma_ru_width:7,
1776 		 nss:4,
1777 		 mcs:4;
1778 	/* user id */
1779 	uint8_t  user_index;
1780 	uint32_t ast_index;
1781 	uint32_t tid;
1782 	uint32_t num_msdu;
1783 	uint16_t  tcp_msdu_count;
1784 	uint16_t  udp_msdu_count;
1785 	uint16_t  other_msdu_count;
1786 	uint16_t frame_control;
1787 	uint8_t  frame_control_info_valid;
1788 	uint8_t data_sequence_control_info_valid;
1789 	uint16_t first_data_seq_ctrl;
1790 	uint32_t preamble_type;
1791 	uint16_t ht_flags;
1792 	uint16_t vht_flags;
1793 	uint16_t he_flags;
1794 	uint32_t mpdu_cnt_fcs_ok;
1795 	uint32_t mpdu_cnt_fcs_err;
1796 	uint32_t mpdu_fcs_ok_bitmap[QDF_MON_STATUS_MPDU_FCS_BMAP_NWORDS];
1797 	uint32_t mpdu_ok_byte_count;
1798 	uint32_t mpdu_err_byte_count;
1799 	uint32_t retries;
1800 	uint8_t  mac_addr[QDF_MAC_ADDR_SIZE];
1801 };
1802 
1803 /**
1804  * struct cdp_rx_indication_ppdu - Rx PPDU indication structure
1805  * @ppdu_id: PPDU Id
1806  * @is_ampdu: mpdu aggregate or non-aggregate?
1807  * @num_mpdu: Number of MPDUs in PPDU
1808  * @reserved: Reserved bits for future use
1809  * @num_msdu: Number of MSDUs in PPDU
1810  * @udp_msdu_count: Number of UDP MSDUs in PPDU
1811  * @tcp_msdu_count: Number of TCP MSDUs in PPDU
1812  * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
1813  * @duration: PPDU duration
1814  * @tid: TID number
1815  * @peer_id: Peer ID
1816  * @vdev_id: VAP ID
1817  * @mac_addr: Peer MAC Address
1818  * @first_data_seq_ctrl: Sequence control field of first data frame
1819  * @ltf_size: ltf_size
1820  * @stbc: When set, STBC rate was used
1821  * @he_re: he_re (range extension)
1822  * @bw: Bandwidth
1823  *       <enum 0 bw_20_MHz>
1824  *       <enum 1 bw_40_MHz>
1825  *       <enum 2 bw_80_MHz>
1826  *       <enum 3 bw_160_MHz>
1827  * @nss: NSS 1,2, ...8
1828  * @mcs: MCS index
1829  * @preamble: preamble
1830  * @gi: <enum 0     0_8_us_sgi > Legacy normal GI
1831  *       <enum 1     0_4_us_sgi > Legacy short GI
1832  *       <enum 2     1_6_us_sgi > HE related GI
1833  *       <enum 3     3_2_us_sgi > HE
1834  * @dcm: dcm
1835  * @ldpc: ldpc
1836  * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
1837  * UL_BSR_TRIG/UNKNOWN
1838  * @rssi: RSSI value (units = dB above noise floor)
1839  * @timestamp: TSF at the reception of PPDU
1840  * @length: PPDU length
1841  * @channel: Channel informartion
1842  * @lsig_A: L-SIG in 802.11 PHY header
1843  * @frame_ctrl: frame control field
1844  * @rix: rate index
1845  * @rssi_chain: rssi chain per nss per bw
1846  * @cookie: cookie to used by upper layer
1847  * @user: per user stats in MU-user case
1848  * @nf: noise floor
1849  * @per_chain_rssi: rssi per antenna
1850  */
1851 struct cdp_rx_indication_ppdu {
1852 	uint32_t ppdu_id;
1853 	uint16_t is_ampdu:1,
1854 		 num_mpdu:9,
1855 		 reserved:6;
1856 	uint32_t num_msdu;
1857 	uint32_t num_bytes;
1858 	uint16_t udp_msdu_count;
1859 	uint16_t tcp_msdu_count;
1860 	uint16_t other_msdu_count;
1861 	uint16_t duration;
1862 	uint32_t tid:8,
1863 		 peer_id:16;
1864 	uint8_t vdev_id;
1865 	uint8_t mac_addr[6];
1866 	uint16_t first_data_seq_ctrl;
1867 	union {
1868 		uint32_t rate_info;
1869 		struct {
1870 			uint32_t ltf_size:2,
1871 				 stbc:1,
1872 				 he_re:1,
1873 				 bw:4,
1874 				 nss:4,
1875 				 mcs:4,
1876 				 preamble:4,
1877 				 gi:4,
1878 				 dcm:1,
1879 				 ldpc:1,
1880 				 ppdu_type:5;
1881 		};
1882 	} u;
1883 	uint32_t rix;
1884 	uint32_t lsig_a;
1885 	uint32_t rssi;
1886 	uint64_t timestamp;
1887 	uint32_t length;
1888 	uint8_t channel;
1889 	uint8_t beamformed;
1890 
1891 	uint32_t rx_ratekbps;
1892 	uint32_t ppdu_rx_rate;
1893 
1894 	uint32_t retries;
1895 	uint32_t rx_byte_count;
1896 	uint16_t rx_ratecode;
1897 	uint8_t fcs_error_mpdus;
1898 	uint16_t frame_ctrl;
1899 	int8_t rssi_chain[SS_COUNT][MAX_BW];
1900 	struct cdp_stats_cookie *cookie;
1901 	struct cdp_rx_su_evm_info evm_info;
1902 	uint32_t rx_antenna;
1903 	uint8_t num_users;
1904 	struct cdp_rx_stats_ppdu_user user[CDP_MU_MAX_USERS];
1905 	uint32_t nf;
1906 	uint8_t  per_chain_rssi[MAX_CHAIN];
1907 	uint8_t is_mcast_bcast;
1908 };
1909 
1910 /**
1911  * struct cdp_rx_indication_msdu - Rx MSDU info
1912  * @ppdu_id: PPDU to which the MSDU belongs
1913  * @msdu_len: Length of MSDU in bytes
1914  * @ack_frame_rssi: RSSI of the received ACK or BA frame
1915  * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
1916  * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
1917  * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
1918  * @extd: Extended structure containing rate statistics
1919  */
1920 struct cdp_rx_indication_msdu {
1921 	uint32_t ppdu_id;
1922 	uint16_t msdu_len;
1923 	uint32_t ack_frame_rssi:8,
1924 		 resvd0:1,
1925 		 first_msdu:1,
1926 		 last_msdu:1,
1927 		 msdu_part_of_amsdu:1,
1928 		 msdu_part_of_ampdu:1,
1929 		 resvd1:19;
1930 	struct cdp_rate_stats extd;
1931 };
1932 
1933 /**
1934  * struct cdp_config_params - Propagate configuration parameters to datapath
1935  * @tso_enable: Enable/Disable TSO
1936  * @lro_enable: Enable/Disable LRO
1937  * @gro_enable: Enable/Disable GRO
1938  * @flow_steering_enable: Enable/Disable Rx Hash based flow steering
1939  * @tcp_Udp_ChecksumOffload: Enable/Disable tcp-Udp checksum Offload
1940  * @napi_enable: Enable/Disable Napi
1941  * @ipa_enable: Flag indicating if IPA is enabled or not
1942  * @tx_flow_stop_queue_threshold: Value to Pause tx queues
1943  * @tx_flow_start_queue_offset: Available Tx descriptors to unpause
1944  *				tx queue
1945  * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
1946  * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
1947  * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
1948  */
1949 struct cdp_config_params {
1950 	unsigned int tso_enable:1;
1951 	unsigned int lro_enable:1;
1952 	unsigned int gro_enable:1;
1953 	unsigned int flow_steering_enable:1;
1954 	unsigned int tcp_udp_checksumoffload:1;
1955 	unsigned int napi_enable:1;
1956 	unsigned int ipa_enable:1;
1957 	/* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */
1958 	uint8_t tx_flow_stop_queue_threshold;
1959 	uint8_t tx_flow_start_queue_offset;
1960 	uint32_t tx_comp_loop_pkt_limit;
1961 	uint32_t rx_reap_loop_pkt_limit;
1962 	uint32_t rx_hp_oos_update_limit;
1963 
1964 };
1965 
1966 /**
1967  * cdp_txrx_stats_req: stats request wrapper
1968  *	used to pass request information to cdp layer
1969  * @stats: type of stats requested
1970  * @param0: opaque argument 0 to be passed to htt
1971  * @param1: opaque argument 1 to be passed to htt
1972  * @param2: opaque argument 2 to be passed to htt
1973  * @param3: opaque argument 3 to be passed to htt
1974  * @mac id: mac_id
1975  */
1976 struct cdp_txrx_stats_req {
1977 	enum cdp_stats	stats;
1978 	uint32_t	param0;
1979 	uint32_t	param1;
1980 	uint32_t	param2;
1981 	uint32_t	param3;
1982 	uint32_t	cookie_val;
1983 	uint8_t		mac_id;
1984 	char *peer_addr;
1985 };
1986 
1987 /**
1988  * struct cdp_monitor_filter - monitor filter info
1989  * @mode: set filter mode
1990  * @fp_mgmt: set Filter Pass MGMT Configuration
1991  * @fp_ctrl: set Filter Pass CTRL Configuration
1992  * @fp_data: set Filter Pass DATA Configuration
1993  * @mo_mgmt: set Monitor Other MGMT Configuration
1994  * @mo_ctrl: set Monitor Other CTRL Configuration
1995  * @mo_data: set Monitor other DATA Configuration
1996  *
1997  */
1998 struct cdp_monitor_filter {
1999 	uint16_t mode;
2000 	uint16_t fp_mgmt;
2001 	uint16_t fp_ctrl;
2002 	uint16_t fp_data;
2003 	uint16_t mo_mgmt;
2004 	uint16_t mo_ctrl;
2005 	uint16_t mo_data;
2006 };
2007 
2008 /**
2009  * cdp_dp_cfg - dp ini config enum
2010  */
2011 enum cdp_dp_cfg {
2012 	cfg_dp_enable_data_stall,
2013 	cfg_dp_enable_ip_tcp_udp_checksum_offload,
2014 	cfg_dp_tso_enable,
2015 	cfg_dp_lro_enable,
2016 	cfg_dp_gro_enable,
2017 	cfg_dp_tx_flow_start_queue_offset,
2018 	cfg_dp_tx_flow_stop_queue_threshold,
2019 	cfg_dp_ipa_uc_tx_buf_size,
2020 	cfg_dp_ipa_uc_tx_partition_base,
2021 	cfg_dp_ipa_uc_rx_ind_ring_count,
2022 	cfg_dp_enable_flow_steering,
2023 	cfg_dp_reorder_offload_supported,
2024 	cfg_dp_ce_classify_enable,
2025 	cfg_dp_disable_intra_bss_fwd,
2026 };
2027 
2028 /**
2029  * struct cdp_peer_cookie - cookie used when creating peer
2030  * @ctx: context passed to be used by consumer
2031  * @mac_addr: MAC address of peer
2032  * @peer_id: peer id
2033  * @pdev_id: pdev_id
2034  * @cookie: cookie to be used by consumer
2035  */
2036 struct cdp_peer_cookie {
2037 	struct cdp_stats_cookie *ctx;
2038 	uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
2039 	uint8_t peer_id;
2040 	uint8_t pdev_id;
2041 	uint8_t cookie;
2042 };
2043 
2044 /**
2045  * cdp_flow_stats - Per-Flow (5-tuple) statistics
2046  * @msdu_count: number of rx msdus matching this flow
2047  *
2048  * HW also includes msdu_byte_count and timestamp, which
2049  * are not currently tracked in SW.
2050  */
2051 struct cdp_flow_stats {
2052 	uint32_t msdu_count;
2053 };
2054 
2055 /**
2056  * cdp_flow_fst_operation - RX FST operations allowed
2057  */
2058 enum cdp_flow_fst_operation {
2059 	CDP_FLOW_FST_ENTRY_ADD,
2060 	CDP_FLOW_FST_ENTRY_DEL,
2061 	CDP_FLOW_FST_RX_BYPASS_ENABLE,
2062 	CDP_FLOW_FST_RX_BYPASS_DISABLE
2063 };
2064 
2065 /**
2066  * cdp_flow_protocol_type - RX FST supported protocol types, mapped to HW spec
2067  */
2068 enum cdp_flow_protocol_type {
2069 	CDP_FLOW_PROTOCOL_TYPE_TCP = 6,
2070 	CDP_FLOW_PROTOCOL_TYPE_UDP = 17,
2071 };
2072 
2073 /**
2074  * cdp_rx_flow_tuple_info - RX flow tuple info used for addition/deletion
2075  * @dest_ip_127_96: destination IP address bit fields 96-127
2076  * @dest_ip_95_64: destination IP address bit fields 64-95
2077  * @dest_ip_63_32: destination IP address bit fields 32-63
2078  * @dest_ip_31_0: destination IP address bit fields 0-31
2079  * @src_ip_127_96: source IP address bit fields 96-127
2080  * @src_ip_95_64: source IP address bit fields 64-95
2081  * @src_ip_63_32: source IP address bit fields 32-63
2082  * @src_ip_31_0: source IP address bit fields 0-31
2083  * @dest_port: destination port of flow
2084  * @src_port: source port of flow
2085  * @l4_protocol: protocol type in flow (TCP/UDP)
2086  */
2087 struct cdp_rx_flow_tuple_info {
2088 	uint32_t dest_ip_127_96;
2089 	uint32_t dest_ip_95_64;
2090 	uint32_t dest_ip_63_32;
2091 	uint32_t dest_ip_31_0;
2092 	uint32_t src_ip_127_96;
2093 	uint32_t src_ip_95_64;
2094 	uint32_t src_ip_63_32;
2095 	uint32_t src_ip_31_0;
2096 	uint16_t dest_port;
2097 	uint16_t src_port;
2098 	uint16_t l4_protocol;
2099 };
2100 
2101 /**
2102  * cdp_rx_flow_info - RX flow info used for addition/deletion
2103  * @is_addr_ipv4: indicates whether given IP address is IPv4/IPv6
2104  * @op_code: add/delete/enable/disable operation requested
2105  * @flow_tupe_info: structure containing tuple info
2106  * @fse_metadata: metadata to be set in RX flow
2107  */
2108 struct cdp_rx_flow_info {
2109 	bool is_addr_ipv4;
2110 	enum cdp_flow_fst_operation op_code;
2111 	struct cdp_rx_flow_tuple_info flow_tuple_info;
2112 	uint16_t fse_metadata;
2113 };
2114 #endif
2115