xref: /wlan-dirver/qca-wifi-host-cmn/dp/inc/cdp_txrx_cmn_struct.h (revision dd4dc88b837a295134aa9869114a2efee0f4894b)
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 CONFIG_MCL
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_LOCAL_PEER_ID 0xffff
60 #define CDP_INVALID_VDEV_ID 0xff
61 /* Options for Dump Statistics */
62 #define CDP_HDD_STATS               0
63 #define CDP_TXRX_PATH_STATS         1
64 #define CDP_TXRX_HIST_STATS         2
65 #define CDP_TXRX_TSO_STATS          3
66 #define CDP_HDD_NETIF_OPER_HISTORY  4
67 #define CDP_DUMP_TX_FLOW_POOL_INFO  5
68 #define CDP_TXRX_DESC_STATS         6
69 #define CDP_HIF_STATS               7
70 #define CDP_LRO_STATS               8
71 #define CDP_NAPI_STATS              9
72 #define CDP_WLAN_RX_BUF_DEBUG_STATS 10
73 #define CDP_RX_RING_STATS          11
74 #define CDP_DP_NAPI_STATS          12
75 #define CDP_DP_RX_THREAD_STATS     13
76 #define CDP_SCHEDULER_STATS        21
77 #define CDP_TX_QUEUE_STATS         22
78 #define CDP_BUNDLE_STATS           23
79 #define CDP_CREDIT_STATS           24
80 #define CDP_DISCONNECT_STATS       25
81 
82 #define WME_AC_TO_TID(_ac) (       \
83 		((_ac) == WME_AC_VO) ? 6 : \
84 		((_ac) == WME_AC_VI) ? 5 : \
85 		((_ac) == WME_AC_BK) ? 1 : \
86 		0)
87 
88 #define TID_TO_WME_AC(_tid) (      \
89 		(((_tid) == 0) || ((_tid) == 3)) ? WME_AC_BE : \
90 		(((_tid) == 1) || ((_tid) == 2)) ? WME_AC_BK : \
91 		(((_tid) == 4) || ((_tid) == 5)) ? WME_AC_VI : \
92 		WME_AC_VO)
93 
94 #define CDP_MU_MAX_USERS 37
95 #define CDP_MU_MAX_USER_INDEX (CDP_MU_MAX_USERS - 1)
96 #define CDP_INVALID_PEER 0xffff
97 #define CDP_INVALID_TID	 31
98 
99 #define CDP_DATA_TID_MAX 8
100 #define CDP_DATA_NON_QOS_TID 16
101 /*
102  * advance rx monitor filter
103  * */
104 #define MON_FILTER_PASS			0x0001
105 #define MON_FILTER_OTHER		0x0002
106 #define MON_FILTER_ALL			0x0003
107 
108 #define FILTER_MGMT_ALL			0xFFFF
109 #define FILTER_MGMT_ASSOC_REQ		0x0001
110 #define FILTER_MGMT_ASSOC_RES		0x0002
111 #define FILTER_MGMT_REASSOC_REQ		0x0004
112 #define FILTER_MGMT_REASSOC_RES		0x0008
113 #define FILTER_MGMT_PROBE_REQ		0x0010
114 #define FILTER_MGMT_PROBE_RES		0x0020
115 #define FILTER_MGMT_TIM_ADVT		0x0040
116 #define FILTER_MGMT_RESERVED_7		0x0080
117 #define FILTER_MGMT_BEACON		0x0100
118 #define FILTER_MGMT_ATIM		0x0200
119 #define FILTER_MGMT_DISASSOC		0x0400
120 #define FILTER_MGMT_AUTH		0x0800
121 #define FILTER_MGMT_DEAUTH		0x1000
122 #define FILTER_MGMT_ACTION		0x2000
123 #define FILTER_MGMT_ACT_NO_ACK		0x4000
124 #define FILTER_MGMT_RESERVED_15		0x8000
125 
126 #define FILTER_CTRL_ALL			0xFFFF
127 #define FILTER_CTRL_RESERVED_1		0x0001
128 #define FILTER_CTRL_RESERVED_2		0x0002
129 #define FILTER_CTRL_TRIGGER		0x0004
130 #define FILTER_CTRL_RESERVED_4		0x0008
131 #define FILTER_CTRL_BF_REP_POLL		0x0010
132 #define FILTER_CTRL_VHT_NDP		0x0020
133 #define FILTER_CTRL_FRAME_EXT		0x0040
134 #define FILTER_CTRL_CTRLWRAP		0x0080
135 #define FILTER_CTRL_BA_REQ		0x0100
136 #define FILTER_CTRL_BA			0x0200
137 #define FILTER_CTRL_PSPOLL		0x0400
138 #define FILTER_CTRL_RTS			0x0800
139 #define FILTER_CTRL_CTS			0x1000
140 #define FILTER_CTRL_ACK			0x2000
141 #define FILTER_CTRL_CFEND		0x4000
142 #define FILTER_CTRL_CFEND_CFACK		0x8000
143 
144 #define FILTER_DATA_ALL			0xFFFF
145 #define FILTER_DATA_MCAST		0x4000
146 #define FILTER_DATA_UCAST		0x8000
147 #define FILTER_DATA_DATA		0x0001
148 #define FILTER_DATA_NULL		0x0008
149 
150 QDF_DECLARE_EWMA(tx_lag, 1024, 8)
151 struct cdp_stats_cookie;
152 
153 /*
154  * DP configuration parameters
155  */
156 enum cdp_cfg_param_type {
157 	CDP_CFG_MAX_PEER_ID,
158 	CDP_CFG_CCE_DISABLE,
159 	CDP_CFG_NUM_PARAMS
160 };
161 
162 /*
163  * htt_dbg_stats_type -
164  * bit positions for each stats type within a stats type bitmask
165  * The bitmask contains 24 bits.
166  */
167 enum htt_cmn_dbg_stats_type {
168 	HTT_DBG_CMN_STATS_WAL_PDEV_TXRX      = 0,  /* bit 0 -> 0x1 */
169 	HTT_DBG_CMN_STATS_RX_REORDER         = 1,  /* bit 1 -> 0x2 */
170 	HTT_DBG_CMN_STATS_RX_RATE_INFO       = 2,  /* bit 2 -> 0x4 */
171 	HTT_DBG_CMN_STATS_TX_PPDU_LOG        = 3,  /* bit 3 -> 0x8 */
172 	HTT_DBG_CMN_STATS_TX_RATE_INFO       = 4,  /* bit 4 -> 0x10 */
173 	HTT_DBG_CMN_STATS_TIDQ               = 5,  /* bit 5 -> 0x20 */
174 	HTT_DBG_CMN_STATS_TXBF_INFO          = 6,  /* bit 6 -> 0x40 */
175 	HTT_DBG_CMN_STATS_SND_INFO           = 7,  /* bit 7 -> 0x80 */
176 	HTT_DBG_CMN_STATS_ERROR_INFO         = 8,  /* bit 8  -> 0x100 */
177 	HTT_DBG_CMN_STATS_TX_SELFGEN_INFO    = 9,  /* bit 9  -> 0x200 */
178 	HTT_DBG_CMN_STATS_TX_MU_INFO         = 10, /* bit 10 -> 0x400 */
179 	HTT_DBG_CMN_STATS_SIFS_RESP_INFO     = 11, /* bit 11 -> 0x800 */
180 	HTT_DBG_CMN_STATS_RESET_INFO         = 12, /* bit 12 -> 0x1000 */
181 	HTT_DBG_CMN_STATS_MAC_WDOG_INFO      = 13, /* bit 13 -> 0x2000 */
182 	HTT_DBG_CMN_STATS_TX_DESC_INFO       = 14, /* bit 14 -> 0x4000 */
183 	HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO  = 15, /* bit 15 -> 0x8000 */
184 	HTT_DBG_CMN_STATS_TX_PFSCHED_INFO    = 16, /* bit 16 -> 0x10000 */
185 	HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO = 17, /* bit 17 -> 0x20000 */
186 	/* bits 18-23 currently reserved */
187 
188 	/* keep this last */
189 	HTT_DBG_CMN_NUM_STATS,
190 	HTT_DBG_CMN_NUM_STATS_INVALID        = 31, /* bit 31 -> 0x80000000 */
191 };
192 
193 /*
194  * cdp_host_txrx_stats: Different types of host stats
195  * @TXRX_HOST_STATS_INVALID: Invalid option
196  * @TXRX_RX_RATE_STATS: Rx rate info
197  * @TXRX_TX_RATE_STATS: Tx rate info
198  * @TXRX_TX_HOST_STATS: Print Tx stats
199  * @TXRX_RX_HOST_STATS: Print host Rx stats
200  * @TXRX_CLEAR_STATS: clear all host stats
201  * @TXRX_SRNG_PTR_STATS: Print SRNG pointer stats
202  * @TXRX_RX_MON_STATS: Print monitor mode stats
203  * @TXRX_REO_QUEUE_STATS: Print Per peer REO Queue Stats
204  * @TXRX_SOC_CFG_PARAMS: Print soc cfg params info
205  * @TXRX_PDEV_CFG_PARAMS: Print pdev cfg params info
206  * @TXRX_NAPI_STATS: Print NAPI scheduling statistics
207  * @TXRX_SOC_INTERRUPT_STATS: Print soc interrupt stats
208  */
209 enum cdp_host_txrx_stats {
210 	TXRX_HOST_STATS_INVALID  = -1,
211 	TXRX_CLEAR_STATS     = 0,
212 	TXRX_RX_RATE_STATS   = 1,
213 	TXRX_TX_RATE_STATS   = 2,
214 	TXRX_TX_HOST_STATS   = 3,
215 	TXRX_RX_HOST_STATS   = 4,
216 	TXRX_AST_STATS       = 5,
217 	TXRX_SRNG_PTR_STATS  = 6,
218 	TXRX_RX_MON_STATS    = 7,
219 	TXRX_REO_QUEUE_STATS = 8,
220 	TXRX_SOC_CFG_PARAMS   = 9,
221 	TXRX_PDEV_CFG_PARAMS  = 10,
222 	TXRX_NAPI_STATS       = 11,
223 	TXRX_SOC_INTERRUPT_STATS = 12,
224 	TXRX_HOST_STATS_MAX,
225 };
226 
227 /*
228  * cdp_ppdu_ftype: PPDU Frame Type
229  * @CDP_PPDU_FTYPE_DATA: SU or MU Data Frame
230  * @CDP_PPDU_FTYPE_CTRL: Control/Management Frames
231  * @CDP_PPDU_FTYPE_BAR: SU or MU BAR frames
232 */
233 enum cdp_ppdu_ftype {
234 	CDP_PPDU_FTYPE_CTRL,
235 	CDP_PPDU_FTYPE_DATA,
236 	CDP_PPDU_FTYPE_BAR,
237 	CDP_PPDU_FTYPE_MAX
238 };
239 
240 
241 /**
242  * @brief General specification of the tx frame contents
243  *
244  * @details
245  * for efficiency, the HTT packet type values correspond
246  * to the bit positions of the WAL packet type values, so the
247  * translation is a simple shift operation.
248  */
249 enum htt_cmn_pkt_type {
250 	htt_cmn_pkt_type_raw = 0,
251 	htt_cmn_pkt_type_native_wifi = 1,
252 	htt_cmn_pkt_type_ethernet = 2,
253 	htt_cmn_pkt_type_mgmt = 3,
254 	htt_cmn_pkt_type_eth2 = 4,
255 
256 	/* keep this last */
257 	htt_cmn_pkt_num_types
258 };
259 
260 /**
261  * @General description of HTT received packets status
262  * It is similar to htt_rx_status enum
263  * but is added as a cdp enum can be freely used in OL_IF layer
264  */
265 enum htt_cmn_rx_status {
266 	htt_cmn_rx_status_unknown = 0x0,
267 	htt_cmn_rx_status_ok,
268 	htt_cmn_rx_status_err_fcs,
269 	htt_cmn_rx_status_err_dup,
270 	htt_cmn_rx_status_err_replay,
271 	htt_cmn_rx_status_inv_peer,
272 	htt_cmn_rx_status_ctrl_mgmt_null = 0x08,
273 	htt_cmn_rx_status_tkip_mic_err = 0x09,
274 	htt_cmn_rx_status_decrypt_err = 0x0A,
275 	htt_cmn_rx_status_mpdu_length_err = 0x0B,
276 	htt_cmn_rx_status_err_misc = 0xFF
277 };
278 
279 
280 enum cdp_host_reo_dest_ring {
281     cdp_host_reo_dest_ring_unknown = 0,
282     cdp_host_reo_dest_ring_1 = 1,
283     cdp_host_reo_dest_ring_2 = 2,
284     cdp_host_reo_dest_ring_3 = 3,
285     cdp_host_reo_dest_ring_4 = 4,
286 };
287 
288 enum htt_cmn_t2h_en_stats_type {
289     /* keep this alwyas first */
290     HTT_CMN_T2H_EN_STATS_TYPE_START     = 0,
291 
292     /** ppdu_common_stats is the payload */
293     HTT_CMN_T2H_EN_STATS_TYPE_COMMON    = 1,
294     /** ppdu_sant_stats is the payload */
295     HTT_CMN_T2H_EN_STATS_TYPE_SANT      = 2,
296     /** ppdu_common_stats_v2 is the payload */
297     HTT_CMN_T2H_EN_STATS_TYPE_COMMON_V2 = 3,
298 
299     /* Keep this last */
300     HTT_CMN_T2H_EN_STATS_TYPE_END       = 0x1f,
301 };
302 
303 enum htt_cmn_t2h_en_stats_status {
304     /* Keep this first always */
305     HTT_CMN_T2H_EN_STATS_STATUS_PARTIAL     = 0,
306     HTT_CMN_T2H_EN_STATS_STATUS_PRESENT     = 1,
307     HTT_CMN_T2H_EN_STATS_STATUS_ERROR       = 2,
308     HTT_CMN_T2H_EN_STATS_STATUS_INVALID     = 3,
309 
310 
311     /* keep this always last */
312     HTT_CMN_T2H_EN_STATS_STATUS_SERIES_DONE         = 7,
313 };
314 
315 /**
316  * struct ol_txrx_peer_state - Peer state information
317  */
318 enum ol_txrx_peer_state {
319 	OL_TXRX_PEER_STATE_INVALID,
320 	OL_TXRX_PEER_STATE_DISC,    /* initial state */
321 	OL_TXRX_PEER_STATE_CONN,    /* authentication in progress */
322 	OL_TXRX_PEER_STATE_AUTH,    /* authentication successful */
323 };
324 
325 /**
326  * struct ol_txrx_ast_type - AST entry type information
327  */
328 enum cdp_txrx_ast_entry_type {
329 	CDP_TXRX_AST_TYPE_NONE,	/* static ast entry for connected peer */
330 	CDP_TXRX_AST_TYPE_STATIC, /* static ast entry for connected peer */
331 	CDP_TXRX_AST_TYPE_SELF, /* static ast entry for self peer (STA mode) */
332 	CDP_TXRX_AST_TYPE_WDS,	/* WDS peer ast entry type*/
333 	CDP_TXRX_AST_TYPE_MEC,	/* Multicast echo ast entry type */
334 	CDP_TXRX_AST_TYPE_WDS_HM, /* HM WDS entry */
335 	CDP_TXRX_AST_TYPE_STA_BSS,	 /* BSS entry(STA mode) */
336 	CDP_TXRX_AST_TYPE_DA,	/* AST entry based on Destination address */
337 	CDP_TXRX_AST_TYPE_WDS_HM_SEC, /* HM WDS entry for secondary radio */
338 	CDP_TXRX_AST_TYPE_MAX
339 };
340 
341 /*
342  * cdp_ast_free_status: status passed to callback function before freeing ast
343  * @CDP_TXRX_AST_DELETED - AST is deleted from FW and delete response received
344  * @CDP_TXRX_AST_DELETE_IN_PROGRESS - AST delete command sent to FW and host
345  *                                    is waiting for FW response
346  */
347 enum cdp_ast_free_status {
348 	CDP_TXRX_AST_DELETED,
349 	CDP_TXRX_AST_DELETE_IN_PROGRESS,
350 };
351 
352 /**
353  * txrx_ast_free_cb - callback registered for ast free
354  * @ctrl_soc: control path soc context
355  * @cdp_soc: DP soc context
356  * @cookie: cookie
357  * @cdp_ast_free_status: ast free status
358  */
359 typedef void (*txrx_ast_free_cb)(void *ctrl_soc,
360 				 void *cdp_soc,
361 				 void *cookie,
362 				 enum cdp_ast_free_status);
363 
364 /**
365  *  struct cdp_ast_entry_info - AST entry information
366  *  @peer_mac_addr: mac address of peer on which AST entry is added
367  *  @type: ast entry type
368  *  @vdev_id: vdev_id
369  *  @pdev_id: pdev_id
370  *  @peer_id: peer_id
371  *
372  *  This structure holds the ast entry information
373  *
374  */
375 struct cdp_ast_entry_info {
376 	uint8_t peer_mac_addr[QDF_MAC_ADDR_SIZE];
377 	enum cdp_txrx_ast_entry_type type;
378 	uint8_t vdev_id;
379 	uint8_t pdev_id;
380 	uint16_t peer_id;
381 };
382 
383 /**
384  * struct cdp_sec_type - security type information
385  */
386 enum cdp_sec_type {
387     cdp_sec_type_none,
388     cdp_sec_type_wep128,
389     cdp_sec_type_wep104,
390     cdp_sec_type_wep40,
391     cdp_sec_type_tkip,
392     cdp_sec_type_tkip_nomic,
393     cdp_sec_type_aes_ccmp,
394     cdp_sec_type_wapi,
395     cdp_sec_type_aes_ccmp_256,
396     cdp_sec_type_aes_gcmp,
397     cdp_sec_type_aes_gcmp_256,
398 
399     /* keep this last! */
400     cdp_num_sec_types
401 };
402 
403 /**
404  *  struct cdp_tx_exception_metadata - Exception path parameters
405  *  @peer_id: Peer id of the peer
406  *  @tid: Transmit Identifier
407  *  @tx_encap_type: Transmit encap type (i.e. Raw, Native Wi-Fi, Ethernet)
408  *  @sec_type: sec_type to be passed to HAL
409  *
410  *  This structure holds the parameters needed in the exception path of tx
411  *
412  */
413 struct cdp_tx_exception_metadata {
414 	uint16_t peer_id;
415 	uint8_t tid;
416 	uint16_t tx_encap_type;
417 	enum cdp_sec_type sec_type;
418 };
419 
420 typedef struct cdp_soc_t *ol_txrx_soc_handle;
421 
422 /**
423  * ol_txrx_vdev_delete_cb - callback registered during vdev
424  * detach
425  */
426 typedef void (*ol_txrx_vdev_delete_cb)(void *context);
427 
428 /**
429  * ol_txrx_peer_unmap_sync_cb - callback registered during peer detach sync
430  */
431 typedef QDF_STATUS(*ol_txrx_peer_unmap_sync_cb)(uint8_t vdev_id,
432 						 uint32_t peer_id_cnt,
433 						 uint16_t *peer_id_list);
434 
435 /**
436  * ol_txrx_pkt_direction - Packet Direction
437  * @rx_direction: rx path packet
438  * @tx_direction: tx path packet
439  */
440 enum txrx_direction {
441 	rx_direction = 1,
442 	tx_direction = 0,
443 };
444 
445 /**
446  * cdp_capabilities- DP capabilities
447  */
448 enum cdp_capabilities {
449 	CDP_CFG_DP_TSO,
450 	CDP_CFG_DP_LRO,
451 	CDP_CFG_DP_SG,
452 	CDP_CFG_DP_GRO,
453 	CDP_CFG_DP_OL_TX_CSUM,
454 	CDP_CFG_DP_OL_RX_CSUM,
455 	CDP_CFG_DP_RAWMODE,
456 	CDP_CFG_DP_PEER_FLOW_CTRL,
457 };
458 
459 /**
460  * ol_txrx_nbuf_classify - Packet classification object
461  * @peer_id: unique peer identifier from fw
462  * @tid: traffic identifier(could be overridden)
463  * @pkt_tid: traffic identifier(cannot be overridden)
464  * @pkt_tos: ip header tos value
465  * @pkt_dscp: ip header dscp value
466  * @tos: index value in map
467  * @dscp: DSCP_TID map index
468  * @is_mcast: multicast pkt check
469  * @is_eap: eapol pkt check
470  * @is_arp: arp pkt check
471  * @is_tcp: tcp pkt check
472  * @is_dhcp: dhcp pkt check
473  * @is_igmp: igmp pkt check
474  * @is_ipv4: ip version 4 pkt check
475  * @is_ipv6: ip version 6 pkt check
476  */
477 struct ol_txrx_nbuf_classify {
478 	uint16_t peer_id;
479 	uint8_t tid;
480 	uint8_t pkt_tid;
481 	uint8_t pkt_tos;
482 	uint8_t pkt_dscp;
483 	uint8_t tos;
484 	uint8_t dscp;
485 	uint8_t is_mcast;
486 	uint8_t is_eap;
487 	uint8_t is_arp;
488 	uint8_t is_tcp;
489 	uint8_t is_dhcp;
490 	uint8_t is_igmp;
491 	uint8_t is_ipv4;
492 	uint8_t is_ipv6;
493 };
494 
495 /**
496  * ol_osif_vdev_handle - paque handle for OS shim virtual device
497  * object
498  */
499 struct ol_osif_vdev_t;
500 typedef struct ol_osif_vdev_t *ol_osif_vdev_handle;
501 
502 /**
503  * wlan_op_mode - Virtual device operation mode
504  * @wlan_op_mode_unknown: Unknown mode
505  * @wlan_op_mode_ap: AP mode
506  * @wlan_op_mode_ibss: IBSS mode
507  * @wlan_op_mode_sta: STA (client) mode
508  * @wlan_op_mode_monitor: Monitor mode
509  * @wlan_op_mode_ocb: OCB mode
510  */
511 enum wlan_op_mode {
512 	wlan_op_mode_unknown,
513 	wlan_op_mode_ap,
514 	wlan_op_mode_ibss,
515 	wlan_op_mode_sta,
516 	wlan_op_mode_monitor,
517 	wlan_op_mode_ocb,
518 	wlan_op_mode_ndi,
519 };
520 
521 /**
522  * connectivity_stats_pkt_status - data pkt type
523  * @PKT_TYPE_REQ: Request packet
524  * @PKT_TYPE_RSP: Response packet
525  * @PKT_TYPE_TX_DROPPED: TX packet dropped
526  * @PKT_TYPE_RX_DROPPED: RX packet dropped
527  * @PKT_TYPE_RX_DELIVERED: RX packet delivered
528  * @PKT_TYPE_RX_REFUSED: RX packet refused
529  * @PKT_TYPE_TX_HOST_FW_SENT: TX packet FW sent
530  * @PKT_TYPE_TX_ACK_CNT:TC packet acked
531  * @PKT_TYPE_NONE: Invalid packet
532  */
533 enum connectivity_stats_pkt_status {
534 	PKT_TYPE_REQ,
535 	PKT_TYPE_RSP,
536 	PKT_TYPE_TX_DROPPED,
537 	PKT_TYPE_RX_DROPPED,
538 	PKT_TYPE_RX_DELIVERED,
539 	PKT_TYPE_RX_REFUSED,
540 	PKT_TYPE_TX_HOST_FW_SENT,
541 	PKT_TYPE_TX_ACK_CNT,
542 	PKT_TYPE_NONE,
543 };
544 
545 /**
546  * ol_txrx_mgmt_tx_cb - tx management delivery notification
547  * callback function
548  */
549 typedef void
550 (*ol_txrx_mgmt_tx_cb)(void *ctxt, qdf_nbuf_t tx_mgmt_frm, int had_error);
551 
552 /**
553  * ol_txrx_data_tx_cb - Function registered with the data path
554  * that is called when tx frames marked as "no free" are
555  * done being transmitted
556  */
557 typedef void
558 (*ol_txrx_data_tx_cb)(void *ctxt, qdf_nbuf_t tx_frm, int had_error);
559 
560 /**
561  * ol_txrx_tx_fp - top-level transmit function
562  * @data_vdev - handle to the virtual device object
563  * @msdu_list - list of network buffers
564  */
565 typedef qdf_nbuf_t (*ol_txrx_tx_fp)(void *data_vdev,
566 				    qdf_nbuf_t msdu_list);
567 
568 /**
569  * ol_txrx_tx_exc_fp - top-level transmit function on exception path
570  * @data_vdev - handle to the virtual device object
571  * @msdu_list - list of network buffers
572  * @tx_exc_metadata - structure that holds parameters to exception path
573  */
574 typedef qdf_nbuf_t (*ol_txrx_tx_exc_fp)(void *data_vdev,
575 					qdf_nbuf_t msdu_list,
576 					struct cdp_tx_exception_metadata
577 						*tx_exc_metadata);
578 
579 /**
580  * ol_txrx_completion_fp - top-level transmit function
581  * for tx completion
582  * @skb: skb data
583  * @osif_dev: the virtual device's OS shim object
584  */
585 typedef void (*ol_txrx_completion_fp)(qdf_nbuf_t skb,
586 				      void *osif_dev);
587 /**
588  * ol_txrx_tx_flow_control_fp - tx flow control notification
589  * function from txrx to OS shim
590  * @osif_dev - the virtual device's OS shim object
591  * @tx_resume - tx os q should be resumed or not
592  */
593 typedef void (*ol_txrx_tx_flow_control_fp)(void *osif_dev,
594 					    bool tx_resume);
595 
596 /**
597  * ol_txrx_tx_flow_control_is_pause_fp - is tx paused by flow control
598  * function from txrx to OS shim
599  * @osif_dev - the virtual device's OS shim object
600  *
601  * Return: true if tx is paused by flow control
602  */
603 typedef bool (*ol_txrx_tx_flow_control_is_pause_fp)(void *osif_dev);
604 
605 /**
606  * ol_txrx_rx_fp - receive function to hand batches of data
607  * frames from txrx to OS shim
608  * @data_vdev - handle to the OSIF virtual device object
609  * @msdu_list - list of network buffers
610  */
611 typedef QDF_STATUS(*ol_txrx_rx_fp)(void *osif_dev, qdf_nbuf_t msdu_list);
612 
613 /**
614  * ol_txrx_stats_rx_fp - receive function to hand batches of data
615  * frames from txrx to OS shim
616  * @skb: skb data
617  * @osif_dev: the virtual device's OS shim object
618  * @action: data packet type
619  * @pkt_type: packet data type
620  */
621 typedef void (*ol_txrx_stats_rx_fp)(struct sk_buff *skb,
622 		void *osif_dev, enum connectivity_stats_pkt_status action,
623 		uint8_t *pkt_type);
624 
625 /**
626  * ol_txrx_get_key_fp - function to gey key based on keyix and peer
627  * mac address
628  * @osif_dev - the virtual device's OS shim object
629  * @key_buf - pointer to store key
630  * @mac_addr - pointer to mac address
631  * @keyix - key id
632  */
633 typedef QDF_STATUS(*ol_txrx_get_key_fp)(void *osif_dev, uint8_t *key_buf, uint8_t *mac_addr, uint8_t keyix);
634 
635 /**
636  * ol_txrx_rsim_rx_decap_fp - raw mode simulation function to decap the
637  * packets in receive path.
638  * @osif_dev  - the virtual device's OS shim object
639  * @list_head - poniter to head of receive packet queue to decap
640  * @list_tail - poniter to tail of receive packet queue to decap
641  * @peer      - Peer handler
642  */
643 typedef QDF_STATUS(*ol_txrx_rsim_rx_decap_fp)(void *osif_dev,
644 						qdf_nbuf_t *list_head,
645 						qdf_nbuf_t *list_tail,
646 						struct cdp_peer *peer);
647 
648 /* ol_txrx_rx_fp - external tx free function to read per packet stats and
649  *                            free tx buffer externally
650  * @netbuf - tx network buffer
651  */
652 typedef void (*ol_txrx_tx_free_ext_fp)(qdf_nbuf_t netbuf);
653 
654 /**
655  * ol_txrx_rx_check_wai_fp - OSIF WAPI receive function
656 */
657 typedef bool (*ol_txrx_rx_check_wai_fp)(ol_osif_vdev_handle vdev,
658 					    qdf_nbuf_t mpdu_head,
659 					    qdf_nbuf_t mpdu_tail);
660 /**
661  * ol_txrx_rx_mon_fp - OSIF monitor mode receive function for single
662  * MPDU (802.11 format)
663  */
664 typedef void (*ol_txrx_rx_mon_fp)(ol_osif_vdev_handle vdev,
665 					    qdf_nbuf_t mpdu,
666 					    void *rx_status);
667 
668 /**
669  * ol_txrx_proxy_arp_fp - proxy arp function pointer
670 */
671 typedef int (*ol_txrx_proxy_arp_fp)(ol_osif_vdev_handle vdev,
672 					    qdf_nbuf_t netbuf);
673 
674 /*
675  * ol_txrx_mcast_me_fp - function pointer for multicast enhancement
676  */
677 typedef int (*ol_txrx_mcast_me_fp)(ol_osif_vdev_handle vdev,
678 						qdf_nbuf_t netbuf);
679 
680 /**
681  * ol_txrx_stats_callback - statistics notify callback
682  */
683 typedef void (*ol_txrx_stats_callback)(void *ctxt,
684 				       enum htt_cmn_dbg_stats_type type,
685 				       uint8_t *buf, int bytes);
686 
687 /**
688  * ol_txrx_pktdump_cb - callback for packet dump feature
689  */
690 typedef void (*ol_txrx_pktdump_cb)(ol_txrx_soc_handle soc,
691 				struct cdp_vdev *vdev,
692 				qdf_nbuf_t netbuf,
693 				uint8_t status,
694 				uint8_t type);
695 
696 /**
697  * ol_txrx_ops - (pointers to) the functions used for tx and rx
698  * data xfer
699  *
700  * There are two portions of these txrx operations.
701  * The rx portion is filled in by OSIF SW before calling
702  * ol_txrx_osif_vdev_register; inside the ol_txrx_osif_vdev_register
703  * the txrx SW stores a copy of these rx function pointers, to use
704  * as it delivers rx data frames to the OSIF SW.
705  * The tx portion is filled in by the txrx SW inside
706  * ol_txrx_osif_vdev_register; when the function call returns,
707  * the OSIF SW stores a copy of these tx functions to use as it
708  * delivers tx data frames to the txrx SW.
709  *
710  * @tx.std -  the tx function pointer for standard data
711  * frames This function pointer is set by the txrx SW
712  * perform host-side transmit operations based on
713  * whether a HL or LL host/target interface is in use.
714  * @tx.flow_control_cb - the transmit flow control
715  * function that is registered by the
716  * OSIF which is called from txrx to
717  * indicate whether the transmit OS
718  * queues should be paused/resumed
719  * @rx.rx - the OS shim rx function to deliver rx data
720  * frames to. This can have different values for
721  * different virtual devices, e.g. so one virtual
722  * device's OS shim directly hands rx frames to the OS,
723  * but another virtual device's OS shim filters out P2P
724  * messages before sending the rx frames to the OS. The
725  * netbufs delivered to the osif_rx function are in the
726  * format specified by the OS to use for tx and rx
727  * frames (either 802.3 or native WiFi). In case RX Threads are enabled, pkts
728  * are given to the thread, instead of the stack via this pointer.
729  * @rx.stack - function to give packets to the stack. Differs from @rx.rx.
730  * In case RX Threads are enabled, this pointer holds the callback to give
731  * packets to the stack.
732  * @rx.wai_check - the tx function pointer for WAPI frames
733  * @rx.mon - the OS shim rx monitor function to deliver
734  * monitor data to Though in practice, it is probable
735  * that the same function will be used for delivering
736  * rx monitor data for all virtual devices, in theory
737  * each different virtual device can have a different
738  * OS shim function for accepting rx monitor data. The
739  * netbufs delivered to the osif_rx_mon function are in
740  * 802.11 format.  Each netbuf holds a 802.11 MPDU, not
741  * an 802.11 MSDU. Depending on compile-time
742  * configuration, each netbuf may also have a
743  * monitor-mode encapsulation header such as a radiotap
744  * header added before the MPDU contents.
745  * @rx.std - the OS shim rx function to deliver rx data
746  * @proxy_arp - proxy arp function pointer - specified by
747  * OS shim, stored by txrx
748  * @get_key - function pointer to get key of the peer with
749  * specific key index
750  */
751 struct ol_txrx_ops {
752 	/* tx function pointers - specified by txrx, stored by OS shim */
753 	struct {
754 		ol_txrx_tx_fp         tx;
755 		ol_txrx_tx_exc_fp     tx_exception;
756 		ol_txrx_tx_free_ext_fp tx_free_ext;
757 		ol_txrx_completion_fp tx_comp;
758 	} tx;
759 
760 	/* rx function pointers - specified by OS shim, stored by txrx */
761 	struct {
762 		ol_txrx_rx_fp           rx;
763 		ol_txrx_rx_fp           rx_stack;
764 		ol_txrx_rx_check_wai_fp wai_check;
765 		ol_txrx_rx_mon_fp       mon;
766 		ol_txrx_stats_rx_fp           stats_rx;
767 		ol_txrx_rsim_rx_decap_fp rsim_rx_decap;
768 	} rx;
769 	/* proxy arp function pointer - specified by OS shim, stored by txrx */
770 	ol_txrx_proxy_arp_fp      proxy_arp;
771 	ol_txrx_mcast_me_fp          me_convert;
772 
773 	ol_txrx_get_key_fp  get_key;
774 };
775 
776 /**
777  * ol_txrx_stats_req - specifications of the requested
778  * statistics
779  */
780 struct ol_txrx_stats_req {
781 	uint32_t stats_type_upload_mask;        /* which stats to upload */
782 	uint32_t stats_type_reset_mask; /* which stats to reset */
783 
784 	/* stats will be printed if either print element is set */
785 	struct {
786 		int verbose;    /* verbose stats printout */
787 		int concise;    /* concise stats printout (takes precedence) */
788 	} print;                /* print uploaded stats */
789 
790 	/* stats notify callback will be invoked if fp is non-NULL */
791 	struct {
792 		ol_txrx_stats_callback fp;
793 		void *ctxt;
794 	} callback;
795 
796 	/* stats will be copied into the specified buffer if buf is non-NULL */
797 	struct {
798 		uint8_t *buf;
799 		int byte_limit; /* don't copy more than this */
800 	} copy;
801 
802 	/*
803 	 * If blocking is true, the caller will take the specified semaphore
804 	 * to wait for the stats to be uploaded, and the driver will release
805 	 * the semaphore when the stats are done being uploaded.
806 	 */
807 	struct {
808 		int blocking;
809 		/*Note: this needs to change to some qdf_* type */
810 		qdf_semaphore_t *sem_ptr;
811 	} wait;
812 };
813 
814 
815 /* DP soc struct definition */
816 struct cdp_soc_t {
817 	struct cdp_ops *ops;
818 	struct ol_if_ops *ol_ops;
819 };
820 
821 /*
822  * cdp_pdev_param_type: different types of parameters
823  *			to set values in pdev
824  * @CDP_CONFIG_DEBUG_SNIFFER: Enable debug sniffer feature
825  * @CDP_CONFIG_BPR_ENABLE: Enable bcast probe feature
826  * @CDP_CONFIG_PRIMARY_RADIO: Configure radio as primary
827  * @CDP_CONFIG_ENABLE_PERPKT_TXSTATS: Enable per packet statistics
828  * @CDP_CONFIG_IGMPMLD_OVERRIDE: Override IGMP/MLD
829  * @CDP_CONFIG_IGMPMLD_TID: Configurable TID value when igmmld_override is set
830  * @CDP_CONFIG_ARP_DBG_CONF: Enable ARP debug
831  * @CDP_CONFIG_CAPTURE_LATENCY: Capture time latency
832  * @CDP_INGRESS_STATS: Accumulate ingress statistics
833  * @CDP_OSIF_DROP: Accumulate drops in OSIF layer
834  * @CDP_CONFIG_ENH_RX_CAPTURE: Enable enhanced RX capture
835  */
836 enum cdp_pdev_param_type {
837 	CDP_CONFIG_DEBUG_SNIFFER,
838 	CDP_CONFIG_BPR_ENABLE,
839 	CDP_CONFIG_PRIMARY_RADIO,
840 	CDP_CONFIG_ENABLE_PERPKT_TXSTATS,
841 	CDP_CONFIG_IGMPMLD_OVERRIDE,
842 	CDP_CONFIG_IGMPMLD_TID,
843 	CDP_CONFIG_ARP_DBG_CONF,
844 	CDP_CONFIG_CAPTURE_LATENCY,
845 	CDP_INGRESS_STATS,
846 	CDP_OSIF_DROP,
847 	CDP_CONFIG_ENH_RX_CAPTURE,
848 	CDP_CONFIG_TX_CAPTURE,
849 };
850 
851 /**
852  * cdp_rx_enh_capture_mode - Rx enhanced capture modes
853  * @CDP_RX_ENH_CAPTURE_DISABLED: Disable Rx enhance capture
854  * @CDP_RX_ENH_CAPTURE_MPDU: Enable capture of 128 bytes of each MPDU
855  * @CDP_RX_ENH_CAPTURE_MPDU_MSDU: Enable capture of 128 bytes of each MSDU
856  */
857 enum cdp_rx_enh_capture_mode {
858 	CDP_RX_ENH_CAPTURE_DISABLED = 0,
859 	CDP_RX_ENH_CAPTURE_MPDU,
860 	CDP_RX_ENH_CAPTURE_MPDU_MSDU,
861 };
862 
863 /*
864  * enum cdp_pdev_bpr_param - different types of parameters
865  *			     to set value in pdev
866  * @CDP_BPR_DISABLE: Set bpr to disable state
867  * @CDP_BPR_ENABLE: set bpr to enable state
868  *
869  * Enum indicating bpr state to enable/disable.
870  */
871 enum cdp_pdev_bpr_param {
872 	CDP_BPR_DISABLE,
873 	CDP_BPR_ENABLE,
874 };
875 
876 /*
877  * cdp_vdev_param_type: different types of parameters
878  *			to set values in vdev
879  * @CDP_ENABLE_NAWDS: set nawds enable/disable
880  * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement
881  * @CDP_ENABLE_WDS: wds sta
882  * @CDP_ENABLE_MEC: MEC enable flags
883  * @CDP_ENABLE_PROXYSTA: proxy sta
884  * @CDP_UPDATE_TDLS_FLAGS: tdls link flags
885  * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable
886  * @CDP_ENABLE_CIPHER : set cipher type based on security
887  * @CDP_ENABLE_QWRAP_ISOLATION: qwrap isolation mode
888  */
889 enum cdp_vdev_param_type {
890 	CDP_ENABLE_NAWDS,
891 	CDP_ENABLE_MCAST_EN,
892 	CDP_ENABLE_WDS,
893 	CDP_ENABLE_MEC,
894 	CDP_ENABLE_DA_WAR,
895 	CDP_ENABLE_PROXYSTA,
896 	CDP_UPDATE_TDLS_FLAGS,
897 	CDP_CFG_WDS_AGING_TIMER,
898 	CDP_ENABLE_AP_BRIDGE,
899 	CDP_ENABLE_CIPHER,
900 	CDP_ENABLE_QWRAP_ISOLATION
901 };
902 
903 #define TXRX_FW_STATS_TXSTATS                     1
904 #define TXRX_FW_STATS_RXSTATS                     2
905 #define TXRX_FW_STATS_RX_RATE_INFO                3
906 #define TXRX_FW_STATS_PHYSTATS                    4
907 #define TXRX_FW_STATS_PHYSTATS_CONCISE            5
908 #define TXRX_FW_STATS_TX_RATE_INFO                6
909 #define TXRX_FW_STATS_TID_STATE                   7
910 #define TXRX_FW_STATS_HOST_STATS                  8
911 #define TXRX_FW_STATS_CLEAR_HOST_STATS            9
912 #define TXRX_FW_STATS_CE_STATS                   10
913 #define TXRX_FW_STATS_VOW_UMAC_COUNTER           11
914 #define TXRX_FW_STATS_ME_STATS                   12
915 #define TXRX_FW_STATS_TXBF_INFO                  13
916 #define TXRX_FW_STATS_SND_INFO                   14
917 #define TXRX_FW_STATS_ERROR_INFO                 15
918 #define TXRX_FW_STATS_TX_SELFGEN_INFO            16
919 #define TXRX_FW_STATS_TX_MU_INFO                 17
920 #define TXRX_FW_SIFS_RESP_INFO                   18
921 #define TXRX_FW_RESET_STATS                      19
922 #define TXRX_FW_MAC_WDOG_STATS                   20
923 #define TXRX_FW_MAC_DESC_STATS                   21
924 #define TXRX_FW_MAC_FETCH_MGR_STATS              22
925 #define TXRX_FW_MAC_PREFETCH_MGR_STATS           23
926 #define TXRX_FW_STATS_DURATION_INFO              24
927 #define TXRX_FW_STATS_DURATION_INFO_RESET        25
928 #define TXRX_FW_HALPHY_STATS                     26
929 #define TXRX_FW_COEX_STATS                       27
930 
931 #define PER_RADIO_FW_STATS_REQUEST 0
932 #define PER_VDEV_FW_STATS_REQUEST 1
933 /**
934  * enum data_stall_log_event_indicator - Module triggering data stall
935  * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused
936  * @DATA_STALL_LOG_INDICATOR_HOST_DRIVER: Host driver indicates data stall
937  * @DATA_STALL_LOG_INDICATOR_FIRMWARE: FW indicates data stall
938  * @DATA_STALL_LOG_INDICATOR_FRAMEWORK: Framework indicates data stall
939  *
940  * Enum indicating the module that indicates data stall event
941  */
942 enum data_stall_log_event_indicator {
943 	DATA_STALL_LOG_INDICATOR_UNUSED,
944 	DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
945 	DATA_STALL_LOG_INDICATOR_FIRMWARE,
946 	DATA_STALL_LOG_INDICATOR_FRAMEWORK,
947 };
948 
949 /**
950  * enum data_stall_log_event_type - data stall event type
951  * @DATA_STALL_LOG_NONE
952  * @DATA_STALL_LOG_FW_VDEV_PAUSE
953  * @DATA_STALL_LOG_HWSCHED_CMD_FILTER
954  * @DATA_STALL_LOG_HWSCHED_CMD_FLUSH
955  * @DATA_STALL_LOG_FW_RX_REFILL_FAILED
956  * @DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR
957  * @DATA_STALL_LOG_FW_WDOG_ERRORS
958  * @DATA_STALL_LOG_BB_WDOG_ERROR
959  * @DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR
960  * @DATA_STALL_LOG_HOST_STA_TX_TIMEOUT
961  * @DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT
962  * @DATA_STALL_LOG_NUD_FAILURE
963  *
964  * Enum indicating data stall event type
965  */
966 enum data_stall_log_event_type {
967 	DATA_STALL_LOG_NONE,
968 	DATA_STALL_LOG_FW_VDEV_PAUSE,
969 	DATA_STALL_LOG_HWSCHED_CMD_FILTER,
970 	DATA_STALL_LOG_HWSCHED_CMD_FLUSH,
971 	DATA_STALL_LOG_FW_RX_REFILL_FAILED,
972 	DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR,
973 	DATA_STALL_LOG_FW_WDOG_ERRORS,
974 	DATA_STALL_LOG_BB_WDOG_ERROR,
975 	DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR,
976 	/* Stall events triggered by host/framework start from 0x100 onwards. */
977 	DATA_STALL_LOG_HOST_STA_TX_TIMEOUT = 0x100,
978 	DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,
979 	DATA_STALL_LOG_NUD_FAILURE,
980 };
981 
982 /**
983  * enum data_stall_log_recovery_type - data stall recovery type
984  * @DATA_STALL_LOG_RECOVERY_NONE,
985  * @DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
986  * @DATA_STALL_LOG_RECOVERY_TRIGGER_PDR
987  *
988  * Enum indicating data stall recovery type
989  */
990 enum data_stall_log_recovery_type {
991 	DATA_STALL_LOG_RECOVERY_NONE = 0,
992 	DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
993 	DATA_STALL_LOG_RECOVERY_TRIGGER_PDR,
994 };
995 
996 /**
997  * struct data_stall_event_info - data stall info
998  * @indicator: Module triggering data stall
999  * @data_stall_type: data stall event type
1000  * @vdev_id_bitmap: vdev_id_bitmap
1001  * @pdev_id: pdev id
1002  * @recovery_type: data stall recovery type
1003  */
1004 struct data_stall_event_info {
1005 	uint32_t indicator;
1006 	uint32_t data_stall_type;
1007 	uint32_t vdev_id_bitmap;
1008 	uint32_t pdev_id;
1009 	uint32_t recovery_type;
1010 };
1011 
1012 typedef void (*data_stall_detect_cb)(struct data_stall_event_info *);
1013 
1014 /*
1015  * enum cdp_stats - options for host and firmware
1016  * statistics
1017  * @CDP_TXRX_STATS_1: HTT Pdev tx stats
1018  * @CDP_TXRX_STATS_2: HTT Pdev rx stats
1019  * @CDP_TXRX_STATS_3: HTT Pdev Tx HW Queue stats
1020  * @CDP_TXRX_STATS_4: HTT Pdev Tx HW Sched stats
1021  * @CDP_TXRX_STATS_5: HTT Pdev error stats
1022  * @CDP_TXRX_STATS_6: HTT TQM stats
1023  * @CDP_TXRX_STATS_7: HTT TQM CMDQ stats
1024  * @CDP_TXRX_STATS_8: HTT Tx_de_cmn thread stats
1025  * @CDP_TXRX_STATS_9: HTT Pdev Tx rate stats
1026  * @CDP_TXRX_STATS_10: HTT Pdev Rx rate stats
1027  * @CDP_TXRX_STATS_11: HTT Peer stats
1028  * @CDP_TXRX_STATS_12: HTT Tx Self Gen Info
1029  * @CDP_TXRX_STATS_13: HTT Tx MU HWQ stats
1030  * @CDP_TXRX_STATS_14: HTT Ring interface info stats
1031  * @CDP_TXRX_STATS_15: HTT SRNG info stats
1032  * @CDP_TXRX_STATS_16: HTT SFM info stats
1033  * @CDP_TXRX_STATS_17: HTT Pdev tx mu mimo sched info
1034  * @CDP_TXRX_STATS_18: HTT Peer list details
1035  * @CDP_TXRX_STATS_19: Reserved
1036  * @CDP_TXRX_STATS_20: Reset Host stats
1037  * @CDP_TXRX_STATS_21: Host Rx rate stats
1038  * @CDP_TXRX_STATS_22: Host Tx rate stats
1039  * @CDP_TXRX_STATS_23: Host Tx stats
1040  * @CDP_TXRX_STATS_24: Host Rx stats
1041  * @CDP_TXRX_STATS_25: Host Ast stats
1042  * @CDP_TXRX_STATS_26: Host Head/Tail Pointer stats
1043  * @CDP_TXRX_STATS_27: Host Monitor mode stats
1044  * @CDP_TXRX_STATS_28: Host Peer entry stats
1045  * @CDP_TXRX_STATS_29: Host Soc config params info
1046  * @CDP_TXRX_STATS_30: Host Pdev config params info
1047  * @CDP_TXRX_STATS_31: Host DP Interrupt Stats
1048  */
1049 enum cdp_stats {
1050 	CDP_TXRX_STATS_0  = 0,
1051 	CDP_TXRX_STATS_1,
1052 	CDP_TXRX_STATS_2,
1053 	CDP_TXRX_STATS_3,
1054 	CDP_TXRX_STATS_4,
1055 	CDP_TXRX_STATS_5,
1056 	CDP_TXRX_STATS_6,
1057 	CDP_TXRX_STATS_7,
1058 	CDP_TXRX_STATS_8,
1059 	CDP_TXRX_STATS_9,
1060 	CDP_TXRX_STATS_10,
1061 	CDP_TXRX_STATS_11,
1062 	CDP_TXRX_STATS_12,
1063 	CDP_TXRX_STATS_13,
1064 	CDP_TXRX_STATS_14,
1065 	CDP_TXRX_STATS_15,
1066 	CDP_TXRX_STATS_16,
1067 	CDP_TXRX_STATS_17,
1068 	CDP_TXRX_STATS_18,
1069 	CDP_TXRX_STATS_19,
1070 	CDP_TXRX_STATS_20,
1071 	CDP_TXRX_STATS_21,
1072 	CDP_TXRX_STATS_22,
1073 	CDP_TXRX_STATS_23,
1074 	CDP_TXRX_STATS_24,
1075 	CDP_TXRX_STATS_25,
1076 	CDP_TXRX_STATS_26,
1077 	CDP_TXRX_STATS_27,
1078 	CDP_TXRX_STATS_28,
1079 	CDP_TXRX_STATS_29,
1080 	CDP_TXRX_STATS_30,
1081 	CDP_TXRX_STATS_31,
1082 	CDP_TXRX_STATS_HTT_MAX = 256,
1083 	CDP_TXRX_MAX_STATS = 265,
1084 };
1085 
1086 /*
1087  * Different Stat update types sent to OL_IF
1088  * @UPDATE_PEER_STATS: update peer stats
1089  * @UPDATE_VDEV_STATS: update vdev stats
1090  * @UPDATE_PDE_STATS: Update pdev stats
1091  */
1092 enum cdp_stat_update_type {
1093 	UPDATE_PEER_STATS = 0,
1094 	UPDATE_VDEV_STATS = 1,
1095 	UPDATE_PDEV_STATS = 2,
1096 };
1097 
1098 /*
1099  * struct cdp_tx_sojourn_stats - Tx sojourn stats
1100  * @ppdu_seq_id: ppdu_seq_id from tx completion
1101  * @avg_sojourn_msdu: average sojourn msdu time
1102  * @sum_sojourn_msdu: sum sojourn msdu time
1103  * @num_msdu: number of msdus per ppdu
1104  * @cookie: cookie to be used by upper layer
1105  */
1106 struct cdp_tx_sojourn_stats {
1107 	uint32_t ppdu_seq_id;
1108 	qdf_ewma_tx_lag avg_sojourn_msdu[CDP_DATA_TID_MAX];
1109 	uint32_t sum_sojourn_msdu[CDP_DATA_TID_MAX];
1110 	uint32_t num_msdus[CDP_DATA_TID_MAX];
1111 	struct cdp_stats_cookie *cookie;
1112 };
1113 
1114 /**
1115  * struct cdp_tx_completion_ppdu_user - Tx PPDU completion per-user information
1116  * @completion_status: completion status - OK/Filter/Abort/Timeout
1117  * @tid: TID number
1118  * @peer_id: Peer ID
1119  * @frame_ctrl: frame control field in 802.11 header
1120  * @qos_ctrl: QoS control field in 802.11 header
1121  * @mpdu_tried: number of mpdus tried
1122  * @mpdu_success: number of mpdus successfully transmitted
1123  * @long_retries: long retries
1124  * @short_retries: short retries
1125  * @is_ampdu: mpdu aggregate or non-aggregate?
1126  * @success_bytes: bytes successfully transmitted
1127  * @retry_bytes: bytes retried
1128  * @failed_msdus: MSDUs failed transmission
1129  * @duration: user duration in ppdu
1130  * @ltf_size: ltf_size
1131  * @stbc: stbc
1132  * @he_re: he_re (range extension)
1133  * @txbf: txbf
1134  * @bw: Transmission bandwidth
1135  *       <enum 2 transmit_bw_20_MHz>
1136  *       <enum 3 transmit_bw_40_MHz>
1137  *       <enum 4 transmit_bw_80_MHz>
1138  *       <enum 5 transmit_bw_160_MHz>
1139  * @nss: NSS 1,2, ...8
1140  * @mcs: MCS index
1141  * @preamble: preamble
1142  * @gi: guard interval 800/400/1600/3200 ns
1143  * @dcm: dcm
1144  * @ldpc: ldpc
1145  * @delayed_ba: delayed ba bit
1146  * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
1147  * UL_BSR_TRIG/UNKNOWN
1148  * @ba_seq_no: Block Ack sequence number
1149  * @ba_bitmap: Block Ack bitmap
1150  * @start_seqa: Sequence number of first MPDU
1151  * @enq_bitmap: Enqueue MPDU bitmap
1152  * @ru_start: RU start index
1153  * @ru_tones: RU tones length
1154  * @is_mcast: MCAST or UCAST
1155  * @tx_rate: Transmission Rate
1156  * @user_pos: user position
1157  * @mu_group_id: mu group id
1158  * @rix: rate index
1159  * @cookie: cookie to used by upper layer
1160  */
1161 struct cdp_tx_completion_ppdu_user {
1162 	uint32_t completion_status:8,
1163 		 tid:8,
1164 		 peer_id:16;
1165 	uint8_t mac_addr[6];
1166 	uint32_t frame_ctrl:16,
1167 		 qos_ctrl:16;
1168 	uint32_t mpdu_tried_ucast:16,
1169 		mpdu_tried_mcast:16;
1170 	uint16_t mpdu_success:16;
1171 	uint16_t mpdu_failed:16;
1172 	uint32_t long_retries:4,
1173 		 short_retries:4,
1174 		 tx_ratecode:8,
1175 		 is_ampdu:1,
1176 		 ppdu_type:5;
1177 	uint32_t success_bytes;
1178 	uint32_t retry_bytes;
1179 	uint32_t failed_bytes;
1180 	uint32_t success_msdus:16,
1181 		 retry_msdus:16;
1182 	uint32_t failed_msdus:16,
1183 		 duration:16;
1184 	uint32_t ltf_size:2,
1185 		 stbc:1,
1186 		 he_re:1,
1187 		 txbf:4,
1188 		 bw:4,
1189 		 nss:4,
1190 		 mcs:4,
1191 		 preamble:4,
1192 		 gi:4,
1193 		 dcm:1,
1194 		 ldpc:1,
1195 		 delayed_ba:1;
1196 	uint32_t ba_seq_no;
1197 	uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
1198 	uint32_t start_seq;
1199 	uint32_t enq_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
1200 	uint32_t failed_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
1201 	uint32_t num_mpdu:9,
1202 		 num_msdu:16;
1203 	uint32_t tx_duration;
1204 	uint16_t ru_start;
1205 	uint16_t ru_tones;
1206 	bool is_mcast;
1207 	uint32_t tx_rate;
1208 	uint32_t tx_ratekbps;
1209 	/*ack rssi for separate chains*/
1210 	uint32_t ack_rssi[CDP_RSSI_CHAIN_LEN];
1211 	bool ack_rssi_valid;
1212 	uint32_t user_pos;
1213 	uint32_t mu_group_id;
1214 	uint32_t rix;
1215 	struct cdp_stats_cookie *cookie;
1216 };
1217 
1218 /**
1219  * struct cdp_tx_indication_mpdu_info - Tx MPDU completion information
1220  * @ppdu_id: PPDU id
1221  * @duration: user duration in ppdu
1222  * @frame_type: frame type MGMT/CTRL/DATA/BAR
1223  * @frame_ctrl: frame control field in 802.11 header
1224  * @qos_ctrl: QoS control field in 802.11 header
1225  * @tid: TID number
1226  * @num_msdu: number of msdu in MPDU
1227  * @seq_no: Sequence number of first MPDU
1228  * @ltf_size: ltf_size
1229  * @stbc: stbc
1230  * @he_re: he_re (range extension)
1231  * @txbf: txbf
1232  * @bw: Transmission bandwidth
1233  *       <enum 2 transmit_bw_20_MHz>
1234  *       <enum 3 transmit_bw_40_MHz>
1235  *       <enum 4 transmit_bw_80_MHz>
1236  *       <enum 5 transmit_bw_160_MHz>
1237  * @nss: NSS 1,2, ...8
1238  * @mcs: MCS index
1239  * @preamble: preamble
1240  * @gi: guard interval 800/400/1600/3200 ns
1241  * @channel: frequency
1242  * @channel_num: channel number
1243  * @ack_rssi: ack rssi
1244  * @ldpc: ldpc
1245  * @tx_rate: Transmission Rate
1246  * @mac_address: peer mac address
1247  * @bss_mac_address: bss mac address
1248  * @ppdu_start_timestamp: TSF at PPDU start
1249  * @ppdu_end_timestamp: TSF at PPDU end
1250  * @ba_start_seq: Block Ack sequence number
1251  * @ba_bitmap: Block Ack bitmap
1252  */
1253 struct cdp_tx_indication_mpdu_info {
1254 	uint32_t ppdu_id;
1255 	uint32_t tx_duration;
1256 	uint16_t frame_type;
1257 	uint16_t frame_ctrl;
1258 	uint16_t qos_ctrl;
1259 	uint8_t tid;
1260 	uint32_t num_msdu;
1261 	uint32_t seq_no;
1262 	uint32_t ltf_size:2,
1263 		 he_re:1,
1264 		 txbf:4,
1265 		 bw:4,
1266 		 nss:4,
1267 		 mcs:4,
1268 		 preamble:4,
1269 		 gi:4;
1270 	uint32_t channel;
1271 	uint8_t channel_num;
1272 	uint32_t ack_rssi;
1273 	uint32_t ldpc;
1274 	uint32_t tx_rate;
1275 	uint8_t mac_address[QDF_MAC_ADDR_SIZE];
1276 	uint8_t bss_mac_address[QDF_MAC_ADDR_SIZE];
1277 	uint32_t ppdu_start_timestamp;
1278 	uint32_t ppdu_end_timestamp;
1279 	uint32_t ba_start_seq;
1280 	uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
1281 };
1282 
1283 /**
1284  * struct cdp_tx_indication_info - Tx capture information
1285  * @mpdu_info: Tx MPDU completion information
1286  * @mpdu_nbuf: reconstructed mpdu packet
1287  */
1288 struct cdp_tx_indication_info {
1289 	struct cdp_tx_indication_mpdu_info mpdu_info;
1290 	qdf_nbuf_t mpdu_nbuf;
1291 };
1292 
1293 /**
1294  * struct cdp_tx_completion_ppdu - Tx PPDU completion information
1295  * @completion_status: completion status - OK/Filter/Abort/Timeout
1296  * @ppdu_id: PPDU Id
1297  * @ppdu_seq_id: ppdu sequence id for sojourn stats
1298  * @vdev_id: VAP Id
1299  * @num_users: Number of users
1300  * @num_mpdu: Number of MPDUs in PPDU
1301  * @num_msdu: Number of MSDUs in PPDU
1302  * @frame_type: frame SU or MU
1303  * @frame_ctrl: frame control of 80211 header
1304  * @channel: Channel informartion
1305  * @ack_rssi: RSSI value of last ack packet (units=dB above noise floor)
1306  * @tx_duration: PPDU airtime
1307  * @ppdu_start_timestamp: TSF at PPDU start
1308  * @ppdu_end_timestamp: TSF at PPDU end
1309  * @ack_timestamp: TSF at the reception of ACK
1310  * @user: per-User stats (array of per-user structures)
1311  * @mpdu_q: queue of mpdu in a ppdu
1312  */
1313 struct cdp_tx_completion_ppdu {
1314 	uint32_t ppdu_id;
1315 	uint32_t ppdu_seq_id;
1316 	uint16_t vdev_id;
1317 	uint32_t num_users;
1318 	uint8_t last_usr_index;
1319 	uint32_t num_mpdu:9,
1320 		 num_msdu:16;
1321 	uint16_t frame_type;
1322 	uint16_t frame_ctrl;
1323 	uint16_t channel;
1324 	uint16_t phy_mode;
1325 	uint32_t ack_rssi;
1326 	uint32_t tx_duration;
1327 	uint32_t ppdu_start_timestamp;
1328 	uint32_t ppdu_end_timestamp;
1329 	uint32_t ack_timestamp;
1330 	struct cdp_tx_completion_ppdu_user user[CDP_MU_MAX_USERS];
1331 	qdf_nbuf_queue_t mpdu_q;
1332 };
1333 
1334 /**
1335  * struct cdp_dev_stats - Network device stats structure
1336  * @tx_packets: Tx total packets transmitted
1337  * @tx_bytes  : Tx total bytes transmitted
1338  * @tx_errors : Tx error due to FW tx failure, Ring failure DMA etc
1339  * @tx_dropped: Tx dropped is same as tx errors as above
1340  * @rx_packets: Rx total packets transmitted
1341  * @rx_bytes  : Rx total bytes transmitted
1342  */
1343 struct cdp_dev_stats {
1344 	uint32_t tx_packets;
1345 	uint32_t tx_bytes;
1346 	uint32_t tx_errors;
1347 	uint32_t tx_dropped;
1348 	uint32_t rx_packets;
1349 	uint32_t rx_bytes;
1350 };
1351 
1352 /**
1353  * struct cdp_rate_stats - Tx/Rx Rate statistics
1354  * @bw: Indicates the BW of the upcoming transmission -
1355  *       <enum 2 transmit_bw_20_MHz>
1356  *       <enum 3 transmit_bw_40_MHz>
1357  *       <enum 4 transmit_bw_80_MHz>
1358  *       <enum 5 transmit_bw_160_MHz>
1359  * @pkt_type: Transmit Packet Type
1360  * @stbc: When set, STBC transmission rate was used
1361  * @ldpc: When set, use LDPC transmission rates
1362  * @sgi: <enum 0     0_8_us_sgi > Legacy normal GI
1363  *       <enum 1     0_4_us_sgi > Legacy short GI
1364  *       <enum 2     1_6_us_sgi > HE related GI
1365  *       <enum 3     3_2_us_sgi > HE
1366  * @mcs: Transmit MCS Rate
1367  * @ofdma: Set when the transmission was an OFDMA transmission
1368  * @tones_in_ru: The number of tones in the RU used.
1369  * @tsf: Lower 32 bits of the TSF (timestamp when ppdu transmission finished)
1370  * @peer_id: Peer ID of the flow or MPDU queue
1371  * @tid: TID of the flow or MPDU queue
1372  */
1373 struct cdp_rate_stats {
1374 	uint32_t rate_stats_info_valid:1,
1375 		 bw:2,
1376 		 pkt_type:4,
1377 		 stbc:1,
1378 		 ldpc:1,
1379 		 sgi:2,
1380 		 mcs:4,
1381 		 ofdma:1,
1382 		 tones_in_ru:12,
1383 		 resvd0:4;
1384 	uint32_t tsf;
1385 	uint16_t peer_id;
1386 	uint8_t tid;
1387 };
1388 
1389 /**
1390  * struct cdp_tx_completion_msdu - Tx MSDU completion descriptor
1391  * @ppdu_id: PPDU to which this MSDU belongs
1392  * @transmit_cnt: Number of times this frame has been transmitted
1393  * @ack_frame_rssi: RSSI of the received ACK or BA frame
1394  * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
1395  * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
1396  * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
1397  * @extd: Extended structure containing rate statistics
1398  */
1399 struct cdp_tx_completion_msdu {
1400 	uint32_t ppdu_id;
1401 	uint8_t transmit_cnt;
1402 	uint32_t ack_frame_rssi:8,
1403 		 resvd0:1,
1404 		 first_msdu:1,
1405 		 last_msdu:1,
1406 		 msdu_part_of_amsdu:1,
1407 		 resvd1:20;
1408 	struct cdp_rate_stats extd;
1409 };
1410 
1411 /**
1412  * struct cdp_rx_indication_ppdu - Rx PPDU indication structure
1413  * @ppdu_id: PPDU Id
1414  * @is_ampdu: mpdu aggregate or non-aggregate?
1415  * @num_mpdu: Number of MPDUs in PPDU
1416  * @reserved: Reserved bits for future use
1417  * @num_msdu: Number of MSDUs in PPDU
1418  * @udp_msdu_count: Number of UDP MSDUs in PPDU
1419  * @tcp_msdu_count: Number of TCP MSDUs in PPDU
1420  * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
1421  * @duration: PPDU duration
1422  * @tid: TID number
1423  * @peer_id: Peer ID
1424  * @vdev_id: VAP ID
1425  * @mac_addr: Peer MAC Address
1426  * @first_data_seq_ctrl: Sequence control field of first data frame
1427  * @ltf_size: ltf_size
1428  * @stbc: When set, STBC rate was used
1429  * @he_re: he_re (range extension)
1430  * @bw: Bandwidth
1431  *       <enum 0 bw_20_MHz>
1432  *       <enum 1 bw_40_MHz>
1433  *       <enum 2 bw_80_MHz>
1434  *       <enum 3 bw_160_MHz>
1435  * @nss: NSS 1,2, ...8
1436  * @mcs: MCS index
1437  * @preamble: preamble
1438  * @gi: <enum 0     0_8_us_sgi > Legacy normal GI
1439  *       <enum 1     0_4_us_sgi > Legacy short GI
1440  *       <enum 2     1_6_us_sgi > HE related GI
1441  *       <enum 3     3_2_us_sgi > HE
1442  * @dcm: dcm
1443  * @ldpc: ldpc
1444  * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
1445  * UL_BSR_TRIG/UNKNOWN
1446  * @rssi: RSSI value (units = dB above noise floor)
1447  * @timestamp: TSF at the reception of PPDU
1448  * @length: PPDU length
1449  * @channel: Channel informartion
1450  * @lsig_A: L-SIG in 802.11 PHY header
1451  * @frame_ctrl: frame control field
1452  * @rix: rate index
1453  * @rssi_chain: rssi chain per nss per bw
1454  * @cookie: cookie to used by upper layer
1455  */
1456 struct cdp_rx_indication_ppdu {
1457 	uint32_t ppdu_id;
1458 	uint16_t is_ampdu:1,
1459 		 num_mpdu:9,
1460 		 reserved:6;
1461 	uint32_t num_msdu;
1462 	uint32_t num_bytes;
1463 	uint16_t udp_msdu_count;
1464 	uint16_t tcp_msdu_count;
1465 	uint16_t other_msdu_count;
1466 	uint16_t duration;
1467 	uint32_t tid:8,
1468 		 peer_id:16;
1469 	uint8_t vdev_id;
1470 	uint8_t mac_addr[6];
1471 	uint16_t first_data_seq_ctrl;
1472 	union {
1473 		uint32_t rate_info;
1474 		struct {
1475 			uint32_t ltf_size:2,
1476 				 stbc:1,
1477 				 he_re:1,
1478 				 bw:4,
1479 				 nss:4,
1480 				 mcs:4,
1481 				 preamble:4,
1482 				 gi:4,
1483 				 dcm:1,
1484 				 ldpc:1,
1485 				 ppdu_type:5;
1486 		};
1487 	} u;
1488 	uint32_t rix;
1489 	uint32_t lsig_a;
1490 	uint32_t rssi;
1491 	uint64_t timestamp;
1492 	uint32_t length;
1493 	uint8_t channel;
1494 	uint8_t beamformed;
1495 
1496 	uint32_t rx_ratekbps;
1497 	uint32_t ppdu_rx_rate;
1498 
1499 	uint32_t retries;
1500 	uint32_t rx_byte_count;
1501 	uint8_t rx_ratecode;
1502 	uint8_t fcs_error_mpdus;
1503 	uint16_t frame_ctrl;
1504 	uint32_t rssi_chain[SS_COUNT][MAX_BW];
1505 	struct cdp_stats_cookie *cookie;
1506 };
1507 
1508 /**
1509  * struct cdp_rx_indication_msdu - Rx MSDU info
1510  * @ppdu_id: PPDU to which the MSDU belongs
1511  * @msdu_len: Length of MSDU in bytes
1512  * @ack_frame_rssi: RSSI of the received ACK or BA frame
1513  * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
1514  * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
1515  * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
1516  * @extd: Extended structure containing rate statistics
1517  */
1518 struct cdp_rx_indication_msdu {
1519 	uint32_t ppdu_id;
1520 	uint16_t msdu_len;
1521 	uint32_t ack_frame_rssi:8,
1522 		 resvd0:1,
1523 		 first_msdu:1,
1524 		 last_msdu:1,
1525 		 msdu_part_of_amsdu:1,
1526 		 msdu_part_of_ampdu:1,
1527 		 resvd1:19;
1528 	struct cdp_rate_stats extd;
1529 };
1530 
1531 /**
1532  * struct cdp_config_params - Propagate configuration parameters to datapath
1533  * @tso_enable: Enable/Disable TSO
1534  * @lro_enable: Enable/Disable LRO
1535  * @gro_enable: Enable/Disable GRO
1536  * @flow_steering_enable: Enable/Disable Rx Hash based flow steering
1537  * @tcp_Udp_ChecksumOffload: Enable/Disable tcp-Udp checksum Offload
1538  * @napi_enable: Enable/Disable Napi
1539  * @ipa_enable: Flag indicating if IPA is enabled or not
1540  * @tx_flow_stop_queue_threshold: Value to Pause tx queues
1541  * @tx_flow_start_queue_offset: Available Tx descriptors to unpause
1542  *				tx queue
1543  * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
1544  * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
1545  * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
1546  */
1547 struct cdp_config_params {
1548 	unsigned int tso_enable:1;
1549 	unsigned int lro_enable:1;
1550 	unsigned int gro_enable:1;
1551 	unsigned int flow_steering_enable:1;
1552 	unsigned int tcp_udp_checksumoffload:1;
1553 	unsigned int napi_enable:1;
1554 	unsigned int ipa_enable:1;
1555 	/* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */
1556 	uint8_t tx_flow_stop_queue_threshold;
1557 	uint8_t tx_flow_start_queue_offset;
1558 	uint32_t tx_comp_loop_pkt_limit;
1559 	uint32_t rx_reap_loop_pkt_limit;
1560 	uint32_t rx_hp_oos_update_limit;
1561 
1562 };
1563 
1564 /**
1565  * cdp_txrx_stats_req: stats request wrapper
1566  *	used to pass request information to cdp layer
1567  * @stats: type of stats requested
1568  * @param0: opaque argument 0 to be passed to htt
1569  * @param1: opaque argument 1 to be passed to htt
1570  * @param2: opaque argument 2 to be passed to htt
1571  * @param3: opaque argument 3 to be passed to htt
1572  * @mac id: mac_id
1573  */
1574 struct cdp_txrx_stats_req {
1575 	enum cdp_stats	stats;
1576 	uint32_t	param0;
1577 	uint32_t	param1;
1578 	uint32_t	param2;
1579 	uint32_t	param3;
1580 	uint32_t	cookie_val;
1581 	uint8_t		mac_id;
1582 	char *peer_addr;
1583 };
1584 
1585 /**
1586  * struct cdp_monitor_filter - monitor filter info
1587  * @mode: set filter mode
1588  * @fp_mgmt: set Filter Pass MGMT Configuration
1589  * @fp_ctrl: set Filter Pass CTRL Configuration
1590  * @fp_data: set Filter Pass DATA Configuration
1591  * @mo_mgmt: set Monitor Other MGMT Configuration
1592  * @mo_ctrl: set Monitor Other CTRL Configuration
1593  * @mo_data: set Monitor other DATA Configuration
1594  *
1595  */
1596 struct cdp_monitor_filter {
1597 	uint16_t mode;
1598 	uint16_t fp_mgmt;
1599 	uint16_t fp_ctrl;
1600 	uint16_t fp_data;
1601 	uint16_t mo_mgmt;
1602 	uint16_t mo_ctrl;
1603 	uint16_t mo_data;
1604 };
1605 
1606 /**
1607  * cdp_dp_cfg - dp ini config enum
1608  */
1609 enum cdp_dp_cfg {
1610 	cfg_dp_enable_data_stall,
1611 	cfg_dp_enable_ip_tcp_udp_checksum_offload,
1612 	cfg_dp_tso_enable,
1613 	cfg_dp_lro_enable,
1614 	cfg_dp_gro_enable,
1615 	cfg_dp_tx_flow_start_queue_offset,
1616 	cfg_dp_tx_flow_stop_queue_threshold,
1617 	cfg_dp_ipa_uc_tx_buf_size,
1618 	cfg_dp_ipa_uc_tx_partition_base,
1619 	cfg_dp_ipa_uc_rx_ind_ring_count,
1620 	cfg_dp_enable_flow_steering,
1621 	cfg_dp_reorder_offload_supported,
1622 	cfg_dp_ce_classify_enable,
1623 	cfg_dp_disable_intra_bss_fwd,
1624 };
1625 
1626 /**
1627  * struct cdp_peer_cookie - cookie used when creating peer
1628  * @peer_id: peer id
1629  * @mac_addr: MAC address of peer
1630  * @cookie: cookie to be used by consumer
1631  * @ctx: context passed to be used by consumer
1632  */
1633 struct cdp_peer_cookie {
1634 	uint8_t peer_id;
1635 	uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
1636 	uint8_t cookie;
1637 	struct cdp_stats_cookie *ctx;
1638 };
1639 #endif
1640