xref: /wlan-dirver/qca-wifi-host-cmn/dp/inc/cdp_txrx_ops.h (revision 2f4b444fb7e689b83a4ab0e7b3b38f0bf4def8e0)
1 /*
2  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
3  *
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 /**
20  * @file cdp_txrx_ops.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_OPS_H_
25 #define _CDP_TXRX_CMN_OPS_H_
26 
27 #include <cdp_txrx_cmn_struct.h>
28 #include <cdp_txrx_stats_struct.h>
29 #include "cdp_txrx_handle.h"
30 #include <cdp_txrx_mon_struct.h>
31 #include "wlan_objmgr_psoc_obj.h"
32 #include <wmi_unified_api.h>
33 #include <wdi_event_api.h>
34 
35 #ifdef IPA_OFFLOAD
36 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || \
37 	defined(CONFIG_IPA_WDI_UNIFIED_API)
38 #include <qdf_ipa_wdi3.h>
39 #else
40 #include <qdf_ipa.h>
41 #endif
42 #endif
43 
44 /**
45  * bitmap values to indicate special handling of peer_delete
46  */
47 #define CDP_PEER_DELETE_NO_SPECIAL             0
48 #define CDP_PEER_DO_NOT_START_UNMAP_TIMER      1
49 
50 struct hif_opaque_softc;
51 
52 /* same as ieee80211_nac_param */
53 enum cdp_nac_param_cmd {
54 	/* IEEE80211_NAC_PARAM_ADD */
55 	CDP_NAC_PARAM_ADD = 1,
56 	/* IEEE80211_NAC_PARAM_DEL */
57 	CDP_NAC_PARAM_DEL,
58 	/* IEEE80211_NAC_PARAM_LIST */
59 	CDP_NAC_PARAM_LIST,
60 };
61 
62 #define CDP_DELBA_INTERVAL_MS 3000
63 /**
64  * enum cdp_delba_rcode - CDP reason code for sending DELBA
65  * @CDP_DELBA_REASON_NONE: None
66  * @CDP_DELBA_2K_JUMP: Sending DELBA from 2k_jump_handle
67  */
68 enum cdp_delba_rcode {
69 	CDP_DELBA_REASON_NONE = 0,
70 	CDP_DELBA_2K_JUMP,
71 };
72 
73 /**
74  * enum vdev_peer_protocol_enter_exit - whether ingress or egress
75  * @CDP_VDEV_PEER_PROTOCOL_IS_INGRESS: ingress
76  * @CDP_VDEV_PEER_PROTOCOL_IS_EGRESS: egress
77  *
78  * whether ingress or egress
79  */
80 enum vdev_peer_protocol_enter_exit {
81 	CDP_VDEV_PEER_PROTOCOL_IS_INGRESS,
82 	CDP_VDEV_PEER_PROTOCOL_IS_EGRESS
83 };
84 
85 /**
86  * enum vdev_peer_protocol_tx_rx - whether tx or rx
87  * @CDP_VDEV_PEER_PROTOCOL_IS_TX: tx
88  * @CDP_VDEV_PEER_PROTOCOL_IS_RX: rx
89  *
90  * whether tx or rx
91  */
92 enum vdev_peer_protocol_tx_rx {
93 	CDP_VDEV_PEER_PROTOCOL_IS_TX,
94 	CDP_VDEV_PEER_PROTOCOL_IS_RX
95 };
96 
97 /**
98  * enum vdev_ll_conn_actions - Actions to informvdev about
99  *			       low latency connection.
100  * @CDP_VDEV_LL_CONN_ADD: Add Low latency connection
101  * @CDP_VDEV_LL_CONN_DEL: Delete Low latency connection
102  */
103 enum vdev_ll_conn_actions {
104 	CDP_VDEV_LL_CONN_ADD,
105 	CDP_VDEV_LL_CONN_DEL
106 };
107 
108 /******************************************************************************
109  *
110  * Control Interface (A Interface)
111  *
112  *****************************************************************************/
113 
114 struct cdp_cmn_ops {
115 
116 	QDF_STATUS (*txrx_soc_attach_target)(ol_txrx_soc_handle soc);
117 
118 	int (*txrx_pdev_attach_target)(ol_txrx_soc_handle soc, uint8_t pdev_id);
119 
120 	QDF_STATUS (*txrx_vdev_attach)
121 		(struct cdp_soc_t *soc, uint8_t pdev_id, uint8_t *mac,
122 		 uint8_t vdev_id, enum wlan_op_mode op_mode,
123 		 enum wlan_op_subtype subtype);
124 
125 	QDF_STATUS
126 	(*txrx_vdev_detach)(struct cdp_soc_t *cdp_soc, uint8_t vdev_id,
127 			    ol_txrx_vdev_delete_cb callback,
128 			    void *cb_context);
129 
130 	QDF_STATUS (*txrx_pdev_attach)
131 		(ol_txrx_soc_handle soc, HTC_HANDLE htc_pdev,
132 		 qdf_device_t osdev, uint8_t pdev_id);
133 
134 	int (*txrx_pdev_post_attach)(struct cdp_soc_t *soc, uint8_t pdev_id);
135 
136 	void
137 	(*txrx_pdev_pre_detach)(struct cdp_soc_t *soc, uint8_t pdev_id,
138 				int force);
139 
140 	QDF_STATUS
141 	(*txrx_pdev_detach)(struct cdp_soc_t *psoc, uint8_t pdev_id,
142 			    int force);
143 
144 	/**
145 	 * txrx_pdev_deinit() - Deinitialize pdev and dp ring memory
146 	 * @soc: soc dp handle
147 	 * @pdev_id: id of Dp pdev handle
148 	 * @force: Force deinit or not
149 	 *
150 	 * Return: QDF_STATUS
151 	 */
152 	QDF_STATUS
153 	(*txrx_pdev_deinit)(struct cdp_soc_t *soc, uint8_t pdev_id,
154 			    int force);
155 
156 	QDF_STATUS
157 	(*txrx_peer_create)
158 		(ol_txrx_soc_handle soc, uint8_t vdev_id,
159 		uint8_t *peer_mac_addr);
160 
161 	QDF_STATUS
162 	(*txrx_peer_setup)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
163 			   uint8_t *peer_mac);
164 
165 	QDF_STATUS
166 	(*txrx_cp_peer_del_response)
167 		(ol_txrx_soc_handle soc, uint8_t vdev_id,
168 		 uint8_t *peer_mac_addr);
169 
170 	QDF_STATUS
171 	(*txrx_peer_teardown)
172 		(struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t *peer_mac);
173 
174 	int (*txrx_peer_add_ast)
175 		(ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac,
176 		uint8_t *mac_addr, enum  cdp_txrx_ast_entry_type type,
177 		uint32_t flags);
178 
179 	int (*txrx_peer_update_ast)
180 		(ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac,
181 		uint8_t *mac_addr, uint32_t flags);
182 
183 	bool (*txrx_peer_get_ast_info_by_soc)
184 		(ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
185 		 struct cdp_ast_entry_info *ast_entry_info);
186 
187 	bool (*txrx_peer_get_ast_info_by_pdev)
188 		(ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
189 		 uint8_t pdev_id,
190 		 struct cdp_ast_entry_info *ast_entry_info);
191 
192 	QDF_STATUS (*txrx_peer_ast_delete_by_soc)
193 		(ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
194 		txrx_ast_free_cb callback,
195 		void *cookie);
196 
197 	QDF_STATUS (*txrx_peer_ast_delete_by_pdev)
198 		(ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
199 		 uint8_t pdev_id,
200 		txrx_ast_free_cb callback,
201 		void *cookie);
202 
203 	QDF_STATUS
204 	(*txrx_peer_delete)(struct cdp_soc_t *soc, uint8_t vdev_id,
205 			    uint8_t *peer_mac, uint32_t bitmap);
206 
207 	QDF_STATUS (*txrx_set_monitor_mode)(struct cdp_soc_t *soc,
208 					    uint8_t vdev_id,
209 					    uint8_t smart_monitor);
210 	void (*txrx_peer_delete_sync)(struct cdp_soc_t *soc, uint8_t vdev_id,
211 				      uint8_t *peer_mac,
212 				      QDF_STATUS(*delete_cb)(
213 						uint8_t vdev_id,
214 						uint32_t peerid_cnt,
215 						uint16_t *peerid_list),
216 				      uint32_t bitmap);
217 
218 	void (*txrx_peer_unmap_sync_cb_set)(struct cdp_soc_t *soc_hdl,
219 					    uint8_t pdev_id,
220 					    ol_txrx_peer_unmap_sync_cb
221 					    peer_unmap_sync);
222 
223 	QDF_STATUS
224 	(*txrx_get_peer_mac_from_peer_id)
225 		(struct cdp_soc_t *cdp_soc,
226 		 uint32_t peer_id, uint8_t *peer_mac);
227 
228 	void
229 	(*txrx_vdev_tx_lock)(struct cdp_soc_t *soc, uint8_t vdev_id);
230 
231 	void
232 	(*txrx_vdev_tx_unlock)(struct cdp_soc_t *soc, uint8_t vdev_id);
233 
234 	QDF_STATUS
235 	(*txrx_ath_getstats)(struct cdp_soc_t *soc, uint8_t id,
236 			     struct cdp_dev_stats *stats, uint8_t type);
237 
238 	QDF_STATUS
239 	(*txrx_set_gid_flag)(struct cdp_soc_t *soc, uint8_t pdev_id,
240 			     u_int8_t *mem_status,
241 			     u_int8_t *user_position);
242 
243 	uint32_t (*txrx_fw_supported_enh_stats_version)(struct cdp_soc_t *soc,
244 							uint8_t pdev_id);
245 
246 	QDF_STATUS
247 	(*txrx_if_mgmt_drain)(struct cdp_soc_t *soc, uint8_t pdev_id,
248 			      int force);
249 
250 	QDF_STATUS
251 	(*txrx_set_curchan)(struct cdp_soc_t *soc, uint8_t pdev_id,
252 			    uint32_t chan_mhz);
253 
254 	QDF_STATUS
255 	(*txrx_set_privacy_filters)
256 		(struct cdp_soc_t *soc, uint8_t vdev_id, void *filter,
257 		 uint32_t num);
258 
259 	uint32_t (*txrx_get_cfg)(struct cdp_soc_t *soc, enum cdp_dp_cfg cfg);
260 
261 	/********************************************************************
262 	 * Data Interface (B Interface)
263 	 ********************************************************************/
264 
265 	QDF_STATUS
266 	(*txrx_vdev_register)(struct cdp_soc_t *soc, uint8_t vdev_id,
267 			      ol_osif_vdev_handle osif_vdev,
268 			      struct ol_txrx_ops *txrx_ops);
269 
270 	int (*txrx_mgmt_send)(struct cdp_soc_t *soc, uint8_t vdev_id,
271 			      qdf_nbuf_t tx_mgmt_frm, uint8_t type);
272 
273 	int (*txrx_mgmt_send_ext)(struct cdp_soc_t *soc, uint8_t vdev_id,
274 				  qdf_nbuf_t tx_mgmt_frm, uint8_t type,
275 				  uint8_t use_6mbps, uint16_t chanfreq);
276 
277 	/**
278 	 * ol_txrx_mgmt_tx_cb - tx management delivery notification
279 	 * callback function
280 	 */
281 
282 	QDF_STATUS
283 	(*txrx_mgmt_tx_cb_set)(struct cdp_soc_t *soc, uint8_t pdev_id,
284 			       uint8_t type,
285 			       ol_txrx_mgmt_tx_cb download_cb,
286 			       ol_txrx_mgmt_tx_cb ota_ack_cb,
287 			       void *ctxt);
288 
289 	/**
290 	 * ol_txrx_data_tx_cb - Function registered with the data path
291 	 * that is called when tx frames marked as "no free" are
292 	 * done being transmitted
293 	 */
294 
295 	void (*txrx_data_tx_cb_set)(struct cdp_soc_t *soc, uint8_t vdev_id,
296 				    ol_txrx_data_tx_cb callback, void *ctxt);
297 
298 	qdf_nbuf_t (*tx_send_exc)
299 		(ol_txrx_soc_handle soc, uint8_t vdev_id, qdf_nbuf_t msdu_list,
300 		 struct cdp_tx_exception_metadata *tx_exc_metadata);
301 
302 	/*******************************************************************
303 	 * Statistics and Debugging Interface (C Interface)
304 	 ********************************************************************/
305 
306 	int (*txrx_aggr_cfg)(struct cdp_soc_t *soc, uint8_t vdev_id,
307 			     int max_subfrms_ampdu,
308 			     int max_subfrms_amsdu);
309 
310 	A_STATUS
311 	(*txrx_fw_stats_get)(struct cdp_soc_t *soc, uint8_t vdev_id,
312 			     struct ol_txrx_stats_req *req,
313 			     bool per_vdev, bool response_expected);
314 
315 	int (*txrx_debug)(struct cdp_soc_t *soc, uint8_t vdev_id,
316 			  int debug_specs);
317 
318 	QDF_STATUS
319 	(*txrx_fw_stats_cfg)(struct cdp_soc_t *soc, uint8_t vdev_id,
320 			     uint8_t cfg_stats_type, uint32_t cfg_val);
321 
322 	void (*txrx_print_level_set)(unsigned level);
323 
324 	/**
325 	 * ol_txrx_get_vdev_mac_addr() - Return mac addr of vdev
326 	 * @soc: datapath soc handle
327 	 * @vdev_id: vdev id
328 	 *
329 	 * Return: vdev mac address
330 	 */
331 	uint8_t * (*txrx_get_vdev_mac_addr)(struct cdp_soc_t *soc,
332 					    uint8_t vdev_id);
333 
334 	/**
335 	 * ol_txrx_get_ctrl_pdev_from_vdev() - Return control pdev of vdev
336 	 * @soc: datapath soc handle
337 	 * @vdev_id: vdev id
338 	 *
339 	 * Return: Handle to control pdev
340 	 */
341 	struct cdp_cfg *(*txrx_get_ctrl_pdev_from_vdev)(struct cdp_soc_t *soc,
342 							uint8_t vdev_id);
343 
344 	/**
345 	 * txrx_get_mon_vdev_from_pdev() - Return monitor mode vdev
346 	 * @soc: datapath soc handle
347 	 * @pdev: pdev id
348 	 *
349 	 * Return: vdev_id
350 	 */
351 	uint8_t (*txrx_get_mon_vdev_from_pdev)(struct cdp_soc_t *soc,
352 					       uint8_t pdev_id);
353 
354 	void (*txrx_soc_detach)(struct cdp_soc_t *soc);
355 
356 	/**
357 	 * txrx_soc_deinit() - Deinitialize dp soc and dp ring memory
358 	 * @soc: Opaque Dp handle
359 	 *
360 	 * Return None
361 	 */
362 	void (*txrx_soc_deinit)(struct cdp_soc_t *soc);
363 
364 	/**
365 	 * txrx_soc_init() - Initialize dp soc and dp ring memory
366 	 * @soc: Opaque Dp handle
367 	 * @ctrl_psoc: Opaque Cp handle
368 	 * @htchdl: Opaque htc handle
369 	 * @hifhdl: Opaque hif handle
370 	 *
371 	 * Return: None
372 	 */
373 	void *(*txrx_soc_init)(struct cdp_soc_t *soc,
374 			       struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
375 			       struct hif_opaque_softc *hif_handle,
376 			       HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
377 			       struct ol_if_ops *ol_ops, uint16_t device_id);
378 
379 	QDF_STATUS (*txrx_pdev_init)(ol_txrx_soc_handle soc,
380 				     HTC_HANDLE htc_handle,
381 				     qdf_device_t qdf_osdev,
382 				     uint8_t pdev_id);
383 
384 	/**
385 	 * txrx_tso_soc_attach() - TSO attach handler triggered during
386 	 * dynamic tso activation
387 	 * @soc: Opaque Dp handle
388 	 *
389 	 * Return: QDF status
390 	 */
391 	QDF_STATUS (*txrx_tso_soc_attach)(struct cdp_soc_t *soc);
392 
393 	/**
394 	 * txrx_tso_soc_detach() - TSO detach handler triggered during
395 	 * dynamic tso de-activation
396 	 * @soc: Opaque Dp handle
397 	 *
398 	 * Return: QDF status
399 	 */
400 	QDF_STATUS (*txrx_tso_soc_detach)(struct cdp_soc_t *soc);
401 	int (*addba_resp_tx_completion)(struct cdp_soc_t *cdp_soc,
402 					uint8_t *peer_mac,
403 					uint16_t vdev_id, uint8_t tid,
404 					int status);
405 
406 	int (*addba_requestprocess)(struct cdp_soc_t *cdp_soc,
407 				    uint8_t *peer_mac,
408 				    uint16_t vdev_id,
409 				    uint8_t dialogtoken,
410 				    uint16_t tid, uint16_t batimeout,
411 				    uint16_t buffersize,
412 				    uint16_t startseqnum);
413 
414 	QDF_STATUS
415 	(*addba_responsesetup)(struct cdp_soc_t *cdp_soc,
416 			       uint8_t *peer_mac,
417 			       uint16_t vdev_id, uint8_t tid,
418 			       uint8_t *dialogtoken, uint16_t *statuscode,
419 			       uint16_t *buffersize, uint16_t *batimeout);
420 
421 	int (*delba_process)(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac,
422 			     uint16_t vdev_id, int tid, uint16_t reasoncode);
423 
424 	/**
425 	 * delba_tx_completion() - Indicate delba tx status
426 	 * @cdp_soc: soc handle
427 	 * @peer_mac: Peer mac address
428 	 * @vdev_id: vdev id
429 	 * @tid: Tid number
430 	 * @status: Tx completion status
431 	 *
432 	 * Return: 0 on Success, 1 on failure
433 	 */
434 	int (*delba_tx_completion)(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac,
435 				   uint16_t vdev_id,
436 				   uint8_t tid, int status);
437 
438 	QDF_STATUS
439 	(*set_addba_response)(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac,
440 			      uint16_t vdev_id, uint8_t tid,
441 			      uint16_t statuscode);
442 
443 	QDF_STATUS
444 	(*set_vdev_dscp_tid_map)(struct cdp_soc_t *soc_handle,
445 				 uint8_t vdev_id, uint8_t map_id);
446 	int (*txrx_get_total_per)(struct cdp_soc_t *soc, uint8_t pdev_id);
447 
448 	void (*flush_cache_rx_queue)(void);
449 
450 	QDF_STATUS (*set_pdev_dscp_tid_map)(struct cdp_soc_t *soc_handle,
451 					    uint8_t pdev_id,
452 					    uint8_t map_id,
453 					    uint8_t tos, uint8_t tid);
454 
455 	QDF_STATUS (*txrx_stats_request)(struct cdp_soc_t *soc_handle,
456 					 uint8_t vdev_id,
457 					 struct cdp_txrx_stats_req *req);
458 
459 	QDF_STATUS (*display_stats)(struct cdp_soc_t *psoc, uint16_t value,
460 				    enum qdf_stats_verbosity_level level);
461 
462 	QDF_STATUS (*txrx_intr_attach)(struct cdp_soc_t *soc_handle);
463 	void (*txrx_intr_detach)(struct cdp_soc_t *soc_handle);
464 	QDF_STATUS  (*set_pn_check)(struct cdp_soc_t *soc_handle,
465 				    uint8_t vdev_id, uint8_t *peermac,
466 				    enum cdp_sec_type sec_type,
467 				    uint32_t *rx_pn);
468 
469 	QDF_STATUS(*set_key_sec_type)(struct cdp_soc_t *soc_handle,
470 				      uint8_t vdev_id, uint8_t *peermac,
471 				      enum cdp_sec_type sec_type,
472 				      bool is_unicast);
473 
474 	QDF_STATUS (*update_config_parameters)(struct cdp_soc *psoc,
475 			struct cdp_config_params *params);
476 
477 	void *(*get_dp_txrx_handle)(ol_txrx_soc_handle soc, uint8_t pdev_id);
478 	void (*set_dp_txrx_handle)(ol_txrx_soc_handle soc, uint8_t pdev_id,
479 				   void *dp_hdl);
480 
481 	void *(*get_vdev_dp_ext_txrx_handle)(struct cdp_soc_t *soc,
482 					     uint8_t vdev_id);
483 	QDF_STATUS (*set_vdev_dp_ext_txrx_handle)(struct cdp_soc_t *soc,
484 						  uint8_t vdev_id,
485 						  uint16_t size);
486 
487 	void *(*get_soc_dp_txrx_handle)(struct cdp_soc *soc_handle);
488 	void (*set_soc_dp_txrx_handle)(struct cdp_soc *soc_handle,
489 			void *dp_txrx_handle);
490 
491 	QDF_STATUS (*map_pdev_to_lmac)(ol_txrx_soc_handle soc, uint8_t pdev_id,
492 				       uint32_t lmac_id);
493 
494 	QDF_STATUS (*handle_mode_change)(ol_txrx_soc_handle soc,
495 					 uint8_t pdev_id, uint32_t lmac_id);
496 
497 	QDF_STATUS (*set_pdev_status_down)(struct cdp_soc_t *soc_handle,
498 					   uint8_t pdev_id, bool is_pdev_down);
499 
500 	QDF_STATUS (*txrx_peer_reset_ast)
501 		(ol_txrx_soc_handle soc, uint8_t *ast_macaddr,
502 		 uint8_t *peer_macaddr, uint8_t vdev_id);
503 
504 	QDF_STATUS (*txrx_peer_reset_ast_table)(ol_txrx_soc_handle soc,
505 						uint8_t vdev_id);
506 
507 	void (*txrx_peer_flush_ast_table)(ol_txrx_soc_handle soc);
508 	void (*txrx_set_ba_aging_timeout)(struct cdp_soc_t *soc_handle,
509 					  uint8_t ac, uint32_t value);
510 	void (*txrx_get_ba_aging_timeout)(struct cdp_soc_t *soc_handle,
511 					  uint8_t ac, uint32_t *value);
512 
513 	QDF_STATUS (*txrx_peer_map_attach)(ol_txrx_soc_handle soc,
514 					   uint32_t num_peers,
515 					   uint32_t max_ast_index,
516 					   bool peer_map_unmap_v2);
517 
518 	QDF_STATUS (*set_soc_param)(ol_txrx_soc_handle soc,
519 				    enum cdp_soc_param_t param,
520 				    uint32_t value);
521 
522 	ol_txrx_tx_fp tx_send;
523 	/**
524 	 * txrx_get_os_rx_handles_from_vdev() - Return function, osif vdev
525 	 *					to deliver pkt to stack.
526 	 * @soc: datapath soc handle
527 	 * @vdev: vdev id
528 	 * @stack_fn: pointer to - function pointer to deliver RX pkt to stack
529 	 * @osif_vdev: pointer to - osif vdev to deliver RX packet to.
530 	 */
531 	void (*txrx_get_os_rx_handles_from_vdev)
532 					(ol_txrx_soc_handle soc,
533 					 uint8_t vdev_id,
534 					 ol_txrx_rx_fp *stack_fn,
535 					 ol_osif_vdev_handle *osif_vdev);
536 
537 	void (*set_rate_stats_ctx)(struct cdp_soc_t *soc,
538 				   void *ctx);
539 
540 	int (*txrx_classify_update)
541 		(struct cdp_soc_t *soc, uint8_t vdev_id, qdf_nbuf_t skb,
542 		 enum txrx_direction, struct ol_txrx_nbuf_classify *nbuf_class);
543 
544 	bool (*get_dp_capabilities)(struct cdp_soc_t *soc,
545 				    enum cdp_capabilities dp_caps);
546 	void* (*get_rate_stats_ctx)(struct cdp_soc_t *soc);
547 	QDF_STATUS (*txrx_peer_flush_rate_stats)(struct cdp_soc_t *soc,
548 						 uint8_t pdev_id,
549 						 void *buf);
550 	void* (*txrx_peer_get_rdkstats_ctx)(struct cdp_soc_t *soc,
551 					    uint8_t vdev_id,
552 					    uint8_t *mac_addr);
553 
554 	QDF_STATUS (*txrx_flush_rate_stats_request)(struct cdp_soc_t *soc,
555 						    uint8_t pdev_id);
556 	QDF_STATUS (*set_pdev_pcp_tid_map)(struct cdp_soc_t *soc,
557 					   uint8_t pdev_id,
558 					   uint8_t pcp, uint8_t tid);
559 	QDF_STATUS (*set_vdev_pcp_tid_map)(struct cdp_soc_t *soc,
560 					   uint8_t vdev_id,
561 					   uint8_t pcp, uint8_t tid);
562 #ifdef QCA_MULTIPASS_SUPPORT
563 	QDF_STATUS (*set_vlan_groupkey)(struct cdp_soc_t *soc, uint8_t vdev_id,
564 					uint16_t vlan_id, uint16_t group_key);
565 #endif
566 
567 	uint16_t (*get_peer_mac_list)
568 		 (ol_txrx_soc_handle soc, uint8_t vdev_id,
569 		  u_int8_t newmac[][QDF_MAC_ADDR_SIZE], uint16_t mac_cnt,
570 		  bool limit);
571 #ifdef QCA_SUPPORT_WDS_EXTENDED
572 	uint16_t (*get_wds_ext_peer_id)(ol_txrx_soc_handle soc,
573 					uint8_t vdev_id,
574 					uint8_t *mac);
575 	QDF_STATUS (*set_wds_ext_peer_rx)(ol_txrx_soc_handle soc,
576 					  uint8_t vdev_id,
577 					  uint8_t *mac,
578 					  ol_txrx_rx_fp rx,
579 					  ol_osif_peer_handle osif_peer);
580 #endif /* QCA_SUPPORT_WDS_EXTENDED */
581 	void (*txrx_drain)(ol_txrx_soc_handle soc);
582 	int (*get_free_desc_poolsize)(struct cdp_soc_t *soc);
583 };
584 
585 struct cdp_ctrl_ops {
586 
587 	int
588 		(*txrx_mempools_attach)(ol_txrx_soc_handle dp_soc);
589 	int
590 		(*txrx_update_filter_neighbour_peers)(
591 				struct cdp_soc_t *soc, uint8_t vdev_id,
592 				uint32_t cmd, uint8_t *macaddr);
593 
594 	/* Is this similar to ol_txrx_peer_state_update() in MCL */
595 	/**
596 	 * @brief Update the authorize peer object at association time
597 	 * @details
598 	 * For the host-based implementation of rate-control, it
599 	 * updates the peer/node-related parameters within rate-control
600 	 * context of the peer at association.
601 	 *
602 	 * @param soc_hdl - pointer to the soc object
603 	 * @param vdev_id - id of the virtual object
604 	 * @param peer_mac - mac address of the node's object
605 	 * @authorize - either to authorize or unauthorize peer
606 	 *
607 	 * @return QDF_STATUS
608 	 */
609 	QDF_STATUS
610 		(*txrx_peer_authorize)(struct cdp_soc_t *soc_hdl,
611 				       uint8_t vdev_id,
612 				       uint8_t *peer_mac,
613 				       u_int32_t authorize);
614 
615 	void (*tx_flush_buffers)(struct cdp_soc_t *soc, uint8_t vdev_id);
616 
617 	int (*txrx_is_target_ar900b)(struct cdp_soc_t *soc_hdl);
618 
619 	QDF_STATUS
620 	(*txrx_set_vdev_param)(struct cdp_soc_t *soc, uint8_t vdev_id,
621 			       enum cdp_vdev_param_type param,
622 			       cdp_config_param_type val);
623 
624 	/**
625 	 * @brief Set the reo dest ring num of the radio
626 	 * @details
627 	 *  Set the reo destination ring no on which we will receive
628 	 *  pkts for this radio.
629 	 *
630 	 * @txrx_soc - soc handle
631 	 * @param pdev_id - id of physical device
632 	 * @return the reo destination ring number
633 	 * @param reo_dest_ring_num - value ranges between 1 - 4
634 	 */
635 	QDF_STATUS (*txrx_set_pdev_reo_dest)(
636 			struct cdp_soc_t *txrx_soc,
637 			uint8_t pdev_id,
638 			enum cdp_host_reo_dest_ring reo_dest_ring_num);
639 
640 	/**
641 	 * @brief Get the reo dest ring num of the radio
642 	 * @details
643 	 *  Get the reo destination ring no on which we will receive
644 	 *  pkts for this radio.
645 	 *
646 	 * @txrx_soc - soc handle
647 	 * @param pdev_id - id of physical device
648 	 * @return the reo destination ring number
649 	 */
650 	enum cdp_host_reo_dest_ring (*txrx_get_pdev_reo_dest)(
651 				     struct cdp_soc_t *txrx_soc,
652 				     uint8_t pdev_id);
653 
654 	int (*txrx_wdi_event_sub)(struct cdp_soc_t *soc, uint8_t pdev_id,
655 				  wdi_event_subscribe *event_cb_sub,
656 				  uint32_t event);
657 
658 	int (*txrx_wdi_event_unsub)(struct cdp_soc_t *soc, uint8_t pdev_id,
659 				    wdi_event_subscribe *event_cb_sub,
660 				    uint32_t event);
661 
662 	int (*txrx_get_sec_type)(ol_txrx_soc_handle soc, uint8_t vdev_id,
663 				 uint8_t *peer_mac, uint8_t sec_idx);
664 
665 	QDF_STATUS
666 	(*txrx_update_mgmt_txpow_vdev)(struct cdp_soc_t *soc,
667 				       uint8_t vdev_id,
668 				       uint8_t subtype, uint8_t tx_power);
669 
670 	/**
671 	 * txrx_set_pdev_param() - callback to set pdev parameter
672 	 * @soc: opaque soc handle
673 	 * @pdev_id:id of data path pdev handle
674 	 * @val: value of pdev_tx_capture
675 	 *
676 	 * Return: status: 0 - Success, non-zero: Failure
677 	 */
678 	QDF_STATUS (*txrx_set_pdev_param)(struct cdp_soc_t *soc,
679 					  uint8_t pdev_id,
680 					  enum cdp_pdev_param_type type,
681 					  cdp_config_param_type val);
682 
683 	QDF_STATUS (*txrx_get_pdev_param)(struct cdp_soc_t *soc,
684 					  uint8_t pdev_id,
685 					  enum cdp_pdev_param_type type,
686 					  cdp_config_param_type *val);
687 
688 	QDF_STATUS (*txrx_set_peer_param)(struct cdp_soc_t *soc,
689 					  uint8_t vdev_id, uint8_t *peer_mac,
690 					  enum cdp_peer_param_type param,
691 					  cdp_config_param_type val);
692 
693 	QDF_STATUS (*txrx_get_peer_param)(struct cdp_soc_t *soc,
694 					  uint8_t vdev_id, uint8_t *peer_mac,
695 					  enum cdp_peer_param_type param,
696 					  cdp_config_param_type *val);
697 
698 	void * (*txrx_get_pldev)(struct cdp_soc_t *soc, uint8_t pdev_id);
699 	void (*txrx_peer_flush_frags)(struct cdp_soc_t *soc, uint8_t vdev_id,
700 				      uint8_t *peer_mac);
701 
702 #ifdef VDEV_PEER_PROTOCOL_COUNT
703 	void (*txrx_peer_protocol_cnt)(struct cdp_soc_t *soc,
704 				       int8_t vdev_id,
705 				       qdf_nbuf_t nbuf,
706 				       bool is_egress,
707 				       bool is_rx);
708 #endif
709 #ifdef ATH_SUPPORT_NAC_RSSI
710 	QDF_STATUS (*txrx_vdev_config_for_nac_rssi)(struct cdp_soc_t *cdp_soc,
711 						    uint8_t vdev_id,
712 						    enum cdp_nac_param_cmd cmd,
713 						    char *bssid,
714 						    char *client_macaddr,
715 						    uint8_t chan_num);
716 
717 	QDF_STATUS (*txrx_vdev_get_neighbour_rssi)(struct cdp_soc_t *cdp_soc,
718 						   uint8_t vdev_id,
719 						   char *macaddr,
720 						   uint8_t *rssi);
721 #endif
722 
723 #ifdef WLAN_SUPPORT_SCS
724 	QDF_STATUS
725 		(*txrx_enable_scs_params) (
726 			   struct cdp_soc_t *soc, struct qdf_mac_addr
727 			   *macaddr,
728 			   uint8_t vdev_id,
729 			   bool is_active);
730 
731 	QDF_STATUS
732 		(*txrx_record_scs_params) (
733 			   struct cdp_soc_t *soc, struct qdf_mac_addr
734 			   *macaddr,
735 			   uint8_t vdev_id,
736 			   struct cdp_scs_params *scs_params,
737 			   uint8_t entry_ctr,
738 			   uint8_t scs_sessions);
739 #endif
740 
741 #ifdef WLAN_SUPPORT_MSCS
742 	QDF_STATUS
743 		(*txrx_record_mscs_params) (
744 				struct cdp_soc_t *soc, uint8_t *macaddr,
745 				uint8_t vdev_id,
746 				struct cdp_mscs_params *mscs_params,
747 				bool active);
748 #endif
749 
750 	QDF_STATUS
751 	(*set_key)(struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t *mac,
752 		   bool is_unicast, uint32_t *key);
753 
754 	QDF_STATUS (*txrx_get_vdev_param)(struct cdp_soc_t *soc,
755 					  uint8_t vdev_id,
756 					  enum cdp_vdev_param_type param,
757 					  cdp_config_param_type *val);
758 	int (*enable_peer_based_pktlog)(struct cdp_soc_t *cdp_soc,
759 					uint8_t pdev_id,
760 					uint8_t *macaddr, uint8_t enb_dsb);
761 
762 	QDF_STATUS
763 	(*calculate_delay_stats)(struct cdp_soc_t *cdp_soc,
764 				 uint8_t vdev_id, qdf_nbuf_t nbuf);
765 #ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG
766 	QDF_STATUS (*txrx_update_pdev_rx_protocol_tag)(
767 			struct cdp_soc_t  *soc, uint8_t pdev_id,
768 			uint32_t protocol_mask, uint16_t protocol_type,
769 			uint16_t tag);
770 #ifdef WLAN_SUPPORT_RX_TAG_STATISTICS
771 	void (*txrx_dump_pdev_rx_protocol_tag_stats)(
772 				struct cdp_soc_t  *soc, uint8_t pdev_id,
773 				uint16_t protocol_type);
774 #endif /* WLAN_SUPPORT_RX_TAG_STATISTICS */
775 #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
776 #ifdef WLAN_SUPPORT_RX_FLOW_TAG
777 	QDF_STATUS (*txrx_set_rx_flow_tag)(
778 		struct cdp_soc_t *cdp_soc, uint8_t pdev_id,
779 		struct cdp_rx_flow_info *flow_info);
780 	QDF_STATUS (*txrx_dump_rx_flow_tag_stats)(
781 		struct cdp_soc_t *cdp_soc, uint8_t pdev_id,
782 		struct cdp_rx_flow_info *flow_info);
783 #endif /* WLAN_SUPPORT_RX_FLOW_TAG */
784 #ifdef QCA_MULTIPASS_SUPPORT
785 	void (*txrx_peer_set_vlan_id)(struct cdp_soc_t *cdp_soc,
786 				      uint8_t vdev_id, uint8_t *peer_mac,
787 				      uint16_t vlan_id);
788 #endif
789 #if defined(WLAN_TX_PKT_CAPTURE_ENH) || defined(WLAN_RX_PKT_CAPTURE_ENH)
790 	QDF_STATUS (*txrx_update_peer_pkt_capture_params)(
791 			ol_txrx_soc_handle soc, uint8_t pdev_id,
792 			bool is_rx_pkt_cap_enable, uint8_t is_tx_pkt_cap_enable,
793 			uint8_t *peer_mac);
794 #endif /* WLAN_TX_PKT_CAPTURE_ENH || WLAN_RX_PKT_CAPTURE_ENH */
795 	QDF_STATUS
796 	(*txrx_set_psoc_param)(struct cdp_soc_t *soc,
797 			       enum cdp_psoc_param_type param,
798 			       cdp_config_param_type val);
799 
800 	QDF_STATUS (*txrx_get_psoc_param)(ol_txrx_soc_handle soc,
801 					  enum cdp_psoc_param_type type,
802 					  cdp_config_param_type *val);
803 #ifdef VDEV_PEER_PROTOCOL_COUNT
804 	/*
805 	 * Enable per-peer protocol counters
806 	 */
807 	void (*txrx_enable_peer_protocol_count)(struct cdp_soc_t *soc,
808 						int8_t vdev_id, bool enable);
809 	void (*txrx_set_peer_protocol_drop_mask)(struct cdp_soc_t *soc,
810 						 int8_t vdev_id, int mask);
811 	int (*txrx_is_peer_protocol_count_enabled)(struct cdp_soc_t *soc,
812 						   int8_t vdev_id);
813 	int (*txrx_get_peer_protocol_drop_mask)(struct cdp_soc_t *soc,
814 						int8_t vdev_id);
815 
816 #endif
817 
818 #ifdef WLAN_FEATURE_TSF_UPLINK_DELAY
819 	void (*txrx_set_delta_tsf)(struct cdp_soc_t *soc, uint8_t vdev_id,
820 				   uint32_t delta_tsf);
821 	QDF_STATUS (*txrx_set_tsf_ul_delay_report)(struct cdp_soc_t *soc,
822 						   uint8_t vdev_id,
823 						   bool enable);
824 	QDF_STATUS (*txrx_get_uplink_delay)(struct cdp_soc_t *soc,
825 					    uint8_t vdev_id,
826 					    uint32_t *val);
827 #endif
828 };
829 
830 struct cdp_me_ops {
831 
832 	void (*tx_me_alloc_descriptor)(struct cdp_soc_t *soc,
833 				       uint8_t pdev_id);
834 
835 	void (*tx_me_free_descriptor)(struct cdp_soc_t *soc, uint8_t pdev_id);
836 
837 	uint16_t (*tx_me_convert_ucast)(struct cdp_soc_t *soc, uint8_t vdev_id,
838 					qdf_nbuf_t wbuf, u_int8_t newmac[][6],
839 					uint8_t newmaccnt, uint8_t tid,
840 					bool is_igmp);
841 };
842 
843 struct cdp_mon_ops {
844 
845 	QDF_STATUS (*txrx_reset_monitor_mode)
846 		(ol_txrx_soc_handle soc, uint8_t pdev_id, u_int8_t smart_monitor);
847 
848 	QDF_STATUS (*txrx_deliver_tx_mgmt)
849 		(struct cdp_soc_t *cdp_soc, uint8_t pdev_id, qdf_nbuf_t nbuf);
850 
851 	/* HK advance monitor filter support */
852 	QDF_STATUS (*txrx_set_advance_monitor_filter)
853 		(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
854 		 struct cdp_monitor_filter *filter_val);
855 
856 	/* Configure full monitor mode */
857 	QDF_STATUS
858 		(*config_full_mon_mode)(struct cdp_soc_t *soc, uint8_t val);
859 };
860 
861 struct cdp_host_stats_ops {
862 	int (*txrx_host_stats_get)(struct cdp_soc_t *soc, uint8_t vdev_id,
863 				   struct ol_txrx_stats_req *req);
864 
865 	QDF_STATUS (*txrx_host_stats_clr)(struct cdp_soc_t *soc,
866 					  uint8_t vdev_id);
867 
868 	QDF_STATUS
869 	(*txrx_host_ce_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
870 
871 	int (*txrx_stats_publish)(struct cdp_soc_t *soc, uint8_t pdev_id,
872 				  struct cdp_stats_extd *buf);
873 	/**
874 	 * @brief Enable enhanced stats functionality.
875 	 *
876 	 * @param soc - the soc handle
877 	 * @param pdev_id - pdev_id of pdev
878 	 * @return - QDF_STATUS
879 	 */
880 	QDF_STATUS (*txrx_enable_enhanced_stats)(struct cdp_soc_t *soc,
881 						 uint8_t pdev_id);
882 
883 	/**
884 	 * @brief Disable enhanced stats functionality.
885 	 *
886 	 * @param soc - the soc handle
887 	 * @param pdev_id - pdev_id of pdev
888 	 * @return - QDF_STATUS
889 	 */
890 	QDF_STATUS (*txrx_disable_enhanced_stats)(struct cdp_soc_t *soc,
891 						  uint8_t pdev_id);
892 
893 	QDF_STATUS
894 		(*tx_print_tso_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
895 
896 	QDF_STATUS
897 		(*tx_rst_tso_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
898 
899 	QDF_STATUS
900 		(*tx_print_sg_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
901 
902 	QDF_STATUS
903 		(*tx_rst_sg_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
904 
905 	QDF_STATUS
906 		(*print_rx_cksum_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
907 
908 	QDF_STATUS
909 		(*rst_rx_cksum_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
910 
911 	QDF_STATUS
912 		(*txrx_host_me_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
913 
914 	QDF_STATUS
915 		(*txrx_per_peer_stats)(struct cdp_soc_t *soc, uint8_t *addr);
916 
917 	int (*txrx_host_msdu_ttl_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
918 					struct ol_txrx_stats_req *req);
919 
920 	int (*ol_txrx_update_peer_stats)(struct cdp_soc_t *soc,
921 					 uint8_t pdev_id,
922 					 uint8_t *addr, void *stats,
923 					 uint32_t last_tx_rate_mcs,
924 					 uint32_t stats_id);
925 
926 	QDF_STATUS
927 		(*get_fw_peer_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
928 				     uint8_t *addr,
929 				     uint32_t cap, uint32_t copy_stats);
930 
931 	QDF_STATUS
932 		(*get_htt_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
933 				 void *data,
934 				 uint32_t data_len);
935 	QDF_STATUS
936 		(*txrx_update_pdev_stats)(struct cdp_soc_t *soc,
937 					  uint8_t pdev_id, void *data,
938 					  uint16_t stats_id);
939 	QDF_STATUS
940 		(*txrx_get_peer_stats_param)(struct cdp_soc_t *soc,
941 					     uint8_t vdev_id,
942 					     uint8_t *peer_mac,
943 					     enum cdp_peer_stats_type type,
944 					     cdp_peer_stats_param_t *buf);
945 	QDF_STATUS
946 		(*txrx_get_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
947 				       uint8_t *peer_mac,
948 				       struct cdp_peer_stats *peer_stats);
949 	QDF_STATUS
950 		(*txrx_get_soc_stats)(struct cdp_soc_t *soc,
951 				      struct cdp_soc_stats *soc_stats);
952 	QDF_STATUS
953 		(*txrx_reset_peer_ald_stats)(struct cdp_soc_t *soc,
954 					     uint8_t vdev_id,
955 					     uint8_t *peer_mac);
956 	QDF_STATUS
957 		(*txrx_reset_peer_stats)(struct cdp_soc_t *soc,
958 					 uint8_t vdev_id, uint8_t *peer_mac);
959 	int
960 		(*txrx_get_vdev_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
961 				       void *buf, bool is_aggregate);
962 	int
963 		(*txrx_process_wmi_host_vdev_stats)(ol_txrx_soc_handle soc,
964 						    void *data, uint32_t len,
965 						    uint32_t stats_id);
966 	int
967 		(*txrx_get_vdev_extd_stats)(struct cdp_soc_t *soc,
968 					    uint8_t vdev_id,
969 					    wmi_host_vdev_extd_stats *buffer);
970 	QDF_STATUS
971 		(*txrx_update_vdev_stats)(struct cdp_soc_t *soc,
972 					  uint8_t vdev_id, void *buf,
973 					  uint16_t stats_id);
974 	int
975 		(*txrx_get_radio_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
976 					void *buf);
977 	QDF_STATUS
978 		(*txrx_get_pdev_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
979 				       struct cdp_pdev_stats *buf);
980 	int
981 		(*txrx_get_ratekbps)(int preamb, int mcs,
982 				     int htflag, int gintval);
983 
984 	QDF_STATUS
985 	(*txrx_update_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
986 				  uint8_t *peer_mac, void *stats,
987 				  uint32_t last_tx_rate_mcs,
988 				  uint32_t stats_id);
989 
990 #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
991 	QDF_STATUS
992 	(*txrx_get_scan_spcl_vap_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
993 					struct cdp_scan_spcl_vap_stats *stats);
994 #endif
995 };
996 
997 struct cdp_wds_ops {
998 	QDF_STATUS
999 	(*txrx_set_wds_rx_policy)(struct cdp_soc_t *soc, uint8_t vdev_id,
1000 				  u_int32_t val);
1001 	QDF_STATUS
1002 	(*txrx_wds_peer_tx_policy_update)(struct cdp_soc_t *soc,
1003 					  uint8_t vdev_id, uint8_t *peer_mac,
1004 					  int wds_tx_ucast, int wds_tx_mcast);
1005 	int (*vdev_set_wds)(struct cdp_soc_t *soc, uint8_t vdev_id,
1006 			    uint32_t val);
1007 };
1008 
1009 struct cdp_raw_ops {
1010 	QDF_STATUS
1011 	(*rsim_get_astentry)(struct cdp_soc_t *soc, uint8_t vdev_id,
1012 			     qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast);
1013 };
1014 
1015 #ifdef PEER_FLOW_CONTROL
1016 struct cdp_pflow_ops {
1017 	uint32_t (*pflow_update_pdev_params)(struct cdp_soc_t *soc,
1018 					     uint8_t pdev_id,
1019 					     enum _dp_param_t,
1020 					     uint32_t, void *);
1021 };
1022 #endif /* PEER_FLOW_CONTROL */
1023 
1024 #define LRO_IPV4_SEED_ARR_SZ 5
1025 #define LRO_IPV6_SEED_ARR_SZ 11
1026 
1027 /**
1028  * struct cdp_lro_hash_config - set rx_offld(LRO/GRO) init parameters
1029  * @lro_enable: indicates whether rx_offld is enabled
1030  * @tcp_flag: If the TCP flags from the packet do not match
1031  * the values in this field after masking with TCP flags mask
1032  * below, packet is not rx_offld eligible
1033  * @tcp_flag_mask: field for comparing the TCP values provided
1034  * above with the TCP flags field in the received packet
1035  * @toeplitz_hash_ipv4: contains seed needed to compute the flow id
1036  * 5-tuple toeplitz hash for ipv4 packets
1037  * @toeplitz_hash_ipv6: contains seed needed to compute the flow id
1038  * 5-tuple toeplitz hash for ipv6 packets
1039  */
1040 struct cdp_lro_hash_config {
1041 	uint32_t lro_enable;
1042 	uint32_t tcp_flag:9,
1043 		tcp_flag_mask:9;
1044 	uint32_t toeplitz_hash_ipv4[LRO_IPV4_SEED_ARR_SZ];
1045 	uint32_t toeplitz_hash_ipv6[LRO_IPV6_SEED_ARR_SZ];
1046 };
1047 
1048 struct ol_if_ops {
1049 	void
1050 	(*peer_set_default_routing)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
1051 				    uint8_t pdev_id, uint8_t *peer_macaddr,
1052 				    uint8_t vdev_id,
1053 				    bool hash_based, uint8_t ring_num);
1054 	QDF_STATUS
1055 	(*peer_rx_reorder_queue_setup)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
1056 				       uint8_t pdev_id,
1057 				       uint8_t vdev_id, uint8_t *peer_mac,
1058 				       qdf_dma_addr_t hw_qdesc, int tid,
1059 				       uint16_t queue_num,
1060 				       uint8_t ba_window_size_valid,
1061 				       uint16_t ba_window_size);
1062 	QDF_STATUS
1063 	(*peer_rx_reorder_queue_remove)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
1064 					uint8_t pdev_id,
1065 					uint8_t vdev_id, uint8_t *peer_macaddr,
1066 					uint32_t tid_mask);
1067 	int (*peer_unref_delete)(struct cdp_ctrl_objmgr_psoc *psoc,
1068 				 uint8_t pdev_id,
1069 				 uint8_t *peer_mac,
1070 				 uint8_t *vdev_mac, enum wlan_op_mode opmode);
1071 	bool (*is_hw_dbs_2x2_capable)(struct wlan_objmgr_psoc *psoc);
1072 	int (*peer_add_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc,
1073 				  uint8_t vdev_id,
1074 				  uint8_t *peer_macaddr,
1075 				  uint16_t peer_id,
1076 				  const uint8_t *dest_macaddr,
1077 				  uint8_t *next_node_mac,
1078 				  uint32_t flags,
1079 				  uint8_t type);
1080 	int (*peer_update_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc,
1081 				     uint8_t vdev_id,
1082 				     uint8_t *dest_macaddr,
1083 				     uint8_t *peer_macaddr,
1084 				     uint32_t flags);
1085 	void (*peer_del_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc,
1086 				   uint8_t vdev_id,
1087 				   uint8_t *wds_macaddr,
1088 				   uint8_t type,
1089 				   uint8_t delete_in_fw);
1090 	QDF_STATUS
1091 	(*lro_hash_config)(struct cdp_ctrl_objmgr_psoc *psoc, uint8_t pdev_id,
1092 			   struct cdp_lro_hash_config *rx_offld_hash);
1093 
1094 	void (*update_dp_stats)(void *soc, void *stats, uint16_t id,
1095 			uint8_t type);
1096 #ifdef FEATURE_NAC_RSSI
1097 	uint8_t (*rx_invalid_peer)(struct cdp_ctrl_objmgr_psoc *soc,
1098 				   uint8_t pdev_id, void *msg);
1099 #else
1100 	uint8_t (*rx_invalid_peer)(uint8_t vdev_id, void *wh);
1101 #endif
1102 
1103 	int  (*peer_map_event)(struct cdp_ctrl_objmgr_psoc *psoc,
1104 			       uint16_t peer_id, uint16_t hw_peer_id,
1105 			       uint8_t vdev_id, uint8_t *peer_mac_addr,
1106 			       enum cdp_txrx_ast_entry_type peer_type,
1107 			       uint32_t tx_ast_hashidx);
1108 	int (*peer_unmap_event)(struct cdp_ctrl_objmgr_psoc *psoc,
1109 				uint16_t peer_id,
1110 				uint8_t vdev_id);
1111 
1112 	int (*get_dp_cfg_param)(struct cdp_ctrl_objmgr_psoc *psoc,
1113 				enum cdp_cfg_param_type param_num);
1114 
1115 	void (*rx_mic_error)(struct cdp_ctrl_objmgr_psoc *psoc,
1116 			     uint8_t pdev_id,
1117 			     struct cdp_rx_mic_err_info *info);
1118 
1119 	bool (*rx_frag_tkip_demic)(struct cdp_ctrl_objmgr_psoc *psoc,
1120 				   uint8_t vdev_id, uint8_t *peer_mac_addr,
1121 				   qdf_nbuf_t nbuf,
1122 				   uint16_t hdr_space);
1123 
1124 	uint8_t (*freq_to_channel)(struct cdp_ctrl_objmgr_psoc *psoc,
1125 				   uint8_t pdev_id, uint16_t freq);
1126 
1127 	uint8_t (*freq_to_band)(struct cdp_ctrl_objmgr_psoc *psoc,
1128 				uint8_t pdev_id, uint16_t freq);
1129 
1130 #ifdef ATH_SUPPORT_NAC_RSSI
1131 	int (*config_fw_for_nac_rssi)(struct cdp_ctrl_objmgr_psoc *psoc,
1132 				      uint8_t pdev_id,
1133 				      u_int8_t vdev_id,
1134 				      enum cdp_nac_param_cmd cmd, char *bssid,
1135 				      char *client_macaddr, uint8_t chan_num);
1136 
1137 	int
1138 	(*config_bssid_in_fw_for_nac_rssi)(struct cdp_ctrl_objmgr_psoc *psoc,
1139 					   uint8_t pdev_id, u_int8_t vdev_id,
1140 					   enum cdp_nac_param_cmd cmd,
1141 					   char *bssid, char *client_mac);
1142 #endif
1143 	int (*peer_sta_kickout)(struct cdp_ctrl_objmgr_psoc *psoc,
1144 				uint16_t pdev_id, uint8_t *peer_macaddr);
1145 
1146 	/**
1147 	 * send_delba() - Send delba to peer
1148 	 * @psoc: Objmgr soc handle
1149 	 * @vdev_id: dp vdev id
1150 	 * @peer_macaddr: Peer mac addr
1151 	 * @tid: Tid number
1152 	 * @reason_code: Reason code
1153 	 * @cdp_rcode: CDP reason code for sending DELBA
1154 	 *
1155 	 * Return: 0 for success, non-zero for failure
1156 	 */
1157 	int (*send_delba)(struct cdp_ctrl_objmgr_psoc *psoc, uint8_t vdev_id,
1158 			  uint8_t *peer_macaddr, uint8_t tid,
1159 			  uint8_t reason_code, uint8_t cdp_rcode);
1160 
1161 	int
1162 	(*peer_delete_multiple_wds_entries)(struct cdp_ctrl_objmgr_psoc *psoc,
1163 					    uint8_t vdev_id,
1164 					    uint8_t *dest_macaddr,
1165 					    uint8_t *peer_macaddr,
1166 					    uint32_t flags);
1167 	int
1168 	(*pdev_update_lmac_n_target_pdev_id)(struct cdp_ctrl_objmgr_psoc *psoc,
1169 					    uint8_t *pdev_id,
1170 					    uint8_t *lmac_id,
1171 					    uint8_t *target_pdev_id);
1172 	bool (*is_roam_inprogress)(uint32_t vdev_id);
1173 	enum QDF_GLOBAL_MODE (*get_con_mode)(void);
1174 #ifdef QCA_PEER_MULTIQ_SUPPORT
1175 	int (*peer_ast_flowid_map)(struct cdp_ctrl_objmgr_psoc *ol_soc_handle,
1176 				   uint16_t peer_id, uint8_t vdev_id,
1177 				   uint8_t *peer_mac_addr);
1178 #endif
1179 #ifdef DP_MEM_PRE_ALLOC
1180 	void *(*dp_prealloc_get_context)(uint32_t ctxt_type);
1181 
1182 	QDF_STATUS(*dp_prealloc_put_context)(uint32_t ctxt_type, void *vaddr);
1183 	void *(*dp_prealloc_get_consistent)(uint32_t *size,
1184 					    void **base_vaddr_unaligned,
1185 					    qdf_dma_addr_t *paddr_unaligned,
1186 					    qdf_dma_addr_t *paddr_aligned,
1187 					    uint32_t align,
1188 					    uint32_t ring_type);
1189 	void (*dp_prealloc_put_consistent)(qdf_size_t size,
1190 					   void *vaddr_unligned,
1191 					   qdf_dma_addr_t paddr);
1192 	void (*dp_get_multi_pages)(uint32_t desc_type,
1193 				   size_t element_size,
1194 				   uint16_t element_num,
1195 				   struct qdf_mem_multi_page_t *pages,
1196 				   bool cacheable);
1197 	void (*dp_put_multi_pages)(uint32_t desc_type,
1198 				   struct qdf_mem_multi_page_t *pages);
1199 #endif
1200 	int (*get_soc_nss_cfg)(struct cdp_ctrl_objmgr_psoc *ol_soc_handle);
1201 
1202 	char *(*get_device_name)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
1203 				 uint8_t pdev_id);
1204 	QDF_STATUS(*nss_stats_clr)(struct cdp_ctrl_objmgr_psoc *psoc,
1205 				   uint8_t vdev_id);
1206 	int (*dp_rx_get_pending)(ol_txrx_soc_handle soc);
1207 	void (*dp_rx_sched_refill_thread)(ol_txrx_soc_handle soc);
1208 	/* TODO: Add any other control path calls required to OL_IF/WMA layer */
1209 #ifdef QCA_SUPPORT_WDS_EXTENDED
1210 	void (*rx_wds_ext_peer_learn)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
1211 				      uint16_t peer_id, uint8_t vdev_id,
1212 				      uint8_t *peer_macaddr);
1213 #endif /* QCA_SUPPORT_WDS_EXTENDED */
1214 #ifdef WLAN_SUPPORT_MESH_LATENCY
1215 	QDF_STATUS(*peer_update_mesh_latency_params)(
1216 			     struct cdp_ctrl_objmgr_psoc *psoc,
1217 				   uint8_t vdev_id, uint8_t *peer_mac, uint8_t tid,
1218 				   uint32_t service_interval_dl, uint32_t burst_size_dl,
1219 				   uint32_t service_interval_ul, uint32_t burst_size_ul,
1220 				   uint8_t add_or_sub, uint8_t ac);
1221 #endif
1222 };
1223 
1224 #ifdef DP_PEER_EXTENDED_API
1225 /**
1226  * struct cdp_misc_ops - mcl ops not classified
1227  * @set_ibss_vdev_heart_beat_timer: Update ibss vdev heart beat timer
1228  * @set_wmm_param: set wmm parameters
1229  * @bad_peer_txctl_set_setting: configure bad peer tx limit setting
1230  * @bad_peer_txctl_update_threshold: configure bad peer tx threshold limit
1231  * @hl_tdls_flag_reset: reset tdls flag for vdev
1232  * @tx_non_std: Allow the control-path SW to send data frames
1233  * @get_vdev_id: get vdev id
1234  * @set_wisa_mode: set wisa mode for a vdev
1235  * @txrx_data_stall_cb_register: register data stall callback
1236  * @txrx_data_stall_cb_deregister: deregister data stall callback
1237  * @txrx_post_data_stall_event: post data stall event
1238  * @runtime_suspend: ensure TXRX is ready to runtime suspend
1239  * @runtime_resume: ensure TXRX is ready to runtime resume
1240  * @get_opmode: get operation mode of vdev
1241  * @mark_first_wakeup_packet: set flag to indicate that fw is compatible for
1242 			      marking first packet after wow wakeup
1243  * @update_mac_id: update mac_id for vdev
1244  * @flush_rx_frames: flush rx frames on the queue
1245  * @get_intra_bss_fwd_pkts_count: to get the total tx and rx packets that
1246 				  has been forwarded from txrx layer
1247 				  without going to upper layers
1248  * @pkt_log_init: handler to initialize packet log
1249  * @pkt_log_con_service: handler to connect packet log service
1250  * @get_num_rx_contexts: handler to get number of RX contexts
1251  * @register_packetdump_cb: register callback for different pktlog
1252  * @unregister_packetdump_cb: unregister callback for different pktlog
1253  * @pdev_reset_driver_del_ack: reset driver delayed ack enabled flag
1254  * @vdev_set_driver_del_ack_enable: set driver delayed ack enabled flag
1255  *
1256  * @vdev_inform_ll_conn: inform DP to add/delete a latency critical connection
1257  *			 for this particular vdev.
1258  * @set_swlm_enable: Enable or Disable Software Latency Manager.
1259  * @is_swlm_enabled: Check if Software latency manager is enabled or not.
1260  * @display_txrx_hw_info: Dump the DP rings info
1261  *
1262  * Function pointers for miscellaneous soc/pdev/vdev related operations.
1263  */
1264 struct cdp_misc_ops {
1265 	uint16_t (*set_ibss_vdev_heart_beat_timer)(struct cdp_soc_t *soc_hdl,
1266 						   uint8_t vdev_id,
1267 						   uint16_t timer_value_sec);
1268 	void (*set_wmm_param)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
1269 			      struct ol_tx_wmm_param_t wmm_param);
1270 	void (*bad_peer_txctl_set_setting)(struct cdp_soc_t *soc_hdl,
1271 					   uint8_t pdev_id, int enable,
1272 					   int period, int txq_limit);
1273 	void (*bad_peer_txctl_update_threshold)(struct cdp_soc_t *soc_hdl,
1274 						uint8_t pdev_id,
1275 						int level, int tput_thresh,
1276 						int tx_limit);
1277 	void (*hl_tdls_flag_reset)(struct cdp_soc_t *soc_hdl,
1278 				   uint8_t vdev_id, bool flag);
1279 	qdf_nbuf_t (*tx_non_std)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
1280 				 enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
1281 	uint16_t (*get_vdev_id)(struct cdp_vdev *vdev);
1282 	uint32_t (*get_tx_ack_stats)(struct cdp_soc_t *soc_hdl,
1283 				     uint8_t vdev_id);
1284 	QDF_STATUS (*set_wisa_mode)(struct cdp_soc_t *soc_hdl,
1285 				    uint8_t vdev_id, bool enable);
1286 	QDF_STATUS (*txrx_data_stall_cb_register)(struct cdp_soc_t *soc_hdl,
1287 						  uint8_t pdev_id,
1288 						  data_stall_detect_cb cb);
1289 	QDF_STATUS (*txrx_data_stall_cb_deregister)(struct cdp_soc_t *soc_hdl,
1290 						    uint8_t pdev_id,
1291 						    data_stall_detect_cb cb);
1292 	void (*txrx_post_data_stall_event)(
1293 			struct cdp_soc_t *soc_hdl,
1294 			enum data_stall_log_event_indicator indicator,
1295 			enum data_stall_log_event_type data_stall_type,
1296 			uint32_t pdev_id, uint32_t vdev_id_bitmap,
1297 			enum data_stall_log_recovery_type recovery_type);
1298 	QDF_STATUS (*runtime_suspend)(struct cdp_soc_t *soc_hdl,
1299 				      uint8_t pdev_id);
1300 	QDF_STATUS (*runtime_resume)(struct cdp_soc_t *soc_hdl,
1301 				     uint8_t pdev_id);
1302 	int (*get_opmode)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
1303 	void (*mark_first_wakeup_packet)(struct cdp_soc_t *soc_hdl,
1304 					 uint8_t pdev_id, uint8_t value);
1305 	void (*update_mac_id)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
1306 			      uint8_t mac_id);
1307 	void (*flush_rx_frames)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
1308 				void *peer, bool drop);
1309 	A_STATUS(*get_intra_bss_fwd_pkts_count)(struct cdp_soc_t *soc_hdl,
1310 						uint8_t vdev_id,
1311 						uint64_t *fwd_tx_packets,
1312 						uint64_t *fwd_rx_packets);
1313 	void (*pkt_log_init)(struct cdp_soc_t *soc_hdl, uint8_t pdev,
1314 			     void *scn);
1315 	void (*pkt_log_con_service)(struct cdp_soc_t *soc_hdl,
1316 				    uint8_t pdev_id, void *scn);
1317 	void (*pkt_log_exit)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
1318 	int (*get_num_rx_contexts)(struct cdp_soc_t *soc_hdl);
1319 	void (*register_pktdump_cb)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
1320 				    ol_txrx_pktdump_cb tx_cb,
1321 				    ol_txrx_pktdump_cb rx_cb);
1322 	void (*unregister_pktdump_cb)(struct cdp_soc_t *soc_hdl,
1323 				      uint8_t pdev_id);
1324 	void (*pdev_reset_driver_del_ack)(struct cdp_soc_t *soc_hdl,
1325 					  uint8_t pdev_id);
1326 	void (*vdev_set_driver_del_ack_enable)(struct cdp_soc_t *soc_hdl,
1327 					       uint8_t vdev_id,
1328 					       unsigned long rx_packets,
1329 					       uint32_t time_in_ms,
1330 					       uint32_t high_th,
1331 					       uint32_t low_th);
1332 	void (*vdev_set_bundle_require_flag)(uint8_t vdev_id,
1333 					     unsigned long tx_bytes,
1334 					     uint32_t time_in_ms,
1335 					     uint32_t high_th,
1336 					     uint32_t low_th);
1337 	void (*pdev_reset_bundle_require_flag)(struct cdp_soc_t *soc_hdl,
1338 					       uint8_t pdev_id);
1339 	QDF_STATUS (*txrx_ext_stats_request)(struct cdp_soc_t *soc_hdl,
1340 					     uint8_t pdev_id,
1341 					     struct cdp_txrx_ext_stats *req);
1342 	QDF_STATUS (*request_rx_hw_stats)(struct cdp_soc_t *soc_hdl,
1343 					  uint8_t vdev_id);
1344 	void (*reset_rx_hw_ext_stats)(struct cdp_soc_t *soc_hdl);
1345 	QDF_STATUS (*vdev_inform_ll_conn)(struct cdp_soc_t *soc_hdl,
1346 					  uint8_t vdev_id,
1347 					  enum vdev_ll_conn_actions action);
1348 	QDF_STATUS (*set_swlm_enable)(struct cdp_soc_t *soc_hdl,
1349 				      uint8_t val);
1350 	uint8_t (*is_swlm_enabled)(struct cdp_soc_t *soc_hdl);
1351 	void (*display_txrx_hw_info)(struct cdp_soc_t *soc_hdl);
1352 };
1353 
1354 /**
1355  * struct cdp_ocb_ops - mcl ocb ops
1356  * @set_ocb_chan_info: set OCB channel info
1357  * @get_ocb_chan_info: get OCB channel info
1358  *
1359  * Function pointers for operations related to OCB.
1360  */
1361 struct cdp_ocb_ops {
1362 	void (*set_ocb_chan_info)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
1363 				  struct ol_txrx_ocb_set_chan ocb_set_chan);
1364 	struct ol_txrx_ocb_chan_info *(*get_ocb_chan_info)(
1365 				struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
1366 };
1367 
1368 /**
1369  * struct cdp_peer_ops - mcl peer related ops
1370  * @register_peer:
1371  * @clear_peer:
1372  * @find_peer_exist
1373  * @find_peer_exist_on_vdev
1374  * @find_peer_exist_on_other_vdev
1375  * @peer_state_update:
1376  * @get_vdevid:
1377  * @register_ocb_peer:
1378  * @peer_get_peer_mac_addr:
1379  * @get_peer_state:
1380  * @update_ibss_add_peer_num_of_vdev:
1381  * @copy_mac_addr_raw:
1382  * @add_last_real_peer:
1383  * @is_vdev_restore_last_peer:
1384  * @update_last_real_peer:
1385  */
1386 struct cdp_peer_ops {
1387 	QDF_STATUS (*register_peer)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
1388 				    struct ol_txrx_desc_type *sta_desc);
1389 	QDF_STATUS (*clear_peer)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
1390 				 struct qdf_mac_addr peer_addr);
1391 	bool (*find_peer_exist)(struct cdp_soc_t *soc, uint8_t pdev_id,
1392 				uint8_t *peer_addr);
1393 	bool (*find_peer_exist_on_vdev)(struct cdp_soc_t *soc, uint8_t vdev_id,
1394 					uint8_t *peer_addr);
1395 	bool (*find_peer_exist_on_other_vdev)(struct cdp_soc_t *soc,
1396 					      uint8_t vdev_id,
1397 					      uint8_t *peer_addr,
1398 					      uint16_t max_bssid);
1399 	QDF_STATUS (*peer_state_update)(struct cdp_soc_t *soc,
1400 					uint8_t *peer_addr,
1401 					enum ol_txrx_peer_state state);
1402 	QDF_STATUS (*get_vdevid)(struct cdp_soc_t *soc_hdl, uint8_t *peer_mac,
1403 				 uint8_t *vdev_id);
1404 	struct cdp_vdev * (*get_vdev_by_peer_addr)(struct cdp_pdev *pdev,
1405 			struct qdf_mac_addr peer_addr);
1406 	QDF_STATUS (*register_ocb_peer)(uint8_t *mac_addr);
1407 	uint8_t * (*peer_get_peer_mac_addr)(void *peer);
1408 	int (*get_peer_state)(struct cdp_soc_t *soc, uint8_t vdev_id,
1409 			      uint8_t *peer_mac);
1410 	struct cdp_vdev * (*get_vdev_for_peer)(void *peer);
1411 	int16_t (*update_ibss_add_peer_num_of_vdev)(struct cdp_soc_t *soc,
1412 						    uint8_t vdev_id,
1413 						    int16_t peer_num_delta);
1414 	void (*remove_peers_for_vdev)(struct cdp_vdev *vdev,
1415 			ol_txrx_vdev_peer_remove_cb callback,
1416 			void *callback_context, bool remove_last_peer);
1417 	void (*remove_peers_for_vdev_no_lock)(struct cdp_vdev *vdev,
1418 			ol_txrx_vdev_peer_remove_cb callback,
1419 			void *callback_context);
1420 	void (*copy_mac_addr_raw)(struct cdp_soc_t *soc, uint8_t vdev_id,
1421 				  uint8_t *bss_addr);
1422 	void (*add_last_real_peer)(struct cdp_soc_t *soc, uint8_t pdev_id,
1423 				   uint8_t vdev_id);
1424 	bool (*is_vdev_restore_last_peer)(struct cdp_soc_t *soc,
1425 					  uint8_t vdev_id,
1426 					  uint8_t *peer_mac);
1427 	void (*update_last_real_peer)(struct cdp_soc_t *soc, uint8_t pdev_id,
1428 				      uint8_t vdev_id, bool restore_last_peer);
1429 	void (*peer_detach_force_delete)(struct cdp_soc_t *soc_hdl,
1430 					 uint8_t vdev_id, uint8_t *peer_addr);
1431 	void (*set_tdls_offchan_enabled)(struct cdp_soc_t *soc, uint8_t vdev_id,
1432 					 uint8_t *peer_mac, bool val);
1433 	void (*set_peer_as_tdls_peer)(struct cdp_soc_t *soc, uint8_t vdev_id,
1434 				      uint8_t *peer_mac, bool val);
1435 	void (*peer_flush_frags)(struct cdp_soc_t *soc_hdl,
1436 				 uint8_t vdev_id, uint8_t *peer_mac);
1437 };
1438 
1439 /**
1440  * struct cdp_mob_stats_ops - mcl mob stats ops
1441  * @clear_stats: handler to clear ol txrx stats
1442  * @stats: handler to update ol txrx stats
1443  */
1444 struct cdp_mob_stats_ops {
1445 	QDF_STATUS(*clear_stats)(struct cdp_soc_t *soc_hdl,
1446 				 uint8_t pdev_id, uint8_t bitmap);
1447 	int (*stats)(uint8_t vdev_id, char *buffer, unsigned buf_len);
1448 };
1449 
1450 /**
1451  * struct cdp_pmf_ops - mcl protected management frame ops
1452  * @get_pn_info: handler to get pn info from peer
1453  *
1454  * Function pointers for pmf related operations.
1455  */
1456 struct cdp_pmf_ops {
1457 	void (*get_pn_info)(struct cdp_soc_t *soc, uint8_t *peer_mac,
1458 			    uint8_t vdev_id, uint8_t **last_pn_valid,
1459 			    uint64_t **last_pn, uint32_t **rmf_pn_replays);
1460 };
1461 #endif
1462 
1463 
1464 #ifdef DP_FLOW_CTL
1465 /**
1466  * struct cdp_cfg_ops - mcl configuration ops
1467  * @set_cfg_rx_fwd_disabled: set rx_fwd_disabled flag
1468  * @set_cfg_packet_log_enabled: set is_packet_log_enabled flag
1469  * @cfg_attach: hardcode the configuration parameters
1470  * @vdev_rx_set_intrabss_fwd: set disable_intrabss_fwd flag
1471  * @is_rx_fwd_disabled: get the rx_fwd_disabled flag,
1472  *                      1 enabled, 0 disabled.
1473  * @tx_set_is_mgmt_over_wmi_enabled: set is_mgmt_over_wmi_enabled flag to
1474  *                                   indicate that mgmt over wmi is enabled
1475  *                                   or not,
1476  *                                   1 for enabled, 0 for disable
1477  * @is_high_latency: get device is high or low latency device,
1478  *                   1 high latency bus, 0 low latency bus
1479  * @set_flow_control_parameters: set flow control parameters
1480  * @set_flow_steering: set flow_steering_enabled flag
1481  * @set_ptp_rx_opt_enabled: set is_ptp_rx_opt_enabled flag
1482  * @set_new_htt_msg_format: set new_htt_msg_format flag
1483  * @set_peer_unmap_conf_support: set enable_peer_unmap_conf_support flag
1484  * @get_peer_unmap_conf_support: get enable_peer_unmap_conf_support flag
1485  * @set_tx_compl_tsf64: set enable_tx_compl_tsf64 flag,
1486  *                      1 enabled, 0 disabled.
1487  * @get_tx_compl_tsf64: get enable_tx_compl_tsf64 flag,
1488  *                      1 enabled, 0 disabled.
1489  */
1490 struct cdp_cfg_ops {
1491 	void (*set_cfg_rx_fwd_disabled)(struct cdp_cfg *cfg_pdev,
1492 		uint8_t disable_rx_fwd);
1493 	void (*set_cfg_packet_log_enabled)(struct cdp_cfg *cfg_pdev,
1494 		uint8_t val);
1495 	struct cdp_cfg * (*cfg_attach)(qdf_device_t osdev, void *cfg_param);
1496 	void (*vdev_rx_set_intrabss_fwd)(struct cdp_soc_t *soc_hdl,
1497 					 uint8_t vdev_id, bool val);
1498 	uint8_t (*is_rx_fwd_disabled)(struct cdp_vdev *vdev);
1499 	void (*tx_set_is_mgmt_over_wmi_enabled)(uint8_t value);
1500 	int (*is_high_latency)(struct cdp_cfg *cfg_pdev);
1501 	void (*set_flow_control_parameters)(struct cdp_cfg *cfg_pdev,
1502 		void *param);
1503 	void (*set_flow_steering)(struct cdp_cfg *cfg_pdev, uint8_t val);
1504 	void (*set_ptp_rx_opt_enabled)(struct cdp_cfg *cfg_pdev, uint8_t val);
1505 	void (*set_new_htt_msg_format)(uint8_t val);
1506 	void (*set_peer_unmap_conf_support)(bool val);
1507 	bool (*get_peer_unmap_conf_support)(void);
1508 	void (*set_tx_compl_tsf64)(bool val);
1509 	bool (*get_tx_compl_tsf64)(void);
1510 };
1511 
1512 /**
1513  * struct cdp_flowctl_ops - mcl flow control
1514  * @flow_pool_map_handler: handler to map flow_id and pool descriptors
1515  * @flow_pool_unmap_handler: handler to unmap flow_id and pool descriptors
1516  * @register_pause_cb: handler to register tx pause callback
1517  * @set_desc_global_pool_size: handler to set global pool size
1518  * @dump_flow_pool_info: handler to dump global and flow pool info
1519  * @tx_desc_thresh_reached: handler to set tx desc threshold
1520  *
1521  * Function pointers for operations related to flow control
1522  */
1523 struct cdp_flowctl_ops {
1524 	QDF_STATUS (*flow_pool_map_handler)(struct cdp_soc_t *soc,
1525 					    uint8_t pdev_id,
1526 					    uint8_t vdev_id);
1527 	void (*flow_pool_unmap_handler)(struct cdp_soc_t *soc,
1528 					uint8_t pdev_id,
1529 					uint8_t vdev_id);
1530 	QDF_STATUS (*register_pause_cb)(struct cdp_soc_t *soc,
1531 					tx_pause_callback);
1532 	void (*set_desc_global_pool_size)(uint32_t num_msdu_desc);
1533 
1534 	void (*dump_flow_pool_info)(struct cdp_soc_t *soc_hdl);
1535 
1536 	bool (*tx_desc_thresh_reached)(struct cdp_soc_t *soc_hdl,
1537 				       uint8_t vdev_id);
1538 };
1539 
1540 /**
1541  * struct cdp_lflowctl_ops - mcl legacy flow control ops
1542  * @register_tx_flow_control: Register tx flow control callback
1543  * @set_vdev_tx_desc_limit:  Set tx descriptor limit for a vdev
1544  * @set_vdev_os_queue_status: Set vdev queue status
1545  * @deregister_tx_flow_control_cb: Deregister tx flow control callback
1546  * @flow_control_cb: Call osif flow control callback
1547  * @get_tx_resource: Get tx resources and comapre with watermark
1548  * @ll_set_tx_pause_q_depth: set pause queue depth
1549  * @vdev_flush: Flush all packets on a particular vdev
1550  * @vdev_pause: Pause a particular vdev
1551  * @vdev_unpause: Unpause a particular vdev
1552  *
1553  * Function pointers for operations related to flow control
1554  */
1555 struct cdp_lflowctl_ops {
1556 #ifdef QCA_HL_NETDEV_FLOW_CONTROL
1557 	int (*register_tx_flow_control)(struct cdp_soc_t *soc_hdl,
1558 					uint8_t pdev_id,
1559 					tx_pause_callback flowcontrol);
1560 	int (*set_vdev_tx_desc_limit)(struct cdp_soc_t *soc_hdl,
1561 				      uint8_t vdev_id, uint32_t chan_freq);
1562 	int (*set_vdev_os_queue_status)(struct cdp_soc_t *soc_hdl,
1563 					uint8_t vdev_id,
1564 					enum netif_action_type action);
1565 #else
1566 	int (*register_tx_flow_control)(
1567 		struct cdp_soc_t *soc_hdl,
1568 		uint8_t vdev_id,
1569 		ol_txrx_tx_flow_control_fp flowControl, void *osif_fc_ctx,
1570 		ol_txrx_tx_flow_control_is_pause_fp flow_control_is_pause);
1571 #endif /* QCA_HL_NETDEV_FLOW_CONTROL */
1572 	int (*deregister_tx_flow_control_cb)(struct cdp_soc_t *soc_hdl,
1573 					     uint8_t vdev_id);
1574 	void (*flow_control_cb)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
1575 				bool tx_resume);
1576 	bool (*get_tx_resource)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
1577 				struct qdf_mac_addr peer_addr,
1578 				unsigned int low_watermark,
1579 				unsigned int high_watermark_offset);
1580 	int (*ll_set_tx_pause_q_depth)(struct cdp_soc_t *soc, uint8_t vdev_id,
1581 				       int pause_q_depth);
1582 	void (*vdev_flush)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
1583 	void (*vdev_pause)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
1584 			   uint32_t reason, uint32_t pause_type);
1585 	void (*vdev_unpause)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
1586 			     uint32_t reason, uint32_t pause_type);
1587 };
1588 
1589 /**
1590  * struct cdp_throttle_ops - mcl throttle ops
1591  * @throttle_init_period: handler to initialize tx throttle time
1592  * @throttle_set_level: handler to set tx throttle level
1593  */
1594 struct cdp_throttle_ops {
1595 	void (*throttle_init_period)(struct cdp_soc_t *soc_hdl,
1596 				     uint8_t pdev_id, int period,
1597 				     uint8_t *dutycycle_level);
1598 	void (*throttle_set_level)(struct cdp_soc_t *soc_hdl,
1599 				   uint8_t pdev_id, int level);
1600 };
1601 #endif
1602 
1603 #ifdef IPA_OFFLOAD
1604 /**
1605  * struct cdp_ipa_ops - mcl ipa data path ops
1606  * @ipa_get_resource:
1607  * @ipa_set_doorbell_paddr:
1608  * @ipa_set_active:
1609  * @ipa_op_response:
1610  * @ipa_register_op_cb:
1611  * @ipa_get_stat:
1612  * @ipa_tx_data_frame:
1613  * @ipa_tx_buf_smmu_mapping: Create SMMU mappings for Tx
1614  * @ipa_tx_buf_smmu_unmapping: Release SMMU mappings for Tx
1615  * buffers to IPA
1616  */
1617 struct cdp_ipa_ops {
1618 	QDF_STATUS (*ipa_get_resource)(struct cdp_soc_t *soc_hdl,
1619 				       uint8_t pdev_id);
1620 	QDF_STATUS (*ipa_set_doorbell_paddr)(struct cdp_soc_t *soc_hdl,
1621 					     uint8_t pdev_id);
1622 	QDF_STATUS (*ipa_set_active)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
1623 				     bool uc_active, bool is_tx);
1624 	QDF_STATUS (*ipa_op_response)(struct cdp_soc_t *soc_hdl,
1625 				      uint8_t pdev_id, uint8_t *op_msg);
1626 	QDF_STATUS (*ipa_register_op_cb)(struct cdp_soc_t *soc_hdl,
1627 					 uint8_t pdev_id,
1628 					 void (*ipa_uc_op_cb_type)
1629 					 (uint8_t *op_msg, void *osif_ctxt),
1630 					 void *usr_ctxt);
1631 	void (*ipa_deregister_op_cb)(struct cdp_soc_t *soc_hdl,
1632 				     uint8_t pdev_id);
1633 	QDF_STATUS (*ipa_get_stat)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
1634 	qdf_nbuf_t (*ipa_tx_data_frame)(struct cdp_soc_t *soc_hdl,
1635 					uint8_t vdev_id, qdf_nbuf_t skb);
1636 	void (*ipa_set_uc_tx_partition_base)(struct cdp_cfg *pdev,
1637 		uint32_t value);
1638 #ifdef FEATURE_METERING
1639 	QDF_STATUS (*ipa_uc_get_share_stats)(struct cdp_soc_t *soc_hdl,
1640 					     uint8_t pdev_id,
1641 					     uint8_t reset_stats);
1642 	QDF_STATUS (*ipa_uc_set_quota)(struct cdp_soc_t *soc_hdl,
1643 				       uint8_t pdev_id, uint64_t quota_bytes);
1644 #endif
1645 	QDF_STATUS (*ipa_enable_autonomy)(struct cdp_soc_t *soc_hdl,
1646 					  uint8_t pdev_id);
1647 	QDF_STATUS (*ipa_disable_autonomy)(struct cdp_soc_t *soc_hdl,
1648 					   uint8_t pdev_id);
1649 
1650 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || \
1651 	defined(CONFIG_IPA_WDI_UNIFIED_API)
1652 	QDF_STATUS (*ipa_setup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
1653 				void *ipa_i2w_cb, void *ipa_w2i_cb,
1654 				void *ipa_wdi_meter_notifier_cb,
1655 				uint32_t ipa_desc_size, void *ipa_priv,
1656 				bool is_rm_enabled, uint32_t *tx_pipe_handle,
1657 				uint32_t *rx_pipe_handle, bool is_smmu_enabled,
1658 				qdf_ipa_sys_connect_params_t *sys_in,
1659 				bool over_gsi);
1660 #else /* CONFIG_IPA_WDI_UNIFIED_API */
1661 	QDF_STATUS (*ipa_setup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
1662 				void *ipa_i2w_cb, void *ipa_w2i_cb,
1663 				void *ipa_wdi_meter_notifier_cb,
1664 				uint32_t ipa_desc_size, void *ipa_priv,
1665 				bool is_rm_enabled, uint32_t *tx_pipe_handle,
1666 				uint32_t *rx_pipe_handle);
1667 #endif /* CONFIG_IPA_WDI_UNIFIED_API */
1668 	QDF_STATUS (*ipa_cleanup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
1669 				  uint32_t tx_pipe_handle,
1670 				  uint32_t rx_pipe_handle);
1671 	QDF_STATUS (*ipa_setup_iface)(char *ifname, uint8_t *mac_addr,
1672 		qdf_ipa_client_type_t prod_client,
1673 		qdf_ipa_client_type_t cons_client,
1674 		uint8_t session_id, bool is_ipv6_enabled);
1675 	QDF_STATUS (*ipa_cleanup_iface)(char *ifname, bool is_ipv6_enabled);
1676 	QDF_STATUS (*ipa_enable_pipes)(struct cdp_soc_t *soc_hdl,
1677 				       uint8_t pdev_id);
1678 	QDF_STATUS (*ipa_disable_pipes)(struct cdp_soc_t *soc_hdl,
1679 					uint8_t pdev_id);
1680 	QDF_STATUS (*ipa_set_perf_level)(int client,
1681 		uint32_t max_supported_bw_mbps);
1682 	bool (*ipa_rx_intrabss_fwd)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
1683 				    qdf_nbuf_t nbuf, bool *fwd_success);
1684 	QDF_STATUS (*ipa_tx_buf_smmu_mapping)(struct cdp_soc_t *soc_hdl,
1685 					      uint8_t pdev_id);
1686 	QDF_STATUS (*ipa_tx_buf_smmu_unmapping)(struct cdp_soc_t *soc_hdl,
1687 						uint8_t pdev_id);
1688 };
1689 #endif
1690 
1691 #ifdef DP_POWER_SAVE
1692 /**
1693  * struct cdp_tx_delay_ops - mcl tx delay ops
1694  * @tx_delay: handler to get tx packet delay
1695  * @tx_delay_hist: handler to get tx packet delay histogram
1696  * @tx_packet_count: handler to get tx packet count
1697  * @tx_set_compute_interval: update compute interval period for TSM stats
1698  *
1699  * Function pointer for operations related to tx delay.
1700  */
1701 struct cdp_tx_delay_ops {
1702 	void (*tx_delay)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
1703 			 uint32_t *queue_delay_microsec,
1704 			 uint32_t *tx_delay_microsec, int category);
1705 	void (*tx_delay_hist)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
1706 			      uint16_t *bin_values, int category);
1707 	void (*tx_packet_count)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
1708 				uint16_t *out_packet_count,
1709 				uint16_t *out_packet_loss_count, int category);
1710 	void (*tx_set_compute_interval)(struct cdp_soc_t *soc_hdl,
1711 					uint8_t pdev_id, uint32_t interval);
1712 };
1713 
1714 /**
1715  * struct cdp_bus_ops - mcl bus suspend/resume ops
1716  * @bus_suspend: handler for bus suspend
1717  * @bus_resume: handler for bus resume
1718  * @process_wow_ack_rsp: handler for wow ack response
1719  * @process_target_suspend_req: handler for target suspend request
1720  */
1721 struct cdp_bus_ops {
1722 	QDF_STATUS (*bus_suspend)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
1723 	QDF_STATUS (*bus_resume)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
1724 	void (*process_wow_ack_rsp)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
1725 	void (*process_target_suspend_req)(struct cdp_soc_t *soc_hdl,
1726 					   uint8_t pdev_id);
1727 };
1728 #endif
1729 
1730 #ifdef RECEIVE_OFFLOAD
1731 /**
1732  * struct cdp_rx_offld_ops - mcl host receive offload ops
1733  * @register_rx_offld_flush_cb:
1734  * @deregister_rx_offld_flush_cb:
1735  */
1736 struct cdp_rx_offld_ops {
1737 	void (*register_rx_offld_flush_cb)(void (rx_offld_flush_cb)(void *));
1738 	void (*deregister_rx_offld_flush_cb)(void);
1739 };
1740 #endif
1741 
1742 #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
1743 /**
1744  * struct cdp_cfr_ops - host cfr ops
1745  * @txrx_cfr_filter: Handler to configure host rx monitor status ring
1746  * @txrx_get_cfr_rcc: Handler to get CFR mode
1747  * @txrx_set_cfr_rcc: Handler to enable/disable CFR mode
1748  * @txrx_get_cfr_dbg_stats: Handler to get debug statistics for CFR mode
1749  * @txrx_clear_cfr_dbg_stats: Handler to clear debug statistics for CFR mode
1750  * @txrx_enable_mon_reap_timer: Enable/Disable reap timer of monitor status ring
1751  */
1752 struct cdp_cfr_ops {
1753 	void (*txrx_cfr_filter)(struct cdp_soc_t *soc_hdl,
1754 				uint8_t pdev_id,
1755 				bool enable,
1756 				struct cdp_monitor_filter *filter_val);
1757 	bool (*txrx_get_cfr_rcc)(struct cdp_soc_t *soc_hdl,
1758 				 uint8_t pdev_id);
1759 	void (*txrx_set_cfr_rcc)(struct cdp_soc_t *soc_hdl,
1760 				 uint8_t pdev_id,
1761 				 bool enable);
1762 	void (*txrx_get_cfr_dbg_stats)(struct cdp_soc_t *soc_hdl,
1763 				       uint8_t pdev_id,
1764 				       struct cdp_cfr_rcc_stats *buf);
1765 	void (*txrx_clear_cfr_dbg_stats)(struct cdp_soc_t *soc_hdl,
1766 					 uint8_t pdev_id);
1767 	void (*txrx_enable_mon_reap_timer)(struct cdp_soc_t *soc_hdl,
1768 					   uint8_t pdev_id,
1769 					   bool enable);
1770 };
1771 #endif
1772 
1773 #ifdef WLAN_SUPPORT_MSCS
1774 /**
1775  * struct cdp_mscs_ops - data path ops for MSCS
1776  * @mscs_peer_lookup_n_get_priority:
1777  */
1778 struct cdp_mscs_ops {
1779 	int (*mscs_peer_lookup_n_get_priority)(struct cdp_soc_t *soc,
1780 			uint8_t *src_mac,
1781 			uint8_t *dst_mac,
1782 			qdf_nbuf_t nbuf);
1783 };
1784 #endif
1785 
1786 #ifdef WLAN_SUPPORT_MESH_LATENCY
1787 /**
1788  * struct cdp_mesh_latency_ops - data path ops for Mesh latency
1789  * @mesh_latency_update_peer_parameter:
1790  */
1791 struct cdp_mesh_latency_ops {
1792 	QDF_STATUS (*mesh_latency_update_peer_parameter)(
1793 			struct cdp_soc_t *soc,
1794 			uint8_t *dest_mac, uint32_t service_interval_dl,
1795 			uint32_t burst_size_dl, uint32_t service_interval_ul,
1796 			uint32_t burst_size_ul, uint16_t priority,
1797 			uint8_t add_or_sub);
1798 };
1799 #endif
1800 
1801 struct cdp_ops {
1802 	struct cdp_cmn_ops          *cmn_drv_ops;
1803 	struct cdp_ctrl_ops         *ctrl_ops;
1804 	struct cdp_me_ops           *me_ops;
1805 	struct cdp_mon_ops          *mon_ops;
1806 	struct cdp_host_stats_ops   *host_stats_ops;
1807 	struct cdp_wds_ops          *wds_ops;
1808 	struct cdp_raw_ops          *raw_ops;
1809 	struct cdp_pflow_ops        *pflow_ops;
1810 #ifdef DP_PEER_EXTENDED_API
1811 	struct cdp_misc_ops         *misc_ops;
1812 	struct cdp_peer_ops         *peer_ops;
1813 	struct cdp_ocb_ops          *ocb_ops;
1814 	struct cdp_mob_stats_ops    *mob_stats_ops;
1815 	struct cdp_pmf_ops          *pmf_ops;
1816 #endif
1817 #ifdef DP_FLOW_CTL
1818 	struct cdp_cfg_ops          *cfg_ops;
1819 	struct cdp_flowctl_ops      *flowctl_ops;
1820 	struct cdp_lflowctl_ops     *l_flowctl_ops;
1821 	struct cdp_throttle_ops     *throttle_ops;
1822 #endif
1823 #ifdef DP_POWER_SAVE
1824 	struct cdp_bus_ops          *bus_ops;
1825 	struct cdp_tx_delay_ops     *delay_ops;
1826 #endif
1827 #ifdef IPA_OFFLOAD
1828 	struct cdp_ipa_ops          *ipa_ops;
1829 #endif
1830 #ifdef RECEIVE_OFFLOAD
1831 	struct cdp_rx_offld_ops     *rx_offld_ops;
1832 #endif
1833 #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
1834 	struct cdp_cfr_ops          *cfr_ops;
1835 #endif
1836 #ifdef WLAN_SUPPORT_MSCS
1837 	struct cdp_mscs_ops         *mscs_ops;
1838 #endif
1839 #ifdef WLAN_SUPPORT_MESH_LATENCY
1840 	struct cdp_mesh_latency_ops         *mesh_latency_ops;
1841 #endif
1842 
1843 };
1844 #endif
1845