xref: /wlan-dirver/qca-wifi-host-cmn/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c (revision f28396d060cff5c6519f883cb28ae0116ce479f1)
1 /*
2  * Copyright (c) 2016-2020 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 #include <wlan_vdev_mgr_tgt_if_rx_api.h>
68 
69 #ifdef WLAN_CFR_ENABLE
70 #include "wlan_cfr_tgt_api.h"
71 #endif
72 
73 #ifdef WIFI_POS_CONVERGED
74 #include "wifi_pos_api.h"
75 #endif
76 
77 /* Function pointer for OL/WMA specific UMAC tx_ops
78  * registration.
79  */
80 QDF_STATUS (*wlan_lmac_if_umac_tx_ops_register)
81 				(struct wlan_lmac_if_tx_ops *tx_ops);
82 qdf_export_symbol(wlan_lmac_if_umac_tx_ops_register);
83 
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 
90 #ifdef QCA_SUPPORT_CP_STATS
91 /**
92  * wlan_lmac_if_cp_stats_rx_ops_register() - API to register cp stats Rx Ops
93  * @rx_ops:	pointer to lmac rx ops
94  *
95  * This API will be used to register function pointers for FW events
96  *
97  * Return: void
98  */
99 static void
100 wlan_lmac_if_cp_stats_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
101 {
102 	tgt_cp_stats_register_rx_ops(rx_ops);
103 }
104 #else
105 static void
106 wlan_lmac_if_cp_stats_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
107 {
108 }
109 #endif /* QCA_SUPPORT_CP_STATS */
110 
111 #ifdef WLAN_ATF_ENABLE
112 /**
113  * wlan_lmac_if_atf_rx_ops_register() - Function to register ATF RX ops.
114  */
115 static void
116 wlan_lmac_if_atf_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
117 {
118 	struct wlan_lmac_if_atf_rx_ops *atf_rx_ops = &rx_ops->atf_rx_ops;
119 
120 	/* ATF rx ops */
121 	atf_rx_ops->atf_get_atf_commit = tgt_atf_get_atf_commit;
122 	atf_rx_ops->atf_get_fmcap = tgt_atf_get_fmcap;
123 	atf_rx_ops->atf_get_obss_scale = tgt_atf_get_obss_scale;
124 	atf_rx_ops->atf_get_mode = tgt_atf_get_mode;
125 	atf_rx_ops->atf_get_msdu_desc = tgt_atf_get_msdu_desc;
126 	atf_rx_ops->atf_get_max_vdevs = tgt_atf_get_max_vdevs;
127 	atf_rx_ops->atf_get_peers = tgt_atf_get_peers;
128 	atf_rx_ops->atf_get_tput_based = tgt_atf_get_tput_based;
129 	atf_rx_ops->atf_get_logging = tgt_atf_get_logging;
130 	atf_rx_ops->atf_update_buf_held = tgt_atf_update_buf_held;
131 	atf_rx_ops->atf_get_ssidgroup = tgt_atf_get_ssidgroup;
132 	atf_rx_ops->atf_get_vdev_ac_blk_cnt = tgt_atf_get_vdev_ac_blk_cnt;
133 	atf_rx_ops->atf_get_peer_blk_txbitmap = tgt_atf_get_peer_blk_txbitmap;
134 	atf_rx_ops->atf_get_vdev_blk_txtraffic = tgt_atf_get_vdev_blk_txtraffic;
135 	atf_rx_ops->atf_get_sched = tgt_atf_get_sched;
136 	atf_rx_ops->atf_get_tx_tokens = tgt_atf_get_tx_tokens;
137 	atf_rx_ops->atf_account_subgroup_txtokens =
138 					tgt_atf_account_subgroup_txtokens;
139 	atf_rx_ops->atf_adjust_subgroup_txtokens =
140 					tgt_atf_adjust_subgroup_txtokens;
141 	atf_rx_ops->atf_get_subgroup_airtime = tgt_atf_get_subgroup_airtime;
142 	atf_rx_ops->atf_subgroup_free_buf = tgt_atf_subgroup_free_buf;
143 	atf_rx_ops->atf_update_subgroup_tidstate =
144 					tgt_atf_update_subgroup_tidstate;
145 	atf_rx_ops->atf_buf_distribute = tgt_atf_buf_distribute;
146 	atf_rx_ops->atf_get_shadow_alloted_tx_tokens =
147 					tgt_atf_get_shadow_alloted_tx_tokens;
148 	atf_rx_ops->atf_get_txtokens_common = tgt_atf_get_txtokens_common;
149 	atf_rx_ops->atf_get_peer_stats = tgt_atf_get_peer_stats;
150 	atf_rx_ops->atf_get_token_allocated = tgt_atf_get_token_allocated;
151 	atf_rx_ops->atf_get_token_utilized = tgt_atf_get_token_utilized;
152 
153 	atf_rx_ops->atf_set_sched = tgt_atf_set_sched;
154 	atf_rx_ops->atf_set_fmcap = tgt_atf_set_fmcap;
155 	atf_rx_ops->atf_set_obss_scale = tgt_atf_set_obss_scale;
156 	atf_rx_ops->atf_set_msdu_desc = tgt_atf_set_msdu_desc;
157 	atf_rx_ops->atf_set_max_vdevs = tgt_atf_set_max_vdevs;
158 	atf_rx_ops->atf_set_peers = tgt_atf_set_peers;
159 	atf_rx_ops->atf_set_peer_stats = tgt_atf_set_peer_stats;
160 	atf_rx_ops->atf_set_vdev_blk_txtraffic = tgt_atf_set_vdev_blk_txtraffic;
161 	atf_rx_ops->atf_peer_blk_txtraffic = tgt_atf_peer_blk_txtraffic;
162 	atf_rx_ops->atf_peer_unblk_txtraffic = tgt_atf_peer_unblk_txtraffic;
163 	atf_rx_ops->atf_set_token_allocated = tgt_atf_set_token_allocated;
164 	atf_rx_ops->atf_set_token_utilized = tgt_atf_set_token_utilized;
165 }
166 #else
167 static void
168 wlan_lmac_if_atf_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
169 {
170 }
171 #endif
172 
173 #ifdef WLAN_SUPPORT_FILS
174 static void
175 wlan_lmac_if_fd_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
176 {
177 	struct wlan_lmac_if_fd_rx_ops *fd_rx_ops = &rx_ops->fd_rx_ops;
178 
179 	fd_rx_ops->fd_is_fils_enable = tgt_fd_is_fils_enable;
180 	fd_rx_ops->fd_alloc = tgt_fd_alloc;
181 	fd_rx_ops->fd_stop = tgt_fd_stop;
182 	fd_rx_ops->fd_free = tgt_fd_free;
183 	fd_rx_ops->fd_get_valid_fd_period = tgt_fd_get_valid_fd_period;
184 	fd_rx_ops->fd_swfda_handler = tgt_fd_swfda_handler;
185 	fd_rx_ops->fd_offload = tgt_fd_offload;
186 }
187 #else
188 static void
189 wlan_lmac_if_fd_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
190 {
191 }
192 #endif
193 
194 #ifdef WLAN_SA_API_ENABLE
195 /**
196  * wlan_lmac_if_sa_api_rx_ops_register() - Function to register SA_API RX ops.
197  */
198 static void
199 wlan_lmac_if_sa_api_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
200 {
201 	struct wlan_lmac_if_sa_api_rx_ops *sa_api_rx_ops = &rx_ops->sa_api_rx_ops;
202 
203 	/* SA API rx ops */
204 	sa_api_rx_ops->sa_api_get_sa_supported = tgt_sa_api_get_sa_supported;
205 	sa_api_rx_ops->sa_api_get_validate_sw  = tgt_sa_api_get_validate_sw;
206 	sa_api_rx_ops->sa_api_enable_sa        = tgt_sa_api_enable_sa;
207 	sa_api_rx_ops->sa_api_get_sa_enable    = tgt_sa_api_get_sa_enable;
208 
209 	sa_api_rx_ops->sa_api_peer_assoc_hanldler = tgt_sa_api_peer_assoc_hanldler;
210 	sa_api_rx_ops->sa_api_update_tx_feedback = tgt_sa_api_update_tx_feedback;
211 	sa_api_rx_ops->sa_api_update_rx_feedback = tgt_sa_api_update_rx_feedback;
212 
213 	sa_api_rx_ops->sa_api_ucfg_set_param = tgt_sa_api_ucfg_set_param;
214 	sa_api_rx_ops->sa_api_ucfg_get_param = tgt_sa_api_ucfg_get_param;
215 
216 	sa_api_rx_ops->sa_api_is_tx_feedback_enabled = tgt_sa_api_is_tx_feedback_enabled;
217 	sa_api_rx_ops->sa_api_is_rx_feedback_enabled = tgt_sa_api_is_rx_feedback_enabled;
218 
219 	sa_api_rx_ops->sa_api_convert_rate_2g = tgt_sa_api_convert_rate_2g;
220 	sa_api_rx_ops->sa_api_convert_rate_5g = tgt_sa_api_convert_rate_5g;
221 	sa_api_rx_ops->sa_api_get_sa_mode = tgt_sa_api_get_sa_mode;
222 
223 	sa_api_rx_ops->sa_api_get_beacon_txantenna = tgt_sa_api_get_beacon_txantenna;
224 	sa_api_rx_ops->sa_api_cwm_action = tgt_sa_api_cwm_action;
225 }
226 #else
227 static void
228 wlan_lmac_if_sa_api_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
229 {
230 }
231 #endif
232 
233 #ifdef WLAN_CFR_ENABLE
234 /**
235  * wlan_lmac_if_cfr_rx_ops_register() - Function to register CFR RX ops
236  */
237 static void
238 wlan_lmac_if_cfr_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
239 {
240 	struct wlan_lmac_if_cfr_rx_ops *cfr_rx_ops = &rx_ops->cfr_rx_ops;
241 
242 	/* CFR rx ops */
243 	cfr_rx_ops->cfr_support_set = tgt_cfr_support_set;
244 	cfr_rx_ops->cfr_info_send  = tgt_cfr_info_send;
245 }
246 #else
247 static void
248 wlan_lmac_if_cfr_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
249 {
250 }
251 #endif
252 
253 #ifdef WLAN_CONV_CRYPTO_SUPPORTED
254 static void
255 wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
256 {
257 	wlan_crypto_register_crypto_rx_ops(&rx_ops->crypto_rx_ops);
258 }
259 #else
260 static void
261 wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
262 {
263 }
264 #endif
265 
266 #ifdef WIFI_POS_CONVERGED
267 static void wlan_lmac_if_umac_rx_ops_register_wifi_pos(
268 				struct wlan_lmac_if_rx_ops *rx_ops)
269 {
270 	wifi_pos_register_rx_ops(rx_ops);
271 }
272 #else
273 static void wlan_lmac_if_umac_rx_ops_register_wifi_pos(
274 				struct wlan_lmac_if_rx_ops *rx_ops)
275 {
276 }
277 #endif /* WIFI_POS_CONVERGED */
278 
279 static void wlan_lmac_if_umac_reg_rx_ops_register(
280 	struct wlan_lmac_if_rx_ops *rx_ops)
281 {
282 	rx_ops->reg_rx_ops.master_list_handler =
283 		tgt_reg_process_master_chan_list;
284 
285 	rx_ops->reg_rx_ops.reg_11d_new_cc_handler =
286 		tgt_reg_process_11d_new_country;
287 
288 	rx_ops->reg_rx_ops.reg_set_regdb_offloaded =
289 		tgt_reg_set_regdb_offloaded;
290 
291 	rx_ops->reg_rx_ops.reg_set_11d_offloaded =
292 		tgt_reg_set_11d_offloaded;
293 
294 	rx_ops->reg_rx_ops.reg_set_6ghz_supported =
295 		tgt_reg_set_6ghz_supported;
296 
297 	rx_ops->reg_rx_ops.get_dfs_region =
298 		wlan_reg_get_dfs_region;
299 
300 	rx_ops->reg_rx_ops.reg_ch_avoid_event_handler =
301 		tgt_reg_process_ch_avoid_event;
302 
303 	rx_ops->reg_rx_ops.reg_freq_to_chan =
304 		wlan_reg_freq_to_chan;
305 
306 	rx_ops->reg_rx_ops.reg_set_chan_144 =
307 		ucfg_reg_modify_chan_144;
308 
309 	rx_ops->reg_rx_ops.reg_get_chan_144 =
310 		ucfg_reg_get_en_chan_144;
311 
312 	rx_ops->reg_rx_ops.reg_program_default_cc =
313 		ucfg_reg_program_default_cc;
314 
315 	rx_ops->reg_rx_ops.reg_get_current_regdomain =
316 		wlan_reg_get_curr_regdomain;
317 
318 	rx_ops->reg_rx_ops.reg_enable_dfs_channels =
319 		ucfg_reg_enable_dfs_channels;
320 
321 	rx_ops->reg_rx_ops.reg_modify_pdev_chan_range =
322 		wlan_reg_modify_pdev_chan_range;
323 
324 	rx_ops->reg_rx_ops.reg_ignore_fw_reg_offload_ind =
325 		tgt_reg_ignore_fw_reg_offload_ind;
326 
327 	rx_ops->reg_rx_ops.reg_disable_chan_coex =
328 		wlan_reg_disable_chan_coex;
329 
330 	rx_ops->reg_rx_ops.reg_get_unii_5g_bitmap =
331 		ucfg_reg_get_unii_5g_bitmap;
332 }
333 
334 #ifdef CONVERGED_P2P_ENABLE
335 #ifdef FEATURE_P2P_LISTEN_OFFLOAD
336 static void wlan_lmac_if_umac_rx_ops_register_p2p(
337 				struct wlan_lmac_if_rx_ops *rx_ops)
338 {
339 	rx_ops->p2p.lo_ev_handler = tgt_p2p_lo_event_cb;
340 	rx_ops->p2p.noa_ev_handler = tgt_p2p_noa_event_cb;
341 	rx_ops->p2p.add_mac_addr_filter_evt_handler =
342 		tgt_p2p_add_mac_addr_status_event_cb;
343 }
344 #else
345 static void wlan_lmac_if_umac_rx_ops_register_p2p(
346 				struct wlan_lmac_if_rx_ops *rx_ops)
347 {
348 	rx_ops->p2p.noa_ev_handler = tgt_p2p_noa_event_cb;
349 	rx_ops->p2p.add_mac_addr_filter_evt_handler =
350 		tgt_p2p_add_mac_addr_status_event_cb;
351 }
352 #endif
353 #else
354 static void wlan_lmac_if_umac_rx_ops_register_p2p(
355 				struct wlan_lmac_if_rx_ops *rx_ops)
356 {
357 }
358 #endif
359 
360 /*
361  * register_precac_auto_chan_rx_ops_ieee() - Register auto chan switch rx ops
362  * for IEEE channel based APIs.
363  * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops
364  */
365 #ifdef DFS_COMPONENT_ENABLE
366 #if defined(WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT) && defined(CONFIG_CHAN_NUM_API)
367 static inline void
368 register_precac_auto_chan_rx_ops_ieee(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
369 {
370 	if (!rx_ops)
371 		return;
372 	rx_ops->dfs_get_precac_chan_state = ucfg_dfs_get_precac_chan_state;
373 }
374 #else
375 static inline void
376 register_precac_auto_chan_rx_ops_ieee(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
377 {
378 }
379 #endif
380 #endif
381 
382 /*
383  * register_precac_auto_chan_rx_ops_freq() - Register auto chan switch rx ops
384  * for frequency based channel APIs.
385  * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops
386  */
387 #ifdef DFS_COMPONENT_ENABLE
388 #if defined(WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT) && defined(CONFIG_CHAN_FREQ_API)
389 static inline void
390 register_precac_auto_chan_rx_ops_freq(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
391 {
392 	if (!rx_ops)
393 		return;
394 	rx_ops->dfs_get_precac_chan_state_for_freq =
395 		ucfg_dfs_get_precac_chan_state_for_freq;
396 }
397 #else
398 static inline void
399 register_precac_auto_chan_rx_ops_freq(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
400 {
401 }
402 #endif
403 #endif
404 
405 #ifdef DFS_COMPONENT_ENABLE
406 #ifdef WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT
407 static inline void
408 register_precac_auto_chan_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
409 {
410 	if (!rx_ops)
411 		return;
412 	rx_ops->dfs_set_precac_intermediate_chan =
413 		ucfg_dfs_set_precac_intermediate_chan;
414 	rx_ops->dfs_get_precac_intermediate_chan =
415 		ucfg_dfs_get_precac_intermediate_chan;
416 }
417 #else
418 static inline void
419 register_precac_auto_chan_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
420 {
421 }
422 #endif
423 
424 /*
425  * register_dfs_rx_ops_for_freq() - Register DFS rx ops for frequency based
426  * channel APIs.
427  * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops.
428  */
429 #ifdef CONFIG_CHAN_FREQ_API
430 static void register_dfs_rx_ops_for_freq(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
431 {
432 	if (!rx_ops)
433 		return;
434 	rx_ops->dfs_find_vht80_chan_for_precac_for_freq =
435 		tgt_dfs_find_vht80_precac_chan_freq;
436 	rx_ops->dfs_set_current_channel_for_freq =
437 		tgt_dfs_set_current_channel_for_freq;
438 }
439 #endif
440 
441 /*
442  * register_dfs_rx_ops_for_ieee() - Register DFS rx ops for IEEE channel based
443  * APIs
444  * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops.
445  */
446 
447 #ifdef CONFIG_CHAN_NUM_API
448 static void register_dfs_rx_ops_for_ieee(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
449 {
450 	if (!rx_ops)
451 		return;
452 	rx_ops->dfs_find_vht80_chan_for_precac =
453 		tgt_dfs_find_vht80_chan_for_precac;
454 	rx_ops->dfs_set_current_channel =
455 		tgt_dfs_set_current_channel;
456 }
457 #endif
458 
459 static QDF_STATUS
460 wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
461 {
462 	struct wlan_lmac_if_dfs_rx_ops *dfs_rx_ops;
463 
464 	dfs_rx_ops = &rx_ops->dfs_rx_ops;
465 
466 	dfs_rx_ops->dfs_get_radars = tgt_dfs_get_radars;
467 	dfs_rx_ops->dfs_process_phyerr = tgt_dfs_process_phyerr;
468 	dfs_rx_ops->dfs_destroy_object = tgt_dfs_destroy_object;
469 	dfs_rx_ops->dfs_radar_enable = tgt_dfs_radar_enable;
470 	dfs_rx_ops->dfs_is_radar_enabled = tgt_dfs_is_radar_enabled;
471 	dfs_rx_ops->dfs_control = tgt_dfs_control;
472 	dfs_rx_ops->dfs_is_precac_timer_running =
473 		tgt_dfs_is_precac_timer_running;
474 	dfs_rx_ops->dfs_agile_precac_start =
475 		tgt_dfs_agile_precac_start;
476 	dfs_rx_ops->dfs_set_agile_precac_state =
477 		tgt_dfs_set_agile_precac_state;
478 	dfs_rx_ops->dfs_start_precac_timer = utils_dfs_start_precac_timer;
479 	dfs_rx_ops->dfs_cancel_precac_timer = utils_dfs_cancel_precac_timer;
480 	dfs_rx_ops->dfs_reset_adfs_config = ucfg_dfs_reset_agile_config;
481 	dfs_rx_ops->dfs_override_precac_timeout =
482 		ucfg_dfs_override_precac_timeout;
483 	dfs_rx_ops->dfs_set_precac_enable = ucfg_dfs_set_precac_enable;
484 	dfs_rx_ops->dfs_get_legacy_precac_enable =
485 		ucfg_dfs_get_legacy_precac_enable;
486 	dfs_rx_ops->dfs_get_agile_precac_enable =
487 		ucfg_dfs_get_agile_precac_enable;
488 	dfs_rx_ops->dfs_get_override_precac_timeout =
489 		ucfg_dfs_get_override_precac_timeout;
490 	dfs_rx_ops->dfs_process_radar_ind = tgt_dfs_process_radar_ind;
491 	dfs_rx_ops->dfs_dfs_cac_complete_ind = tgt_dfs_cac_complete;
492 	dfs_rx_ops->dfs_dfs_ocac_complete_ind = tgt_dfs_ocac_complete;
493 	dfs_rx_ops->dfs_stop = tgt_dfs_stop;
494 	dfs_rx_ops->dfs_reinit_timers = ucfg_dfs_reinit_timers;
495 	dfs_rx_ops->dfs_enable_stadfs = tgt_dfs_enable_stadfs;
496 	dfs_rx_ops->dfs_is_stadfs_enabled = tgt_dfs_is_stadfs_enabled;
497 	dfs_rx_ops->dfs_process_phyerr_filter_offload =
498 		tgt_dfs_process_phyerr_filter_offload;
499 	dfs_rx_ops->dfs_is_phyerr_filter_offload =
500 		tgt_dfs_is_phyerr_filter_offload;
501 	dfs_rx_ops->dfs_action_on_status = tgt_dfs_action_on_status_from_fw;
502 	dfs_rx_ops->dfs_override_status_timeout =
503 		ucfg_dfs_set_override_status_timeout;
504 	dfs_rx_ops->dfs_get_override_status_timeout =
505 		ucfg_dfs_get_override_status_timeout;
506 	dfs_rx_ops->dfs_reset_spoof_test =
507 		tgt_dfs_reset_spoof_test;
508 	dfs_rx_ops->dfs_is_disable_radar_marking_set =
509 		utils_dfs_get_disable_radar_marking;
510 	dfs_rx_ops->dfs_set_nol_subchannel_marking =
511 		ucfg_dfs_set_nol_subchannel_marking;
512 	dfs_rx_ops->dfs_get_nol_subchannel_marking =
513 		ucfg_dfs_get_nol_subchannel_marking;
514 	dfs_rx_ops->dfs_set_bw_reduction =
515 		utils_dfs_bw_reduce;
516 	dfs_rx_ops->dfs_is_bw_reduction_needed =
517 		utils_dfs_is_bw_reduce;
518 	dfs_rx_ops->dfs_allow_hw_pulses =
519 		ucfg_dfs_allow_hw_pulses;
520 	dfs_rx_ops->dfs_is_hw_pulses_allowed =
521 		ucfg_dfs_is_hw_pulses_allowed;
522 	dfs_rx_ops->dfs_set_fw_adfs_support =
523 		tgt_dfs_set_fw_adfs_support;
524 	dfs_rx_ops->dfs_reset_dfs_prevchan =
525 		utils_dfs_reset_dfs_prevchan;
526 	dfs_rx_ops->dfs_init_tmp_psoc_nol =
527 		tgt_dfs_init_tmp_psoc_nol;
528 	dfs_rx_ops->dfs_deinit_tmp_psoc_nol =
529 		tgt_dfs_deinit_tmp_psoc_nol;
530 	dfs_rx_ops->dfs_save_dfs_nol_in_psoc =
531 		tgt_dfs_save_dfs_nol_in_psoc;
532 	dfs_rx_ops->dfs_reinit_nol_from_psoc_copy =
533 		tgt_dfs_reinit_nol_from_psoc_copy;
534 	dfs_rx_ops->dfs_reinit_precac_lists =
535 		tgt_dfs_reinit_precac_lists;
536 	dfs_rx_ops->dfs_complete_deferred_tasks =
537 		tgt_dfs_complete_deferred_tasks;
538 	register_precac_auto_chan_rx_ops(dfs_rx_ops);
539 	register_precac_auto_chan_rx_ops_ieee(dfs_rx_ops);
540 	register_precac_auto_chan_rx_ops_freq(dfs_rx_ops);
541 	register_dfs_rx_ops_for_freq(dfs_rx_ops);
542 	register_dfs_rx_ops_for_ieee(dfs_rx_ops);
543 
544 	return QDF_STATUS_SUCCESS;
545 }
546 #else
547 static QDF_STATUS
548 wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
549 {
550 	return QDF_STATUS_SUCCESS;
551 }
552 #endif
553 
554 #ifdef FEATURE_WLAN_TDLS
555 static QDF_STATUS
556 wlan_lmac_if_umac_tdls_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
557 {
558 	rx_ops->tdls_rx_ops.tdls_ev_handler = tgt_tdls_event_handler;
559 
560 	return QDF_STATUS_SUCCESS;
561 }
562 #else
563 static QDF_STATUS
564 wlan_lmac_if_umac_tdls_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
565 {
566 	return QDF_STATUS_SUCCESS;
567 }
568 #endif
569 
570 #ifdef WLAN_SUPPORT_GREEN_AP
571 static QDF_STATUS
572 wlan_lmac_if_umac_green_ap_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
573 {
574 	rx_ops->green_ap_rx_ops.is_ps_enabled = wlan_green_ap_is_ps_enabled;
575 	rx_ops->green_ap_rx_ops.is_dbg_print_enabled =
576 					ucfg_green_ap_get_debug_prints;
577 	rx_ops->green_ap_rx_ops.ps_set = ucfg_green_ap_set_ps_config;
578 	rx_ops->green_ap_rx_ops.ps_get = ucfg_green_ap_get_ps_config;
579 	rx_ops->green_ap_rx_ops.suspend_handle = wlan_green_ap_suspend_handle;
580 
581 	return QDF_STATUS_SUCCESS;
582 }
583 #else
584 static QDF_STATUS
585 wlan_lmac_if_umac_green_ap_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
586 {
587 	return QDF_STATUS_SUCCESS;
588 }
589 #endif
590 
591 #ifdef QCA_WIFI_FTM
592 static QDF_STATUS
593 wlan_lmac_if_umac_ftm_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
594 {
595 	struct wlan_lmac_if_ftm_rx_ops *ftm_rx_ops;
596 
597 	ftm_rx_ops = &rx_ops->ftm_rx_ops;
598 
599 	ftm_rx_ops->ftm_ev_handler = wlan_ftm_process_utf_event;
600 
601 	return QDF_STATUS_SUCCESS;
602 }
603 #else
604 static QDF_STATUS
605 wlan_lmac_if_umac_ftm_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
606 {
607 	return QDF_STATUS_SUCCESS;
608 }
609 #endif
610 /**
611  * wlan_lmac_if_umac_rx_ops_register() - UMAC rx handler register
612  * @rx_ops: Pointer to rx_ops structure to be populated
613  *
614  * Register umac RX callabacks which will be called by DA/OL/WMA/WMI
615  *
616  * Return: QDF_STATUS_SUCCESS - in case of success
617  */
618 QDF_STATUS
619 wlan_lmac_if_umac_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
620 {
621 	/* Component specific public api's to be called to register
622 	 * respective callbacks
623 	 * Ex: rx_ops->fp = function;
624 	 */
625 	struct wlan_lmac_if_mgmt_txrx_rx_ops *mgmt_txrx_rx_ops;
626 
627 	if (!rx_ops) {
628 		qdf_print("%s: lmac if rx ops pointer is NULL", __func__);
629 		return QDF_STATUS_E_INVAL;
630 	}
631 
632 	/* mgmt txrx rx ops */
633 	mgmt_txrx_rx_ops = &rx_ops->mgmt_txrx_rx_ops;
634 
635 	mgmt_txrx_rx_ops->mgmt_tx_completion_handler =
636 			tgt_mgmt_txrx_tx_completion_handler;
637 	mgmt_txrx_rx_ops->mgmt_rx_frame_handler =
638 			tgt_mgmt_txrx_rx_frame_handler;
639 	mgmt_txrx_rx_ops->mgmt_txrx_get_nbuf_from_desc_id =
640 			tgt_mgmt_txrx_get_nbuf_from_desc_id;
641 	mgmt_txrx_rx_ops->mgmt_txrx_get_peer_from_desc_id =
642 			tgt_mgmt_txrx_get_peer_from_desc_id;
643 	mgmt_txrx_rx_ops->mgmt_txrx_get_vdev_id_from_desc_id =
644 			tgt_mgmt_txrx_get_vdev_id_from_desc_id;
645 	mgmt_txrx_rx_ops->mgmt_txrx_get_free_desc_pool_count =
646 			tgt_mgmt_txrx_get_free_desc_pool_count;
647 
648 	/* scan rx ops */
649 	rx_ops->scan.scan_ev_handler = tgt_scan_event_handler;
650 	rx_ops->scan.scan_set_max_active_scans = tgt_scan_set_max_active_scans;
651 
652 	wlan_lmac_if_atf_rx_ops_register(rx_ops);
653 
654 	wlan_lmac_if_cp_stats_rx_ops_register(rx_ops);
655 
656 	wlan_lmac_if_sa_api_rx_ops_register(rx_ops);
657 
658 	wlan_lmac_if_cfr_rx_ops_register(rx_ops);
659 
660 	wlan_lmac_if_crypto_rx_ops_register(rx_ops);
661 	/* wifi_pos rx ops */
662 	wlan_lmac_if_umac_rx_ops_register_wifi_pos(rx_ops);
663 
664 	/* tdls rx ops */
665 	wlan_lmac_if_umac_tdls_rx_ops_register(rx_ops);
666 
667 	wlan_lmac_if_umac_reg_rx_ops_register(rx_ops);
668 
669 	/* p2p rx ops */
670 	wlan_lmac_if_umac_rx_ops_register_p2p(rx_ops);
671 
672 	/* DFS rx_ops */
673 	wlan_lmac_if_umac_dfs_rx_ops_register(rx_ops);
674 
675 	wlan_lmac_if_umac_green_ap_rx_ops_register(rx_ops);
676 
677 	/* FTM rx_ops */
678 	wlan_lmac_if_umac_ftm_rx_ops_register(rx_ops);
679 
680 	/* FILS Discovery */
681 	wlan_lmac_if_fd_rx_ops_register(rx_ops);
682 
683 	/* MLME rx_ops */
684 	tgt_vdev_mgr_rx_ops_register(rx_ops);
685 
686 	return QDF_STATUS_SUCCESS;
687 }
688 
689 /**
690  * wlan_lmac_if_set_umac_txops_registration_cb() - tx registration
691  * callback assignment
692  * @dev_type: Dev type can be either Direct attach or Offload
693  * @handler: handler to be called for LMAC tx ops registration
694  *
695  * API to assign appropriate tx registration callback handler based on the
696  * device type(Offload or Direct attach)
697  *
698  * Return: QDF_STATUS_SUCCESS - in case of success
699  */
700 QDF_STATUS wlan_lmac_if_set_umac_txops_registration_cb(QDF_STATUS (*handler)
701 				(struct wlan_lmac_if_tx_ops *))
702 {
703 	wlan_lmac_if_umac_tx_ops_register = handler;
704 	return QDF_STATUS_SUCCESS;
705 }
706 qdf_export_symbol(wlan_lmac_if_set_umac_txops_registration_cb);
707 
708