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