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