xref: /wlan-dirver/qca-wifi-host-cmn/dp/inc/cdp_txrx_cmn_struct.h (revision 6ecd284e5a94a1c96e26d571dd47419ac305990d)
1 /*
2  * Copyright (c) 2011-2018 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 #ifndef CONFIG_WIN
38 #include <cdp_txrx_mob_def.h>
39 #endif /* CONFIG_WIN */
40 #include <cdp_txrx_handle.h>
41 
42 #ifndef OL_TXRX_NUM_LOCAL_PEER_IDS
43 #define OL_TXRX_NUM_LOCAL_PEER_IDS 33   /* default */
44 #endif
45 
46 #define CDP_BA_256_BIT_MAP_SIZE_DWORDS 8
47 #define CDP_BA_64_BIT_MAP_SIZE_DWORDS 2
48 
49 #define OL_TXRX_INVALID_LOCAL_PEER_ID 0xffff
50 #define CDP_INVALID_VDEV_ID 0xff
51 /* Options for Dump Statistics */
52 #define CDP_HDD_STATS               0
53 #define CDP_TXRX_PATH_STATS         1
54 #define CDP_TXRX_HIST_STATS         2
55 #define CDP_TXRX_TSO_STATS          3
56 #define CDP_HDD_NETIF_OPER_HISTORY  4
57 #define CDP_DUMP_TX_FLOW_POOL_INFO  5
58 #define CDP_TXRX_DESC_STATS         6
59 #define CDP_HIF_STATS               7
60 #define CDP_LRO_STATS               8
61 #define CDP_NAPI_STATS              9
62 #define CDP_WLAN_RX_BUF_DEBUG_STATS 10
63 #define CDP_RX_RING_STATS          11
64 #define CDP_DP_NAPI_STATS          12
65 #define CDP_SCHEDULER_STATS        21
66 #define CDP_TX_QUEUE_STATS         22
67 #define CDP_BUNDLE_STATS           23
68 #define CDP_CREDIT_STATS           24
69 #define CDP_DISCONNECT_STATS       25
70 
71 #define WME_AC_TO_TID(_ac) (       \
72 		((_ac) == WME_AC_VO) ? 6 : \
73 		((_ac) == WME_AC_VI) ? 5 : \
74 		((_ac) == WME_AC_BK) ? 1 : \
75 		0)
76 
77 #define TID_TO_WME_AC(_tid) (      \
78 		(((_tid) == 0) || ((_tid) == 3)) ? WME_AC_BE : \
79 		(((_tid) == 1) || ((_tid) == 2)) ? WME_AC_BK : \
80 		(((_tid) == 4) || ((_tid) == 5)) ? WME_AC_VI : \
81 		WME_AC_VO)
82 
83 #define CDP_MU_MAX_USERS 8
84 #define CDP_MU_MAX_USER_INDEX (CDP_MU_MAX_USERS - 1)
85 #define CDP_INVALID_PEER 0xffff
86 #define CDP_INVALID_TID	 31
87 
88 #define CDP_DATA_TID_MAX 8
89 /*
90  * advance rx monitor filter
91  * */
92 #define MON_FILTER_PASS			0x0001
93 #define MON_FILTER_OTHER		0x0002
94 #define MON_FILTER_ALL			0x0003
95 
96 #define FILTER_MGMT_ALL			0xFFFF
97 #define FILTER_MGMT_ASSOC_REQ		0x0001
98 #define FILTER_MGMT_ASSOC_RES		0x0002
99 #define FILTER_MGMT_REASSOC_REQ		0x0004
100 #define FILTER_MGMT_REASSOC_RES		0x0008
101 #define FILTER_MGMT_PROBE_REQ		0x0010
102 #define FILTER_MGMT_PROBE_RES		0x0020
103 #define FILTER_MGMT_TIM_ADVT		0x0040
104 #define FILTER_MGMT_RESERVED_7		0x0080
105 #define FILTER_MGMT_BEACON		0x0100
106 #define FILTER_MGMT_ATIM		0x0200
107 #define FILTER_MGMT_DISASSOC		0x0400
108 #define FILTER_MGMT_AUTH		0x0800
109 #define FILTER_MGMT_DEAUTH		0x1000
110 #define FILTER_MGMT_ACTION		0x2000
111 #define FILTER_MGMT_ACT_NO_ACK		0x4000
112 #define FILTER_MGMT_RESERVED_15		0x8000
113 
114 #define FILTER_CTRL_ALL			0xFFFF
115 #define FILTER_CTRL_RESERVED_1		0x0001
116 #define FILTER_CTRL_RESERVED_2		0x0002
117 #define FILTER_CTRL_TRIGGER		0x0004
118 #define FILTER_CTRL_RESERVED_4		0x0008
119 #define FILTER_CTRL_BF_REP_POLL		0x0010
120 #define FILTER_CTRL_VHT_NDP		0x0020
121 #define FILTER_CTRL_FRAME_EXT		0x0040
122 #define FILTER_CTRL_CTRLWRAP		0x0080
123 #define FILTER_CTRL_BA_REQ		0x0100
124 #define FILTER_CTRL_BA			0x0200
125 #define FILTER_CTRL_PSPOLL		0x0400
126 #define FILTER_CTRL_RTS			0x0800
127 #define FILTER_CTRL_CTS			0x1000
128 #define FILTER_CTRL_ACK			0x2000
129 #define FILTER_CTRL_CFEND		0x4000
130 #define FILTER_CTRL_CFEND_CFACK		0x8000
131 
132 #define FILTER_DATA_ALL			0xFFFF
133 #define FILTER_DATA_MCAST		0x4000
134 #define FILTER_DATA_UCAST		0x8000
135 #define FILTER_DATA_DATA		0x0001
136 #define FILTER_DATA_NULL		0x0008
137 
138 /*
139  * DP configuration parameters
140  */
141 enum cdp_cfg_param_type {
142 	CDP_CFG_MAX_PEER_ID,
143 	CDP_CFG_CCE_DISABLE,
144 	CDP_CFG_NUM_PARAMS
145 };
146 
147 /*
148  * htt_dbg_stats_type -
149  * bit positions for each stats type within a stats type bitmask
150  * The bitmask contains 24 bits.
151  */
152 enum htt_cmn_dbg_stats_type {
153 	HTT_DBG_CMN_STATS_WAL_PDEV_TXRX      = 0,  /* bit 0 -> 0x1 */
154 	HTT_DBG_CMN_STATS_RX_REORDER         = 1,  /* bit 1 -> 0x2 */
155 	HTT_DBG_CMN_STATS_RX_RATE_INFO       = 2,  /* bit 2 -> 0x4 */
156 	HTT_DBG_CMN_STATS_TX_PPDU_LOG        = 3,  /* bit 3 -> 0x8 */
157 	HTT_DBG_CMN_STATS_TX_RATE_INFO       = 4,  /* bit 4 -> 0x10 */
158 	HTT_DBG_CMN_STATS_TIDQ               = 5,  /* bit 5 -> 0x20 */
159 	HTT_DBG_CMN_STATS_TXBF_INFO          = 6,  /* bit 6 -> 0x40 */
160 	HTT_DBG_CMN_STATS_SND_INFO           = 7,  /* bit 7 -> 0x80 */
161 	HTT_DBG_CMN_STATS_ERROR_INFO         = 8,  /* bit 8  -> 0x100 */
162 	HTT_DBG_CMN_STATS_TX_SELFGEN_INFO    = 9,  /* bit 9  -> 0x200 */
163 	HTT_DBG_CMN_STATS_TX_MU_INFO         = 10, /* bit 10 -> 0x400 */
164 	HTT_DBG_CMN_STATS_SIFS_RESP_INFO     = 11, /* bit 11 -> 0x800 */
165 	HTT_DBG_CMN_STATS_RESET_INFO         = 12, /* bit 12 -> 0x1000 */
166 	HTT_DBG_CMN_STATS_MAC_WDOG_INFO      = 13, /* bit 13 -> 0x2000 */
167 	HTT_DBG_CMN_STATS_TX_DESC_INFO       = 14, /* bit 14 -> 0x4000 */
168 	HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO  = 15, /* bit 15 -> 0x8000 */
169 	HTT_DBG_CMN_STATS_TX_PFSCHED_INFO    = 16, /* bit 16 -> 0x10000 */
170 	HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO = 17, /* bit 17 -> 0x20000 */
171 	/* bits 18-23 currently reserved */
172 
173 	/* keep this last */
174 	HTT_DBG_CMN_NUM_STATS,
175 	HTT_DBG_CMN_NUM_STATS_INVALID        = 31, /* bit 31 -> 0x80000000 */
176 };
177 
178 /*
179  * cdp_host_txrx_stats: Different types of host stats
180  * @TXRX_HOST_STATS_INVALID: Invalid option
181  * @TXRX_RX_RATE_STATS: Rx rate info
182  * @TXRX_TX_RATE_STATS: Tx rate info
183  * @TXRX_TX_HOST_STATS: Print Tx stats
184  * @TXRX_RX_HOST_STATS: Print host Rx stats
185  * @TXRX_CLEAR_STATS: clear all host stats
186  * @TXRX_SRNG_PTR_STATS: Print SRNG pointer stats
187 */
188 enum cdp_host_txrx_stats {
189 	TXRX_HOST_STATS_INVALID  = -1,
190 	TXRX_CLEAR_STATS    = 0,
191 	TXRX_RX_RATE_STATS  = 1,
192 	TXRX_TX_RATE_STATS  = 2,
193 	TXRX_TX_HOST_STATS  = 3,
194 	TXRX_RX_HOST_STATS  = 4,
195 	TXRX_AST_STATS = 5,
196 	TXRX_SRNG_PTR_STATS	= 6,
197 	TXRX_HOST_STATS_MAX,
198 };
199 
200 /*
201  * cdp_ppdu_ftype: PPDU Frame Type
202  * @CDP_PPDU_FTYPE_DATA: SU or MU Data Frame
203  * @CDP_PPDU_FTYPE_CTRL: Control/Management Frames
204 */
205 enum cdp_ppdu_ftype {
206 	CDP_PPDU_FTYPE_CTRL,
207 	CDP_PPDU_FTYPE_DATA,
208 	CDP_PPDU_FTYPE_MAX
209 };
210 
211 
212 /**
213  * @brief General specification of the tx frame contents
214  *
215  * @details
216  * for efficiency, the HTT packet type values correspond
217  * to the bit positions of the WAL packet type values, so the
218  * translation is a simple shift operation.
219  */
220 enum htt_cmn_pkt_type {
221 	htt_cmn_pkt_type_raw = 0,
222 	htt_cmn_pkt_type_native_wifi = 1,
223 	htt_cmn_pkt_type_ethernet = 2,
224 	htt_cmn_pkt_type_mgmt = 3,
225 	htt_cmn_pkt_type_eth2 = 4,
226 
227 	/* keep this last */
228 	htt_cmn_pkt_num_types
229 };
230 
231 /**
232  * @General description of HTT received packets status
233  * It is similar to htt_rx_status enum
234  * but is added as a cdp enum can be freely used in OL_IF layer
235  */
236 enum htt_cmn_rx_status {
237 	htt_cmn_rx_status_unknown = 0x0,
238 	htt_cmn_rx_status_ok,
239 	htt_cmn_rx_status_err_fcs,
240 	htt_cmn_rx_status_err_dup,
241 	htt_cmn_rx_status_err_replay,
242 	htt_cmn_rx_status_inv_peer,
243 	htt_cmn_rx_status_ctrl_mgmt_null = 0x08,
244 	htt_cmn_rx_status_tkip_mic_err = 0x09,
245 	htt_cmn_rx_status_decrypt_err = 0x0A,
246 	htt_cmn_rx_status_mpdu_length_err = 0x0B,
247 	htt_cmn_rx_status_err_misc = 0xFF
248 };
249 
250 
251 enum cdp_host_reo_dest_ring {
252     cdp_host_reo_dest_ring_unknown = 0,
253     cdp_host_reo_dest_ring_1 = 1,
254     cdp_host_reo_dest_ring_2 = 2,
255     cdp_host_reo_dest_ring_3 = 3,
256     cdp_host_reo_dest_ring_4 = 4,
257 };
258 
259 enum htt_cmn_t2h_en_stats_type {
260     /* keep this alwyas first */
261     HTT_CMN_T2H_EN_STATS_TYPE_START     = 0,
262 
263     /** ppdu_common_stats is the payload */
264     HTT_CMN_T2H_EN_STATS_TYPE_COMMON    = 1,
265     /** ppdu_sant_stats is the payload */
266     HTT_CMN_T2H_EN_STATS_TYPE_SANT      = 2,
267     /** ppdu_common_stats_v2 is the payload */
268     HTT_CMN_T2H_EN_STATS_TYPE_COMMON_V2 = 3,
269 
270     /* Keep this last */
271     HTT_CMN_T2H_EN_STATS_TYPE_END       = 0x1f,
272 };
273 
274 enum htt_cmn_t2h_en_stats_status {
275     /* Keep this first always */
276     HTT_CMN_T2H_EN_STATS_STATUS_PARTIAL     = 0,
277     HTT_CMN_T2H_EN_STATS_STATUS_PRESENT     = 1,
278     HTT_CMN_T2H_EN_STATS_STATUS_ERROR       = 2,
279     HTT_CMN_T2H_EN_STATS_STATUS_INVALID     = 3,
280 
281 
282     /* keep this always last */
283     HTT_CMN_T2H_EN_STATS_STATUS_SERIES_DONE         = 7,
284 };
285 
286 /**
287  * struct ol_txrx_peer_state - Peer state information
288  */
289 enum ol_txrx_peer_state {
290 	OL_TXRX_PEER_STATE_INVALID,
291 	OL_TXRX_PEER_STATE_DISC,    /* initial state */
292 	OL_TXRX_PEER_STATE_CONN,    /* authentication in progress */
293 	OL_TXRX_PEER_STATE_AUTH,    /* authentication successful */
294 };
295 
296 /**
297  * struct ol_txrx_ast_type - AST entry type information
298  */
299 enum cdp_txrx_ast_entry_type {
300 	CDP_TXRX_AST_TYPE_NONE,	/* static ast entry for connected peer */
301 	CDP_TXRX_AST_TYPE_STATIC, /* static ast entry for connected peer */
302 	CDP_TXRX_AST_TYPE_WDS,	/* WDS peer ast entry type*/
303 	CDP_TXRX_AST_TYPE_MEC,	/* Multicast echo ast entry type */
304 	CDP_TXRX_AST_TYPE_WDS_HM, /* HM WDS entry */
305 	CDP_TXRX_AST_TYPE_MAX
306 };
307 
308 /**
309  * struct cdp_sec_type - security type information
310  */
311 enum cdp_sec_type {
312     cdp_sec_type_none,
313     cdp_sec_type_wep128,
314     cdp_sec_type_wep104,
315     cdp_sec_type_wep40,
316     cdp_sec_type_tkip,
317     cdp_sec_type_tkip_nomic,
318     cdp_sec_type_aes_ccmp,
319     cdp_sec_type_wapi,
320     cdp_sec_type_aes_ccmp_256,
321     cdp_sec_type_aes_gcmp,
322     cdp_sec_type_aes_gcmp_256,
323 
324     /* keep this last! */
325     cdp_num_sec_types
326 };
327 
328 /**
329  *  struct cdp_tx_exception_metadata - Exception path parameters
330  *  @peer_id: Peer id of the peer
331  *  @tid: Transmit Identifier
332  *  @tx_encap_type: Transmit encap type (i.e. Raw, Native Wi-Fi, Ethernet)
333  *  @sec_type: sec_type to be passed to HAL
334  *
335  *  This structure holds the parameters needed in the exception path of tx
336  *
337  */
338 struct cdp_tx_exception_metadata {
339 	uint16_t peer_id;
340 	uint8_t tid;
341 	uint16_t tx_encap_type;
342 	enum cdp_sec_type sec_type;
343 };
344 
345 typedef struct cdp_soc_t *ol_txrx_soc_handle;
346 
347 /**
348  * ol_txrx_vdev_delete_cb - callback registered during vdev
349  * detach
350  */
351 typedef void (*ol_txrx_vdev_delete_cb)(void *context);
352 
353 /**
354  * ol_osif_vdev_handle - paque handle for OS shim virtual device
355  * object
356  */
357 struct ol_osif_vdev_t;
358 typedef struct ol_osif_vdev_t *ol_osif_vdev_handle;
359 
360 /**
361  * wlan_op_mode - Virtual device operation mode
362  * @wlan_op_mode_unknown: Unknown mode
363  * @wlan_op_mode_ap: AP mode
364  * @wlan_op_mode_ibss: IBSS mode
365  * @wlan_op_mode_sta: STA (client) mode
366  * @wlan_op_mode_monitor: Monitor mode
367  * @wlan_op_mode_ocb: OCB mode
368  */
369 enum wlan_op_mode {
370 	wlan_op_mode_unknown,
371 	wlan_op_mode_ap,
372 	wlan_op_mode_ibss,
373 	wlan_op_mode_sta,
374 	wlan_op_mode_monitor,
375 	wlan_op_mode_ocb,
376 	wlan_op_mode_ndi,
377 };
378 
379 /**
380  * connectivity_stats_pkt_status - data pkt type
381  * @PKT_TYPE_REQ: Request packet
382  * @PKT_TYPE_RSP: Response packet
383  * @PKT_TYPE_TX_DROPPED: TX packet dropped
384  * @PKT_TYPE_RX_DROPPED: RX packet dropped
385  * @PKT_TYPE_RX_DELIVERED: RX packet delivered
386  * @PKT_TYPE_RX_REFUSED: RX packet refused
387  * @PKT_TYPE_TX_HOST_FW_SENT: TX packet FW sent
388  * @PKT_TYPE_TX_ACK_CNT:TC packet acked
389  * @PKT_TYPE_NONE: Invalid packet
390  */
391 enum connectivity_stats_pkt_status {
392 	PKT_TYPE_REQ,
393 	PKT_TYPE_RSP,
394 	PKT_TYPE_TX_DROPPED,
395 	PKT_TYPE_RX_DROPPED,
396 	PKT_TYPE_RX_DELIVERED,
397 	PKT_TYPE_RX_REFUSED,
398 	PKT_TYPE_TX_HOST_FW_SENT,
399 	PKT_TYPE_TX_ACK_CNT,
400 	PKT_TYPE_NONE,
401 };
402 
403 /**
404  * cdp_mgmt_tx_cb - tx management delivery notification
405  * callback function
406  */
407 typedef void
408 (*ol_txrx_mgmt_tx_cb)(void *ctxt, qdf_nbuf_t tx_mgmt_frm, int had_error);
409 
410 /**
411  * ol_txrx_data_tx_cb - Function registered with the data path
412  * that is called when tx frames marked as "no free" are
413  * done being transmitted
414  */
415 typedef void
416 (*ol_txrx_data_tx_cb)(void *ctxt, qdf_nbuf_t tx_frm, int had_error);
417 
418 /**
419  * ol_txrx_tx_fp - top-level transmit function
420  * @data_vdev - handle to the virtual device object
421  * @msdu_list - list of network buffers
422  */
423 typedef qdf_nbuf_t (*ol_txrx_tx_fp)(void *data_vdev,
424 				    qdf_nbuf_t msdu_list);
425 
426 /**
427  * ol_txrx_tx_exc_fp - top-level transmit function on exception path
428  * @data_vdev - handle to the virtual device object
429  * @msdu_list - list of network buffers
430  * @tx_exc_metadata - structure that holds parameters to exception path
431  */
432 typedef qdf_nbuf_t (*ol_txrx_tx_exc_fp)(void *data_vdev,
433 					qdf_nbuf_t msdu_list,
434 					struct cdp_tx_exception_metadata
435 						*tx_exc_metadata);
436 
437 /**
438  * ol_txrx_tx_flow_control_fp - tx flow control notification
439  * function from txrx to OS shim
440  * @osif_dev - the virtual device's OS shim object
441  * @tx_resume - tx os q should be resumed or not
442  */
443 typedef void (*ol_txrx_tx_flow_control_fp)(void *osif_dev,
444 					    bool tx_resume);
445 
446 /**
447  * ol_txrx_tx_flow_control_is_pause_fp - is tx paused by flow control
448  * function from txrx to OS shim
449  * @osif_dev - the virtual device's OS shim object
450  *
451  * Return: true if tx is paused by flow control
452  */
453 typedef bool (*ol_txrx_tx_flow_control_is_pause_fp)(void *osif_dev);
454 
455 /**
456  * ol_txrx_rx_fp - receive function to hand batches of data
457  * frames from txrx to OS shim
458  * @data_vdev - handle to the OSIF virtual device object
459  * @msdu_list - list of network buffers
460  */
461 typedef QDF_STATUS(*ol_txrx_rx_fp)(void *osif_dev, qdf_nbuf_t msdu_list);
462 
463 /**
464  * ol_txrx_stats_rx_fp - receive function to hand batches of data
465  * frames from txrx to OS shim
466  * @skb: skb data
467  * @osif_dev: the virtual device's OS shim object
468  * @action: data packet type
469  * @pkt_type: packet data type
470  */
471 typedef void (*ol_txrx_stats_rx_fp)(struct sk_buff *skb,
472 		void *osif_dev, enum connectivity_stats_pkt_status action,
473 		uint8_t *pkt_type);
474 
475 /**
476  * ol_txrx_get_key_fp - function to gey key based on keyix and peer
477  * mac address
478  * @osif_dev - the virtual device's OS shim object
479  * @key_buf - pointer to store key
480  * @mac_addr - pointer to mac address
481  * @keyix - key id
482  */
483 typedef QDF_STATUS(*ol_txrx_get_key_fp)(void *osif_dev, uint8_t *key_buf, uint8_t *mac_addr, uint8_t keyix);
484 
485 /**
486  * ol_txrx_rsim_rx_decap_fp - raw mode simulation function to decap the
487  * packets in receive path.
488  * @osif_dev  - the virtual device's OS shim object
489  * @list_head - poniter to head of receive packet queue to decap
490  * @list_tail - poniter to tail of receive packet queue to decap
491  * @peer      - Peer handler
492  */
493 typedef QDF_STATUS(*ol_txrx_rsim_rx_decap_fp)(void *osif_dev,
494 						qdf_nbuf_t *list_head,
495 						qdf_nbuf_t *list_tail,
496 						struct cdp_peer *peer);
497 
498 /* ol_txrx_rx_fp - external tx free function to read per packet stats and
499  *                            free tx buffer externally
500  * @netbuf - tx network buffer
501  */
502 typedef void (*ol_txrx_tx_free_ext_fp)(qdf_nbuf_t netbuf);
503 
504 /**
505  * ol_txrx_rx_check_wai_fp - OSIF WAPI receive function
506 */
507 typedef bool (*ol_txrx_rx_check_wai_fp)(ol_osif_vdev_handle vdev,
508 					    qdf_nbuf_t mpdu_head,
509 					    qdf_nbuf_t mpdu_tail);
510 /**
511  * ol_txrx_rx_mon_fp - OSIF monitor mode receive function for single
512  * MPDU (802.11 format)
513  */
514 typedef void (*ol_txrx_rx_mon_fp)(ol_osif_vdev_handle vdev,
515 					    qdf_nbuf_t mpdu,
516 					    void *rx_status);
517 
518 /**
519  * ol_txrx_proxy_arp_fp - proxy arp function pointer
520 */
521 typedef int (*ol_txrx_proxy_arp_fp)(ol_osif_vdev_handle vdev,
522 					    qdf_nbuf_t netbuf);
523 
524 /*
525  * ol_txrx_mcast_me_fp - function pointer for multicast enhancement
526  */
527 typedef int (*ol_txrx_mcast_me_fp)(ol_osif_vdev_handle vdev,
528 						qdf_nbuf_t netbuf);
529 
530 /**
531  * ol_txrx_stats_callback - statistics notify callback
532  */
533 typedef void (*ol_txrx_stats_callback)(void *ctxt,
534 				       enum htt_cmn_dbg_stats_type type,
535 				       uint8_t *buf, int bytes);
536 
537 /**
538  * ol_txrx_ops - (pointers to) the functions used for tx and rx
539  * data xfer
540  *
541  * There are two portions of these txrx operations.
542  * The rx portion is filled in by OSIF SW before calling
543  * ol_txrx_osif_vdev_register; inside the ol_txrx_osif_vdev_register
544  * the txrx SW stores a copy of these rx function pointers, to use
545  * as it delivers rx data frames to the OSIF SW.
546  * The tx portion is filled in by the txrx SW inside
547  * ol_txrx_osif_vdev_register; when the function call returns,
548  * the OSIF SW stores a copy of these tx functions to use as it
549  * delivers tx data frames to the txrx SW.
550  *
551  * @tx.std -  the tx function pointer for standard data
552  * frames This function pointer is set by the txrx SW
553  * perform host-side transmit operations based on
554  * whether a HL or LL host/target interface is in use.
555  * @tx.flow_control_cb - the transmit flow control
556  * function that is registered by the
557  * OSIF which is called from txrx to
558  * indicate whether the transmit OS
559  * queues should be paused/resumed
560  * @rx.std - the OS shim rx function to deliver rx data
561  * frames to. This can have different values for
562  * different virtual devices, e.g. so one virtual
563  * device's OS shim directly hands rx frames to the OS,
564  * but another virtual device's OS shim filters out P2P
565  * messages before sending the rx frames to the OS. The
566  * netbufs delivered to the osif_rx function are in the
567  * format specified by the OS to use for tx and rx
568  * frames (either 802.3 or native WiFi)
569  * @rx.wai_check - the tx function pointer for WAPI frames
570  * @rx.mon - the OS shim rx monitor function to deliver
571  * monitor data to Though in practice, it is probable
572  * that the same function will be used for delivering
573  * rx monitor data for all virtual devices, in theory
574  * each different virtual device can have a different
575  * OS shim function for accepting rx monitor data. The
576  * netbufs delivered to the osif_rx_mon function are in
577  * 802.11 format.  Each netbuf holds a 802.11 MPDU, not
578  * an 802.11 MSDU. Depending on compile-time
579  * configuration, each netbuf may also have a
580  * monitor-mode encapsulation header such as a radiotap
581  * header added before the MPDU contents.
582  * @rx.std - the OS shim rx function to deliver rx data
583  * @proxy_arp - proxy arp function pointer - specified by
584  * OS shim, stored by txrx
585  * @get_key - function pointer to get key of the peer with
586  * specific key index
587  */
588 struct ol_txrx_ops {
589 	/* tx function pointers - specified by txrx, stored by OS shim */
590 	struct {
591 		ol_txrx_tx_fp         tx;
592 		ol_txrx_tx_exc_fp     tx_exception;
593 		ol_txrx_tx_free_ext_fp tx_free_ext;
594 	} tx;
595 
596 	/* rx function pointers - specified by OS shim, stored by txrx */
597 	struct {
598 		ol_txrx_rx_fp           rx;
599 		ol_txrx_rx_check_wai_fp wai_check;
600 		ol_txrx_rx_mon_fp       mon;
601 		ol_txrx_stats_rx_fp           stats_rx;
602 		ol_txrx_rsim_rx_decap_fp rsim_rx_decap;
603 	} rx;
604 
605 	/* proxy arp function pointer - specified by OS shim, stored by txrx */
606 	ol_txrx_proxy_arp_fp      proxy_arp;
607 	ol_txrx_mcast_me_fp          me_convert;
608 
609 	ol_txrx_get_key_fp  get_key;
610 };
611 
612 /**
613  * ol_txrx_stats_req - specifications of the requested
614  * statistics
615  */
616 struct ol_txrx_stats_req {
617 	uint32_t stats_type_upload_mask;        /* which stats to upload */
618 	uint32_t stats_type_reset_mask; /* which stats to reset */
619 
620 	/* stats will be printed if either print element is set */
621 	struct {
622 		int verbose;    /* verbose stats printout */
623 		int concise;    /* concise stats printout (takes precedence) */
624 	} print;                /* print uploaded stats */
625 
626 	/* stats notify callback will be invoked if fp is non-NULL */
627 	struct {
628 		ol_txrx_stats_callback fp;
629 		void *ctxt;
630 	} callback;
631 
632 	/* stats will be copied into the specified buffer if buf is non-NULL */
633 	struct {
634 		uint8_t *buf;
635 		int byte_limit; /* don't copy more than this */
636 	} copy;
637 
638 	/*
639 	 * If blocking is true, the caller will take the specified semaphore
640 	 * to wait for the stats to be uploaded, and the driver will release
641 	 * the semaphore when the stats are done being uploaded.
642 	 */
643 	struct {
644 		int blocking;
645 		/*Note: this needs to change to some qdf_* type */
646 		qdf_semaphore_t *sem_ptr;
647 	} wait;
648 };
649 
650 
651 /* DP soc struct definition */
652 struct cdp_soc_t {
653 	struct cdp_ops *ops;
654 	struct ol_if_ops *ol_ops;
655 };
656 
657 /*
658  * cdp_pdev_param_type: different types of parameters
659  *			to set values in pdev
660  * @CDP_CONFIG_DEBUG_SNIFFER: Enable debug sniffer feature
661  */
662 enum cdp_pdev_param_type {
663 	CDP_CONFIG_DEBUG_SNIFFER,
664 };
665 
666 /*
667  * cdp_vdev_param_type: different types of parameters
668  *			to set values in vdev
669  * @CDP_ENABLE_NAWDS: set nawds enable/disable
670  * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement
671  * @CDP_ENABLE_WDS: wds sta
672  * @CDP_ENABLE_PROXYSTA: proxy sta
673  * @CDP_UPDATE_TDLS_FLAGS: tdls link flags
674  * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable
675  * @CDP_ENABLE_CIPHER : set cipher type based on security
676  * @CDP_ENABLE_QWRAP_ISOLATION: qwrap isolation mode
677  */
678 enum cdp_vdev_param_type {
679 	CDP_ENABLE_NAWDS,
680 	CDP_ENABLE_MCAST_EN,
681 	CDP_ENABLE_WDS,
682 	CDP_ENABLE_PROXYSTA,
683 	CDP_UPDATE_TDLS_FLAGS,
684 	CDP_CFG_WDS_AGING_TIMER,
685 	CDP_ENABLE_AP_BRIDGE,
686 	CDP_ENABLE_CIPHER,
687 	CDP_ENABLE_QWRAP_ISOLATION
688 };
689 
690 #define TXRX_FW_STATS_TXSTATS                     1
691 #define TXRX_FW_STATS_RXSTATS                     2
692 #define TXRX_FW_STATS_RX_RATE_INFO                3
693 #define TXRX_FW_STATS_PHYSTATS                    4
694 #define TXRX_FW_STATS_PHYSTATS_CONCISE            5
695 #define TXRX_FW_STATS_TX_RATE_INFO                6
696 #define TXRX_FW_STATS_TID_STATE                   7
697 #define TXRX_FW_STATS_HOST_STATS                  8
698 #define TXRX_FW_STATS_CLEAR_HOST_STATS            9
699 #define TXRX_FW_STATS_CE_STATS                   10
700 #define TXRX_FW_STATS_VOW_UMAC_COUNTER           11
701 #define TXRX_FW_STATS_ME_STATS                   12
702 #define TXRX_FW_STATS_TXBF_INFO                  13
703 #define TXRX_FW_STATS_SND_INFO                   14
704 #define TXRX_FW_STATS_ERROR_INFO                 15
705 #define TXRX_FW_STATS_TX_SELFGEN_INFO            16
706 #define TXRX_FW_STATS_TX_MU_INFO                 17
707 #define TXRX_FW_SIFS_RESP_INFO                   18
708 #define TXRX_FW_RESET_STATS                      19
709 #define TXRX_FW_MAC_WDOG_STATS                   20
710 #define TXRX_FW_MAC_DESC_STATS                   21
711 #define TXRX_FW_MAC_FETCH_MGR_STATS              22
712 #define TXRX_FW_MAC_PREFETCH_MGR_STATS           23
713 #define TXRX_FW_STATS_DURATION_INFO              24
714 #define TXRX_FW_STATS_DURATION_INFO_RESET        25
715 #define TXRX_FW_HALPHY_STATS                     26
716 #define TXRX_FW_COEX_STATS                       27
717 
718 #define PER_RADIO_FW_STATS_REQUEST 0
719 #define PER_VDEV_FW_STATS_REQUEST 1
720 
721 /**
722  * enum data_stall_log_event_indicator - Module triggering data stall
723  * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused
724  * @DATA_STALL_LOG_INDICATOR_HOST_DRIVER: Host driver indicates data stall
725  * @DATA_STALL_LOG_INDICATOR_FIRMWARE: FW indicates data stall
726  * @DATA_STALL_LOG_INDICATOR_FRAMEWORK: Framework indicates data stall
727  *
728  * Enum indicating the module that indicates data stall event
729  */
730 enum data_stall_log_event_indicator {
731 	DATA_STALL_LOG_INDICATOR_UNUSED,
732 	DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
733 	DATA_STALL_LOG_INDICATOR_FIRMWARE,
734 	DATA_STALL_LOG_INDICATOR_FRAMEWORK,
735 };
736 
737 /**
738  * enum data_stall_log_event_type - data stall event type
739  * @DATA_STALL_LOG_NONE
740  * @DATA_STALL_LOG_FW_VDEV_PAUSE
741  * @DATA_STALL_LOG_HWSCHED_CMD_FILTER
742  * @DATA_STALL_LOG_HWSCHED_CMD_FLUSH
743  * @DATA_STALL_LOG_FW_RX_REFILL_FAILED
744  * @DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR
745  * @DATA_STALL_LOG_FW_WDOG_ERRORS
746  * @DATA_STALL_LOG_BB_WDOG_ERROR
747  * @DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR
748  * @DATA_STALL_LOG_HOST_STA_TX_TIMEOUT
749  * @DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT
750  * @DATA_STALL_LOG_NUD_FAILURE
751  *
752  * Enum indicating data stall event type
753  */
754 enum data_stall_log_event_type {
755 	DATA_STALL_LOG_NONE,
756 	DATA_STALL_LOG_FW_VDEV_PAUSE,
757 	DATA_STALL_LOG_HWSCHED_CMD_FILTER,
758 	DATA_STALL_LOG_HWSCHED_CMD_FLUSH,
759 	DATA_STALL_LOG_FW_RX_REFILL_FAILED,
760 	DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR,
761 	DATA_STALL_LOG_FW_WDOG_ERRORS,
762 	DATA_STALL_LOG_BB_WDOG_ERROR,
763 	DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR,
764 	/* Stall events triggered by host/framework start from 0x100 onwards. */
765 	DATA_STALL_LOG_HOST_STA_TX_TIMEOUT = 0x100,
766 	DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,
767 	DATA_STALL_LOG_NUD_FAILURE,
768 };
769 
770 /**
771  * enum data_stall_log_recovery_type - data stall recovery type
772  * @DATA_STALL_LOG_RECOVERY_NONE,
773  * @DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
774  * @DATA_STALL_LOG_RECOVERY_TRIGGER_PDR
775  *
776  * Enum indicating data stall recovery type
777  */
778 enum data_stall_log_recovery_type {
779 	DATA_STALL_LOG_RECOVERY_NONE = 0,
780 	DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
781 	DATA_STALL_LOG_RECOVERY_TRIGGER_PDR,
782 };
783 
784 /**
785  * struct data_stall_event_info - data stall info
786  * @indicator: Module triggering data stall
787  * @data_stall_type: data stall event type
788  * @vdev_id_bitmap: vdev_id_bitmap
789  * @pdev_id: pdev id
790  * @recovery_type: data stall recovery type
791  */
792 struct data_stall_event_info {
793 	uint32_t indicator;
794 	uint32_t data_stall_type;
795 	uint32_t vdev_id_bitmap;
796 	uint32_t pdev_id;
797 	uint32_t recovery_type;
798 };
799 
800 typedef void (*data_stall_detect_cb)(struct data_stall_event_info *);
801 
802 /*
803  * cdp_stats - options for host and firmware
804  * statistics
805 */
806 enum cdp_stats {
807 	CDP_TXRX_STATS_0  = 0,
808 	CDP_TXRX_STATS_1,
809 	CDP_TXRX_STATS_2,
810 	CDP_TXRX_STATS_3,
811 	CDP_TXRX_STATS_4,
812 	CDP_TXRX_STATS_5,
813 	CDP_TXRX_STATS_6,
814 	CDP_TXRX_STATS_7,
815 	CDP_TXRX_STATS_8,
816 	CDP_TXRX_STATS_9,
817 	CDP_TXRX_STATS_10,
818 	CDP_TXRX_STATS_11,
819 	CDP_TXRX_STATS_12,
820 	CDP_TXRX_STATS_13,
821 	CDP_TXRX_STATS_14,
822 	CDP_TXRX_STATS_15,
823 	CDP_TXRX_STATS_16,
824 	CDP_TXRX_STATS_17,
825 	CDP_TXRX_STATS_18,
826 	CDP_TXRX_STATS_19,
827 	CDP_TXRX_STATS_20,
828 	CDP_TXRX_STATS_21,
829 	CDP_TXRX_STATS_22,
830 	CDP_TXRX_STATS_23,
831 	CDP_TXRX_STATS_24,
832 	CDP_TXRX_STATS_25,
833 	CDP_TXRX_STATS_26,
834 	CDP_TXRX_STATS_27,
835 	CDP_TXRX_STATS_HTT_MAX = 256,
836 	CDP_TXRX_MAX_STATS = 512,
837 };
838 
839 /*
840  * Different Stat update types sent to OL_IF
841  * @UPDATE_PEER_STATS: update peer stats
842  * @UPDATE_VDEV_STATS: update vdev stats
843  * @UPDATE_PDE_STATS: Update pdev stats
844  */
845 enum cdp_stat_update_type {
846 	UPDATE_PEER_STATS = 0,
847 	UPDATE_VDEV_STATS = 1,
848 	UPDATE_PDEV_STATS = 2,
849 };
850 
851 /**
852  * struct cdp_tx_completion_ppdu_user - Tx PPDU completion per-user information
853  * @completion_status: completion status - OK/Filter/Abort/Timeout
854  * @tid: TID number
855  * @peer_id: Peer ID
856  * @frame_ctrl: frame control field in 802.11 header
857  * @qos_ctrl: QoS control field in 802.11 header
858  * @mpdu_tried: number of mpdus tried
859  * @mpdu_success: number of mpdus successfully transmitted
860  * @long_retries: long retries
861  * @short_retries: short retries
862  * @is_ampdu: mpdu aggregate or non-aggregate?
863  * @success_bytes: bytes successfully transmitted
864  * @retry_bytes: bytes retried
865  * @failed_msdus: MSDUs failed transmission
866  * @duration: user duration in ppdu
867  * @ltf_size: ltf_size
868  * @stbc: stbc
869  * @he_re: he_re (range extension)
870  * @txbf: txbf
871  * @bw: Transmission bandwidth
872  *       <enum 2 transmit_bw_20_MHz>
873  *       <enum 3 transmit_bw_40_MHz>
874  *       <enum 4 transmit_bw_80_MHz>
875  *       <enum 5 transmit_bw_160_MHz>
876  * @nss: NSS 1,2, ...8
877  * @mcs: MCS index
878  * @preamble: preamble
879  * @gi: guard interval 800/400/1600/3200 ns
880  * @dcm: dcm
881  * @ldpc: ldpc
882  * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
883  * UL_BSR_TRIG/UNKNOWN
884  * @ba_seq_no: Block Ack sequence number
885  * @ba_bitmap: Block Ack bitmap
886  * @start_seqa: Sequence number of first MPDU
887  * @enq_bitmap: Enqueue MPDU bitmap
888  * @is_mcast: MCAST or UCAST
889  * @tx_rate: Transmission Rate
890  */
891 struct cdp_tx_completion_ppdu_user {
892 	uint32_t completion_status:8,
893 		 tid:8,
894 		 peer_id:16;
895 	uint8_t mac_addr[6];
896 	uint32_t frame_ctrl:16,
897 		 qos_ctrl:16;
898 	uint32_t mpdu_tried_ucast:16,
899 		mpdu_tried_mcast:16;
900 	uint16_t mpdu_success:16;
901 	uint32_t long_retries:4,
902 		 short_retries:4,
903 		 tx_ratecode:8,
904 		 is_ampdu:1,
905 		 ppdu_type:5;
906 	uint32_t success_bytes;
907 	uint32_t retry_bytes;
908 	uint32_t failed_bytes;
909 	uint32_t success_msdus:16,
910 		 retry_msdus:16;
911 	uint32_t failed_msdus:16,
912 		 duration:16;
913 	uint32_t ltf_size:2,
914 		 stbc:1,
915 		 he_re:1,
916 		 txbf:4,
917 		 bw:4,
918 		 nss:4,
919 		 mcs:4,
920 		 preamble:4,
921 		 gi:4,
922 		 dcm:1,
923 		 ldpc:1;
924 	uint32_t ba_seq_no;
925 	uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
926 	uint32_t start_seq;
927 	uint32_t enq_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
928 	uint32_t num_mpdu:9,
929 		 num_msdu:16;
930 	uint32_t tx_duration;
931 	uint16_t ru_tones;
932 	bool is_mcast;
933 	uint32_t tx_rate;
934 };
935 
936 /**
937  * struct cdp_tx_completion_ppdu - Tx PPDU completion information
938  * @completion_status: completion status - OK/Filter/Abort/Timeout
939  * @ppdu_id: PPDU Id
940  * @vdev_id: VAP Id
941  * @num_users: Number of users
942  * @num_mpdu: Number of MPDUs in PPDU
943  * @num_msdu: Number of MSDUs in PPDU
944  * @frame_type: frame SU or MU
945  * @frame_ctrl: frame control of 80211 header
946  * @channel: Channel informartion
947  * @ack_rssi: RSSI value of last ack packet (units=dB above noise floor)
948  * @tx_duration: PPDU airtime
949  * @ppdu_start_timestamp: TSF at PPDU start
950  * @ppdu_end_timestamp: TSF at PPDU end
951  * @ack_timestamp: TSF at the reception of ACK
952  * @user: per-User stats (array of per-user structures)
953  */
954 struct cdp_tx_completion_ppdu {
955 	uint32_t ppdu_id;
956 	uint16_t vdev_id;
957 	uint32_t num_users;
958 	uint32_t num_mpdu:9,
959 		 num_msdu:16;
960 	uint16_t frame_type;
961 	uint16_t frame_ctrl;
962 	uint16_t channel;
963 	uint16_t phy_mode;
964 	uint32_t ack_rssi;
965 	uint32_t tx_duration;
966 	uint32_t ppdu_start_timestamp;
967 	uint32_t ppdu_end_timestamp;
968 	uint32_t ack_timestamp;
969 	struct cdp_tx_completion_ppdu_user user[CDP_MU_MAX_USERS];
970 };
971 
972 /**
973  * struct cdp_dev_stats - Network device stats structure
974  * @tx_packets: Tx total packets transmitted
975  * @tx_bytes  : Tx total bytes transmitted
976  * @tx_errors : Tx error due to FW tx failure, Ring failure DMA etc
977  * @tx_dropped: Tx dropped is same as tx errors as above
978  * @rx_packets: Rx total packets transmitted
979  * @rx_bytes  : Rx total bytes transmitted
980  */
981 struct cdp_dev_stats {
982 	uint32_t tx_packets;
983 	uint32_t tx_bytes;
984 	uint32_t tx_errors;
985 	uint32_t tx_dropped;
986 	uint32_t rx_packets;
987 	uint32_t rx_bytes;
988 };
989 
990 /**
991  * struct cdp_rate_stats - Tx/Rx Rate statistics
992  * @bw: Indicates the BW of the upcoming transmission -
993  *       <enum 2 transmit_bw_20_MHz>
994  *       <enum 3 transmit_bw_40_MHz>
995  *       <enum 4 transmit_bw_80_MHz>
996  *       <enum 5 transmit_bw_160_MHz>
997  * @pkt_type: Transmit Packet Type
998  * @stbc: When set, STBC transmission rate was used
999  * @ldpc: When set, use LDPC transmission rates
1000  * @sgi: <enum 0     0_8_us_sgi > Legacy normal GI
1001  *       <enum 1     0_4_us_sgi > Legacy short GI
1002  *       <enum 2     1_6_us_sgi > HE related GI
1003  *       <enum 3     3_2_us_sgi > HE
1004  * @mcs: Transmit MCS Rate
1005  * @ofdma: Set when the transmission was an OFDMA transmission
1006  * @tones_in_ru: The number of tones in the RU used.
1007  * @tsf: Lower 32 bits of the TSF (timestamp when ppdu transmission finished)
1008  * @peer_id: Peer ID of the flow or MPDU queue
1009  * @tid: TID of the flow or MPDU queue
1010  */
1011 struct cdp_rate_stats {
1012 	uint32_t rate_stats_info_valid:1,
1013 		 bw:2,
1014 		 pkt_type:4,
1015 		 stbc:1,
1016 		 ldpc:1,
1017 		 sgi:2,
1018 		 mcs:4,
1019 		 ofdma:1,
1020 		 tones_in_ru:12,
1021 		 resvd0:4;
1022 	uint32_t tsf;
1023 	uint16_t peer_id;
1024 	uint8_t tid;
1025 };
1026 
1027 /**
1028  * struct cdp_tx_completion_msdu - Tx MSDU completion descriptor
1029  * @ppdu_id: PPDU to which this MSDU belongs
1030  * @transmit_cnt: Number of times this frame has been transmitted
1031  * @ack_frame_rssi: RSSI of the received ACK or BA frame
1032  * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
1033  * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
1034  * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
1035  * @extd: Extended structure containing rate statistics
1036  */
1037 struct cdp_tx_completion_msdu {
1038 	uint32_t ppdu_id;
1039 	uint8_t transmit_cnt;
1040 	uint32_t ack_frame_rssi:8,
1041 		 resvd0:1,
1042 		 first_msdu:1,
1043 		 last_msdu:1,
1044 		 msdu_part_of_amsdu:1,
1045 		 resvd1:20;
1046 	struct cdp_rate_stats extd;
1047 };
1048 
1049 /**
1050  * struct cdp_rx_indication_ppdu - Rx PPDU indication structure
1051  * @ppdu_id: PPDU Id
1052  * @is_ampdu: mpdu aggregate or non-aggregate?
1053  * @num_mpdu: Number of MPDUs in PPDU
1054  * @reserved: Reserved bits for future use
1055  * @num_msdu: Number of MSDUs in PPDU
1056  * @udp_msdu_count: Number of UDP MSDUs in PPDU
1057  * @tcp_msdu_count: Number of TCP MSDUs in PPDU
1058  * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
1059  * @duration: PPDU duration
1060  * @tid: TID number
1061  * @peer_id: Peer ID
1062  * @vdev_id: VAP ID
1063  * @mac_addr: Peer MAC Address
1064  * @first_data_seq_ctrl: Sequence control field of first data frame
1065  * @ltf_size: ltf_size
1066  * @stbc: When set, STBC rate was used
1067  * @he_re: he_re (range extension)
1068  * @bw: Bandwidth
1069  *       <enum 0 bw_20_MHz>
1070  *       <enum 1 bw_40_MHz>
1071  *       <enum 2 bw_80_MHz>
1072  *       <enum 3 bw_160_MHz>
1073  * @nss: NSS 1,2, ...8
1074  * @mcs: MCS index
1075  * @preamble: preamble
1076  * @gi: <enum 0     0_8_us_sgi > Legacy normal GI
1077  *       <enum 1     0_4_us_sgi > Legacy short GI
1078  *       <enum 2     1_6_us_sgi > HE related GI
1079  *       <enum 3     3_2_us_sgi > HE
1080  * @dcm: dcm
1081  * @ldpc: ldpc
1082  * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
1083  * UL_BSR_TRIG/UNKNOWN
1084  * @rssi: RSSI value (units = dB above noise floor)
1085  * @timestamp: TSF at the reception of PPDU
1086  * @length: PPDU length
1087  * @channel: Channel informartion
1088  * @lsig_A: L-SIG in 802.11 PHY header
1089  */
1090 struct cdp_rx_indication_ppdu {
1091 	uint32_t ppdu_id;
1092 	uint16_t is_ampdu:1,
1093 		 num_mpdu:9,
1094 		 reserved:6;
1095 	uint32_t num_msdu;
1096 	uint16_t udp_msdu_count;
1097 	uint16_t tcp_msdu_count;
1098 	uint16_t other_msdu_count;
1099 	uint16_t duration;
1100 	uint32_t tid:8,
1101 		 peer_id:16;
1102 	uint8_t vdev_id;
1103 	uint8_t mac_addr[6];
1104 	uint16_t first_data_seq_ctrl;
1105 	union {
1106 		uint32_t rate_info;
1107 		struct {
1108 			uint32_t ltf_size:2,
1109 				 stbc:1,
1110 				 he_re:1,
1111 				 bw:4,
1112 				 nss:4,
1113 				 mcs:4,
1114 				 preamble:4,
1115 				 gi:4,
1116 				 dcm:1,
1117 				 ldpc:1,
1118 				 ppdu_type:2;
1119 		};
1120 	} u;
1121 	uint32_t lsig_a;
1122 	uint32_t rssi;
1123 	uint64_t timestamp;
1124 	uint32_t length;
1125 	uint8_t channel;
1126 };
1127 
1128 /**
1129  * struct cdp_rx_indication_msdu - Rx MSDU info
1130  * @ppdu_id: PPDU to which the MSDU belongs
1131  * @msdu_len: Length of MSDU in bytes
1132  * @ack_frame_rssi: RSSI of the received ACK or BA frame
1133  * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
1134  * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
1135  * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
1136  * @extd: Extended structure containing rate statistics
1137  */
1138 struct cdp_rx_indication_msdu {
1139 	uint32_t ppdu_id;
1140 	uint16_t msdu_len;
1141 	uint32_t ack_frame_rssi:8,
1142 		 resvd0:1,
1143 		 first_msdu:1,
1144 		 last_msdu:1,
1145 		 msdu_part_of_amsdu:1,
1146 		 msdu_part_of_ampdu:1,
1147 		 resvd1:19;
1148 	struct cdp_rate_stats extd;
1149 };
1150 
1151 /**
1152  * struct cdp_config_params - Propagate configuration parameters to datapath
1153  * @tso_enable: Enable/Disable TSO
1154  * @lro_enable: Enable/Disable LRO
1155  * @flow_steering_enable: Enable/Disable Rx Hash
1156  * @tcp_Udp_ChecksumOffload: Enable/Disable tcp-Udp checksum Offload
1157  * @napi_enable: Enable/Disable Napi
1158  * @tx_flow_stop_queue_threshold: Value to Pause tx queues
1159  * @tx_flow_start_queue_offset: Available Tx descriptors to unpause
1160  *				tx queue
1161  */
1162 struct cdp_config_params {
1163 	unsigned int tso_enable:1;
1164 	unsigned int lro_enable:1;
1165 	unsigned int flow_steering_enable:1;
1166 	unsigned int tcp_udp_checksumoffload:1;
1167 	unsigned int napi_enable:1;
1168 	/* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */
1169 	uint8_t tx_flow_stop_queue_threshold;
1170 	uint8_t tx_flow_start_queue_offset;
1171 };
1172 
1173 /**
1174  * cdp_txrx_stats_req: stats request wrapper
1175  *	used to pass request information to cdp layer
1176  * @stats: type of stats requested
1177  * @param0: opaque argument 0 to be passed to htt
1178  * @param1: opaque argument 1 to be passed to htt
1179  * @param2: opaque argument 2 to be passed to htt
1180  * @param3: opaque argument 3 to be passed to htt
1181  * @channel_param: Channel Information
1182  */
1183 struct cdp_txrx_stats_req {
1184 	enum cdp_stats	stats;
1185 	uint32_t	param0;
1186 	uint32_t	param1;
1187 	uint32_t	param2;
1188 	uint32_t	param3;
1189 	uint32_t	cookie_val;
1190 	uint8_t		channel;
1191 };
1192 
1193 /**
1194  * struct cdp_monitor_filter - monitor filter info
1195  * @mode: set filter mode
1196  * @fp_mgmt: set Filter Pass MGMT Configuration
1197  * @fp_ctrl: set Filter Pass CTRL Configuration
1198  * @fp_data: set Filter Pass DATA Configuration
1199  * @mo_mgmt: set Monitor Other MGMT Configuration
1200  * @mo_ctrl: set Monitor Other CTRL Configuration
1201  * @mo_data: set Monitor other DATA Configuration
1202  *
1203  */
1204 struct cdp_monitor_filter {
1205 	uint16_t mode;
1206 	uint16_t fp_mgmt;
1207 	uint16_t fp_ctrl;
1208 	uint16_t fp_data;
1209 	uint16_t mo_mgmt;
1210 	uint16_t mo_ctrl;
1211 	uint16_t mo_data;
1212 };
1213 #endif
1214