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