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