xref: /wlan-dirver/qca-wifi-host-cmn/dp/inc/cdp_txrx_ops.h (revision fa47688f04ef001a6dcafaebdcc3c031f15ee75e)
1 /*
2  * Copyright (c) 2017-2019 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 
33 #ifdef IPA_OFFLOAD
34 #ifdef CONFIG_IPA_WDI_UNIFIED_API
35 #include <qdf_ipa_wdi3.h>
36 #else
37 #include <qdf_ipa.h>
38 #endif
39 #endif
40 
41 /**
42  * bitmap values to indicate special handling of peer_delete
43  */
44 #define CDP_PEER_DELETE_NO_SPECIAL             0
45 #define CDP_PEER_DO_NOT_START_UNMAP_TIMER      1
46 
47 /* same as ieee80211_nac_param */
48 enum cdp_nac_param_cmd {
49 	/* IEEE80211_NAC_PARAM_ADD */
50 	CDP_NAC_PARAM_ADD = 1,
51 	/* IEEE80211_NAC_PARAM_DEL */
52 	CDP_NAC_PARAM_DEL,
53 	/* IEEE80211_NAC_PARAM_LIST */
54 	CDP_NAC_PARAM_LIST,
55 };
56 /******************************************************************************
57  *
58  * Control Interface (A Interface)
59  *
60  *****************************************************************************/
61 
62 struct cdp_cmn_ops {
63 
64 	QDF_STATUS (*txrx_soc_attach_target)(ol_txrx_soc_handle soc);
65 
66 	int (*txrx_pdev_attach_target)(struct cdp_pdev *pdev);
67 
68 	struct cdp_vdev *(*txrx_vdev_attach)
69 		(struct cdp_pdev *pdev, uint8_t *vdev_mac_addr,
70 		 uint8_t vdev_id, enum wlan_op_mode op_mode);
71 
72 	void (*txrx_vdev_detach)
73 		(struct cdp_vdev *vdev, ol_txrx_vdev_delete_cb callback,
74 		 void *cb_context);
75 
76 	struct cdp_pdev *(*txrx_pdev_attach)
77 		(ol_txrx_soc_handle soc, struct cdp_ctrl_objmgr_pdev *ctrl_pdev,
78 		HTC_HANDLE htc_pdev, qdf_device_t osdev, uint8_t pdev_id);
79 
80 	int (*txrx_pdev_post_attach)(struct cdp_pdev *pdev);
81 
82 	void (*txrx_pdev_pre_detach)(struct cdp_pdev *pdev, int force);
83 
84 	void (*txrx_pdev_detach)(struct cdp_pdev *pdev, int force);
85 
86 	/**
87 	 * txrx_pdev_deinit() - Deinitialize pdev and dp ring memory
88 	 * @pdev: Dp pdev handle
89 	 * @force: Force deinit or not
90 	 *
91 	 * Return: None
92 	 */
93 	void (*txrx_pdev_deinit)(struct cdp_pdev *pdev, int force);
94 
95 	void *(*txrx_peer_create)
96 		(struct cdp_vdev *vdev, uint8_t *peer_mac_addr,
97 		 struct cdp_ctrl_objmgr_peer *ctrl_peer);
98 
99 	void (*txrx_peer_setup)
100 		(struct cdp_vdev *vdev_hdl, void *peer_hdl);
101 
102 	void (*txrx_peer_teardown)
103 		(struct cdp_vdev *vdev_hdl, void *peer_hdl);
104 
105 	int (*txrx_peer_add_ast)
106 		(ol_txrx_soc_handle soc, struct cdp_peer *peer_hdl,
107 		uint8_t *mac_addr, enum  cdp_txrx_ast_entry_type type,
108 		uint32_t flags);
109 
110 	int (*txrx_peer_update_ast)
111 		(ol_txrx_soc_handle soc, struct cdp_peer *peer_hdl,
112 		uint8_t *mac_addr, uint32_t flags);
113 
114 	bool (*txrx_peer_get_ast_info_by_soc)
115 		(ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
116 		 struct cdp_ast_entry_info *ast_entry_info);
117 
118 	bool (*txrx_peer_get_ast_info_by_pdev)
119 		(ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
120 		 uint8_t pdev_id,
121 		 struct cdp_ast_entry_info *ast_entry_info);
122 
123 	QDF_STATUS (*txrx_peer_ast_delete_by_soc)
124 		(ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
125 		txrx_ast_free_cb callback,
126 		void *cookie);
127 
128 	QDF_STATUS (*txrx_peer_ast_delete_by_pdev)
129 		(ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
130 		 uint8_t pdev_id,
131 		txrx_ast_free_cb callback,
132 		void *cookie);
133 
134 	void (*txrx_peer_delete)(void *peer, uint32_t bitmap);
135 
136 	void (*txrx_vdev_flush_peers)(struct cdp_vdev *vdev, bool unmap_only);
137 
138 	QDF_STATUS (*txrx_set_monitor_mode)(struct cdp_vdev *vdev,
139 					    uint8_t smart_monitor);
140 	void (*txrx_peer_delete_sync)(void *peer,
141 				      QDF_STATUS(*delete_cb)(
142 						uint8_t vdev_id,
143 						uint32_t peerid_cnt,
144 						uint16_t *peerid_list),
145 				      uint32_t bitmap);
146 
147 	uint8_t (*txrx_get_pdev_id_frm_pdev)(struct cdp_pdev *pdev);
148 	bool (*txrx_get_vow_config_frm_pdev)(struct cdp_pdev *pdev);
149 
150 	void (*txrx_pdev_set_chan_noise_floor)(struct cdp_pdev *pdev,
151 					       int16_t chan_noise_floor);
152 
153 	void (*txrx_set_nac)(struct cdp_peer *peer);
154 
155 	/**
156 	 * txrx_set_pdev_tx_capture() - callback to set pdev tx_capture
157 	 * @soc: opaque soc handle
158 	 * @pdev: data path pdev handle
159 	 * @val: value of pdev_tx_capture
160 	 *
161 	 * Return: status: 0 - Success, non-zero: Failure
162 	 */
163 	QDF_STATUS (*txrx_set_pdev_tx_capture)(struct cdp_pdev *pdev, int val);
164 
165 	void (*txrx_get_peer_mac_from_peer_id)
166 		(struct cdp_pdev *pdev_handle,
167 		 uint32_t peer_id, uint8_t *peer_mac);
168 
169 	void (*txrx_vdev_tx_lock)(struct cdp_vdev *vdev);
170 
171 	void (*txrx_vdev_tx_unlock)(struct cdp_vdev *vdev);
172 
173 	void (*txrx_ath_getstats)(void *pdev,
174 			struct cdp_dev_stats *stats, uint8_t type);
175 
176 	void (*txrx_set_gid_flag)(struct cdp_pdev *pdev, u_int8_t *mem_status,
177 			u_int8_t *user_position);
178 
179 	uint32_t (*txrx_fw_supported_enh_stats_version)(struct cdp_pdev *pdev);
180 
181 	void (*txrx_if_mgmt_drain)(void *ni, int force);
182 
183 	void (*txrx_set_curchan)(struct cdp_pdev *pdev, uint32_t chan_mhz);
184 
185 	void (*txrx_set_privacy_filters)
186 		(struct cdp_vdev *vdev, void *filter, uint32_t num);
187 
188 	uint32_t (*txrx_get_cfg)(void *soc, enum cdp_dp_cfg cfg);
189 
190 	/********************************************************************
191 	 * Data Interface (B Interface)
192 	 ********************************************************************/
193 
194 	void (*txrx_vdev_register)(struct cdp_vdev *vdev,
195 			void *osif_vdev, struct cdp_ctrl_objmgr_vdev *ctrl_vdev,
196 			struct ol_txrx_ops *txrx_ops);
197 
198 	int (*txrx_mgmt_send)(struct cdp_vdev *vdev,
199 			qdf_nbuf_t tx_mgmt_frm, uint8_t type);
200 
201 	int (*txrx_mgmt_send_ext)(struct cdp_vdev *vdev,
202 			qdf_nbuf_t tx_mgmt_frm,	uint8_t type, uint8_t use_6mbps,
203 			uint16_t chanfreq);
204 
205 	/**
206 	 * ol_txrx_mgmt_tx_cb - tx management delivery notification
207 	 * callback function
208 	 */
209 
210 	void (*txrx_mgmt_tx_cb_set)(struct cdp_pdev *pdev, uint8_t type,
211 				    ol_txrx_mgmt_tx_cb download_cb,
212 				    ol_txrx_mgmt_tx_cb ota_ack_cb,
213 				    void *ctxt);
214 
215 	int (*txrx_get_tx_pending)(struct cdp_pdev *pdev);
216 
217 	/**
218 	 * ol_txrx_data_tx_cb - Function registered with the data path
219 	 * that is called when tx frames marked as "no free" are
220 	 * done being transmitted
221 	 */
222 
223 	void (*txrx_data_tx_cb_set)(struct cdp_vdev *data_vdev,
224 			ol_txrx_data_tx_cb callback, void *ctxt);
225 
226 	/*******************************************************************
227 	 * Statistics and Debugging Interface (C Interface)
228 	 ********************************************************************/
229 
230 	int (*txrx_aggr_cfg)(struct cdp_vdev *vdev, int max_subfrms_ampdu,
231 			int max_subfrms_amsdu);
232 
233 	A_STATUS (*txrx_fw_stats_get)(struct cdp_vdev *vdev,
234 			struct ol_txrx_stats_req *req,
235 			bool per_vdev, bool response_expected);
236 
237 	int (*txrx_debug)(struct cdp_vdev *vdev, int debug_specs);
238 
239 	void (*txrx_fw_stats_cfg)(struct cdp_vdev *vdev,
240 			uint8_t cfg_stats_type, uint32_t cfg_val);
241 
242 	void (*txrx_print_level_set)(unsigned level);
243 
244 	/**
245 	 * ol_txrx_get_vdev_mac_addr() - Return mac addr of vdev
246 	 * @vdev: vdev handle
247 	 *
248 	 * Return: vdev mac address
249 	 */
250 	uint8_t * (*txrx_get_vdev_mac_addr)(struct cdp_vdev *vdev);
251 
252 	/**
253 	 * ol_txrx_get_vdev_struct_mac_addr() - Return handle to struct qdf_mac_addr of
254 	 * vdev
255 	 * @vdev: vdev handle
256 	 *
257 	 * Return: Handle to struct qdf_mac_addr
258 	 */
259 	struct qdf_mac_addr *
260 		(*txrx_get_vdev_struct_mac_addr)(struct cdp_vdev *vdev);
261 
262 	/**
263 	 * ol_txrx_get_pdev_from_vdev() - Return handle to pdev of vdev
264 	 * @vdev: vdev handle
265 	 *
266 	 * Return: Handle to pdev
267 	 */
268 	struct cdp_pdev *(*txrx_get_pdev_from_vdev)
269 		(struct cdp_vdev *vdev);
270 
271 	/**
272 	 * ol_txrx_get_ctrl_pdev_from_vdev() - Return control pdev of vdev
273 	 * @vdev: vdev handle
274 	 *
275 	 * Return: Handle to control pdev
276 	 */
277 	struct cdp_cfg *
278 		(*txrx_get_ctrl_pdev_from_vdev)(struct cdp_vdev *vdev);
279 
280 	/**
281 	 * txrx_get_mon_vdev_from_pdev() - Return monitor mode vdev
282 	 * @pdev: pdev handle
283 	 *
284 	 * Return: Handle to vdev
285 	 */
286 	struct cdp_vdev *
287 		(*txrx_get_mon_vdev_from_pdev)(struct cdp_pdev *pdev);
288 
289 	struct cdp_vdev *
290 		(*txrx_get_vdev_from_vdev_id)(struct cdp_pdev *pdev,
291 				uint8_t vdev_id);
292 
293 	void (*txrx_soc_detach)(void *soc);
294 
295 	/**
296 	 * txrx_soc_deinit() - Deinitialize dp soc and dp ring memory
297 	 * @soc: Opaque Dp handle
298 	 *
299 	 * Return: None
300 	 */
301 	void (*txrx_soc_deinit)(void *soc);
302 
303 	/**
304 	 * txrx_soc_init() - Initialize dp soc and dp ring memory
305 	 * @soc: Opaque Dp handle
306 	 * @htchdl: Opaque htc handle
307 	 * @hifhdl: Opaque hif handle
308 	 *
309 	 * Return: None
310 	 */
311 	void *(*txrx_soc_init)(void *soc, void *ctrl_psoc, void *hif_handle,
312 			       HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
313 			       struct ol_if_ops *ol_ops, uint16_t device_id);
314 
315 	/**
316 	 * txrx_tso_soc_attach() - TSO attach handler triggered during
317 	 * dynamic tso activation
318 	 * @soc: Opaque Dp handle
319 	 *
320 	 * Return: QDF status
321 	 */
322 	QDF_STATUS (*txrx_tso_soc_attach)(void *soc);
323 
324 	/**
325 	 * txrx_tso_soc_detach() - TSO detach handler triggered during
326 	 * dynamic tso de-activation
327 	 * @soc: Opaque Dp handle
328 	 *
329 	 * Return: QDF status
330 	 */
331 	QDF_STATUS (*txrx_tso_soc_detach)(void *soc);
332 	int (*addba_resp_tx_completion)(void *peer_handle, uint8_t tid,
333 					int status);
334 
335 	int (*addba_requestprocess)(void *peer_handle, uint8_t dialogtoken,
336 				   uint16_t tid, uint16_t batimeout,
337 				   uint16_t buffersize,
338 				   uint16_t startseqnum);
339 
340 	void (*addba_responsesetup)(void *peer_handle, uint8_t tid,
341 		uint8_t *dialogtoken, uint16_t *statuscode,
342 		uint16_t *buffersize, uint16_t *batimeout);
343 
344 	int (*delba_process)(void *peer_handle,
345 		int tid, uint16_t reasoncode);
346 
347 	/**
348 	 * delba_tx_completion() - Indicate delba tx status
349 	 * @peer_handle: Peer handle
350 	 * @tid: Tid number
351 	 * @status: Tx completion status
352 	 *
353 	 * Return: 0 on Success, 1 on failure
354 	 */
355 	int (*delba_tx_completion)(void *peer_handle,
356 				   uint8_t tid, int status);
357 
358 	void (*set_addba_response)(void *peer_handle,
359 		uint8_t tid, uint16_t statuscode);
360 
361 	uint8_t (*get_peer_mac_addr_frm_id)(struct cdp_soc_t *soc_handle,
362 			uint16_t peer_id, uint8_t *mac_addr);
363 
364 	void (*set_vdev_dscp_tid_map)(struct cdp_vdev *vdev_handle,
365 			uint8_t map_id);
366 	int (*txrx_get_total_per)(struct cdp_pdev *pdev_handle);
367 
368 	void (*flush_cache_rx_queue)(void);
369 	void (*set_pdev_dscp_tid_map)(struct cdp_pdev *pdev, uint8_t map_id,
370 			uint8_t tos, uint8_t tid);
371 	void (*hmmc_tid_override_en)(struct cdp_pdev *pdev, bool val);
372 	void (*set_hmmc_tid_val)(struct cdp_pdev *pdev, uint8_t tid);
373 
374 	QDF_STATUS (*txrx_stats_request)(struct cdp_vdev *vdev,
375 					 struct cdp_txrx_stats_req *req);
376 
377 	QDF_STATUS (*display_stats)(void *psoc, uint16_t value,
378 				    enum qdf_stats_verbosity_level level);
379 	void (*txrx_soc_set_nss_cfg)(ol_txrx_soc_handle soc, int config);
380 
381 	int(*txrx_soc_get_nss_cfg)(ol_txrx_soc_handle soc);
382 	QDF_STATUS (*txrx_intr_attach)(void *soc);
383 	void (*txrx_intr_detach)(void *soc);
384 	void  (*set_pn_check)(struct cdp_vdev *vdev,
385 		struct cdp_peer *peer_handle, enum cdp_sec_type sec_type,
386 		 uint32_t *rx_pn);
387 	QDF_STATUS (*update_config_parameters)(struct cdp_soc *psoc,
388 			struct cdp_config_params *params);
389 
390 	void *(*get_dp_txrx_handle)(struct cdp_pdev *pdev_hdl);
391 	void (*set_dp_txrx_handle)(struct cdp_pdev *pdev_hdl,
392 			void *dp_txrx_hdl);
393 
394 	void *(*get_soc_dp_txrx_handle)(struct cdp_soc *soc_handle);
395 	void (*set_soc_dp_txrx_handle)(struct cdp_soc *soc_handle,
396 			void *dp_txrx_handle);
397 
398 	void (*txrx_peer_reset_ast)
399 		(ol_txrx_soc_handle soc, uint8_t *ast_macaddr, void *vdev_hdl);
400 
401 	void (*txrx_peer_reset_ast_table)(ol_txrx_soc_handle soc,
402 					  void *vdev_hdl);
403 
404 	void (*txrx_peer_flush_ast_table)(ol_txrx_soc_handle soc);
405 	void (*txrx_set_ba_aging_timeout)(struct cdp_soc_t *soc_handle,
406 					  uint8_t ac, uint32_t value);
407 	void (*txrx_get_ba_aging_timeout)(struct cdp_soc_t *soc_handle,
408 					  uint8_t ac, uint32_t *value);
409 
410 	QDF_STATUS (*txrx_peer_map_attach)(ol_txrx_soc_handle soc,
411 					   uint32_t num_peers,
412 					   bool peer_map_unmap_v2);
413 
414 	void (*txrx_pdev_set_ctrl_pdev)(struct cdp_pdev *pdev_hdl,
415 					struct cdp_ctrl_objmgr_pdev *ctrl_pdev);
416 
417 	ol_txrx_tx_fp tx_send;
418 	/**
419 	 * txrx_get_os_rx_handles_from_vdev() - Return function, osif vdev
420 	 *					to deliver pkt to stack.
421 	 * @vdev: vdev handle
422 	 * @stack_fn: pointer to - function pointer to deliver RX pkt to stack
423 	 * @osif_vdev: pointer to - osif vdev to deliver RX packet to.
424 	 */
425 	void (*txrx_get_os_rx_handles_from_vdev)
426 					(struct cdp_vdev *vdev,
427 					 ol_txrx_rx_fp *stack_fn,
428 					 ol_osif_vdev_handle *osif_vdev);
429 	int (*txrx_classify_update)
430 		(struct cdp_vdev *vdev, qdf_nbuf_t skb,
431 		 enum txrx_direction, struct ol_txrx_nbuf_classify *nbuf_class);
432 
433 	bool (*get_dp_capabilities)(struct cdp_soc_t *soc,
434 				    enum cdp_capabilities dp_caps);
435 };
436 
437 struct cdp_ctrl_ops {
438 
439 	int
440 		(*txrx_mempools_attach)(void *ctrl_pdev);
441 	int
442 		(*txrx_set_filter_neighbour_peers)(
443 				struct cdp_pdev *pdev,
444 				uint32_t val);
445 	int
446 		(*txrx_update_filter_neighbour_peers)(
447 				struct cdp_vdev *vdev,
448 				uint32_t cmd, uint8_t *macaddr);
449 	/**
450 	 * @brief set the safemode of the device
451 	 * @details
452 	 * This flag is used to bypass the encrypt and decrypt processes when
453 	 * send and receive packets. It works like open AUTH mode, HW will
454 	 * ctreate all packets as non-encrypt frames because no key installed.
455 	 * For rx fragmented frames,it bypasses all the rx defragmentaion.
456 	 *
457 	 * @param vdev - the data virtual device object
458 	 * @param val - the safemode state
459 	 * @return - void
460 	 */
461 
462 	void
463 		(*txrx_set_safemode)(
464 				struct cdp_vdev *vdev,
465 				u_int32_t val);
466 	/**
467 	 * @brief configure the drop unencrypted frame flag
468 	 * @details
469 	 * Rx related. When set this flag, all the unencrypted frames
470 	 * received over a secure connection will be discarded
471 	 *
472 	 * @param vdev - the data virtual device object
473 	 * @param val - flag
474 	 * @return - void
475 	 */
476 	void
477 		(*txrx_set_drop_unenc)(
478 				struct cdp_vdev *vdev,
479 				u_int32_t val);
480 
481 
482 	/**
483 	 * @brief set the Tx encapsulation type of the VDEV
484 	 * @details
485 	 * This will be used to populate the HTT desc packet type field
486 	 * during Tx
487 	 * @param vdev - the data virtual device object
488 	 * @param val - the Tx encap type
489 	 * @return - void
490 	 */
491 	void
492 		(*txrx_set_tx_encap_type)(
493 				struct cdp_vdev *vdev,
494 				enum htt_cmn_pkt_type val);
495 	/**
496 	 * @brief set the Rx decapsulation type of the VDEV
497 	 * @details
498 	 * This will be used to configure into firmware and hardware
499 	 * which format to decap all Rx packets into, for all peers under
500 	 * the VDEV.
501 	 * @param vdev - the data virtual device object
502 	 * @param val - the Rx decap mode
503 	 * @return - void
504 	 */
505 	void
506 		(*txrx_set_vdev_rx_decap_type)(
507 				struct cdp_vdev *vdev,
508 				enum htt_cmn_pkt_type val);
509 
510 	/**
511 	 * @brief get the Rx decapsulation type of the VDEV
512 	 *
513 	 * @param vdev - the data virtual device object
514 	 * @return - the Rx decap type
515 	 */
516 	enum htt_cmn_pkt_type
517 		(*txrx_get_vdev_rx_decap_type)(struct cdp_vdev *vdev);
518 
519 	/* Is this similar to ol_txrx_peer_state_update() in MCL */
520 	/**
521 	 * @brief Update the authorize peer object at association time
522 	 * @details
523 	 * For the host-based implementation of rate-control, it
524 	 * updates the peer/node-related parameters within rate-control
525 	 * context of the peer at association.
526 	 *
527 	 * @param peer - pointer to the node's object
528 	 * @authorize - either to authorize or unauthorize peer
529 	 *
530 	 * @return none
531 	 */
532 	void
533 		(*txrx_peer_authorize)(struct cdp_peer *peer,
534 				u_int32_t authorize);
535 
536 	/* Should be ol_txrx_ctrl_api.h */
537 	void (*txrx_set_mesh_mode)(struct cdp_vdev *vdev, u_int32_t val);
538 
539 	/**
540 	 * @brief setting mesh rx filter
541 	 * @details
542 	 *  based on the bits enabled in the filter packets has to be dropped.
543 	 *
544 	 * @param vdev - the data virtual device object
545 	 * @param val - value to set
546 	 */
547 	void (*txrx_set_mesh_rx_filter)(struct cdp_vdev *vdev, uint32_t val);
548 
549 	void (*tx_flush_buffers)(struct cdp_vdev *vdev);
550 
551 	int (*txrx_is_target_ar900b)(struct cdp_vdev *vdev);
552 
553 	void (*txrx_set_vdev_param)(struct cdp_vdev *vdev,
554 			enum cdp_vdev_param_type param, uint32_t val);
555 
556 	void (*txrx_peer_set_nawds)(struct cdp_peer *peer, uint8_t value);
557 	/**
558 	 * @brief Set the reo dest ring num of the radio
559 	 * @details
560 	 *  Set the reo destination ring no on which we will receive
561 	 *  pkts for this radio.
562 	 *
563 	 * @param pdev - the data physical device object
564 	 * @param reo_dest_ring_num - value ranges between 1 - 4
565 	 */
566 	void (*txrx_set_pdev_reo_dest)(
567 			struct cdp_pdev *pdev,
568 			enum cdp_host_reo_dest_ring reo_dest_ring_num);
569 
570 	/**
571 	 * @brief Get the reo dest ring num of the radio
572 	 * @details
573 	 *  Get the reo destination ring no on which we will receive
574 	 *  pkts for this radio.
575 	 *
576 	 * @param pdev - the data physical device object
577 	 * @return the reo destination ring number
578 	 */
579 	enum cdp_host_reo_dest_ring (*txrx_get_pdev_reo_dest)(
580 						struct cdp_pdev *pdev);
581 
582 	int (*txrx_wdi_event_sub)(struct cdp_pdev *pdev, void *event_cb_sub,
583 			uint32_t event);
584 
585 	int (*txrx_wdi_event_unsub)(struct cdp_pdev *pdev, void *event_cb_sub,
586 			uint32_t event);
587 	int (*txrx_get_sec_type)(struct cdp_peer *peer, uint8_t sec_idx);
588 
589 	void (*txrx_update_mgmt_txpow_vdev)(struct cdp_vdev *vdev,
590 			uint8_t subtype, uint8_t tx_power);
591 
592 	/**
593 	 * txrx_set_pdev_param() - callback to set pdev parameter
594 	 * @soc: opaque soc handle
595 	 * @pdev: data path pdev handle
596 	 * @val: value of pdev_tx_capture
597 	 *
598 	 * Return: status: 0 - Success, non-zero: Failure
599 	 */
600 	QDF_STATUS (*txrx_set_pdev_param)(struct cdp_pdev *pdev,
601 					  enum cdp_pdev_param_type type,
602 					  uint8_t val);
603 	void * (*txrx_get_pldev)(struct cdp_pdev *pdev);
604 
605 #ifdef ATH_SUPPORT_NAC_RSSI
606 	QDF_STATUS (*txrx_vdev_config_for_nac_rssi)(struct cdp_vdev *vdev,
607 		enum cdp_nac_param_cmd cmd, char *bssid, char *client_macaddr,
608 		uint8_t chan_num);
609 	QDF_STATUS (*txrx_vdev_get_neighbour_rssi)(struct cdp_vdev *vdev,
610 						   char *macaddr,
611 						   uint8_t *rssi);
612 #endif
613 	void (*set_key)(struct cdp_peer *peer_handle,
614 			bool is_unicast, uint32_t *key);
615 
616 	uint32_t (*txrx_get_vdev_param)(struct cdp_vdev *vdev,
617 					enum cdp_vdev_param_type param);
618 	int (*enable_peer_based_pktlog)(struct cdp_pdev
619 			*txrx_pdev_handle, char *macaddr, uint8_t enb_dsb);
620 
621 };
622 
623 struct cdp_me_ops {
624 
625 	u_int16_t (*tx_desc_alloc_and_mark_for_mcast_clone)
626 		(struct cdp_pdev *pdev, u_int16_t buf_count);
627 
628 		u_int16_t (*tx_desc_free_and_unmark_for_mcast_clone)(
629 				struct cdp_pdev *pdev,
630 				u_int16_t buf_count);
631 
632 	u_int16_t
633 		(*tx_get_mcast_buf_allocated_marked)
634 			(struct cdp_pdev *pdev);
635 	void
636 		(*tx_me_alloc_descriptor)(struct cdp_pdev *pdev);
637 
638 	void
639 		(*tx_me_free_descriptor)(struct cdp_pdev *pdev);
640 
641 	uint16_t
642 		(*tx_me_convert_ucast)(struct cdp_vdev *vdev,
643 			qdf_nbuf_t wbuf, u_int8_t newmac[][6],
644 			uint8_t newmaccnt);
645 	/* Should be a function pointer in ol_txrx_osif_ops{} */
646 	/**
647 	 * @brief notify mcast frame indication from FW.
648 	 * @details
649 	 *     This notification will be used to convert
650 	 *     multicast frame to unicast.
651 	 *
652 	 * @param pdev - handle to the ctrl SW's physical device object
653 	 * @param vdev_id - ID of the virtual device received the special data
654 	 * @param msdu - the multicast msdu returned by FW for host inspect
655 	 */
656 
657 	int (*mcast_notify)(struct cdp_pdev *pdev,
658 			u_int8_t vdev_id, qdf_nbuf_t msdu);
659 
660 	uint16_t (*tx_me_find_ast_entry)(struct cdp_vdev *vdev,
661 					 uint8_t *da_mac_addr,
662 					 uint8_t *ra_mac_addr);
663 };
664 
665 struct cdp_mon_ops {
666 
667 	void (*txrx_monitor_set_filter_ucast_data)
668 		(struct cdp_pdev *, u_int8_t val);
669 	void (*txrx_monitor_set_filter_mcast_data)
670 		(struct cdp_pdev *, u_int8_t val);
671 	void (*txrx_monitor_set_filter_non_data)
672 	      (struct cdp_pdev *, u_int8_t val);
673 
674 	bool (*txrx_monitor_get_filter_ucast_data)
675 		(struct cdp_vdev *vdev_txrx_handle);
676 	bool (*txrx_monitor_get_filter_mcast_data)
677 		(struct cdp_vdev *vdev_txrx_handle);
678 	bool (*txrx_monitor_get_filter_non_data)
679 		(struct cdp_vdev *vdev_txrx_handle);
680 	QDF_STATUS (*txrx_reset_monitor_mode)(struct cdp_pdev *pdev);
681 
682 	/* HK advance monitor filter support */
683 	QDF_STATUS (*txrx_set_advance_monitor_filter)
684 		(struct cdp_pdev *pdev, struct cdp_monitor_filter *filter_val);
685 };
686 
687 struct cdp_host_stats_ops {
688 	int (*txrx_host_stats_get)(struct cdp_vdev *vdev,
689 			struct ol_txrx_stats_req *req);
690 
691 	void (*txrx_host_stats_clr)(struct cdp_vdev *vdev);
692 
693 	void (*txrx_host_ce_stats)(struct cdp_vdev *vdev);
694 
695 	int (*txrx_stats_publish)(struct cdp_pdev *pdev,
696 			void *buf);
697 	/**
698 	 * @brief Enable enhanced stats functionality.
699 	 *
700 	 * @param pdev - the physical device object
701 	 * @return - void
702 	 */
703 	void (*txrx_enable_enhanced_stats)(struct cdp_pdev *pdev);
704 
705 	/**
706 	 * @brief Disable enhanced stats functionality.
707 	 *
708 	 * @param pdev - the physical device object
709 	 * @return - void
710 	 */
711 	void (*txrx_disable_enhanced_stats)(struct cdp_pdev *pdev);
712 
713 	/**
714 	 * @brief Get the desired stats from the message.
715 	 *
716 	 * @param pdev - the physical device object
717 	 * @param stats_base - stats buffer received from FW
718 	 * @param type - stats type.
719 	 * @return - pointer to requested stat identified by type
720 	 */
721 	uint32_t * (*txrx_get_stats_base)(struct cdp_pdev *pdev,
722 			uint32_t *stats_base, uint32_t msg_len, uint8_t type);
723 	void
724 		(*tx_print_tso_stats)(struct cdp_vdev *vdev);
725 
726 	void
727 		(*tx_rst_tso_stats)(struct cdp_vdev *vdev);
728 
729 	void
730 		(*tx_print_sg_stats)(struct cdp_vdev *vdev);
731 
732 	void
733 		(*tx_rst_sg_stats)(struct cdp_vdev *vdev);
734 
735 	void
736 		(*print_rx_cksum_stats)(struct cdp_vdev *vdev);
737 
738 	void
739 		(*rst_rx_cksum_stats)(struct cdp_vdev *vdev);
740 
741 	A_STATUS
742 		(*txrx_host_me_stats)(struct cdp_vdev *vdev);
743 
744 	void
745 		(*txrx_per_peer_stats)(struct cdp_pdev *pdev, char *addr);
746 
747 	int (*txrx_host_msdu_ttl_stats)(struct cdp_vdev *vdev,
748 			struct ol_txrx_stats_req *req);
749 
750 	void
751 		(*print_lro_stats)(struct cdp_vdev *vdev);
752 
753 	void
754 		(*reset_lro_stats)(struct cdp_vdev *vdev);
755 
756 	void
757 		(*get_fw_peer_stats)(struct cdp_pdev *pdev, uint8_t *addr,
758 				uint32_t cap);
759 	void
760 		(*get_htt_stats)(struct cdp_pdev *pdev, void *data,
761 				uint32_t data_len);
762 	void
763 		(*txrx_update_pdev_stats)(struct cdp_pdev *pdev, void *data,
764 					  uint16_t stats_id);
765 	struct cdp_peer_stats*
766 		(*txrx_get_peer_stats)(struct cdp_peer *peer);
767 	void
768 		(*txrx_reset_peer_ald_stats)(struct cdp_peer *peer);
769 	void
770 		(*txrx_reset_peer_stats)(struct cdp_peer *peer);
771 	int
772 		(*txrx_get_vdev_stats)(struct cdp_vdev *vdev, void *buf,
773 				       bool is_aggregate);
774 	int
775 		(*txrx_process_wmi_host_vdev_stats)(ol_txrx_soc_handle soc,
776 						    void *data, uint32_t len,
777 						    uint32_t stats_id);
778 	int
779 		(*txrx_get_vdev_extd_stats)(struct cdp_vdev *vdev_handle,
780 					    void *buffer);
781 	void
782 		(*txrx_update_vdev_stats)(struct cdp_vdev *vdev, void *buf,
783 					  uint16_t stats_id);
784 	int
785 		(*txrx_get_radio_stats)(struct cdp_pdev *pdev,
786 					void *buf);
787 	struct cdp_pdev_stats*
788 		(*txrx_get_pdev_stats)(struct cdp_pdev *pdev);
789 };
790 
791 struct cdp_wds_ops {
792 	void
793 		(*txrx_set_wds_rx_policy)(struct cdp_vdev *vdev,
794 				u_int32_t val);
795 	void
796 		(*txrx_wds_peer_tx_policy_update)(struct cdp_peer *peer,
797 				int wds_tx_ucast, int wds_tx_mcast);
798 	int (*vdev_set_wds)(void *vdev, uint32_t val);
799 };
800 
801 struct cdp_raw_ops {
802 	int (*txrx_get_nwifi_mode)(struct cdp_vdev *vdev);
803 
804 	void (*rsim_get_astentry)(struct cdp_vdev *vdev,
805 				qdf_nbuf_t *pnbuf,
806 				struct cdp_raw_ast *raw_ast);
807 };
808 
809 #ifdef CONFIG_WIN
810 struct cdp_pflow_ops {
811 	uint32_t(*pflow_update_pdev_params)(void *,
812 			enum _ol_ath_param_t, uint32_t, void *);
813 };
814 #endif /* CONFIG_WIN */
815 
816 #define LRO_IPV4_SEED_ARR_SZ 5
817 #define LRO_IPV6_SEED_ARR_SZ 11
818 
819 /**
820  * struct cdp_lro_hash_config - set rx_offld(LRO/GRO) init parameters
821  * @lro_enable: indicates whether rx_offld is enabled
822  * @tcp_flag: If the TCP flags from the packet do not match
823  * the values in this field after masking with TCP flags mask
824  * below, packet is not rx_offld eligible
825  * @tcp_flag_mask: field for comparing the TCP values provided
826  * above with the TCP flags field in the received packet
827  * @toeplitz_hash_ipv4: contains seed needed to compute the flow id
828  * 5-tuple toeplitz hash for ipv4 packets
829  * @toeplitz_hash_ipv6: contains seed needed to compute the flow id
830  * 5-tuple toeplitz hash for ipv6 packets
831  */
832 struct cdp_lro_hash_config {
833 	uint32_t lro_enable;
834 	uint32_t tcp_flag:9,
835 		tcp_flag_mask:9;
836 	uint32_t toeplitz_hash_ipv4[LRO_IPV4_SEED_ARR_SZ];
837 	uint32_t toeplitz_hash_ipv6[LRO_IPV6_SEED_ARR_SZ];
838 };
839 
840 struct ol_if_ops {
841 	void
842 	(*peer_set_default_routing)(struct cdp_ctrl_objmgr_pdev *ctrl_pdev,
843 				    uint8_t *peer_macaddr, uint8_t vdev_id,
844 				    bool hash_based, uint8_t ring_num);
845 	QDF_STATUS
846 	(*peer_rx_reorder_queue_setup)(struct cdp_ctrl_objmgr_pdev *ctrl_pdev,
847 				       uint8_t vdev_id, uint8_t *peer_mac,
848 				       qdf_dma_addr_t hw_qdesc, int tid,
849 				       uint16_t queue_num,
850 				       uint8_t ba_window_size_valid,
851 				       uint16_t ba_window_size);
852 	QDF_STATUS
853 	(*peer_rx_reorder_queue_remove)(struct cdp_ctrl_objmgr_pdev *ctrl_pdev,
854 					uint8_t vdev_id, uint8_t *peer_macaddr,
855 					uint32_t tid_mask);
856 	int (*peer_unref_delete)(void *scn_handle, uint8_t *peer_mac,
857 				 uint8_t *vdev_mac, enum wlan_op_mode opmode,
858 				 void *old_peer, void *new_peer);
859 	bool (*is_hw_dbs_2x2_capable)(struct wlan_objmgr_psoc *psoc);
860 	int (*peer_add_wds_entry)(void *vdev_handle,
861 				  struct cdp_peer *peer_handle,
862 				  const uint8_t *dest_macaddr,
863 				  uint8_t *next_node_mac,
864 				  uint32_t flags);
865 	int (*peer_update_wds_entry)(void *ol_soc_handle,
866 			uint8_t *dest_macaddr, uint8_t *peer_macaddr,
867 			uint32_t flags);
868 	void (*peer_del_wds_entry)(void *ol_soc_handle,
869 			uint8_t *wds_macaddr);
870 	QDF_STATUS
871 	(*lro_hash_config)(struct cdp_ctrl_objmgr_pdev *ctrl_pdev,
872 			   struct cdp_lro_hash_config *rx_offld_hash);
873 	void (*update_dp_stats)(void *soc, void *stats, uint16_t id,
874 			uint8_t type);
875 #ifdef CONFIG_WIN
876 	uint8_t (*rx_invalid_peer)(void *ctrl_pdev, void *msg);
877 #else
878 	uint8_t (*rx_invalid_peer)(uint8_t vdev_id, void *wh);
879 #endif
880 	int  (*peer_map_event)(void *ol_soc_handle, uint16_t peer_id, uint16_t hw_peer_id,
881 			uint8_t vdev_id, uint8_t *peer_mac_addr,
882 			enum cdp_txrx_ast_entry_type peer_type,
883 			uint32_t tx_ast_hashidx);
884 	int (*peer_unmap_event)(void *ol_soc_handle, uint16_t peer_id);
885 
886 	int (*get_dp_cfg_param)(void *ol_soc_handle, enum cdp_cfg_param_type param_num);
887 
888 	void (*rx_mic_error)(void *ol_soc_handle,
889 			 uint16_t vdev_id, void *wh);
890 	bool (*rx_frag_tkip_demic)(struct wlan_objmgr_peer *ctrl_peer,
891 				   qdf_nbuf_t nbuf,
892 				   uint16_t hdr_space);
893 	uint8_t (*freq_to_channel)(void *ol_soc_handle,  uint16_t vdev_id);
894 
895 	void (*record_act_change)(struct wlan_objmgr_pdev *pdev,
896 				  u_int8_t *dstmac, bool active);
897 #ifdef ATH_SUPPORT_NAC_RSSI
898 	int (*config_fw_for_nac_rssi)(struct wlan_objmgr_pdev *pdev,
899 		u_int8_t vdev_id, enum cdp_nac_param_cmd cmd, char *bssid,
900 		char *client_macaddr, uint8_t chan_num);
901 	int (*config_bssid_in_fw_for_nac_rssi)(struct wlan_objmgr_pdev *pdev,
902 		u_int8_t vdev_id, enum cdp_nac_param_cmd cmd, char *bssid);
903 #endif
904 	int (*peer_sta_kickout)(void *ctrl_pdev, uint8_t *peer_macaddr);
905 
906 	/**
907 	 * send_delba() - Send delba to peer
908 	 * @pdev_handle: Dp pdev handle
909 	 * @ctrl_peer: Peer handle
910 	 * @peer_macaddr: Peer mac addr
911 	 * @tid: Tid number
912 	 *
913 	 * Return: 0 for success, non-zero for failure
914 	 */
915 	int (*send_delba)(void *pdev_handle,  void *ctrl_peer,
916 			  uint8_t *peer_macaddr, uint8_t tid, void *vdev_handle,
917 			  uint8_t reason_code);
918 	/* TODO: Add any other control path calls required to OL_IF/WMA layer */
919 };
920 
921 #ifndef CONFIG_WIN
922 /* From here MCL specific OPs */
923 /**
924  * struct cdp_misc_ops - mcl ops not classified
925  * @set_ibss_vdev_heart_beat_timer:
926  * @bad_peer_txctl_set_setting:
927  * @bad_peer_txctl_update_threshold:
928  * @hl_tdls_flag_reset:
929  * @tx_non_std:
930  * @get_vdev_id:
931  * @set_wisa_mode:
932  * @txrx_data_stall_cb_register:
933  * @txrx_data_stall_cb_deregister:
934  * @txrx_post_data_stall_event
935  * @runtime_suspend:
936  * @runtime_resume:
937  * @register_packetdump_cb:
938  * @unregister_packetdump_cb:
939  */
940 struct cdp_misc_ops {
941 	uint16_t (*set_ibss_vdev_heart_beat_timer)(struct cdp_vdev *vdev,
942 			uint16_t timer_value_sec);
943 	void (*set_wmm_param)(struct cdp_pdev *cfg_pdev,
944 			struct ol_tx_wmm_param_t wmm_param);
945 	void (*bad_peer_txctl_set_setting)(struct cdp_pdev *pdev, int enable,
946 			int period, int txq_limit);
947 	void (*bad_peer_txctl_update_threshold)(struct cdp_pdev *pdev,
948 		int level, int tput_thresh, int tx_limit);
949 	void (*hl_tdls_flag_reset)(struct cdp_vdev *vdev, bool flag);
950 	qdf_nbuf_t (*tx_non_std)(struct cdp_vdev *vdev,
951 		enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
952 	uint16_t (*get_vdev_id)(struct cdp_vdev *vdev);
953 	uint32_t (*get_tx_ack_stats)(uint8_t vdev_id);
954 	QDF_STATUS (*set_wisa_mode)(struct cdp_vdev *vdev, bool enable);
955 	QDF_STATUS (*txrx_data_stall_cb_register)(data_stall_detect_cb cb);
956 	QDF_STATUS (*txrx_data_stall_cb_deregister)(data_stall_detect_cb cb);
957 	void (*txrx_post_data_stall_event)(
958 			enum data_stall_log_event_indicator indicator,
959 			enum data_stall_log_event_type data_stall_type,
960 			uint32_t pdev_id, uint32_t vdev_id_bitmap,
961 			enum data_stall_log_recovery_type recovery_type);
962 	QDF_STATUS (*runtime_suspend)(struct cdp_pdev *pdev);
963 	QDF_STATUS (*runtime_resume)(struct cdp_pdev *pdev);
964 	int (*get_opmode)(struct cdp_vdev *vdev);
965 	void (*mark_first_wakeup_packet)(uint8_t value);
966 	void (*update_mac_id)(uint8_t vdev_id, uint8_t mac_id);
967 	void (*flush_rx_frames)(void *peer, bool drop);
968 	A_STATUS (*get_intra_bss_fwd_pkts_count)(uint8_t vdev_id,
969 		uint64_t *fwd_tx_packets, uint64_t *fwd_rx_packets);
970 	void (*pkt_log_init)(struct cdp_pdev *handle, void *scn);
971 	void (*pkt_log_con_service)(struct cdp_pdev *pdev, void *scn);
972 	int (*get_num_rx_contexts)(struct cdp_soc_t *soc);
973 	void (*register_pktdump_cb)(ol_txrx_pktdump_cb tx_cb,
974 				    ol_txrx_pktdump_cb rx_cb);
975 	void (*unregister_pktdump_cb)(void);
976 };
977 
978 /**
979  * struct cdp_tx_delay_ops - mcl tx delay ops
980  * @tx_delay:
981  * @tx_delay_hist:
982  * @tx_packet_count:
983  * @tx_set_compute_interval:
984  */
985 struct cdp_tx_delay_ops {
986 	void (*tx_delay)(struct cdp_pdev *pdev, uint32_t *queue_delay_microsec,
987 		uint32_t *tx_delay_microsec, int category);
988 	void (*tx_delay_hist)(struct cdp_pdev *pdev,
989 		uint16_t *bin_values, int category);
990 	void (*tx_packet_count)(struct cdp_pdev *pdev,
991 		uint16_t *out_packet_count,
992 		uint16_t *out_packet_loss_count, int category);
993 	void (*tx_set_compute_interval)(struct cdp_pdev *pdev,
994 		uint32_t interval);
995 };
996 
997 /**
998  * struct cdp_pmf_ops - mcl protected management frame ops
999  * @get_pn_info:
1000  */
1001 struct cdp_pmf_ops {
1002 	void (*get_pn_info)(void *peer, uint8_t **last_pn_valid,
1003 			uint64_t **last_pn, uint32_t **rmf_pn_replays);
1004 };
1005 
1006 /**
1007  * struct cdp_cfg_ops - mcl configuration ops
1008  * @set_cfg_rx_fwd_disabled:
1009  * @set_cfg_packet_log_enabled:
1010  * @cfg_attach:
1011  * @vdev_rx_set_intrabss_fwd:
1012  * @is_rx_fwd_disabled:
1013  * @tx_set_is_mgmt_over_wmi_enabled:
1014  * @is_high_latency:
1015  * @set_flow_control_parameters:
1016  * @set_flow_steering:
1017  * @set_ptp_rx_opt_enabled:
1018  * @set_new_htt_msg_format:
1019  * @set_peer_unmap_conf_support:
1020  * @get_peer_unmap_conf_support:
1021  */
1022 struct cdp_cfg_ops {
1023 	void (*set_cfg_rx_fwd_disabled)(struct cdp_cfg *cfg_pdev,
1024 		uint8_t disable_rx_fwd);
1025 	void (*set_cfg_packet_log_enabled)(struct cdp_cfg *cfg_pdev,
1026 		uint8_t val);
1027 	struct cdp_cfg * (*cfg_attach)(qdf_device_t osdev, void *cfg_param);
1028 	void (*vdev_rx_set_intrabss_fwd)(struct cdp_vdev *vdev, bool val);
1029 	uint8_t (*is_rx_fwd_disabled)(struct cdp_vdev *vdev);
1030 	void (*tx_set_is_mgmt_over_wmi_enabled)(uint8_t value);
1031 	int (*is_high_latency)(struct cdp_cfg *cfg_pdev);
1032 	void (*set_flow_control_parameters)(struct cdp_cfg *cfg_pdev,
1033 		void *param);
1034 	void (*set_flow_steering)(struct cdp_cfg *cfg_pdev, uint8_t val);
1035 	void (*set_ptp_rx_opt_enabled)(struct cdp_cfg *cfg_pdev, uint8_t val);
1036 	void (*set_new_htt_msg_format)(uint8_t val);
1037 	void (*set_peer_unmap_conf_support)(bool val);
1038 	bool (*get_peer_unmap_conf_support)(void);
1039 };
1040 
1041 /**
1042  * struct cdp_flowctl_ops - mcl flow control
1043  * @register_pause_cb:
1044  * @set_desc_global_pool_size:
1045  * @dump_flow_pool_info:
1046  */
1047 struct cdp_flowctl_ops {
1048 	QDF_STATUS (*flow_pool_map_handler)(struct cdp_soc_t *soc,
1049 					    struct cdp_pdev *pdev,
1050 					    uint8_t vdev_id);
1051 	void (*flow_pool_unmap_handler)(struct cdp_soc_t *soc,
1052 					struct cdp_pdev *pdev,
1053 					uint8_t vdev_id);
1054 	QDF_STATUS (*register_pause_cb)(struct cdp_soc_t *soc,
1055 					tx_pause_callback);
1056 	void (*set_desc_global_pool_size)(uint32_t num_msdu_desc);
1057 
1058 	void (*dump_flow_pool_info)(void *);
1059 
1060 	bool (*tx_desc_thresh_reached)(struct cdp_vdev *vdev);
1061 };
1062 
1063 /**
1064  * struct cdp_lflowctl_ops - mcl legacy flow control ops
1065  * @register_tx_flow_control:
1066  * @deregister_tx_flow_control_cb:
1067  * @flow_control_cb:
1068  * @get_tx_resource:
1069  * @ll_set_tx_pause_q_depth:
1070  * @vdev_flush:
1071  * @vdev_pause:
1072  * @vdev_unpause:
1073  */
1074 struct cdp_lflowctl_ops {
1075 #ifdef QCA_HL_NETDEV_FLOW_CONTROL
1076 	int (*register_tx_flow_control)(struct cdp_soc_t *soc,
1077 					tx_pause_callback flowcontrol);
1078 	int (*set_vdev_tx_desc_limit)(uint8_t vdev_id, uint8_t chan);
1079 	int (*set_vdev_os_queue_status)(uint8_t vdev_id,
1080 					enum netif_action_type action);
1081 #else
1082 	int (*register_tx_flow_control)(uint8_t vdev_id,
1083 		ol_txrx_tx_flow_control_fp flowControl, void *osif_fc_ctx,
1084 		ol_txrx_tx_flow_control_is_pause_fp flow_control_is_pause);
1085 #endif /* QCA_HL_NETDEV_FLOW_CONTROL */
1086 	int (*deregister_tx_flow_control_cb)(uint8_t vdev_id);
1087 	void (*flow_control_cb)(struct cdp_vdev *vdev, bool tx_resume);
1088 	bool (*get_tx_resource)(uint8_t sta_id,
1089 			 unsigned int low_watermark,
1090 			 unsigned int high_watermark_offset);
1091 	int (*ll_set_tx_pause_q_depth)(uint8_t vdev_id, int pause_q_depth);
1092 	void (*vdev_flush)(struct cdp_vdev *vdev);
1093 	void (*vdev_pause)(struct cdp_vdev *vdev, uint32_t reason);
1094 	void (*vdev_unpause)(struct cdp_vdev *vdev, uint32_t reason);
1095 };
1096 
1097 #ifdef IPA_OFFLOAD
1098 /**
1099  * struct cdp_ipa_ops - mcl ipa data path ops
1100  * @ipa_get_resource:
1101  * @ipa_set_doorbell_paddr:
1102  * @ipa_set_active:
1103  * @ipa_op_response:
1104  * @ipa_register_op_cb:
1105  * @ipa_get_stat:
1106  * @ipa_tx_data_frame:
1107  */
1108 struct cdp_ipa_ops {
1109 	QDF_STATUS (*ipa_get_resource)(struct cdp_pdev *pdev);
1110 	QDF_STATUS (*ipa_set_doorbell_paddr)(struct cdp_pdev *pdev);
1111 	QDF_STATUS (*ipa_set_active)(struct cdp_pdev *pdev, bool uc_active,
1112 		bool is_tx);
1113 	QDF_STATUS (*ipa_op_response)(struct cdp_pdev *pdev, uint8_t *op_msg);
1114 	QDF_STATUS (*ipa_register_op_cb)(struct cdp_pdev *pdev,
1115 		void (*ipa_uc_op_cb_type)(uint8_t *op_msg, void *osif_ctxt),
1116 		void *usr_ctxt);
1117 	QDF_STATUS (*ipa_get_stat)(struct cdp_pdev *pdev);
1118 	qdf_nbuf_t (*ipa_tx_data_frame)(struct cdp_vdev *vdev, qdf_nbuf_t skb);
1119 	void (*ipa_set_uc_tx_partition_base)(struct cdp_cfg *pdev,
1120 		uint32_t value);
1121 #ifdef FEATURE_METERING
1122 	QDF_STATUS (*ipa_uc_get_share_stats)(struct cdp_pdev *pdev,
1123 		uint8_t reset_stats);
1124 	QDF_STATUS (*ipa_uc_set_quota)(struct cdp_pdev *pdev,
1125 		uint64_t quota_bytes);
1126 #endif
1127 	QDF_STATUS (*ipa_enable_autonomy)(struct cdp_pdev *pdev);
1128 	QDF_STATUS (*ipa_disable_autonomy)(struct cdp_pdev *pdev);
1129 #ifdef CONFIG_IPA_WDI_UNIFIED_API
1130 	QDF_STATUS (*ipa_setup)(struct cdp_pdev *pdev, void *ipa_i2w_cb,
1131 		void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,
1132 		uint32_t ipa_desc_size, void *ipa_priv, bool is_rm_enabled,
1133 		uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle,
1134 		bool is_smmu_enabled, qdf_ipa_sys_connect_params_t *sys_in);
1135 #else /* CONFIG_IPA_WDI_UNIFIED_API */
1136 	QDF_STATUS (*ipa_setup)(struct cdp_pdev *pdev, void *ipa_i2w_cb,
1137 		void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,
1138 		uint32_t ipa_desc_size, void *ipa_priv, bool is_rm_enabled,
1139 		uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle);
1140 #endif /* CONFIG_IPA_WDI_UNIFIED_API */
1141 	QDF_STATUS (*ipa_cleanup)(uint32_t tx_pipe_handle,
1142 		uint32_t rx_pipe_handle);
1143 	QDF_STATUS (*ipa_setup_iface)(char *ifname, uint8_t *mac_addr,
1144 		qdf_ipa_client_type_t prod_client,
1145 		qdf_ipa_client_type_t cons_client,
1146 		uint8_t session_id, bool is_ipv6_enabled);
1147 	QDF_STATUS (*ipa_cleanup_iface)(char *ifname, bool is_ipv6_enabled);
1148 	QDF_STATUS (*ipa_enable_pipes)(struct cdp_pdev *pdev);
1149 	QDF_STATUS (*ipa_disable_pipes)(struct cdp_pdev *pdev);
1150 	QDF_STATUS (*ipa_set_perf_level)(int client,
1151 		uint32_t max_supported_bw_mbps);
1152 };
1153 #endif
1154 
1155 /**
1156  * struct cdp_bus_ops - mcl bus suspend/resume ops
1157  * @bus_suspend:
1158  * @bus_resume:
1159  */
1160 struct cdp_bus_ops {
1161 	QDF_STATUS (*bus_suspend)(struct cdp_pdev *opaque_pdev);
1162 	QDF_STATUS (*bus_resume)(struct cdp_pdev *opaque_pdev);
1163 };
1164 
1165 /**
1166  * struct cdp_ocb_ops - mcl ocb ops
1167  * @set_ocb_chan_info:
1168  * @get_ocb_chan_info:
1169  */
1170 struct cdp_ocb_ops {
1171 	void (*set_ocb_chan_info)(struct cdp_vdev *vdev,
1172 			struct ol_txrx_ocb_set_chan ocb_set_chan);
1173 	struct ol_txrx_ocb_chan_info *
1174 		(*get_ocb_chan_info)(struct cdp_vdev *vdev);
1175 };
1176 
1177 /**
1178  * struct cdp_peer_ops - mcl peer related ops
1179  * @register_peer:
1180  * @clear_peer:
1181  * @cfg_attach:
1182  * @find_peer_by_addr:
1183  * @find_peer_by_addr_and_vdev:
1184  * @local_peer_id:
1185  * @peer_find_by_local_id:
1186  * @peer_state_update:
1187  * @get_vdevid:
1188  * @get_vdev_by_sta_id:
1189  * @register_ocb_peer:
1190  * @peer_get_peer_mac_addr:
1191  * @get_peer_state:
1192  * @get_vdev_for_peer:
1193  * @update_ibss_add_peer_num_of_vdev:
1194  * @remove_peers_for_vdev:
1195  * @remove_peers_for_vdev_no_lock:
1196  * @copy_mac_addr_raw:
1197  * @add_last_real_peer:
1198  * @is_vdev_restore_last_peer:
1199  * @update_last_real_peer:
1200  */
1201 struct cdp_peer_ops {
1202 	QDF_STATUS (*register_peer)(struct cdp_pdev *pdev,
1203 			struct ol_txrx_desc_type *sta_desc);
1204 	QDF_STATUS (*clear_peer)(struct cdp_pdev *pdev, uint8_t sta_id);
1205 	QDF_STATUS (*change_peer_state)(uint8_t sta_id,
1206 			enum ol_txrx_peer_state sta_state,
1207 			bool roam_synch_in_progress);
1208 	void * (*peer_get_ref_by_addr)(struct cdp_pdev *pdev,
1209 				       uint8_t *peer_addr, uint8_t *peer_id,
1210 				       enum peer_debug_id_type debug_id);
1211 	void (*peer_release_ref)(void *peer, enum peer_debug_id_type debug_id);
1212 	void * (*find_peer_by_addr)(struct cdp_pdev *pdev,
1213 			uint8_t *peer_addr, uint8_t *peer_id);
1214 	void * (*find_peer_by_addr_and_vdev)(struct cdp_pdev *pdev,
1215 			struct cdp_vdev *vdev,
1216 			uint8_t *peer_addr, uint8_t *peer_id);
1217 	uint16_t (*local_peer_id)(void *peer);
1218 	void * (*peer_find_by_local_id)(struct cdp_pdev *pdev,
1219 			uint8_t local_peer_id);
1220 	QDF_STATUS (*peer_state_update)(struct cdp_pdev *pdev,
1221 			uint8_t *peer_addr,
1222 			enum ol_txrx_peer_state state);
1223 	QDF_STATUS (*get_vdevid)(void *peer, uint8_t *vdev_id);
1224 	struct cdp_vdev * (*get_vdev_by_sta_id)(struct cdp_pdev *pdev,
1225 			uint8_t sta_id);
1226 	QDF_STATUS (*register_ocb_peer)(uint8_t *mac_addr, uint8_t *peer_id);
1227 	uint8_t * (*peer_get_peer_mac_addr)(void *peer);
1228 	int (*get_peer_state)(void *peer);
1229 	struct cdp_vdev * (*get_vdev_for_peer)(void *peer);
1230 	int16_t (*update_ibss_add_peer_num_of_vdev)(struct cdp_vdev *vdev,
1231 			int16_t peer_num_delta);
1232 	void (*remove_peers_for_vdev)(struct cdp_vdev *vdev,
1233 			ol_txrx_vdev_peer_remove_cb callback,
1234 			void *callback_context, bool remove_last_peer);
1235 	void (*remove_peers_for_vdev_no_lock)(struct cdp_vdev *vdev,
1236 			ol_txrx_vdev_peer_remove_cb callback,
1237 			void *callback_context);
1238 	void (*copy_mac_addr_raw)(struct cdp_vdev *vdev, uint8_t *bss_addr);
1239 	void (*add_last_real_peer)(struct cdp_pdev *pdev,
1240 		struct cdp_vdev *vdev, uint8_t *peer_id);
1241 	bool (*is_vdev_restore_last_peer)(void *peer);
1242 	void (*update_last_real_peer)(struct cdp_pdev *pdev, void *peer,
1243 			uint8_t *peer_id, bool restore_last_peer);
1244 	void (*peer_detach_force_delete)(void *peer);
1245 };
1246 
1247 /**
1248  * struct cdp_ocb_ops - mcl ocb ops
1249  * @throttle_init_period:
1250  * @throttle_set_level:
1251  */
1252 struct cdp_throttle_ops {
1253 	void (*throttle_init_period)(struct cdp_pdev *pdev, int period,
1254 			uint8_t *dutycycle_level);
1255 	void (*throttle_set_level)(struct cdp_pdev *pdev, int level);
1256 };
1257 
1258 /**
1259  * struct cdp_ocb_ops - mcl ocb ops
1260  * @clear_stats:
1261  * @stats:
1262  */
1263 struct cdp_mob_stats_ops {
1264 	void (*clear_stats)(uint16_t bitmap);
1265 	int (*stats)(uint8_t vdev_id, char *buffer, unsigned buf_len);
1266 };
1267 #endif /* CONFIG_WIN */
1268 
1269 #ifdef RECEIVE_OFFLOAD
1270 /**
1271  * struct cdp_rx_offld_ops - mcl host receive offload ops
1272  * @register_rx_offld_flush_cb:
1273  * @deregister_rx_offld_flush_cb:
1274  */
1275 struct cdp_rx_offld_ops {
1276 	void (*register_rx_offld_flush_cb)(void (rx_offld_flush_cb)(void *));
1277 	void (*deregister_rx_offld_flush_cb)(void);
1278 };
1279 #endif
1280 
1281 struct cdp_ops {
1282 	struct cdp_cmn_ops          *cmn_drv_ops;
1283 	struct cdp_ctrl_ops         *ctrl_ops;
1284 	struct cdp_me_ops           *me_ops;
1285 	struct cdp_mon_ops          *mon_ops;
1286 	struct cdp_host_stats_ops   *host_stats_ops;
1287 	struct cdp_wds_ops          *wds_ops;
1288 	struct cdp_raw_ops          *raw_ops;
1289 	struct cdp_pflow_ops        *pflow_ops;
1290 #ifndef CONFIG_WIN
1291 	struct cdp_misc_ops         *misc_ops;
1292 	struct cdp_cfg_ops          *cfg_ops;
1293 	struct cdp_flowctl_ops      *flowctl_ops;
1294 	struct cdp_lflowctl_ops     *l_flowctl_ops;
1295 #ifdef IPA_OFFLOAD
1296 	struct cdp_ipa_ops          *ipa_ops;
1297 #endif
1298 #ifdef RECEIVE_OFFLOAD
1299 	struct cdp_rx_offld_ops     *rx_offld_ops;
1300 #endif
1301 	struct cdp_bus_ops          *bus_ops;
1302 	struct cdp_ocb_ops          *ocb_ops;
1303 	struct cdp_peer_ops         *peer_ops;
1304 	struct cdp_throttle_ops     *throttle_ops;
1305 	struct cdp_mob_stats_ops    *mob_stats_ops;
1306 	struct cdp_tx_delay_ops     *delay_ops;
1307 	struct cdp_pmf_ops          *pmf_ops;
1308 #endif /* CONFIG_WIN */
1309 };
1310 #endif
1311