xref: /wlan-dirver/qca-wifi-host-cmn/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h (revision 4865edfd190c086bbe2c69aae12a8226f877b91e)
1 /*
2  * Copyright (c) 2016-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 #ifndef _WLAN_LMAC_IF_DEF_H_
21 #define _WLAN_LMAC_IF_DEF_H_
22 
23 #include <qdf_time.h>
24 #include "qdf_status.h"
25 #include "wlan_objmgr_cmn.h"
26 #ifdef DFS_COMPONENT_ENABLE
27 #include <wlan_dfs_public_struct.h>
28 #endif
29 #include "wlan_mgmt_txrx_utils_api.h"
30 #include "wlan_scan_public_structs.h"
31 
32 #ifdef WLAN_ATF_ENABLE
33 #include "wlan_atf_utils_defs.h"
34 #endif
35 #ifdef QCA_SUPPORT_SON
36 #include <wlan_son_tgt_api.h>
37 #endif
38 #ifdef WLAN_SA_API_ENABLE
39 #include "wlan_sa_api_utils_defs.h"
40 #endif
41 #ifdef WLAN_CONV_SPECTRAL_ENABLE
42 #include "wlan_spectral_public_structs.h"
43 #endif
44 #include <reg_services_public_struct.h>
45 
46 #ifdef WLAN_CONV_CRYPTO_SUPPORTED
47 #include "wlan_crypto_global_def.h"
48 #endif
49 
50 #include <wlan_dfs_tgt_api.h>
51 #include <wlan_dfs_ioctl.h>
52 
53 /* Number of dev type: Direct attach and Offload */
54 #define MAX_DEV_TYPE 2
55 
56 #ifdef WIFI_POS_CONVERGED
57 /* forward declarations */
58 struct oem_data_req;
59 struct oem_data_rsp;
60 #endif /* WIFI_POS_CONVERGED */
61 
62 #ifdef DIRECT_BUF_RX_ENABLE
63 /* forward declarations for direct buf rx */
64 struct direct_buf_rx_data;
65 #endif
66 
67 #ifdef WLAN_FEATURE_NAN_CONVERGENCE
68 struct scheduler_msg;
69 #endif
70 
71 #ifdef CONVERGED_TDLS_ENABLE
72 #include "wlan_tdls_public_structs.h"
73 #endif
74 
75 #ifdef QCA_SUPPORT_CP_STATS
76 #include <wlan_cp_stats_mc_defs.h>
77 #endif /* QCA_SUPPORT_CP_STATS */
78 
79 #ifdef QCA_SUPPORT_CP_STATS
80 /**
81  * struct wlan_lmac_if_cp_stats_tx_ops - defines southbound tx callbacks for
82  * control plane statistics component
83  * @cp_stats_attach:	function pointer to register events from FW
84  * @cp_stats_detach:	function pointer to unregister events from FW
85  */
86 struct wlan_lmac_if_cp_stats_tx_ops {
87 	QDF_STATUS (*cp_stats_attach)(struct wlan_objmgr_psoc *psoc);
88 	QDF_STATUS (*cp_stats_detach)(struct wlan_objmgr_psoc *posc);
89 #ifdef CONFIG_MCL
90 	void (*inc_wake_lock_stats)(uint32_t reason,
91 				    struct wake_lock_stats *stats,
92 				    uint32_t *unspecified_wake_count);
93 	QDF_STATUS (*send_req_stats)(struct wlan_objmgr_psoc *psoc,
94 				     enum stats_req_type type,
95 				     struct request_info *req);
96 #endif
97 };
98 
99 /**
100  * struct wlan_lmac_if_cp_stats_rx_ops - defines southbound rx callbacks for
101  * control plane statistics component
102  * @cp_stats_rx_event_handler:	function pointer to rx FW events
103  */
104 struct wlan_lmac_if_cp_stats_rx_ops {
105 	QDF_STATUS (*cp_stats_rx_event_handler)(struct wlan_objmgr_vdev *vdev);
106 #ifdef CONFIG_MCL
107 	QDF_STATUS (*process_stats_event)(struct wlan_objmgr_psoc *psoc,
108 					  struct stats_event *ev);
109 #endif
110 };
111 #endif
112 
113 /**
114  * struct wlan_lmac_if_mgmt_txrx_tx_ops - structure of tx function
115  *                  pointers for mgmt txrx component
116  * @mgmt_tx_send: function pointer to transmit mgmt tx frame
117  * @beacon_send:  function pointer to transmit beacon frame
118  * @fd_action_frame_send: function pointer to transmit FD action frame
119  */
120 struct wlan_lmac_if_mgmt_txrx_tx_ops {
121 	QDF_STATUS (*mgmt_tx_send)(struct wlan_objmgr_vdev *vdev,
122 			qdf_nbuf_t nbuf, u_int32_t desc_id,
123 			void *mgmt_tx_params);
124 	QDF_STATUS (*beacon_send)(struct wlan_objmgr_vdev *vdev,
125 			qdf_nbuf_t nbuf);
126 	QDF_STATUS (*fd_action_frame_send)(struct wlan_objmgr_vdev *vdev,
127 					   qdf_nbuf_t nbuf);
128 };
129 
130 /**
131  * struct wlan_lmac_if_scan_tx_ops - south bound tx function pointers for scan
132  * @scan_start: function to start scan
133  * @scan_cancel: function to cancel scan
134  * @pno_start: start pno scan
135  * @pno_stop: stop pno scan
136  * @scan_reg_ev_handler: function to register for scan events
137  * @scan_unreg_ev_handler: function to unregister for scan events
138  *
139  * scan module uses these functions to avail ol/da lmac services
140  */
141 struct wlan_lmac_if_scan_tx_ops {
142 	QDF_STATUS (*scan_start)(struct wlan_objmgr_pdev *pdev,
143 			struct scan_start_request *req);
144 	QDF_STATUS (*scan_cancel)(struct wlan_objmgr_pdev *pdev,
145 			struct scan_cancel_param *req);
146 	QDF_STATUS (*pno_start)(struct wlan_objmgr_psoc *psoc,
147 			struct pno_scan_req_params *req);
148 	QDF_STATUS (*pno_stop)(struct wlan_objmgr_psoc *psoc,
149 			uint8_t vdev_id);
150 	QDF_STATUS (*scan_reg_ev_handler)(struct wlan_objmgr_psoc *psoc,
151 			void *arg);
152 	QDF_STATUS (*scan_unreg_ev_handler)(struct wlan_objmgr_psoc *psoc,
153 			void *arg);
154 	QDF_STATUS (*set_chan_list)(struct wlan_objmgr_pdev *pdev, void *arg);
155 };
156 
157 /**
158  * struct wlan_lmac_if_ftm_tx_ops - south bound tx function pointers for ftm
159  * @ftm_attach: function to register event handlers with FW
160  * @ftm_detach: function to de-register event handlers with FW
161  * @ftm_cmd_send: function to send FTM commands to FW
162  *
163  * ftm module uses these functions to avail ol/da lmac services
164  */
165 struct wlan_lmac_if_ftm_tx_ops {
166 	QDF_STATUS (*ftm_attach)(struct wlan_objmgr_psoc *psoc);
167 	QDF_STATUS (*ftm_detach)(struct wlan_objmgr_psoc *psoc);
168 	QDF_STATUS (*ftm_cmd_send)(struct wlan_objmgr_pdev *pdev,
169 				uint8_t *buf, uint32_t len, uint8_t mac_id);
170 };
171 
172 
173 struct wlan_lmac_if_mlme_tx_ops {
174 	void (*scan_sta_power_events)(struct wlan_objmgr_pdev *pdev,
175 			int event_type, int event_status);
176 	void (*scan_connection_lost)(struct wlan_objmgr_pdev *pdev);
177 	void (*scan_end)(struct wlan_objmgr_pdev *pdev);
178 	uint32_t (*get_wifi_iface_id) (struct wlan_objmgr_pdev *pdev);
179 };
180 
181 /**
182  * struct wlan_lmac_if_scan_rx_ops  - south bound rx function pointers for scan
183  * @scan_ev_handler: scan event handler
184  * @scan_set_max_active_scans: set max active scans allowed
185  *
186  * lmac modules uses this API to post scan events to scan module
187  */
188 struct wlan_lmac_if_scan_rx_ops {
189 	QDF_STATUS (*scan_ev_handler)(struct wlan_objmgr_psoc *psoc,
190 		struct scan_event_info *event_info);
191 	QDF_STATUS (*scan_set_max_active_scans)(struct wlan_objmgr_psoc *psoc,
192 			uint32_t max_active_scans);
193 };
194 
195 #ifdef CONVERGED_P2P_ENABLE
196 
197 /* forward declarations for p2p tx ops */
198 struct p2p_ps_config;
199 struct p2p_lo_start;
200 
201 /**
202  * struct wlan_lmac_if_p2p_tx_ops - structure of tx function pointers
203  * for P2P component
204  * @set_ps:      function pointer to set power save
205  * @lo_start:    function pointer to start listen offload
206  * @lo_stop:     function pointer to stop listen offload
207  * @set_noa:     function pointer to disable/enable NOA
208  * @reg_lo_ev_handler:   function pointer to register lo event handler
209  * @reg_noa_ev_handler:  function pointer to register noa event handler
210  * @unreg_lo_ev_handler: function pointer to unregister lo event handler
211  * @unreg_noa_ev_handler:function pointer to unregister noa event handler
212  */
213 struct wlan_lmac_if_p2p_tx_ops {
214 	QDF_STATUS (*set_ps)(struct wlan_objmgr_psoc *psoc,
215 		struct p2p_ps_config *ps_config);
216 	QDF_STATUS (*lo_start)(struct wlan_objmgr_psoc *psoc,
217 		struct p2p_lo_start *lo_start);
218 	QDF_STATUS (*lo_stop)(struct wlan_objmgr_psoc *psoc,
219 		uint32_t vdev_id);
220 	QDF_STATUS (*set_noa)(struct wlan_objmgr_psoc *psoc,
221 		uint32_t vdev_id, bool disable_noa);
222 	QDF_STATUS (*reg_lo_ev_handler)(struct wlan_objmgr_psoc *psoc,
223 			void *arg);
224 	QDF_STATUS (*reg_noa_ev_handler)(struct wlan_objmgr_psoc *psoc,
225 			void *arg);
226 	QDF_STATUS (*unreg_lo_ev_handler)(struct wlan_objmgr_psoc *psoc,
227 			void *arg);
228 	QDF_STATUS (*unreg_noa_ev_handler)(struct wlan_objmgr_psoc *psoc,
229 			void *arg);
230 };
231 #endif
232 
233 #ifdef WLAN_ATF_ENABLE
234 
235 /**
236  * struct wlan_lmac_if_atf_tx_ops - ATF specific tx function pointers
237  * @atf_update_peer_txtoken:      Update peer Tx token
238  * @atf_set_enable_disable:       Set atf enable/disable
239  * @atf_tokens_used:              Get used atf tokens
240  * @atf_get_unused_txtoken:       Get unused atf tokens
241  * @atf_peer_resume:              Resume peer
242  * @atf_tokens_unassigned:        Set unassigned atf tockens
243  * @atf_capable_peer:             Set atf state change
244  * @atf_airtime_estimate:         Get estimated airtime
245  * @atf_debug_peerstate:          Get peer state
246  * @atf_enable_disable:           Set atf peer stats enable/disable
247  * @atf_ssid_sched_policy:        Set ssid schedule policy
248  * @atf_set:                      Set atf
249  * @atf_set_grouping:             Set atf grouping
250  * @atf_send_peer_request:        Send peer requests
251  * @atf_set_bwf:                  Set bandwidth fairness
252  * @atf_peer_buf_held:            Get buffer held
253  * @atf_get_peer_airtime:         Get peer airtime
254  * @atf_get_chbusyper:            Get channel busy
255  * @atf_open:                     ATF open
256  * @atf_register_event_handler    ATF register wmi event handlers
257  * @atf_unregister_event_handler  ATF unregister wmi event handlers
258  */
259 struct wlan_lmac_if_atf_tx_ops {
260 	void (*atf_update_peer_txtoken)(struct wlan_objmgr_pdev *pdev,
261 					struct wlan_objmgr_peer *peer,
262 					struct atf_stats *stats);
263 	void (*atf_set_enable_disable)(struct wlan_objmgr_pdev *pdev,
264 				       uint8_t value);
265 	uint8_t (*atf_tokens_used)(struct wlan_objmgr_pdev *pdev,
266 				   struct wlan_objmgr_peer *peer);
267 	void (*atf_get_unused_txtoken)(struct wlan_objmgr_pdev *pdev,
268 				       struct wlan_objmgr_peer *peer,
269 				       int *unused_token);
270 	void (*atf_peer_resume)(struct wlan_objmgr_pdev *pdev,
271 				struct wlan_objmgr_peer *peer);
272 	void (*atf_tokens_unassigned)(struct wlan_objmgr_pdev *pdev,
273 				      uint32_t tokens_unassigned);
274 	void (*atf_capable_peer)(struct wlan_objmgr_pdev *pdev,
275 				 struct wlan_objmgr_peer *peer,
276 				 uint8_t val, uint8_t atfstate_change);
277 	uint32_t (*atf_airtime_estimate)(struct wlan_objmgr_pdev *pdev,
278 					 struct wlan_objmgr_peer *peer,
279 					 uint32_t tput,
280 					 uint32_t *possible_tput);
281 	uint32_t (*atf_debug_peerstate)(struct wlan_objmgr_pdev *pdev,
282 					struct wlan_objmgr_peer *peer);
283 
284 	int32_t (*atf_enable_disable)(struct wlan_objmgr_vdev *vdev,
285 				      uint8_t value);
286 	int32_t (*atf_ssid_sched_policy)(struct wlan_objmgr_vdev *vdev,
287 					 uint8_t value);
288 	int32_t (*atf_set)(struct wlan_objmgr_pdev *pdev,
289 			   struct pdev_atf_req *atf_req,
290 			   uint8_t atf_tput_based);
291 	int32_t (*atf_set_grouping)(struct wlan_objmgr_pdev *pdev,
292 				    struct pdev_atf_ssid_group_req *atf_grp_req,
293 				    uint8_t atf_tput_based);
294 	int32_t (*atf_send_peer_request)(struct wlan_objmgr_pdev *pdev,
295 					 struct pdev_atf_peer_ext_request *atfr,
296 					 uint8_t atf_tput_based);
297 	int32_t (*atf_set_bwf)(struct wlan_objmgr_pdev *pdev,
298 			       struct pdev_bwf_req *bwf_req);
299 	uint32_t (*atf_peer_buf_held)(struct wlan_objmgr_peer *peer);
300 	uint32_t (*atf_get_peer_airtime)(struct wlan_objmgr_peer *peer);
301 	uint32_t (*atf_get_chbusyper)(struct wlan_objmgr_pdev *pdev);
302 	void (*atf_open)(struct wlan_objmgr_psoc *psoc);
303 	void (*atf_register_event_handler)(struct wlan_objmgr_psoc *psoc);
304 	void (*atf_unregister_event_handler)(struct wlan_objmgr_psoc *psoc);
305 };
306 #endif
307 
308 #ifdef WLAN_SUPPORT_FILS
309 /**
310  * struct wlan_lmac_if_fd_tx_ops - FILS Discovery specific Tx function pointers
311  * @fd_vdev_config_fils:         Enable and configure FILS Discovery
312  * @fd_register_event_handler:   Register swfda WMI event handler
313  * @fd_unregister_event_handler: Un-register swfda WMI event handler
314  */
315 struct wlan_lmac_if_fd_tx_ops {
316 	QDF_STATUS (*fd_vdev_config_fils)(struct wlan_objmgr_vdev *vdev,
317 					  uint32_t fd_period);
318 	void (*fd_register_event_handler)(struct wlan_objmgr_psoc *psoc);
319 	void (*fd_unregister_event_handler)(struct wlan_objmgr_psoc *psoc);
320 };
321 #endif
322 
323 #ifdef WLAN_SA_API_ENABLE
324 
325 /**
326  * struct wlan_lmac_if_sa_api_tx_ops - SA API specific tx function pointers
327  */
328 
329 struct wlan_lmac_if_sa_api_tx_ops {
330 	void (*sa_api_register_event_handler)(struct wlan_objmgr_psoc *psoc);
331 	void (*sa_api_unregister_event_handler)(struct wlan_objmgr_psoc *posc);
332 	void (*sa_api_enable_sa) (struct wlan_objmgr_pdev *pdev,
333 			uint32_t enable, uint32_t mode, uint32_t rx_antenna);
334 	void (*sa_api_set_rx_antenna) (struct wlan_objmgr_pdev *pdev,
335 			uint32_t antenna);
336 	void (*sa_api_set_tx_antenna) (struct wlan_objmgr_peer *peer,
337 			uint32_t *antenna_array);
338 	void (*sa_api_set_tx_default_antenna) (struct wlan_objmgr_pdev *pdev,
339 			u_int32_t antenna);
340 	void (*sa_api_set_training_info) (struct wlan_objmgr_peer *peer,
341 			uint32_t *rate_array,
342 			uint32_t *antenna_array,
343 			uint32_t numpkts);
344 	void (*sa_api_prepare_rateset)(struct wlan_objmgr_pdev *pdev,
345 			struct wlan_objmgr_peer *peer,
346 			struct sa_rate_info *rate_info);
347 	void (*sa_api_set_node_config_ops) (struct wlan_objmgr_peer *peer,
348 			uint32_t cmd_id, uint16_t args_count,
349 			u_int32_t args_arr[]);
350 };
351 
352 #endif
353 
354 #ifdef WLAN_CONV_SPECTRAL_ENABLE
355 struct wmi_spectral_cmd_ops;
356 /**
357  * struct wlan_lmac_if_sptrl_tx_ops - Spectral south bound Tx operations
358  * @sptrlto_spectral_init:          Initialize LMAC/target_if Spectral
359  * @sptrlto_spectral_deinit:        De-initialize LMAC/target_if Spectral
360  * @sptrlto_set_spectral_config:    Set Spectral configuration
361  * @sptrlto_get_spectral_config:    Get Spectral configuration
362  * @sptrlto_start_spectral_scan:    Start Spectral Scan
363  * @sptrlto_stop_spectral_scan:     Stop Spectral Scan
364  * @sptrlto_is_spectral_active:     Get whether Spectral is active
365  * @sptrlto_is_spectral_enabled:    Get whether Spectral is enabled
366  * @sptrlto_set_icm_active:         Set whether ICM is active or inactive
367  * @sptrlto_get_icm_active:         Get whether ICM is active or inactive
368  * @sptrlto_get_nominal_nf:         Get Nominal Noise Floor for the current
369  *                                  frequency band
370  * @sptrlto_set_debug_level:        Set Spectral debug level
371  * @sptrlto_get_debug_level:        Get Spectral debug level
372  * @sptrlto_get_chaninfo:           Get channel information
373  * @sptrlto_clear_chaninfo:         Clear channel information
374  * @sptrlto_get_spectral_capinfo:   Get Spectral capability information
375  * @sptrlto_get_spectral_diagstats: Get Spectral diagnostic statistics
376  * @sptrlto_register_netlink_cb: Register Spectral Netlink callbacks
377  * @sptrlto_use_nl_bcast: Get whether to use Netlink broadcast/unicast
378  * @sptrlto_deregister_netlink_cb: De-register Spectral Netlink callbacks
379  * @sptrlto_process_spectral_report: Process spectral report
380  **/
381 struct wlan_lmac_if_sptrl_tx_ops {
382 	void *(*sptrlto_pdev_spectral_init)(struct wlan_objmgr_pdev *pdev);
383 	void (*sptrlto_pdev_spectral_deinit)(struct wlan_objmgr_pdev *pdev);
384 	int (*sptrlto_set_spectral_config)(struct wlan_objmgr_pdev *pdev,
385 					   const u_int32_t threshtype,
386 					   const u_int32_t value);
387 	void (*sptrlto_get_spectral_config)(struct wlan_objmgr_pdev *pdev,
388 					    struct spectral_config *sptrl_config
389 					    );
390 	int (*sptrlto_start_spectral_scan)(struct wlan_objmgr_pdev *pdev);
391 	void (*sptrlto_stop_spectral_scan)(struct wlan_objmgr_pdev *pdev);
392 	bool (*sptrlto_is_spectral_active)(struct wlan_objmgr_pdev *pdev);
393 	bool (*sptrlto_is_spectral_enabled)(struct wlan_objmgr_pdev *pdev);
394 	int (*sptrlto_set_debug_level)(struct wlan_objmgr_pdev *pdev,
395 				       u_int32_t debug_level);
396 	u_int32_t (*sptrlto_get_debug_level)(struct wlan_objmgr_pdev *pdev);
397 	void (*sptrlto_get_spectral_capinfo)(struct wlan_objmgr_pdev *pdev,
398 					     void *outdata);
399 	void (*sptrlto_get_spectral_diagstats)(struct wlan_objmgr_pdev *pdev,
400 					       void *outdata);
401 	void (*sptrlto_register_wmi_spectral_cmd_ops)(
402 		struct wlan_objmgr_pdev *pdev,
403 		struct wmi_spectral_cmd_ops *cmd_ops);
404 	void (*sptrlto_register_netlink_cb)(
405 		struct wlan_objmgr_pdev *pdev,
406 		struct spectral_nl_cb *nl_cb);
407 	bool (*sptrlto_use_nl_bcast)(struct wlan_objmgr_pdev *pdev);
408 	void (*sptrlto_deregister_netlink_cb)(struct wlan_objmgr_pdev *pdev);
409 	int (*sptrlto_process_spectral_report)(
410 		struct wlan_objmgr_pdev *pdev,
411 		void *payload);
412 };
413 #endif /* WLAN_CONV_SPECTRAL_ENABLE */
414 
415 #ifdef WIFI_POS_CONVERGED
416 /*
417  * struct wlan_lmac_if_wifi_pos_tx_ops - structure of firmware tx function
418  * pointers for wifi_pos component
419  * @data_req_tx: function pointer to send wifi_pos req to firmware
420  */
421 struct wlan_lmac_if_wifi_pos_tx_ops {
422 	QDF_STATUS (*data_req_tx)(struct wlan_objmgr_psoc *psoc,
423 				  struct oem_data_req *req);
424 };
425 #endif
426 
427 #ifdef DIRECT_BUF_RX_ENABLE
428 /**
429  * struct wlan_lmac_if_direct_buf_rx_tx_ops - structire of direct buf rx txops
430  * @direct_buf_rx_module_register: Registration API callback for modules
431  *                                 to register with direct buf rx framework
432  * @direct_buf_rx_register_events: Registration of WMI events for direct
433  *                                 buffer rx framework
434  * @direct_buf_rx_unregister_events: Unregistraton of WMI events for direct
435  *                                   buffer rx framework
436  */
437 struct wlan_lmac_if_direct_buf_rx_tx_ops {
438 	QDF_STATUS (*direct_buf_rx_module_register)(
439 			struct wlan_objmgr_pdev *pdev, uint8_t mod_id,
440 			int (*dbr_rsp_handler)(struct wlan_objmgr_pdev *pdev,
441 				struct direct_buf_rx_data *dbr_data));
442 	QDF_STATUS (*direct_buf_rx_register_events)(
443 			struct wlan_objmgr_psoc *psoc);
444 	QDF_STATUS (*direct_buf_rx_unregister_events)(
445 			struct wlan_objmgr_psoc *psoc);
446 };
447 #endif
448 
449 #ifdef CONVERGED_TDLS_ENABLE
450 /* fwd declarations for tdls tx ops */
451 struct tdls_info;
452 struct tdls_peer_update_state;
453 struct tdls_channel_switch_params;
454 struct sta_uapsd_trig_params;
455 /**
456  * struct wlan_lmac_if_tdls_tx_ops - south bound tx function pointers for tdls
457  * @update_fw_state: function to update tdls firmware state
458  * @update_peer_state: function to update tdls peer state
459  * @set_offchan_mode: function to set tdls offchannel mode
460  * @tdls_reg_ev_handler: function to register for tdls events
461  * @tdls_unreg_ev_handler: function to unregister for tdls events
462  * @tdls_set_uapsd: function to set upasdt trigger command
463  *
464  * tdls module uses these functions to avail ol/da lmac services
465  */
466 struct wlan_lmac_if_tdls_tx_ops {
467 	QDF_STATUS (*update_fw_state)(struct wlan_objmgr_psoc *psoc,
468 				     struct tdls_info *req);
469 	QDF_STATUS (*update_peer_state)(struct wlan_objmgr_psoc *psoc,
470 				       struct tdls_peer_update_state *param);
471 	QDF_STATUS (*set_offchan_mode)(struct wlan_objmgr_psoc *psoc,
472 				      struct tdls_channel_switch_params *param);
473 	QDF_STATUS (*tdls_reg_ev_handler)(struct wlan_objmgr_psoc *psoc,
474 					 void *arg);
475 	QDF_STATUS (*tdls_unreg_ev_handler) (struct wlan_objmgr_psoc *psoc,
476 					    void *arg);
477 	QDF_STATUS (*tdls_set_uapsd)(struct wlan_objmgr_psoc *psoc,
478 				    struct sta_uapsd_trig_params *params);
479 };
480 
481 /* fwd declarations for tdls rx ops */
482 struct tdls_event_info;
483 /**
484  * struct wlan_lmac_if_tdls_rx_ops  - south bound rx function pointers for tdls
485  * @tdls_ev_handler: function to handler tdls event
486  *
487  * lmac modules uses this API to post scan events to tdls module
488  */
489 struct wlan_lmac_if_tdls_rx_ops {
490 	QDF_STATUS (*tdls_ev_handler)(struct wlan_objmgr_psoc *psoc,
491 				     struct tdls_event_info *info);
492 };
493 #endif
494 
495 #ifdef WLAN_FEATURE_NAN_CONVERGENCE
496 /**
497  * struct wlan_lmac_if_nan_tx_ops - structure of firwware tx function
498  * pointers for nan component
499  * @data_req_tx: function pointer to send nan req to firmware
500  */
501 struct wlan_lmac_if_nan_tx_ops {
502 	QDF_STATUS (*nan_req_tx)(void *req, uint32_t req_id);
503 };
504 #endif
505 
506 /**
507  * struct wlan_lmac_if_ftm_rx_ops  - south bound rx function pointers for FTM
508  * @ftm_ev_handler: function to handle FTM event
509  *
510  * lmac modules uses this API to post FTM events to FTM module
511  */
512 struct wlan_lmac_if_ftm_rx_ops {
513 	QDF_STATUS (*ftm_ev_handler)(struct wlan_objmgr_pdev *pdev,
514 					uint8_t *event_buf, uint32_t len);
515 };
516 
517 /**
518  * struct wlan_lmac_reg_if_tx_ops - structure of tx function
519  *                  pointers for regulatory component
520  * @register_master_handler: pointer to register event handler
521  * @unregister_master_handler:  pointer to unregister event handler
522  * @register_11d_new_cc_handler: pointer to register 11d cc event handler
523  * @unregister_11d_new_cc_handler:  pointer to unregister 11d cc event handler
524  */
525 struct wlan_lmac_if_reg_tx_ops {
526 	QDF_STATUS (*register_master_handler)(struct wlan_objmgr_psoc *psoc,
527 					      void *arg);
528 	QDF_STATUS (*unregister_master_handler)(struct wlan_objmgr_psoc *psoc,
529 						void *arg);
530 
531 	QDF_STATUS (*set_country_code)(struct wlan_objmgr_psoc *psoc,
532 						void *arg);
533 	QDF_STATUS (*fill_umac_legacy_chanlist)(struct wlan_objmgr_pdev *pdev,
534 			struct regulatory_channel *cur_chan_list);
535 	QDF_STATUS (*register_11d_new_cc_handler)(
536 			struct wlan_objmgr_psoc *psoc, void *arg);
537 	QDF_STATUS (*unregister_11d_new_cc_handler)(
538 			struct wlan_objmgr_psoc *psoc, void *arg);
539 	QDF_STATUS (*start_11d_scan)(struct wlan_objmgr_psoc *psoc,
540 			struct reg_start_11d_scan_req *reg_start_11d_scan_req);
541 	QDF_STATUS (*stop_11d_scan)(struct wlan_objmgr_psoc *psoc,
542 			struct reg_stop_11d_scan_req *reg_stop_11d_scan_req);
543 	bool (*is_there_serv_ready_extn)(struct wlan_objmgr_psoc *psoc);
544 	QDF_STATUS (*set_user_country_code)(struct wlan_objmgr_psoc *psoc,
545 					    uint8_t pdev_id,
546 					    struct cc_regdmn_s *rd);
547 	QDF_STATUS (*set_country_failed)(struct wlan_objmgr_pdev *pdev);
548 	QDF_STATUS (*register_ch_avoid_event_handler)(
549 			struct wlan_objmgr_psoc *psoc, void *arg);
550 	QDF_STATUS (*unregister_ch_avoid_event_handler)(
551 			struct wlan_objmgr_psoc *psoc, void *arg);
552 };
553 
554 /**
555  * struct wlan_lmac_if_dfs_tx_ops - Function pointer to call offload/lmac
556  *                                  functions from DFS module.
557  * @dfs_enable:                         Enable DFS.
558  * @dfs_get_caps:                       Get DFS capabilities.
559  * @dfs_disable:                        Disable DFS
560  * @dfs_gettsf64:                       Get tsf64 value.
561  * @dfs_set_use_cac_prssi:              Set use_cac_prssi value.
562  * @dfs_get_dfsdomain:                  Get DFS domain.
563  * @dfs_is_countryCode_CHINA:           Check is country code CHINA.
564  * @dfs_get_thresholds:                 Get thresholds.
565  * @dfs_get_ext_busy:                   Get ext_busy.
566  * @dfs_get_target_type:                Get target type.
567  * @dfs_is_countryCode_KOREA_ROC3:      Check is county code Korea.
568  * @dfs_is_mode_offload:                Check the radio for offload.
569  * @dfs_get_ah_devid:                   Get ah devid.
570  * @dfs_get_phymode_info:               Get phymode info.
571  * @dfs_reg_ev_handler:                 Register dfs event handler.
572  * @dfs_process_emulate_bang_radar_cmd: Process emulate bang radar test command.
573  * @dfs_is_pdev_5ghz:                   Check if the given pdev is 5GHz.
574  * @dfs_set_phyerr_filter_offload:      Config phyerr filter offload.
575  * @dfs_send_offload_enable_cmd:        Send dfs offload enable command to fw.
576  */
577 
578 struct wlan_lmac_if_dfs_tx_ops {
579 	QDF_STATUS (*dfs_enable)(struct wlan_objmgr_pdev *pdev,
580 			int *is_fastclk,
581 			struct wlan_dfs_phyerr_param *param,
582 			uint32_t dfsdomain);
583 	QDF_STATUS (*dfs_get_caps)(struct wlan_objmgr_pdev *pdev,
584 			struct wlan_dfs_caps *dfs_caps);
585 	QDF_STATUS (*dfs_disable)(struct wlan_objmgr_pdev *pdev,
586 			int no_cac);
587 	QDF_STATUS (*dfs_gettsf64)(struct wlan_objmgr_pdev *pdev,
588 			uint64_t *tsf64);
589 	QDF_STATUS (*dfs_set_use_cac_prssi)(struct wlan_objmgr_pdev *pdev);
590 	QDF_STATUS (*dfs_get_thresholds)(struct wlan_objmgr_pdev *pdev,
591 			struct wlan_dfs_phyerr_param *param);
592 	QDF_STATUS (*dfs_get_ext_busy)(struct wlan_objmgr_pdev *pdev,
593 			int *dfs_ext_chan_busy);
594 	QDF_STATUS (*dfs_get_target_type)(struct wlan_objmgr_pdev *pdev,
595 			uint32_t *target_type);
596 	QDF_STATUS (*dfs_is_mode_offload)(struct wlan_objmgr_pdev *pdev,
597 			bool *is_offload);
598 	QDF_STATUS (*dfs_get_ah_devid)(struct wlan_objmgr_pdev *pdev,
599 			uint16_t *devid);
600 	QDF_STATUS (*dfs_get_phymode_info)(struct wlan_objmgr_pdev *pdev,
601 			uint32_t chan_mode,
602 			uint32_t *mode_info,
603 			bool is_2gvht_en);
604 	QDF_STATUS (*dfs_reg_ev_handler)(struct wlan_objmgr_psoc *psoc,
605 			bool dfs_offload);
606 	QDF_STATUS (*dfs_process_emulate_bang_radar_cmd)(
607 			struct wlan_objmgr_pdev *pdev,
608 			struct dfs_emulate_bang_radar_test_cmd *dfs_unit_test);
609 	QDF_STATUS (*dfs_is_pdev_5ghz)(struct wlan_objmgr_pdev *pdev,
610 			bool *is_5ghz);
611 	QDF_STATUS (*dfs_set_phyerr_filter_offload)(
612 			struct wlan_objmgr_pdev *pdev,
613 			bool dfs_phyerr_filter_offload);
614 	QDF_STATUS (*dfs_is_tgt_offload)(struct wlan_objmgr_psoc *psoc,
615 			bool *is_tgt_offload);
616 	QDF_STATUS (*dfs_send_offload_enable_cmd)(
617 			struct wlan_objmgr_pdev *pdev,
618 			bool enable);
619 };
620 
621 /**
622  * struct wlan_lmac_if_target_tx_ops - Function pointers to call target
623  *                                     functions from other modules.
624  * @tgt_is_tgt_type_ar900b:  To check AR900B target type.
625  * @tgt_is_tgt_type_ipq4019: To check IPQ4019 target type.
626  * @tgt_is_tgt_type_qca9984: To check QCA9984 target type.
627  * @tgt_is_tgt_type_qca9888: To check QCA9888 target type.
628  * @tgt_get_tgt_type:        Get target type
629  * @tgt_get_tgt_version:     Get target version
630  * @tgt_get_tgt_revision:    Get target revision
631  */
632 struct wlan_lmac_if_target_tx_ops {
633 	bool (*tgt_is_tgt_type_ar900b)(uint32_t);
634 	bool (*tgt_is_tgt_type_ipq4019)(uint32_t);
635 	bool (*tgt_is_tgt_type_qca9984)(uint32_t);
636 	bool (*tgt_is_tgt_type_qca9888)(uint32_t);
637 	uint32_t (*tgt_get_tgt_type)(struct wlan_objmgr_psoc *psoc);
638 	uint32_t (*tgt_get_tgt_version)(struct wlan_objmgr_psoc *psoc);
639 	uint32_t (*tgt_get_tgt_revision)(struct wlan_objmgr_psoc *psoc);
640 };
641 
642 #ifdef WLAN_OFFCHAN_TXRX_ENABLE
643 /**
644  * struct wlan_lmac_if_offchan_txrx_ops - Function pointers to check target
645  *                                     capabilities related to offchan txrx.
646  * @offchan_data_tid_support: To check if target supports separate tid for
647  *                                     offchan data tx.
648  */
649 struct wlan_lmac_if_offchan_txrx_ops {
650 	bool (*offchan_data_tid_support)(struct wlan_objmgr_pdev *pdev);
651 };
652 #endif
653 
654 #ifdef WLAN_SUPPORT_GREEN_AP
655 struct wlan_green_ap_egap_params;
656 /**
657  * struct wlan_lmac_if_green_ap_tx_ops - structure of tx function
658  *                  pointers for green ap component
659  * @enable_egap: function pointer to send enable egap indication to fw
660  * @ps_on_off_send:  function pointer to send enable/disable green ap ps to fw
661  */
662 struct wlan_lmac_if_green_ap_tx_ops {
663 	QDF_STATUS (*enable_egap)(struct wlan_objmgr_pdev *pdev,
664 				struct wlan_green_ap_egap_params *egap_params);
665 	QDF_STATUS (*ps_on_off_send)(struct wlan_objmgr_pdev *pdev,
666 				     bool value, uint8_t pdev_id);
667 	QDF_STATUS (*reset_dev)(struct wlan_objmgr_pdev *pdev);
668 	uint16_t (*get_current_channel)(struct wlan_objmgr_pdev *pdev);
669 	uint64_t (*get_current_channel_flags)(struct wlan_objmgr_pdev *pdev);
670 	QDF_STATUS (*get_capab)(struct  wlan_objmgr_pdev *pdev);
671 };
672 #endif
673 
674 /**
675  * struct wlan_lmac_if_tx_ops - south bound tx function pointers
676  * @mgmt_txrx_tx_ops: mgmt txrx tx ops
677  * @scan: scan tx ops
678  * @dfs_tx_ops: dfs tx ops.
679  * @green_ap_tx_ops: green_ap tx_ops
680  * @cp_stats_tx_ops: cp stats tx_ops
681  *
682  * Callback function tabled to be registered with umac.
683  * umac will use the functional table to send events/frames to lmac/wmi
684  */
685 
686 struct wlan_lmac_if_tx_ops {
687 	/* Components to declare function pointers required by the module
688 	 * in component specific structure.
689 	 * The component specific ops structure can be declared in this file
690 	 * only
691 	 */
692 	 struct wlan_lmac_if_mgmt_txrx_tx_ops mgmt_txrx_tx_ops;
693 	 struct wlan_lmac_if_scan_tx_ops scan;
694 #ifdef CONVERGED_P2P_ENABLE
695 	struct wlan_lmac_if_p2p_tx_ops p2p;
696 #endif
697 #ifdef QCA_SUPPORT_SON
698 	struct wlan_lmac_if_son_tx_ops son_tx_ops;
699 #endif
700 
701 #ifdef WLAN_ATF_ENABLE
702 	struct wlan_lmac_if_atf_tx_ops atf_tx_ops;
703 #endif
704 #ifdef QCA_SUPPORT_CP_STATS
705 	struct wlan_lmac_if_cp_stats_tx_ops cp_stats_tx_ops;
706 #endif
707 #ifdef WLAN_SA_API_ENABLE
708 	struct wlan_lmac_if_sa_api_tx_ops sa_api_tx_ops;
709 #endif
710 
711 #ifdef WLAN_CONV_SPECTRAL_ENABLE
712 	struct wlan_lmac_if_sptrl_tx_ops sptrl_tx_ops;
713 #endif
714 
715 #ifdef WLAN_CONV_CRYPTO_SUPPORTED
716 	struct wlan_lmac_if_crypto_tx_ops crypto_tx_ops;
717 #endif
718 
719 #ifdef WIFI_POS_CONVERGED
720 	struct wlan_lmac_if_wifi_pos_tx_ops wifi_pos_tx_ops;
721 #endif
722 #ifdef WLAN_FEATURE_NAN_CONVERGENCE
723 	struct wlan_lmac_if_nan_tx_ops nan_tx_ops;
724 #endif
725 	struct wlan_lmac_if_reg_tx_ops reg_ops;
726 	struct wlan_lmac_if_dfs_tx_ops dfs_tx_ops;
727 
728 #ifdef CONVERGED_TDLS_ENABLE
729 	struct wlan_lmac_if_tdls_tx_ops tdls_tx_ops;
730 #endif
731 
732 #ifdef WLAN_SUPPORT_FILS
733 	struct wlan_lmac_if_fd_tx_ops fd_tx_ops;
734 #endif
735 	 struct wlan_lmac_if_mlme_tx_ops mops;
736 	 struct wlan_lmac_if_target_tx_ops target_tx_ops;
737 
738 #ifdef WLAN_OFFCHAN_TXRX_ENABLE
739 	struct wlan_lmac_if_offchan_txrx_ops offchan_txrx_ops;
740 #endif
741 
742 #ifdef DIRECT_BUF_RX_ENABLE
743 	struct wlan_lmac_if_direct_buf_rx_tx_ops dbr_tx_ops;
744 #endif
745 
746 #ifdef WLAN_SUPPORT_GREEN_AP
747 	 struct wlan_lmac_if_green_ap_tx_ops green_ap_tx_ops;
748 #endif
749 
750 	struct wlan_lmac_if_ftm_tx_ops ftm_tx_ops;
751 };
752 
753 /**
754  * struct wlan_lmac_if_mgmt_txrx_rx_ops - structure of rx function
755  *                  pointers for mgmt txrx component
756  * @mgmt_tx_completion_handler: function pointer to give tx completions
757  *                              to mgmt txrx comp.
758  * @mgmt_rx_frame_handler: function pointer to give rx frame to mgmt txrx comp.
759  * @mgmt_txrx_get_nbuf_from_desc_id: function pointer to get nbuf from desc id
760  * @mgmt_txrx_get_peer_from_desc_id: function pointer to get peer from desc id
761  * @mgmt_txrx_get_vdev_id_from_desc_id: function pointer to get vdev id from
762  *                                      desc id
763  */
764 struct wlan_lmac_if_mgmt_txrx_rx_ops {
765 	QDF_STATUS (*mgmt_tx_completion_handler)(
766 			struct wlan_objmgr_pdev *pdev,
767 			uint32_t desc_id, uint32_t status,
768 			void *tx_compl_params);
769 	QDF_STATUS (*mgmt_rx_frame_handler)(
770 			struct wlan_objmgr_psoc *psoc,
771 			qdf_nbuf_t buf,
772 			struct mgmt_rx_event_params *mgmt_rx_params);
773 	qdf_nbuf_t (*mgmt_txrx_get_nbuf_from_desc_id)(
774 			struct wlan_objmgr_pdev *pdev,
775 			uint32_t desc_id);
776 	struct wlan_objmgr_peer * (*mgmt_txrx_get_peer_from_desc_id)(
777 			struct wlan_objmgr_pdev *pdev, uint32_t desc_id);
778 	uint8_t (*mgmt_txrx_get_vdev_id_from_desc_id)(
779 			struct wlan_objmgr_pdev *pdev,
780 			uint32_t desc_id);
781 	uint32_t (*mgmt_txrx_get_free_desc_pool_count)(
782 			struct wlan_objmgr_pdev *pdev);
783 };
784 
785 struct wlan_lmac_if_reg_rx_ops {
786 	QDF_STATUS (*master_list_handler)(struct cur_regulatory_info
787 					  *reg_info);
788 	QDF_STATUS (*reg_11d_new_cc_handler)(struct wlan_objmgr_psoc *psoc,
789 			struct reg_11d_new_country *reg_11d_new_cc);
790 	QDF_STATUS (*reg_set_regdb_offloaded)(struct wlan_objmgr_psoc *psoc,
791 			bool val);
792 	QDF_STATUS (*reg_set_11d_offloaded)(struct wlan_objmgr_psoc *psoc,
793 			bool val);
794 	QDF_STATUS (*get_dfs_region)(struct wlan_objmgr_pdev *pdev,
795 			enum dfs_reg *dfs_reg);
796 	QDF_STATUS (*reg_ch_avoid_event_handler)(struct wlan_objmgr_psoc *psoc,
797 			struct ch_avoid_ind_type *ch_avoid_ind);
798 	uint32_t (*reg_freq_to_chan)(struct wlan_objmgr_pdev *pdev,
799 			uint32_t freq);
800 	QDF_STATUS (*reg_set_chan_144)(struct wlan_objmgr_pdev *pdev,
801 			bool enable_ch_144);
802 	bool (*reg_get_chan_144)(struct wlan_objmgr_pdev *pdev);
803 	QDF_STATUS (*reg_program_default_cc)(struct wlan_objmgr_pdev *pdev,
804 			uint16_t regdmn);
805 	QDF_STATUS (*reg_get_current_regdomain)(struct wlan_objmgr_pdev *pdev,
806 			struct cur_regdmn_info *cur_regdmn);
807 };
808 
809 #ifdef CONVERGED_P2P_ENABLE
810 
811 /* forward declarations for p2p rx ops */
812 struct p2p_noa_info;
813 struct p2p_lo_event;
814 
815 /**
816  * struct wlan_lmac_if_p2p_rx_ops - structure of rx function pointers
817  * for P2P component
818  * @lo_ev_handler:    function pointer to give listen offload event
819  * @noa_ev_handler:   function pointer to give noa event
820  */
821 struct wlan_lmac_if_p2p_rx_ops {
822 	QDF_STATUS (*lo_ev_handler)(struct wlan_objmgr_psoc *psoc,
823 		struct p2p_lo_event *event_info);
824 	QDF_STATUS (*noa_ev_handler)(struct wlan_objmgr_psoc *psoc,
825 		struct p2p_noa_info *event_info);
826 };
827 #endif
828 
829 #ifdef WLAN_ATF_ENABLE
830 
831 /**
832  * struct wlan_lmac_if_atf_rx_ops - ATF south bound rx function pointers
833  * @atf_get_atf_commit:                Get ATF commit state
834  * @atf_get_fmcap:                     Get firmware capability for ATF
835  * @atf_get_obss_scale:                Get OBSS scale
836  * @atf_get_mode:                      Get mode of ATF
837  * @atf_get_msdu_desc:                 Get msdu desc for ATF
838  * @atf_get_max_vdevs:                 Get maximum vdevs for a Radio
839  * @atf_get_peers:                     Get number of peers for a radio
840  * @atf_get_tput_based:                Get throughput based enabled/disabled
841  * @atf_get_logging:                   Get logging enabled/disabled
842  * @atf_get_txbuf_share:               Get TxBuff share state
843  * @atf_get_txbuf_max:                 Get TxBuff MAX number
844  * @atf_get_txbuf_min:                 Get TxBuff MIN number
845  * @atf_get_ssidgroup:                 Get ssid group state
846  * @atf_get_tx_block_count:            Get tx block count
847  * @atf_get_peer_blk_txtraffic:        Get peer tx traffic block state
848  * @atf_get_vdev_blk_txtraffic:        Get vdev tx traffic block state
849  * @atf_get_sched:                     Get ATF scheduled policy
850  * @atf_get_tx_tokens:                 Get Tx tokens
851  * @atf_get_shadow_tx_tokens:          Get shadow tx tokens
852  * @atf_get_tx_tokens_common:          Get common tx tokens
853  * @atf_get_shadow_alloted_tx_tokens:  Get shadow alloted tx tokens
854  * @atf_get_peer_stats:                Get atf peer stats
855  * @atf_get_token_allocated:           Get atf token allocated
856  * @atf_get_token_utilized:            Get atf token utilized
857  * @atf_set_sched:                     Set ATF schedule policy
858  * @atf_set_fmcap:                     Set firmware capability for ATF
859  * @atf_set_obss_scale:                Set ATF obss scale
860  * @atf_set_mode:                      Set ATF mode
861  * @atf_set_msdu_desc:                 Set msdu desc
862  * @atf_set_max_vdevs:                 Set maximum vdevs number
863  * @atf_set_peers:                     Set peers number
864  * @atf_set_peer_stats:                Set peer stats
865  * @atf_set_vdev_blk_txtraffic:        Set Block/unblock vdev tx traffic
866  * @atf_set_peer_blk_txtraffic:        Set Block/unblock peer tx traffic
867  * @atf_set_tx_block_count:            Set tx block count
868  * @atf_set_token_allocated:           Set atf token allocated
869  * @atf_set_token_utilized:            Set atf token utilized
870  */
871 struct wlan_lmac_if_atf_rx_ops {
872 	uint8_t (*atf_get_atf_commit)(struct wlan_objmgr_pdev *pdev);
873 	uint32_t (*atf_get_fmcap)(struct wlan_objmgr_psoc *psoc);
874 	uint32_t (*atf_get_obss_scale)(struct wlan_objmgr_pdev *pdev);
875 	uint32_t (*atf_get_mode)(struct wlan_objmgr_psoc *psoc);
876 	uint32_t (*atf_get_msdu_desc)(struct wlan_objmgr_psoc *psoc);
877 	uint32_t (*atf_get_max_vdevs)(struct wlan_objmgr_psoc *psoc);
878 	uint32_t (*atf_get_peers)(struct wlan_objmgr_psoc *psoc);
879 	uint32_t (*atf_get_tput_based)(struct wlan_objmgr_pdev *pdev);
880 	uint32_t (*atf_get_logging)(struct wlan_objmgr_pdev *pdev);
881 	uint8_t (*atf_get_txbuf_share)(struct wlan_objmgr_pdev *pdev);
882 	uint16_t (*atf_get_txbuf_max)(struct wlan_objmgr_pdev *pdev);
883 	uint16_t (*atf_get_txbuf_min)(struct wlan_objmgr_pdev *pdev);
884 	uint32_t (*atf_get_ssidgroup)(struct wlan_objmgr_pdev *pdev);
885 	uint32_t (*atf_get_tx_block_count)(struct wlan_objmgr_vdev *vdev);
886 	uint8_t (*atf_get_peer_blk_txtraffic)(struct wlan_objmgr_peer *peer);
887 	uint8_t (*atf_get_vdev_blk_txtraffic)(struct wlan_objmgr_vdev *vdev);
888 	uint32_t (*atf_get_sched)(struct wlan_objmgr_pdev *pdev);
889 	uint32_t (*atf_get_tx_tokens)(struct wlan_objmgr_peer *peer);
890 	uint32_t (*atf_get_shadow_tx_tokens)(struct wlan_objmgr_peer *peer);
891 	uint32_t (*atf_get_txtokens_common)(struct wlan_objmgr_pdev *pdev);
892 	uint32_t (*atf_get_shadow_alloted_tx_tokens)(
893 						struct wlan_objmgr_pdev *pdev);
894 	void (*atf_get_peer_stats)(struct wlan_objmgr_peer *peer,
895 				   struct atf_stats *stats);
896 	uint16_t (*atf_get_token_allocated)(struct wlan_objmgr_peer *peer);
897 	uint16_t (*atf_get_token_utilized)(struct wlan_objmgr_peer *peer);
898 
899 	void (*atf_set_sched)(struct wlan_objmgr_pdev *pdev, uint32_t value);
900 	void (*atf_set_fmcap)(struct wlan_objmgr_psoc *psoc, uint32_t value);
901 	void (*atf_set_obss_scale)(struct wlan_objmgr_pdev *pdev,
902 				   uint32_t value);
903 	void (*atf_set_mode)(struct wlan_objmgr_psoc *psoc, uint8_t value);
904 	void (*atf_set_msdu_desc)(struct wlan_objmgr_psoc *psoc,
905 				  uint32_t value);
906 	void (*atf_set_max_vdevs)(struct wlan_objmgr_psoc *psoc,
907 				  uint32_t value);
908 	void (*atf_set_peers)(struct wlan_objmgr_psoc *psoc, uint32_t value);
909 	void (*atf_set_peer_stats)(struct wlan_objmgr_peer *peer,
910 				   struct atf_stats *stats);
911 	void (*atf_set_vdev_blk_txtraffic)(struct wlan_objmgr_vdev *vdev,
912 					   uint8_t value);
913 	void (*atf_set_peer_blk_txtraffic)(struct wlan_objmgr_peer *peer,
914 					   uint8_t value);
915 	void (*atf_set_tx_block_count)(struct wlan_objmgr_vdev *vdev,
916 					uint32_t count);
917 	void (*atf_set_token_allocated)(struct wlan_objmgr_peer *peer,
918 					uint16_t value);
919 	void (*atf_set_token_utilized)(struct wlan_objmgr_peer *peer,
920 					uint16_t value);
921 };
922 #endif
923 
924 #ifdef WLAN_SUPPORT_FILS
925 /**
926  * struct wlan_lmac_if_fd_rx_ops - FILS Discovery specific Rx function pointers
927  * @fd_is_fils_enable:      FILS enabled or not
928  * @fd_alloc:               Allocate FD buffer
929  * @fd_stop:                Stop and free deferred FD buffer
930  * @fd_free:                Free FD frame buffer
931  * @fd_get_valid_fd_period: Get valid FD period
932  * @fd_swfda_handler:       SWFDA event handler
933  */
934 struct wlan_lmac_if_fd_rx_ops {
935 	uint8_t (*fd_is_fils_enable)(struct wlan_objmgr_vdev *vdev);
936 	void (*fd_alloc)(struct wlan_objmgr_vdev *vdev);
937 	void (*fd_stop)(struct wlan_objmgr_vdev *vdev);
938 	void (*fd_free)(struct wlan_objmgr_vdev *vdev);
939 	uint32_t (*fd_get_valid_fd_period)(struct wlan_objmgr_vdev *vdev,
940 					   uint8_t *is_modified);
941 	QDF_STATUS (*fd_swfda_handler)(struct wlan_objmgr_vdev *vdev);
942 };
943 #endif
944 
945 #ifdef WLAN_SA_API_ENABLE
946 
947 /**
948  * struct wlan_lmac_if_sa_api_rx_ops - SA API south bound rx function pointers
949  */
950 struct wlan_lmac_if_sa_api_rx_ops {
951 	uint32_t (*sa_api_get_sa_supported)(struct wlan_objmgr_psoc *psoc);
952 	uint32_t (*sa_api_get_validate_sw)(struct wlan_objmgr_psoc *psoc);
953 	void (*sa_api_enable_sa)(struct wlan_objmgr_psoc *psoc, uint32_t value);
954 	uint32_t (*sa_api_get_sa_enable)(struct wlan_objmgr_psoc *psoc);
955 	void (*sa_api_peer_assoc_hanldler)(struct wlan_objmgr_pdev *pdev,
956 			struct wlan_objmgr_peer *peer, struct sa_rate_cap *);
957 	uint32_t (*sa_api_update_tx_feedback)(struct wlan_objmgr_pdev *pdev,
958 			struct wlan_objmgr_peer *peer,
959 			struct sa_tx_feedback *feedback);
960 	uint32_t (*sa_api_update_rx_feedback)(struct wlan_objmgr_pdev *pdev,
961 			struct wlan_objmgr_peer *peer,
962 			struct sa_rx_feedback *feedback);
963 	uint32_t (*sa_api_ucfg_set_param)(struct wlan_objmgr_pdev *pdev,
964 			char *val);
965 	uint32_t (*sa_api_ucfg_get_param)(struct wlan_objmgr_pdev *pdev,
966 			char *val);
967 	uint32_t (*sa_api_is_tx_feedback_enabled)
968 			(struct wlan_objmgr_pdev *pdev);
969 	uint32_t (*sa_api_is_rx_feedback_enabled)
970 			(struct wlan_objmgr_pdev *pdev);
971 	uint32_t (*sa_api_convert_rate_2g)(uint32_t rate);
972 	uint32_t (*sa_api_convert_rate_5g)(uint32_t rate);
973 	uint32_t (*sa_api_get_sa_mode)(struct wlan_objmgr_pdev *pdev);
974 	uint32_t (*sa_api_get_beacon_txantenna)(struct wlan_objmgr_pdev *pdev);
975 	uint32_t (*sa_api_cwm_action)(struct wlan_objmgr_pdev *pdev);
976 };
977 #endif
978 
979 #ifdef WLAN_CONV_SPECTRAL_ENABLE
980 /**
981  * struct wlan_lmac_if_sptrl_rx_ops - Spectral south bound Rx operations
982  *
983  * @sptrlro_get_target_handle: Get Spectral handle for target/LMAC private data
984  */
985 struct wlan_lmac_if_sptrl_rx_ops {
986 	void * (*sptrlro_get_target_handle)(struct wlan_objmgr_pdev *pdev);
987 	int16_t (*sptrlro_vdev_get_chan_freq)(struct wlan_objmgr_vdev *vdev);
988 	enum phy_ch_width (*sptrlro_vdev_get_ch_width)(
989 			struct wlan_objmgr_vdev *vdev);
990 	int (*sptrlro_vdev_get_sec20chan_freq_mhz)(
991 			struct wlan_objmgr_vdev *vdev,
992 			uint16_t *sec20chan_freq);
993 };
994 #endif /* WLAN_CONV_SPECTRAL_ENABLE */
995 
996 #ifdef WIFI_POS_CONVERGED
997 /**
998  * struct wlan_lmac_if_wifi_pos_rx_ops - structure of rx function
999  * pointers for wifi_pos component
1000  * @oem_rsp_event_rx: callback for WMI_OEM_RESPONSE_EVENTID
1001  */
1002 struct wlan_lmac_if_wifi_pos_rx_ops {
1003 	int (*oem_rsp_event_rx)(struct wlan_objmgr_psoc *psoc,
1004 				struct oem_data_rsp *oem_rsp);
1005 };
1006 #endif
1007 
1008 #ifdef WLAN_FEATURE_NAN_CONVERGENCE
1009 /**
1010  * struct wlan_lmac_if_nan_rx_ops - structure of rx function
1011  * pointers for nan component
1012  * @oem_rsp_event_rx: callback for WMI_OEM_RESPONSE_EVENTID
1013  */
1014 struct wlan_lmac_if_nan_rx_ops {
1015 	QDF_STATUS (*nan_event_rx)(struct scheduler_msg *event);
1016 };
1017 #endif
1018 
1019 /**
1020  * struct wlan_lmac_if_dfs_rx_ops - Function pointers to call dfs functions
1021  *                                  from lmac/offload.
1022  * @dfs_get_radars:                   Calls init radar table functions.
1023  * @dfs_process_phyerr:               Process phyerr.
1024  * @dfs_destroy_object:               Destroys the DFS object.
1025  * @dfs_radar_enable:                 Enables the radar.
1026  * @dfs_control:                      Used to process ioctls related to DFS.
1027  * @dfs_is_precac_timer_running:      Check whether precac timer is running.
1028  * @dfs_find_vht80_chan_for_precac:   Find VHT80 channel for precac.
1029  * @dfs_cancel_precac_timer:          Cancel the precac timer.
1030  * @dfs_override_precac_timeout:      Override the default precac timeout.
1031  * @dfs_set_precac_enable:            Set precac enable flag.
1032  * @dfs_get_precac_enable:            Get precac enable flag.
1033  * @dfs_get_override_precac_timeout:  Get precac timeout.
1034  * @dfs_set_current_channel:          Set DFS current channel.
1035  * @dfs_process_radar_ind:            Process radar found indication.
1036  * @dfs_dfs_cac_complete_ind:         Process cac complete indication.
1037  * @dfs_stop:                         Clear dfs timers.
1038  * @dfs_process_phyerr_filter_offload:Process radar event.
1039  * @dfs_is_phyerr_filter_offload:     Check whether phyerr filter is offload.
1040  */
1041 struct wlan_lmac_if_dfs_rx_ops {
1042 	QDF_STATUS (*dfs_get_radars)(struct wlan_objmgr_pdev *pdev);
1043 	QDF_STATUS (*dfs_process_phyerr)(struct wlan_objmgr_pdev *pdev,
1044 			void *buf,
1045 			uint16_t datalen,
1046 			uint8_t r_rssi,
1047 			uint8_t r_ext_rssi,
1048 			uint32_t r_rs_tstamp,
1049 			uint64_t r_fulltsf);
1050 	QDF_STATUS (*dfs_destroy_object)(struct wlan_objmgr_pdev *pdev);
1051 	QDF_STATUS (*dfs_radar_enable)(struct wlan_objmgr_pdev *pdev,
1052 			int no_cac,
1053 			uint32_t opmode);
1054 	QDF_STATUS (*dfs_control)(struct wlan_objmgr_pdev *pdev,
1055 			u_int id,
1056 			void *indata,
1057 			uint32_t insize,
1058 			void *outdata,
1059 			uint32_t *outsize,
1060 			int *error);
1061 	QDF_STATUS (*dfs_is_precac_timer_running)(struct wlan_objmgr_pdev *pdev,
1062 			bool *is_precac_timer_running);
1063 	QDF_STATUS (*dfs_find_vht80_chan_for_precac)(
1064 			struct wlan_objmgr_pdev *pdev,
1065 			uint32_t chan_mode,
1066 			uint8_t ch_freq_seg1,
1067 			uint32_t *cfreq1,
1068 			uint32_t *cfreq2,
1069 			uint32_t *phy_mode,
1070 			bool *dfs_set_cfreq2,
1071 			bool *set_agile);
1072 	QDF_STATUS (*dfs_cancel_precac_timer)(struct wlan_objmgr_pdev *pdev);
1073 	QDF_STATUS (*dfs_override_precac_timeout)(
1074 			struct wlan_objmgr_pdev *pdev,
1075 			int precac_timeout);
1076 	QDF_STATUS (*dfs_set_precac_enable)(struct wlan_objmgr_pdev *pdev,
1077 			uint32_t value);
1078 	QDF_STATUS (*dfs_get_precac_enable)(struct wlan_objmgr_pdev *pdev,
1079 			int *buff);
1080 	QDF_STATUS (*dfs_get_override_precac_timeout)(
1081 			struct wlan_objmgr_pdev *pdev,
1082 			int *precac_timeout);
1083 	QDF_STATUS (*dfs_set_current_channel)(struct wlan_objmgr_pdev *pdev,
1084 			uint16_t ic_freq,
1085 			uint64_t ic_flags,
1086 			uint16_t ic_flagext,
1087 			uint8_t ic_ieee,
1088 			uint8_t ic_vhtop_ch_freq_seg1,
1089 			uint8_t ic_vhtop_ch_freq_seg2);
1090 #ifdef DFS_COMPONENT_ENABLE
1091 	QDF_STATUS (*dfs_process_radar_ind)(struct wlan_objmgr_pdev *pdev,
1092 			struct radar_found_info *radar_found);
1093 	QDF_STATUS (*dfs_dfs_cac_complete_ind)(struct wlan_objmgr_pdev *pdev,
1094 			uint32_t vdev_id);
1095 #endif
1096 	QDF_STATUS (*dfs_stop)(struct wlan_objmgr_pdev *pdev);
1097 	QDF_STATUS (*dfs_process_phyerr_filter_offload)(
1098 			struct wlan_objmgr_pdev *pdev,
1099 			struct radar_event_info *wlan_radar_info);
1100 	QDF_STATUS (*dfs_is_phyerr_filter_offload)(
1101 			struct wlan_objmgr_psoc *psoc,
1102 			bool *is_phyerr_filter_offload);
1103 };
1104 
1105 struct wlan_lmac_if_mlme_rx_ops {
1106 
1107 	void (*wlan_mlme_scan_start)(struct wlan_objmgr_pdev *pdev);
1108 	void (*wlan_mlme_register_pm_event_handler)(
1109 			struct wlan_objmgr_pdev *pdev,
1110 			uint8_t vdev_id);
1111 	void (*wlan_mlme_unregister_pm_event_handler)(
1112 			struct wlan_objmgr_pdev *pdev,
1113 			uint8_t vdev_id);
1114 	QDF_STATUS (*wlan_mlme_register_vdev_event_handler)(
1115 			struct wlan_objmgr_pdev *pdev,
1116 			uint8_t vdev_id);
1117 	QDF_STATUS (*wlan_mlme_unregister_vdev_event_handler)(
1118 			struct wlan_objmgr_pdev *pdev,
1119 			uint8_t vdev_id);
1120 	int (*wlan_mlme_send_probe_request)(struct wlan_objmgr_pdev *pdev,
1121 			uint8_t vdev_id,
1122 			u_int8_t  *destination,
1123 			u_int8_t  *bssid,
1124 			u_int8_t  *ssid,
1125 			u_int32_t  ssidlen,
1126 			u_int8_t  *ie,
1127 			size_t len);
1128 	int (*wlan_mlme_resmgr_request_bsschan)(struct wlan_objmgr_pdev *pdev);
1129 	int (*wlan_mlme_resmgr_request_offchan)(struct wlan_objmgr_pdev *pdev,
1130 			u_int32_t freq,
1131 			u_int32_t flags,
1132 			u_int32_t estimated_offchannel_time);
1133 	int (*wlan_mlme_resmgr_active)(struct wlan_objmgr_pdev *pdev);
1134 	int (*wlan_mlme_get_cw_inter_found)(struct wlan_objmgr_pdev *pdev);
1135 	int (*wlan_mlme_set_home_channel)(struct wlan_objmgr_pdev *pdev,
1136 			uint8_t vdev_id);
1137 	int (*wlan_mlme_set_channel)(struct wlan_objmgr_pdev *pdev,
1138 			u_int32_t freq,
1139 			u_int32_t flags);
1140 	void (*wlan_mlme_start_record_stats)(struct wlan_objmgr_pdev *pdev);
1141 	void (*wlan_mlme_end_record_stats)(struct wlan_objmgr_pdev *pdev);
1142 	int (*wlan_mlme_get_enh_rpt_ind)(struct wlan_objmgr_pdev *pdev);
1143 	int (*wlan_mlme_pause)(struct wlan_objmgr_pdev *pdev);
1144 	void (*wlan_mlme_unpause)(struct wlan_objmgr_pdev *pdev);
1145 	int (*wlan_mlme_vdev_pause_control)(struct wlan_objmgr_pdev *pdev,
1146 			uint8_t vdev_id);
1147 	int (*wlan_mlme_sta_power_pause)(
1148 			struct wlan_objmgr_pdev *pdev,
1149 			uint8_t vdev_id,
1150 			u_int32_t timeout);
1151 	int (*wlan_mlme_sta_power_unpause)(struct wlan_objmgr_pdev *pdev,
1152 			uint8_t vdev_id);
1153 	int (*wlan_mlme_set_vdev_sleep)(struct wlan_objmgr_pdev *pdev,
1154 			uint8_t vdev_id);
1155 	int (*wlan_mlme_set_vdev_wakeup)(struct wlan_objmgr_pdev *pdev,
1156 			uint8_t vdev_id);
1157 	qdf_time_t (*wlan_mlme_get_traffic_indication_timestamp)(
1158 			struct wlan_objmgr_pdev *pdev);
1159 	int (*wlan_mlme_get_acs_in_progress)(struct wlan_objmgr_pdev *pdev,
1160 			uint8_t vdev_id);
1161 	void (*wlan_mlme_end_scan)(struct wlan_objmgr_pdev *pdev);
1162 };
1163 
1164 #ifdef WLAN_SUPPORT_GREEN_AP
1165 struct wlan_lmac_if_green_ap_rx_ops {
1166 	bool (*is_ps_enabled)(struct wlan_objmgr_pdev *pdev);
1167 	bool (*is_dbg_print_enabled)(struct wlan_objmgr_pdev *pdev);
1168 	QDF_STATUS (*ps_get)(struct wlan_objmgr_pdev *pdev, uint8_t *value);
1169 	QDF_STATUS (*ps_set)(struct wlan_objmgr_pdev *pdev, uint8_t value);
1170 	void (*suspend_handle)(struct wlan_objmgr_pdev *pdev);
1171 };
1172 #endif
1173 
1174 /**
1175  * struct wlan_lmac_if_rx_ops - south bound rx function pointers
1176  * @mgmt_txrx_tx_ops: mgmt txrx rx ops
1177  * @scan: scan rx ops
1178  * @dfs_rx_ops: dfs rx ops.
1179  * @cp_stats_rx_ops: cp stats rx ops
1180  *
1181  * Callback function tabled to be registered with lmac/wmi.
1182  * lmac will use the functional table to send events/frames to umac
1183  */
1184 struct wlan_lmac_if_rx_ops {
1185 	/* Components to declare function pointers required by the module
1186 	 * in component specific structure.
1187 	 * The component specific ops structure can be declared in this file
1188 	 * only
1189 	 */
1190 	 struct wlan_lmac_if_mgmt_txrx_rx_ops mgmt_txrx_rx_ops;
1191 	 struct wlan_lmac_if_scan_rx_ops scan;
1192 #ifdef CONVERGED_P2P_ENABLE
1193 	struct wlan_lmac_if_p2p_rx_ops p2p;
1194 #endif
1195 
1196 #ifdef WLAN_ATF_ENABLE
1197 	struct wlan_lmac_if_atf_rx_ops atf_rx_ops;
1198 #endif
1199 #ifdef QCA_SUPPORT_CP_STATS
1200 	struct wlan_lmac_if_cp_stats_rx_ops cp_stats_rx_ops;
1201 #endif
1202 #ifdef WLAN_SA_API_ENABLE
1203 	struct wlan_lmac_if_sa_api_rx_ops sa_api_rx_ops;
1204 #endif
1205 
1206 #ifdef WLAN_CONV_SPECTRAL_ENABLE
1207 	struct wlan_lmac_if_sptrl_rx_ops sptrl_rx_ops;
1208 #endif
1209 
1210 #ifdef WLAN_CONV_CRYPTO_SUPPORTED
1211 	struct wlan_lmac_if_crypto_rx_ops crypto_rx_ops;
1212 #endif
1213 #ifdef WIFI_POS_CONVERGED
1214 	struct wlan_lmac_if_wifi_pos_rx_ops wifi_pos_rx_ops;
1215 #endif
1216 #ifdef WLAN_FEATURE_NAN_CONVERGENCE
1217 	struct wlan_lmac_if_nan_rx_ops nan_rx_ops;
1218 #endif
1219 	struct wlan_lmac_if_reg_rx_ops reg_rx_ops;
1220 	struct wlan_lmac_if_dfs_rx_ops dfs_rx_ops;
1221 #ifdef CONVERGED_TDLS_ENABLE
1222 	struct wlan_lmac_if_tdls_rx_ops tdls_rx_ops;
1223 #endif
1224 
1225 #ifdef WLAN_SUPPORT_FILS
1226 	struct wlan_lmac_if_fd_rx_ops fd_rx_ops;
1227 #endif
1228 
1229 	struct wlan_lmac_if_mlme_rx_ops mops;
1230 
1231 #ifdef WLAN_SUPPORT_GREEN_AP
1232 	struct wlan_lmac_if_green_ap_rx_ops green_ap_rx_ops;
1233 #endif
1234 
1235 	struct wlan_lmac_if_ftm_rx_ops ftm_rx_ops;
1236 };
1237 
1238 /* Function pointer to call legacy tx_ops registration in OL/WMA.
1239  */
1240 extern QDF_STATUS (*wlan_lmac_if_umac_tx_ops_register)
1241 				(struct wlan_lmac_if_tx_ops *tx_ops);
1242 #endif /* _WLAN_LMAC_IF_DEF_H_ */
1243