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