xref: /wlan-dirver/qca-wifi-host-cmn/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c (revision ad85c389289a03e320cd08dea21861f9857892fc)
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 CONVERGED_TDLS_ENABLE
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 /* Function pointer for OL/WMA specific UMAC tx_ops
69  * registration.
70  */
71 QDF_STATUS (*wlan_lmac_if_umac_tx_ops_register)
72 				(struct wlan_lmac_if_tx_ops *tx_ops);
73 qdf_export_symbol(wlan_lmac_if_umac_tx_ops_register);
74 
75 #ifdef QCA_SUPPORT_CP_STATS
76 /**
77  * wlan_lmac_if_cp_stats_rx_ops_register() - API to register cp stats Rx Ops
78  * @rx_ops:	pointer to lmac rx ops
79  *
80  * This API will be used to register function pointers for FW events
81  *
82  * Return: void
83  */
84 static void
85 wlan_lmac_if_cp_stats_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
86 {
87 	tgt_cp_stats_register_rx_ops(rx_ops);
88 }
89 #else
90 static void
91 wlan_lmac_if_cp_stats_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
92 {
93 }
94 #endif /* QCA_SUPPORT_CP_STATS */
95 
96 #ifdef WLAN_ATF_ENABLE
97 /**
98  * wlan_lmac_if_atf_rx_ops_register() - Function to register ATF RX ops.
99  */
100 static void
101 wlan_lmac_if_atf_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
102 {
103 	struct wlan_lmac_if_atf_rx_ops *atf_rx_ops = &rx_ops->atf_rx_ops;
104 
105 	/* ATF rx ops */
106 	atf_rx_ops->atf_get_atf_commit = tgt_atf_get_atf_commit;
107 	atf_rx_ops->atf_get_fmcap = tgt_atf_get_fmcap;
108 	atf_rx_ops->atf_get_obss_scale = tgt_atf_get_obss_scale;
109 	atf_rx_ops->atf_get_mode = tgt_atf_get_mode;
110 	atf_rx_ops->atf_get_msdu_desc = tgt_atf_get_msdu_desc;
111 	atf_rx_ops->atf_get_max_vdevs = tgt_atf_get_max_vdevs;
112 	atf_rx_ops->atf_get_peers = tgt_atf_get_peers;
113 	atf_rx_ops->atf_get_tput_based = tgt_atf_get_tput_based;
114 	atf_rx_ops->atf_get_logging = tgt_atf_get_logging;
115 	atf_rx_ops->atf_update_buf_held = tgt_atf_update_buf_held;
116 	atf_rx_ops->atf_get_ssidgroup = tgt_atf_get_ssidgroup;
117 	atf_rx_ops->atf_get_vdev_ac_blk_cnt = tgt_atf_get_vdev_ac_blk_cnt;
118 	atf_rx_ops->atf_get_peer_blk_txbitmap = tgt_atf_get_peer_blk_txbitmap;
119 	atf_rx_ops->atf_get_vdev_blk_txtraffic = tgt_atf_get_vdev_blk_txtraffic;
120 	atf_rx_ops->atf_get_sched = tgt_atf_get_sched;
121 	atf_rx_ops->atf_get_tx_tokens = tgt_atf_get_tx_tokens;
122 	atf_rx_ops->atf_account_subgroup_txtokens =
123 					tgt_atf_account_subgroup_txtokens;
124 	atf_rx_ops->atf_adjust_subgroup_txtokens =
125 					tgt_atf_adjust_subgroup_txtokens;
126 	atf_rx_ops->atf_get_subgroup_airtime = tgt_atf_get_subgroup_airtime;
127 	atf_rx_ops->atf_subgroup_free_buf = tgt_atf_subgroup_free_buf;
128 	atf_rx_ops->atf_update_subgroup_tidstate =
129 					tgt_atf_update_subgroup_tidstate;
130 	atf_rx_ops->atf_buf_distribute = tgt_atf_buf_distribute;
131 	atf_rx_ops->atf_get_shadow_alloted_tx_tokens =
132 					tgt_atf_get_shadow_alloted_tx_tokens;
133 	atf_rx_ops->atf_get_txtokens_common = tgt_atf_get_txtokens_common;
134 	atf_rx_ops->atf_get_peer_stats = tgt_atf_get_peer_stats;
135 	atf_rx_ops->atf_get_token_allocated = tgt_atf_get_token_allocated;
136 	atf_rx_ops->atf_get_token_utilized = tgt_atf_get_token_utilized;
137 
138 	atf_rx_ops->atf_set_sched = tgt_atf_set_sched;
139 	atf_rx_ops->atf_set_fmcap = tgt_atf_set_fmcap;
140 	atf_rx_ops->atf_set_obss_scale = tgt_atf_set_obss_scale;
141 	atf_rx_ops->atf_set_msdu_desc = tgt_atf_set_msdu_desc;
142 	atf_rx_ops->atf_set_max_vdevs = tgt_atf_set_max_vdevs;
143 	atf_rx_ops->atf_set_peers = tgt_atf_set_peers;
144 	atf_rx_ops->atf_set_peer_stats = tgt_atf_set_peer_stats;
145 	atf_rx_ops->atf_set_vdev_blk_txtraffic = tgt_atf_set_vdev_blk_txtraffic;
146 	atf_rx_ops->atf_peer_blk_txtraffic = tgt_atf_peer_blk_txtraffic;
147 	atf_rx_ops->atf_peer_unblk_txtraffic = tgt_atf_peer_unblk_txtraffic;
148 	atf_rx_ops->atf_set_token_allocated = tgt_atf_set_token_allocated;
149 	atf_rx_ops->atf_set_token_utilized = tgt_atf_set_token_utilized;
150 }
151 #else
152 static void
153 wlan_lmac_if_atf_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
154 {
155 }
156 #endif
157 
158 #ifdef WLAN_SUPPORT_FILS
159 static void
160 wlan_lmac_if_fd_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
161 {
162 	struct wlan_lmac_if_fd_rx_ops *fd_rx_ops = &rx_ops->fd_rx_ops;
163 
164 	fd_rx_ops->fd_is_fils_enable = tgt_fd_is_fils_enable;
165 	fd_rx_ops->fd_alloc = tgt_fd_alloc;
166 	fd_rx_ops->fd_stop = tgt_fd_stop;
167 	fd_rx_ops->fd_free = tgt_fd_free;
168 	fd_rx_ops->fd_get_valid_fd_period = tgt_fd_get_valid_fd_period;
169 	fd_rx_ops->fd_swfda_handler = tgt_fd_swfda_handler;
170 }
171 #else
172 static void
173 wlan_lmac_if_fd_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
174 {
175 }
176 #endif
177 
178 #ifdef WLAN_SA_API_ENABLE
179 /**
180  * wlan_lmac_if_sa_api_rx_ops_register() - Function to register SA_API RX ops.
181  */
182 static void
183 wlan_lmac_if_sa_api_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
184 {
185 	struct wlan_lmac_if_sa_api_rx_ops *sa_api_rx_ops = &rx_ops->sa_api_rx_ops;
186 
187 	/* SA API rx ops */
188 	sa_api_rx_ops->sa_api_get_sa_supported = tgt_sa_api_get_sa_supported;
189 	sa_api_rx_ops->sa_api_get_validate_sw  = tgt_sa_api_get_validate_sw;
190 	sa_api_rx_ops->sa_api_enable_sa        = tgt_sa_api_enable_sa;
191 	sa_api_rx_ops->sa_api_get_sa_enable    = tgt_sa_api_get_sa_enable;
192 
193 	sa_api_rx_ops->sa_api_peer_assoc_hanldler = tgt_sa_api_peer_assoc_hanldler;
194 	sa_api_rx_ops->sa_api_update_tx_feedback = tgt_sa_api_update_tx_feedback;
195 	sa_api_rx_ops->sa_api_update_rx_feedback = tgt_sa_api_update_rx_feedback;
196 
197 	sa_api_rx_ops->sa_api_ucfg_set_param = tgt_sa_api_ucfg_set_param;
198 	sa_api_rx_ops->sa_api_ucfg_get_param = tgt_sa_api_ucfg_get_param;
199 
200 	sa_api_rx_ops->sa_api_is_tx_feedback_enabled = tgt_sa_api_is_tx_feedback_enabled;
201 	sa_api_rx_ops->sa_api_is_rx_feedback_enabled = tgt_sa_api_is_rx_feedback_enabled;
202 
203 	sa_api_rx_ops->sa_api_convert_rate_2g = tgt_sa_api_convert_rate_2g;
204 	sa_api_rx_ops->sa_api_convert_rate_5g = tgt_sa_api_convert_rate_5g;
205 	sa_api_rx_ops->sa_api_get_sa_mode = tgt_sa_api_get_sa_mode;
206 
207 	sa_api_rx_ops->sa_api_get_beacon_txantenna = tgt_sa_api_get_beacon_txantenna;
208 	sa_api_rx_ops->sa_api_cwm_action = tgt_sa_api_cwm_action;
209 }
210 #else
211 static void
212 wlan_lmac_if_sa_api_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
213 {
214 }
215 #endif
216 
217 
218 #ifdef WLAN_CONV_CRYPTO_SUPPORTED
219 static void
220 wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
221 {
222 	wlan_crypto_register_crypto_rx_ops(&rx_ops->crypto_rx_ops);
223 }
224 #else
225 static void
226 wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
227 {
228 }
229 #endif
230 
231 #ifdef WIFI_POS_CONVERGED
232 static void wlan_lmac_if_umac_rx_ops_register_wifi_pos(
233 				struct wlan_lmac_if_rx_ops *rx_ops)
234 {
235 	target_if_wifi_pos_register_rx_ops(rx_ops);
236 }
237 #else
238 static void wlan_lmac_if_umac_rx_ops_register_wifi_pos(
239 				struct wlan_lmac_if_rx_ops *rx_ops)
240 {
241 }
242 #endif /* WIFI_POS_CONVERGED */
243 
244 static void wlan_lmac_if_umac_reg_rx_ops_register(
245 	struct wlan_lmac_if_rx_ops *rx_ops)
246 {
247 	rx_ops->reg_rx_ops.master_list_handler =
248 		tgt_reg_process_master_chan_list;
249 
250 	rx_ops->reg_rx_ops.reg_11d_new_cc_handler =
251 		tgt_reg_process_11d_new_country;
252 
253 	rx_ops->reg_rx_ops.reg_set_regdb_offloaded =
254 		tgt_reg_set_regdb_offloaded;
255 
256 	rx_ops->reg_rx_ops.reg_set_11d_offloaded =
257 		tgt_reg_set_11d_offloaded;
258 
259 	rx_ops->reg_rx_ops.get_dfs_region =
260 		wlan_reg_get_dfs_region;
261 
262 	rx_ops->reg_rx_ops.reg_ch_avoid_event_handler =
263 		tgt_reg_process_ch_avoid_event;
264 
265 	rx_ops->reg_rx_ops.reg_freq_to_chan =
266 		wlan_reg_freq_to_chan;
267 
268 	rx_ops->reg_rx_ops.reg_set_chan_144 =
269 		ucfg_reg_modify_chan_144;
270 
271 	rx_ops->reg_rx_ops.reg_get_chan_144 =
272 		ucfg_reg_get_en_chan_144;
273 
274 	rx_ops->reg_rx_ops.reg_program_default_cc =
275 		ucfg_reg_program_default_cc;
276 
277 	rx_ops->reg_rx_ops.reg_get_current_regdomain =
278 		wlan_reg_get_curr_regdomain;
279 }
280 
281 #ifdef CONVERGED_P2P_ENABLE
282 #ifdef FEATURE_P2P_LISTEN_OFFLOAD
283 static void wlan_lmac_if_umac_rx_ops_register_p2p(
284 				struct wlan_lmac_if_rx_ops *rx_ops)
285 {
286 	rx_ops->p2p.lo_ev_handler = tgt_p2p_lo_event_cb;
287 	rx_ops->p2p.noa_ev_handler = tgt_p2p_noa_event_cb;
288 	rx_ops->p2p.add_mac_addr_filter_evt_handler =
289 		tgt_p2p_add_mac_addr_status_event_cb;
290 }
291 #else
292 static void wlan_lmac_if_umac_rx_ops_register_p2p(
293 				struct wlan_lmac_if_rx_ops *rx_ops)
294 {
295 	rx_ops->p2p.noa_ev_handler = tgt_p2p_noa_event_cb;
296 	rx_ops->p2p.add_mac_addr_filter_evt_handler =
297 		tgt_p2p_add_mac_addr_status_event_cb;
298 }
299 #endif
300 #else
301 static void wlan_lmac_if_umac_rx_ops_register_p2p(
302 				struct wlan_lmac_if_rx_ops *rx_ops)
303 {
304 }
305 #endif
306 
307 #ifdef DFS_COMPONENT_ENABLE
308 #ifdef WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT
309 static inline void
310 register_precac_auto_chan_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
311 {
312 	if (!rx_ops)
313 		return;
314 	rx_ops->dfs_set_precac_intermediate_chan =
315 		ucfg_dfs_set_precac_intermediate_chan;
316 	rx_ops->dfs_get_precac_intermediate_chan =
317 		ucfg_dfs_get_precac_intermediate_chan;
318 	rx_ops->dfs_get_precac_chan_state = ucfg_dfs_get_precac_chan_state;
319 }
320 #else
321 static inline void
322 register_precac_auto_chan_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
323 {
324 }
325 #endif
326 
327 static QDF_STATUS
328 wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
329 {
330 	struct wlan_lmac_if_dfs_rx_ops *dfs_rx_ops;
331 
332 	dfs_rx_ops = &rx_ops->dfs_rx_ops;
333 
334 	dfs_rx_ops->dfs_get_radars = tgt_dfs_get_radars;
335 	dfs_rx_ops->dfs_process_phyerr = tgt_dfs_process_phyerr;
336 	dfs_rx_ops->dfs_destroy_object = tgt_dfs_destroy_object;
337 	dfs_rx_ops->dfs_radar_enable = tgt_dfs_radar_enable;
338 	dfs_rx_ops->dfs_is_radar_enabled = tgt_dfs_is_radar_enabled;
339 	dfs_rx_ops->dfs_control = tgt_dfs_control;
340 	dfs_rx_ops->dfs_is_precac_timer_running =
341 		tgt_dfs_is_precac_timer_running;
342 	dfs_rx_ops->dfs_find_vht80_chan_for_precac =
343 		tgt_dfs_find_vht80_chan_for_precac;
344 	dfs_rx_ops->dfs_start_precac_timer = utils_dfs_start_precac_timer;
345 	dfs_rx_ops->dfs_cancel_precac_timer = utils_dfs_cancel_precac_timer;
346 	dfs_rx_ops->dfs_override_precac_timeout =
347 		ucfg_dfs_override_precac_timeout;
348 	dfs_rx_ops->dfs_set_precac_enable = ucfg_dfs_set_precac_enable;
349 	dfs_rx_ops->dfs_get_precac_enable = ucfg_dfs_get_precac_enable;
350 	dfs_rx_ops->dfs_get_override_precac_timeout =
351 		ucfg_dfs_get_override_precac_timeout;
352 	dfs_rx_ops->dfs_set_current_channel = tgt_dfs_set_current_channel;
353 	dfs_rx_ops->dfs_process_radar_ind = tgt_dfs_process_radar_ind;
354 	dfs_rx_ops->dfs_dfs_cac_complete_ind = tgt_dfs_cac_complete;
355 	dfs_rx_ops->dfs_stop = tgt_dfs_stop;
356 	dfs_rx_ops->dfs_enable_stadfs = tgt_dfs_enable_stadfs;
357 	dfs_rx_ops->dfs_is_stadfs_enabled = tgt_dfs_is_stadfs_enabled;
358 	dfs_rx_ops->dfs_process_phyerr_filter_offload =
359 		tgt_dfs_process_phyerr_filter_offload;
360 	dfs_rx_ops->dfs_is_phyerr_filter_offload =
361 		tgt_dfs_is_phyerr_filter_offload;
362 	dfs_rx_ops->dfs_action_on_status = tgt_dfs_action_on_status_from_fw;
363 	dfs_rx_ops->dfs_override_status_timeout =
364 		ucfg_dfs_set_override_status_timeout;
365 	dfs_rx_ops->dfs_get_override_status_timeout =
366 		ucfg_dfs_get_override_status_timeout;
367 	dfs_rx_ops->dfs_reset_spoof_test =
368 		tgt_dfs_reset_spoof_test;
369 	dfs_rx_ops->dfs_is_disable_radar_marking_set =
370 		utils_dfs_get_disable_radar_marking;
371 	dfs_rx_ops->dfs_set_nol_subchannel_marking =
372 		ucfg_dfs_set_nol_subchannel_marking;
373 	dfs_rx_ops->dfs_get_nol_subchannel_marking =
374 		ucfg_dfs_get_nol_subchannel_marking;
375 	dfs_rx_ops->dfs_set_bw_reduction =
376 		utils_dfs_bw_reduce;
377 	dfs_rx_ops->dfs_is_bw_reduction_needed =
378 		utils_dfs_is_bw_reduce;
379 
380 	register_precac_auto_chan_rx_ops(dfs_rx_ops);
381 
382 	return QDF_STATUS_SUCCESS;
383 }
384 #else
385 static QDF_STATUS
386 wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
387 {
388 	return QDF_STATUS_SUCCESS;
389 }
390 #endif
391 
392 #ifdef CONVERGED_TDLS_ENABLE
393 static QDF_STATUS
394 wlan_lmac_if_umac_tdls_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
395 {
396 	rx_ops->tdls_rx_ops.tdls_ev_handler = tgt_tdls_event_handler;
397 
398 	return QDF_STATUS_SUCCESS;
399 }
400 #else
401 static QDF_STATUS
402 wlan_lmac_if_umac_tdls_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
403 {
404 	return QDF_STATUS_SUCCESS;
405 }
406 #endif
407 
408 #ifdef WLAN_SUPPORT_GREEN_AP
409 static QDF_STATUS
410 wlan_lmac_if_umac_green_ap_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
411 {
412 	rx_ops->green_ap_rx_ops.is_ps_enabled = wlan_green_ap_is_ps_enabled;
413 	rx_ops->green_ap_rx_ops.is_dbg_print_enabled =
414 					ucfg_green_ap_get_debug_prints;
415 	rx_ops->green_ap_rx_ops.ps_set = ucfg_green_ap_set_ps_config;
416 	rx_ops->green_ap_rx_ops.ps_get = ucfg_green_ap_get_ps_config;
417 	rx_ops->green_ap_rx_ops.suspend_handle = wlan_green_ap_suspend_handle;
418 
419 	return QDF_STATUS_SUCCESS;
420 }
421 #else
422 static QDF_STATUS
423 wlan_lmac_if_umac_green_ap_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
424 {
425 	return QDF_STATUS_SUCCESS;
426 }
427 #endif
428 
429 #ifdef QCA_WIFI_FTM
430 static QDF_STATUS
431 wlan_lmac_if_umac_ftm_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
432 {
433 	struct wlan_lmac_if_ftm_rx_ops *ftm_rx_ops;
434 
435 	ftm_rx_ops = &rx_ops->ftm_rx_ops;
436 
437 	ftm_rx_ops->ftm_ev_handler = wlan_ftm_process_utf_event;
438 
439 	return QDF_STATUS_SUCCESS;
440 }
441 #else
442 static QDF_STATUS
443 wlan_lmac_if_umac_ftm_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
444 {
445 	return QDF_STATUS_SUCCESS;
446 }
447 #endif
448 /**
449  * wlan_lmac_if_umac_rx_ops_register() - UMAC rx handler register
450  * @rx_ops: Pointer to rx_ops structure to be populated
451  *
452  * Register umac RX callabacks which will be called by DA/OL/WMA/WMI
453  *
454  * Return: QDF_STATUS_SUCCESS - in case of success
455  */
456 QDF_STATUS
457 wlan_lmac_if_umac_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
458 {
459 	/* Component specific public api's to be called to register
460 	 * respective callbacks
461 	 * Ex: rx_ops->fp = function;
462 	 */
463 	struct wlan_lmac_if_mgmt_txrx_rx_ops *mgmt_txrx_rx_ops;
464 
465 	if (!rx_ops) {
466 		qdf_print("%s: lmac if rx ops pointer is NULL", __func__);
467 		return QDF_STATUS_E_INVAL;
468 	}
469 
470 	/* mgmt txrx rx ops */
471 	mgmt_txrx_rx_ops = &rx_ops->mgmt_txrx_rx_ops;
472 
473 	mgmt_txrx_rx_ops->mgmt_tx_completion_handler =
474 			tgt_mgmt_txrx_tx_completion_handler;
475 	mgmt_txrx_rx_ops->mgmt_rx_frame_handler =
476 			tgt_mgmt_txrx_rx_frame_handler;
477 	mgmt_txrx_rx_ops->mgmt_txrx_get_nbuf_from_desc_id =
478 			tgt_mgmt_txrx_get_nbuf_from_desc_id;
479 	mgmt_txrx_rx_ops->mgmt_txrx_get_peer_from_desc_id =
480 			tgt_mgmt_txrx_get_peer_from_desc_id;
481 	mgmt_txrx_rx_ops->mgmt_txrx_get_vdev_id_from_desc_id =
482 			tgt_mgmt_txrx_get_vdev_id_from_desc_id;
483 	mgmt_txrx_rx_ops->mgmt_txrx_get_free_desc_pool_count =
484 			tgt_mgmt_txrx_get_free_desc_pool_count;
485 
486 	/* scan rx ops */
487 	rx_ops->scan.scan_ev_handler = tgt_scan_event_handler;
488 	rx_ops->scan.scan_set_max_active_scans = tgt_scan_set_max_active_scans;
489 
490 	wlan_lmac_if_atf_rx_ops_register(rx_ops);
491 
492 	wlan_lmac_if_cp_stats_rx_ops_register(rx_ops);
493 
494 	wlan_lmac_if_sa_api_rx_ops_register(rx_ops);
495 
496 	wlan_lmac_if_crypto_rx_ops_register(rx_ops);
497 	/* wifi_pos rx ops */
498 	wlan_lmac_if_umac_rx_ops_register_wifi_pos(rx_ops);
499 
500 	/* tdls rx ops */
501 	wlan_lmac_if_umac_tdls_rx_ops_register(rx_ops);
502 
503 	wlan_lmac_if_umac_reg_rx_ops_register(rx_ops);
504 
505 	/* p2p rx ops */
506 	wlan_lmac_if_umac_rx_ops_register_p2p(rx_ops);
507 
508 	/* DFS rx_ops */
509 	wlan_lmac_if_umac_dfs_rx_ops_register(rx_ops);
510 
511 	wlan_lmac_if_umac_green_ap_rx_ops_register(rx_ops);
512 
513 	/* FTM rx_ops */
514 	wlan_lmac_if_umac_ftm_rx_ops_register(rx_ops);
515 
516 	/* FILS Discovery */
517 	wlan_lmac_if_fd_rx_ops_register(rx_ops);
518 
519 	return QDF_STATUS_SUCCESS;
520 }
521 
522 /**
523  * wlan_lmac_if_set_umac_txops_registration_cb() - tx registration
524  * callback assignment
525  * @dev_type: Dev type can be either Direct attach or Offload
526  * @handler: handler to be called for LMAC tx ops registration
527  *
528  * API to assign appropriate tx registration callback handler based on the
529  * device type(Offload or Direct attach)
530  *
531  * Return: QDF_STATUS_SUCCESS - in case of success
532  */
533 QDF_STATUS wlan_lmac_if_set_umac_txops_registration_cb(QDF_STATUS (*handler)
534 				(struct wlan_lmac_if_tx_ops *))
535 {
536 	wlan_lmac_if_umac_tx_ops_register = handler;
537 	return QDF_STATUS_SUCCESS;
538 }
539 qdf_export_symbol(wlan_lmac_if_set_umac_txops_registration_cb);
540 
541