xref: /wlan-dirver/qca-wifi-host-cmn/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c (revision 8ddef7dd9a290d4a9b1efd5d3efacf51d78a1a0d)
1 /*
2  * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
3  *
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #include "qdf_mem.h"
21 #include <qdf_module.h>
22 #include "wlan_lmac_if_def.h"
23 #include "wlan_lmac_if_api.h"
24 #include "wlan_mgmt_txrx_tgt_api.h"
25 #include "wlan_scan_tgt_api.h"
26 #include <wlan_reg_services_api.h>
27 #include <wlan_reg_ucfg_api.h>
28 #ifdef WLAN_ATF_ENABLE
29 #include "wlan_atf_tgt_api.h"
30 #endif
31 #ifdef WLAN_SA_API_ENABLE
32 #include "wlan_sa_api_tgt_api.h"
33 #endif
34 #ifdef WIFI_POS_CONVERGED
35 #include "target_if_wifi_pos.h"
36 #endif /* WIFI_POS_CONVERGED */
37 #include "wlan_reg_tgt_api.h"
38 #ifdef CONVERGED_P2P_ENABLE
39 #include "wlan_p2p_tgt_api.h"
40 #endif
41 #ifdef FEATURE_WLAN_TDLS
42 #include "wlan_tdls_tgt_api.h"
43 #endif
44 
45 #ifdef WLAN_CONV_CRYPTO_SUPPORTED
46 #include "wlan_crypto_global_api.h"
47 #endif
48 #ifdef DFS_COMPONENT_ENABLE
49 #include <wlan_dfs_tgt_api.h>
50 #include <wlan_objmgr_vdev_obj.h>
51 #include <wlan_dfs_utils_api.h>
52 #endif
53 
54 #ifdef WLAN_SUPPORT_GREEN_AP
55 #include <wlan_green_ap_api.h>
56 #include <wlan_green_ap_ucfg_api.h>
57 #endif
58 #include <wlan_ftm_ucfg_api.h>
59 
60 #ifdef WLAN_SUPPORT_FILS
61 #include <wlan_fd_tgt_api.h>
62 #endif
63 
64 #ifdef QCA_SUPPORT_CP_STATS
65 #include <wlan_cp_stats_tgt_api.h>
66 #endif /* QCA_SUPPORT_CP_STATS */
67 
68 #ifdef CMN_VDEV_MGR_TGT_IF_ENABLE
69 #include <wlan_vdev_mgr_tgt_if_rx_api.h>
70 #endif
71 
72 #ifdef WLAN_CFR_ENABLE
73 #include "wlan_cfr_tgt_api.h"
74 #endif
75 
76 /* Function pointer for OL/WMA specific UMAC tx_ops
77  * registration.
78  */
79 QDF_STATUS (*wlan_lmac_if_umac_tx_ops_register)
80 				(struct wlan_lmac_if_tx_ops *tx_ops);
81 qdf_export_symbol(wlan_lmac_if_umac_tx_ops_register);
82 
83 #ifdef CMN_VDEV_MGR_TGT_IF_ENABLE
84 static void
85 tgt_vdev_mgr_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
86 {
87 	tgt_vdev_mgr_register_rx_ops(rx_ops);
88 }
89 #else
90 static void
91 tgt_vdev_mgr_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
92 {
93 }
94 #endif
95 
96 #ifdef QCA_SUPPORT_CP_STATS
97 /**
98  * wlan_lmac_if_cp_stats_rx_ops_register() - API to register cp stats Rx Ops
99  * @rx_ops:	pointer to lmac rx ops
100  *
101  * This API will be used to register function pointers for FW events
102  *
103  * Return: void
104  */
105 static void
106 wlan_lmac_if_cp_stats_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
107 {
108 	tgt_cp_stats_register_rx_ops(rx_ops);
109 }
110 #else
111 static void
112 wlan_lmac_if_cp_stats_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
113 {
114 }
115 #endif /* QCA_SUPPORT_CP_STATS */
116 
117 #ifdef WLAN_ATF_ENABLE
118 /**
119  * wlan_lmac_if_atf_rx_ops_register() - Function to register ATF RX ops.
120  */
121 static void
122 wlan_lmac_if_atf_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
123 {
124 	struct wlan_lmac_if_atf_rx_ops *atf_rx_ops = &rx_ops->atf_rx_ops;
125 
126 	/* ATF rx ops */
127 	atf_rx_ops->atf_get_atf_commit = tgt_atf_get_atf_commit;
128 	atf_rx_ops->atf_get_fmcap = tgt_atf_get_fmcap;
129 	atf_rx_ops->atf_get_obss_scale = tgt_atf_get_obss_scale;
130 	atf_rx_ops->atf_get_mode = tgt_atf_get_mode;
131 	atf_rx_ops->atf_get_msdu_desc = tgt_atf_get_msdu_desc;
132 	atf_rx_ops->atf_get_max_vdevs = tgt_atf_get_max_vdevs;
133 	atf_rx_ops->atf_get_peers = tgt_atf_get_peers;
134 	atf_rx_ops->atf_get_tput_based = tgt_atf_get_tput_based;
135 	atf_rx_ops->atf_get_logging = tgt_atf_get_logging;
136 	atf_rx_ops->atf_update_buf_held = tgt_atf_update_buf_held;
137 	atf_rx_ops->atf_get_ssidgroup = tgt_atf_get_ssidgroup;
138 	atf_rx_ops->atf_get_vdev_ac_blk_cnt = tgt_atf_get_vdev_ac_blk_cnt;
139 	atf_rx_ops->atf_get_peer_blk_txbitmap = tgt_atf_get_peer_blk_txbitmap;
140 	atf_rx_ops->atf_get_vdev_blk_txtraffic = tgt_atf_get_vdev_blk_txtraffic;
141 	atf_rx_ops->atf_get_sched = tgt_atf_get_sched;
142 	atf_rx_ops->atf_get_tx_tokens = tgt_atf_get_tx_tokens;
143 	atf_rx_ops->atf_account_subgroup_txtokens =
144 					tgt_atf_account_subgroup_txtokens;
145 	atf_rx_ops->atf_adjust_subgroup_txtokens =
146 					tgt_atf_adjust_subgroup_txtokens;
147 	atf_rx_ops->atf_get_subgroup_airtime = tgt_atf_get_subgroup_airtime;
148 	atf_rx_ops->atf_subgroup_free_buf = tgt_atf_subgroup_free_buf;
149 	atf_rx_ops->atf_update_subgroup_tidstate =
150 					tgt_atf_update_subgroup_tidstate;
151 	atf_rx_ops->atf_buf_distribute = tgt_atf_buf_distribute;
152 	atf_rx_ops->atf_get_shadow_alloted_tx_tokens =
153 					tgt_atf_get_shadow_alloted_tx_tokens;
154 	atf_rx_ops->atf_get_txtokens_common = tgt_atf_get_txtokens_common;
155 	atf_rx_ops->atf_get_peer_stats = tgt_atf_get_peer_stats;
156 	atf_rx_ops->atf_get_token_allocated = tgt_atf_get_token_allocated;
157 	atf_rx_ops->atf_get_token_utilized = tgt_atf_get_token_utilized;
158 
159 	atf_rx_ops->atf_set_sched = tgt_atf_set_sched;
160 	atf_rx_ops->atf_set_fmcap = tgt_atf_set_fmcap;
161 	atf_rx_ops->atf_set_obss_scale = tgt_atf_set_obss_scale;
162 	atf_rx_ops->atf_set_msdu_desc = tgt_atf_set_msdu_desc;
163 	atf_rx_ops->atf_set_max_vdevs = tgt_atf_set_max_vdevs;
164 	atf_rx_ops->atf_set_peers = tgt_atf_set_peers;
165 	atf_rx_ops->atf_set_peer_stats = tgt_atf_set_peer_stats;
166 	atf_rx_ops->atf_set_vdev_blk_txtraffic = tgt_atf_set_vdev_blk_txtraffic;
167 	atf_rx_ops->atf_peer_blk_txtraffic = tgt_atf_peer_blk_txtraffic;
168 	atf_rx_ops->atf_peer_unblk_txtraffic = tgt_atf_peer_unblk_txtraffic;
169 	atf_rx_ops->atf_set_token_allocated = tgt_atf_set_token_allocated;
170 	atf_rx_ops->atf_set_token_utilized = tgt_atf_set_token_utilized;
171 }
172 #else
173 static void
174 wlan_lmac_if_atf_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
175 {
176 }
177 #endif
178 
179 #ifdef WLAN_SUPPORT_FILS
180 static void
181 wlan_lmac_if_fd_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
182 {
183 	struct wlan_lmac_if_fd_rx_ops *fd_rx_ops = &rx_ops->fd_rx_ops;
184 
185 	fd_rx_ops->fd_is_fils_enable = tgt_fd_is_fils_enable;
186 	fd_rx_ops->fd_alloc = tgt_fd_alloc;
187 	fd_rx_ops->fd_stop = tgt_fd_stop;
188 	fd_rx_ops->fd_free = tgt_fd_free;
189 	fd_rx_ops->fd_get_valid_fd_period = tgt_fd_get_valid_fd_period;
190 	fd_rx_ops->fd_swfda_handler = tgt_fd_swfda_handler;
191 }
192 #else
193 static void
194 wlan_lmac_if_fd_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
195 {
196 }
197 #endif
198 
199 #ifdef WLAN_SA_API_ENABLE
200 /**
201  * wlan_lmac_if_sa_api_rx_ops_register() - Function to register SA_API RX ops.
202  */
203 static void
204 wlan_lmac_if_sa_api_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
205 {
206 	struct wlan_lmac_if_sa_api_rx_ops *sa_api_rx_ops = &rx_ops->sa_api_rx_ops;
207 
208 	/* SA API rx ops */
209 	sa_api_rx_ops->sa_api_get_sa_supported = tgt_sa_api_get_sa_supported;
210 	sa_api_rx_ops->sa_api_get_validate_sw  = tgt_sa_api_get_validate_sw;
211 	sa_api_rx_ops->sa_api_enable_sa        = tgt_sa_api_enable_sa;
212 	sa_api_rx_ops->sa_api_get_sa_enable    = tgt_sa_api_get_sa_enable;
213 
214 	sa_api_rx_ops->sa_api_peer_assoc_hanldler = tgt_sa_api_peer_assoc_hanldler;
215 	sa_api_rx_ops->sa_api_update_tx_feedback = tgt_sa_api_update_tx_feedback;
216 	sa_api_rx_ops->sa_api_update_rx_feedback = tgt_sa_api_update_rx_feedback;
217 
218 	sa_api_rx_ops->sa_api_ucfg_set_param = tgt_sa_api_ucfg_set_param;
219 	sa_api_rx_ops->sa_api_ucfg_get_param = tgt_sa_api_ucfg_get_param;
220 
221 	sa_api_rx_ops->sa_api_is_tx_feedback_enabled = tgt_sa_api_is_tx_feedback_enabled;
222 	sa_api_rx_ops->sa_api_is_rx_feedback_enabled = tgt_sa_api_is_rx_feedback_enabled;
223 
224 	sa_api_rx_ops->sa_api_convert_rate_2g = tgt_sa_api_convert_rate_2g;
225 	sa_api_rx_ops->sa_api_convert_rate_5g = tgt_sa_api_convert_rate_5g;
226 	sa_api_rx_ops->sa_api_get_sa_mode = tgt_sa_api_get_sa_mode;
227 
228 	sa_api_rx_ops->sa_api_get_beacon_txantenna = tgt_sa_api_get_beacon_txantenna;
229 	sa_api_rx_ops->sa_api_cwm_action = tgt_sa_api_cwm_action;
230 }
231 #else
232 static void
233 wlan_lmac_if_sa_api_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
234 {
235 }
236 #endif
237 
238 #ifdef WLAN_CFR_ENABLE
239 /**
240  * wlan_lmac_if_cfr_rx_ops_register() - Function to register CFR RX ops
241  */
242 static void
243 wlan_lmac_if_cfr_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
244 {
245 	struct wlan_lmac_if_cfr_rx_ops *cfr_rx_ops = &rx_ops->cfr_rx_ops;
246 
247 	/* CFR rx ops */
248 	cfr_rx_ops->cfr_support_set = tgt_cfr_support_set;
249 	cfr_rx_ops->cfr_info_send  = tgt_cfr_info_send;
250 }
251 #else
252 static void
253 wlan_lmac_if_cfr_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
254 {
255 }
256 #endif
257 
258 #ifdef WLAN_CONV_CRYPTO_SUPPORTED
259 static void
260 wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
261 {
262 	wlan_crypto_register_crypto_rx_ops(&rx_ops->crypto_rx_ops);
263 }
264 #else
265 static void
266 wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
267 {
268 }
269 #endif
270 
271 #ifdef WIFI_POS_CONVERGED
272 static void wlan_lmac_if_umac_rx_ops_register_wifi_pos(
273 				struct wlan_lmac_if_rx_ops *rx_ops)
274 {
275 	target_if_wifi_pos_register_rx_ops(rx_ops);
276 }
277 #else
278 static void wlan_lmac_if_umac_rx_ops_register_wifi_pos(
279 				struct wlan_lmac_if_rx_ops *rx_ops)
280 {
281 }
282 #endif /* WIFI_POS_CONVERGED */
283 
284 static void wlan_lmac_if_umac_reg_rx_ops_register(
285 	struct wlan_lmac_if_rx_ops *rx_ops)
286 {
287 	rx_ops->reg_rx_ops.master_list_handler =
288 		tgt_reg_process_master_chan_list;
289 
290 	rx_ops->reg_rx_ops.reg_11d_new_cc_handler =
291 		tgt_reg_process_11d_new_country;
292 
293 	rx_ops->reg_rx_ops.reg_set_regdb_offloaded =
294 		tgt_reg_set_regdb_offloaded;
295 
296 	rx_ops->reg_rx_ops.reg_set_11d_offloaded =
297 		tgt_reg_set_11d_offloaded;
298 
299 	rx_ops->reg_rx_ops.get_dfs_region =
300 		wlan_reg_get_dfs_region;
301 
302 	rx_ops->reg_rx_ops.reg_ch_avoid_event_handler =
303 		tgt_reg_process_ch_avoid_event;
304 
305 	rx_ops->reg_rx_ops.reg_freq_to_chan =
306 		wlan_reg_freq_to_chan;
307 
308 	rx_ops->reg_rx_ops.reg_set_chan_144 =
309 		ucfg_reg_modify_chan_144;
310 
311 	rx_ops->reg_rx_ops.reg_get_chan_144 =
312 		ucfg_reg_get_en_chan_144;
313 
314 	rx_ops->reg_rx_ops.reg_program_default_cc =
315 		ucfg_reg_program_default_cc;
316 
317 	rx_ops->reg_rx_ops.reg_get_current_regdomain =
318 		wlan_reg_get_curr_regdomain;
319 }
320 
321 #ifdef CONVERGED_P2P_ENABLE
322 #ifdef FEATURE_P2P_LISTEN_OFFLOAD
323 static void wlan_lmac_if_umac_rx_ops_register_p2p(
324 				struct wlan_lmac_if_rx_ops *rx_ops)
325 {
326 	rx_ops->p2p.lo_ev_handler = tgt_p2p_lo_event_cb;
327 	rx_ops->p2p.noa_ev_handler = tgt_p2p_noa_event_cb;
328 	rx_ops->p2p.add_mac_addr_filter_evt_handler =
329 		tgt_p2p_add_mac_addr_status_event_cb;
330 }
331 #else
332 static void wlan_lmac_if_umac_rx_ops_register_p2p(
333 				struct wlan_lmac_if_rx_ops *rx_ops)
334 {
335 	rx_ops->p2p.noa_ev_handler = tgt_p2p_noa_event_cb;
336 	rx_ops->p2p.add_mac_addr_filter_evt_handler =
337 		tgt_p2p_add_mac_addr_status_event_cb;
338 }
339 #endif
340 #else
341 static void wlan_lmac_if_umac_rx_ops_register_p2p(
342 				struct wlan_lmac_if_rx_ops *rx_ops)
343 {
344 }
345 #endif
346 
347 #ifdef DFS_COMPONENT_ENABLE
348 #ifdef WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT
349 static inline void
350 register_precac_auto_chan_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
351 {
352 	if (!rx_ops)
353 		return;
354 	rx_ops->dfs_set_precac_intermediate_chan =
355 		ucfg_dfs_set_precac_intermediate_chan;
356 	rx_ops->dfs_get_precac_intermediate_chan =
357 		ucfg_dfs_get_precac_intermediate_chan;
358 	rx_ops->dfs_get_precac_chan_state = ucfg_dfs_get_precac_chan_state;
359 }
360 #else
361 static inline void
362 register_precac_auto_chan_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
363 {
364 }
365 #endif
366 
367 static QDF_STATUS
368 wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
369 {
370 	struct wlan_lmac_if_dfs_rx_ops *dfs_rx_ops;
371 
372 	dfs_rx_ops = &rx_ops->dfs_rx_ops;
373 
374 	dfs_rx_ops->dfs_get_radars = tgt_dfs_get_radars;
375 	dfs_rx_ops->dfs_process_phyerr = tgt_dfs_process_phyerr;
376 	dfs_rx_ops->dfs_destroy_object = tgt_dfs_destroy_object;
377 	dfs_rx_ops->dfs_radar_enable = tgt_dfs_radar_enable;
378 	dfs_rx_ops->dfs_is_radar_enabled = tgt_dfs_is_radar_enabled;
379 	dfs_rx_ops->dfs_control = tgt_dfs_control;
380 	dfs_rx_ops->dfs_is_precac_timer_running =
381 		tgt_dfs_is_precac_timer_running;
382 	dfs_rx_ops->dfs_find_vht80_chan_for_precac =
383 		tgt_dfs_find_vht80_chan_for_precac;
384 	dfs_rx_ops->dfs_start_precac_timer = utils_dfs_start_precac_timer;
385 	dfs_rx_ops->dfs_cancel_precac_timer = utils_dfs_cancel_precac_timer;
386 	dfs_rx_ops->dfs_override_precac_timeout =
387 		ucfg_dfs_override_precac_timeout;
388 	dfs_rx_ops->dfs_set_precac_enable = ucfg_dfs_set_precac_enable;
389 	dfs_rx_ops->dfs_get_precac_enable = ucfg_dfs_get_precac_enable;
390 	dfs_rx_ops->dfs_get_override_precac_timeout =
391 		ucfg_dfs_get_override_precac_timeout;
392 	dfs_rx_ops->dfs_set_current_channel = tgt_dfs_set_current_channel;
393 	dfs_rx_ops->dfs_process_radar_ind = tgt_dfs_process_radar_ind;
394 	dfs_rx_ops->dfs_dfs_cac_complete_ind = tgt_dfs_cac_complete;
395 	dfs_rx_ops->dfs_stop = tgt_dfs_stop;
396 	dfs_rx_ops->dfs_enable_stadfs = tgt_dfs_enable_stadfs;
397 	dfs_rx_ops->dfs_is_stadfs_enabled = tgt_dfs_is_stadfs_enabled;
398 	dfs_rx_ops->dfs_process_phyerr_filter_offload =
399 		tgt_dfs_process_phyerr_filter_offload;
400 	dfs_rx_ops->dfs_is_phyerr_filter_offload =
401 		tgt_dfs_is_phyerr_filter_offload;
402 	dfs_rx_ops->dfs_action_on_status = tgt_dfs_action_on_status_from_fw;
403 	dfs_rx_ops->dfs_override_status_timeout =
404 		ucfg_dfs_set_override_status_timeout;
405 	dfs_rx_ops->dfs_get_override_status_timeout =
406 		ucfg_dfs_get_override_status_timeout;
407 	dfs_rx_ops->dfs_reset_spoof_test =
408 		tgt_dfs_reset_spoof_test;
409 	dfs_rx_ops->dfs_is_disable_radar_marking_set =
410 		utils_dfs_get_disable_radar_marking;
411 	dfs_rx_ops->dfs_set_nol_subchannel_marking =
412 		ucfg_dfs_set_nol_subchannel_marking;
413 	dfs_rx_ops->dfs_get_nol_subchannel_marking =
414 		ucfg_dfs_get_nol_subchannel_marking;
415 	dfs_rx_ops->dfs_set_bw_reduction =
416 		utils_dfs_bw_reduce;
417 	dfs_rx_ops->dfs_is_bw_reduction_needed =
418 		utils_dfs_is_bw_reduce;
419 
420 	register_precac_auto_chan_rx_ops(dfs_rx_ops);
421 
422 	return QDF_STATUS_SUCCESS;
423 }
424 #else
425 static QDF_STATUS
426 wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
427 {
428 	return QDF_STATUS_SUCCESS;
429 }
430 #endif
431 
432 #ifdef FEATURE_WLAN_TDLS
433 static QDF_STATUS
434 wlan_lmac_if_umac_tdls_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
435 {
436 	rx_ops->tdls_rx_ops.tdls_ev_handler = tgt_tdls_event_handler;
437 
438 	return QDF_STATUS_SUCCESS;
439 }
440 #else
441 static QDF_STATUS
442 wlan_lmac_if_umac_tdls_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
443 {
444 	return QDF_STATUS_SUCCESS;
445 }
446 #endif
447 
448 #ifdef WLAN_SUPPORT_GREEN_AP
449 static QDF_STATUS
450 wlan_lmac_if_umac_green_ap_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
451 {
452 	rx_ops->green_ap_rx_ops.is_ps_enabled = wlan_green_ap_is_ps_enabled;
453 	rx_ops->green_ap_rx_ops.is_dbg_print_enabled =
454 					ucfg_green_ap_get_debug_prints;
455 	rx_ops->green_ap_rx_ops.ps_set = ucfg_green_ap_set_ps_config;
456 	rx_ops->green_ap_rx_ops.ps_get = ucfg_green_ap_get_ps_config;
457 	rx_ops->green_ap_rx_ops.suspend_handle = wlan_green_ap_suspend_handle;
458 
459 	return QDF_STATUS_SUCCESS;
460 }
461 #else
462 static QDF_STATUS
463 wlan_lmac_if_umac_green_ap_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
464 {
465 	return QDF_STATUS_SUCCESS;
466 }
467 #endif
468 
469 #ifdef QCA_WIFI_FTM
470 static QDF_STATUS
471 wlan_lmac_if_umac_ftm_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
472 {
473 	struct wlan_lmac_if_ftm_rx_ops *ftm_rx_ops;
474 
475 	ftm_rx_ops = &rx_ops->ftm_rx_ops;
476 
477 	ftm_rx_ops->ftm_ev_handler = wlan_ftm_process_utf_event;
478 
479 	return QDF_STATUS_SUCCESS;
480 }
481 #else
482 static QDF_STATUS
483 wlan_lmac_if_umac_ftm_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
484 {
485 	return QDF_STATUS_SUCCESS;
486 }
487 #endif
488 /**
489  * wlan_lmac_if_umac_rx_ops_register() - UMAC rx handler register
490  * @rx_ops: Pointer to rx_ops structure to be populated
491  *
492  * Register umac RX callabacks which will be called by DA/OL/WMA/WMI
493  *
494  * Return: QDF_STATUS_SUCCESS - in case of success
495  */
496 QDF_STATUS
497 wlan_lmac_if_umac_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
498 {
499 	/* Component specific public api's to be called to register
500 	 * respective callbacks
501 	 * Ex: rx_ops->fp = function;
502 	 */
503 	struct wlan_lmac_if_mgmt_txrx_rx_ops *mgmt_txrx_rx_ops;
504 
505 	if (!rx_ops) {
506 		qdf_print("%s: lmac if rx ops pointer is NULL", __func__);
507 		return QDF_STATUS_E_INVAL;
508 	}
509 
510 	/* mgmt txrx rx ops */
511 	mgmt_txrx_rx_ops = &rx_ops->mgmt_txrx_rx_ops;
512 
513 	mgmt_txrx_rx_ops->mgmt_tx_completion_handler =
514 			tgt_mgmt_txrx_tx_completion_handler;
515 	mgmt_txrx_rx_ops->mgmt_rx_frame_handler =
516 			tgt_mgmt_txrx_rx_frame_handler;
517 	mgmt_txrx_rx_ops->mgmt_txrx_get_nbuf_from_desc_id =
518 			tgt_mgmt_txrx_get_nbuf_from_desc_id;
519 	mgmt_txrx_rx_ops->mgmt_txrx_get_peer_from_desc_id =
520 			tgt_mgmt_txrx_get_peer_from_desc_id;
521 	mgmt_txrx_rx_ops->mgmt_txrx_get_vdev_id_from_desc_id =
522 			tgt_mgmt_txrx_get_vdev_id_from_desc_id;
523 	mgmt_txrx_rx_ops->mgmt_txrx_get_free_desc_pool_count =
524 			tgt_mgmt_txrx_get_free_desc_pool_count;
525 
526 	/* scan rx ops */
527 	rx_ops->scan.scan_ev_handler = tgt_scan_event_handler;
528 	rx_ops->scan.scan_set_max_active_scans = tgt_scan_set_max_active_scans;
529 
530 	wlan_lmac_if_atf_rx_ops_register(rx_ops);
531 
532 	wlan_lmac_if_cp_stats_rx_ops_register(rx_ops);
533 
534 	wlan_lmac_if_sa_api_rx_ops_register(rx_ops);
535 
536 	wlan_lmac_if_cfr_rx_ops_register(rx_ops);
537 
538 	wlan_lmac_if_crypto_rx_ops_register(rx_ops);
539 	/* wifi_pos rx ops */
540 	wlan_lmac_if_umac_rx_ops_register_wifi_pos(rx_ops);
541 
542 	/* tdls rx ops */
543 	wlan_lmac_if_umac_tdls_rx_ops_register(rx_ops);
544 
545 	wlan_lmac_if_umac_reg_rx_ops_register(rx_ops);
546 
547 	/* p2p rx ops */
548 	wlan_lmac_if_umac_rx_ops_register_p2p(rx_ops);
549 
550 	/* DFS rx_ops */
551 	wlan_lmac_if_umac_dfs_rx_ops_register(rx_ops);
552 
553 	wlan_lmac_if_umac_green_ap_rx_ops_register(rx_ops);
554 
555 	/* FTM rx_ops */
556 	wlan_lmac_if_umac_ftm_rx_ops_register(rx_ops);
557 
558 	/* FILS Discovery */
559 	wlan_lmac_if_fd_rx_ops_register(rx_ops);
560 
561 	/* MLME rx_ops */
562 	tgt_vdev_mgr_rx_ops_register(rx_ops);
563 
564 	return QDF_STATUS_SUCCESS;
565 }
566 
567 /**
568  * wlan_lmac_if_set_umac_txops_registration_cb() - tx registration
569  * callback assignment
570  * @dev_type: Dev type can be either Direct attach or Offload
571  * @handler: handler to be called for LMAC tx ops registration
572  *
573  * API to assign appropriate tx registration callback handler based on the
574  * device type(Offload or Direct attach)
575  *
576  * Return: QDF_STATUS_SUCCESS - in case of success
577  */
578 QDF_STATUS wlan_lmac_if_set_umac_txops_registration_cb(QDF_STATUS (*handler)
579 				(struct wlan_lmac_if_tx_ops *))
580 {
581 	wlan_lmac_if_umac_tx_ops_register = handler;
582 	return QDF_STATUS_SUCCESS;
583 }
584 qdf_export_symbol(wlan_lmac_if_set_umac_txops_registration_cb);
585 
586