xref: /wlan-dirver/qca-wifi-host-cmn/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c (revision 11f5a63a6cbdda84849a730de22f0a71e635d58c)
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 #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.get_dfs_region =
295 		wlan_reg_get_dfs_region;
296 
297 	rx_ops->reg_rx_ops.reg_ch_avoid_event_handler =
298 		tgt_reg_process_ch_avoid_event;
299 
300 	rx_ops->reg_rx_ops.reg_freq_to_chan =
301 		wlan_reg_freq_to_chan;
302 
303 	rx_ops->reg_rx_ops.reg_set_chan_144 =
304 		ucfg_reg_modify_chan_144;
305 
306 	rx_ops->reg_rx_ops.reg_get_chan_144 =
307 		ucfg_reg_get_en_chan_144;
308 
309 	rx_ops->reg_rx_ops.reg_program_default_cc =
310 		ucfg_reg_program_default_cc;
311 
312 	rx_ops->reg_rx_ops.reg_get_current_regdomain =
313 		wlan_reg_get_curr_regdomain;
314 
315 	rx_ops->reg_rx_ops.reg_enable_dfs_channels =
316 		ucfg_reg_enable_dfs_channels;
317 
318 	rx_ops->reg_rx_ops.reg_modify_pdev_chan_range =
319 		wlan_reg_modify_pdev_chan_range;
320 
321 	rx_ops->reg_rx_ops.reg_ignore_fw_reg_offload_ind =
322 		tgt_reg_ignore_fw_reg_offload_ind;
323 }
324 
325 #ifdef CONVERGED_P2P_ENABLE
326 #ifdef FEATURE_P2P_LISTEN_OFFLOAD
327 static void wlan_lmac_if_umac_rx_ops_register_p2p(
328 				struct wlan_lmac_if_rx_ops *rx_ops)
329 {
330 	rx_ops->p2p.lo_ev_handler = tgt_p2p_lo_event_cb;
331 	rx_ops->p2p.noa_ev_handler = tgt_p2p_noa_event_cb;
332 	rx_ops->p2p.add_mac_addr_filter_evt_handler =
333 		tgt_p2p_add_mac_addr_status_event_cb;
334 }
335 #else
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.noa_ev_handler = tgt_p2p_noa_event_cb;
340 	rx_ops->p2p.add_mac_addr_filter_evt_handler =
341 		tgt_p2p_add_mac_addr_status_event_cb;
342 }
343 #endif
344 #else
345 static void wlan_lmac_if_umac_rx_ops_register_p2p(
346 				struct wlan_lmac_if_rx_ops *rx_ops)
347 {
348 }
349 #endif
350 
351 /*
352  * register_precac_auto_chan_rx_ops_ieee() - Register auto chan switch rx ops
353  * for IEEE channel based APIs.
354  * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops
355  */
356 #ifdef DFS_COMPONENT_ENABLE
357 #if defined(WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT) && defined(CONFIG_CHAN_NUM_API)
358 static inline void
359 register_precac_auto_chan_rx_ops_ieee(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
360 {
361 	if (!rx_ops)
362 		return;
363 	rx_ops->dfs_get_precac_chan_state = ucfg_dfs_get_precac_chan_state;
364 }
365 #else
366 static inline void
367 register_precac_auto_chan_rx_ops_ieee(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
368 {
369 }
370 #endif
371 #endif
372 
373 /*
374  * register_precac_auto_chan_rx_ops_freq() - Register auto chan switch rx ops
375  * for frequency based channel APIs.
376  * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops
377  */
378 #ifdef DFS_COMPONENT_ENABLE
379 #if defined(WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT) && defined(CONFIG_CHAN_FREQ_API)
380 static inline void
381 register_precac_auto_chan_rx_ops_freq(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
382 {
383 	if (!rx_ops)
384 		return;
385 	rx_ops->dfs_get_precac_chan_state_for_freq =
386 		ucfg_dfs_get_precac_chan_state_for_freq;
387 }
388 #else
389 static inline void
390 register_precac_auto_chan_rx_ops_freq(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
391 {
392 }
393 #endif
394 #endif
395 
396 #ifdef DFS_COMPONENT_ENABLE
397 #ifdef WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT
398 static inline void
399 register_precac_auto_chan_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
400 {
401 	if (!rx_ops)
402 		return;
403 	rx_ops->dfs_set_precac_intermediate_chan =
404 		ucfg_dfs_set_precac_intermediate_chan;
405 	rx_ops->dfs_get_precac_intermediate_chan =
406 		ucfg_dfs_get_precac_intermediate_chan;
407 }
408 #else
409 static inline void
410 register_precac_auto_chan_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
411 {
412 }
413 #endif
414 
415 /*
416  * register_dfs_rx_ops_for_freq() - Register DFS rx ops for frequency based
417  * channel APIs.
418  * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops.
419  */
420 #ifdef CONFIG_CHAN_FREQ_API
421 static void register_dfs_rx_ops_for_freq(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
422 {
423 	if (!rx_ops)
424 		return;
425 	rx_ops->dfs_find_vht80_chan_for_precac_for_freq =
426 		tgt_dfs_find_vht80_precac_chan_freq;
427 	rx_ops->dfs_set_current_channel_for_freq =
428 		tgt_dfs_set_current_channel_for_freq;
429 }
430 #endif
431 
432 /*
433  * register_dfs_rx_ops_for_ieee() - Register DFS rx ops for IEEE channel based
434  * APIs
435  * rx_ops: Pointer to wlan_lmac_if_dfs_rx_ops.
436  */
437 
438 #ifdef CONFIG_CHAN_NUM_API
439 static void register_dfs_rx_ops_for_ieee(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
440 {
441 	if (!rx_ops)
442 		return;
443 	rx_ops->dfs_find_vht80_chan_for_precac =
444 		tgt_dfs_find_vht80_chan_for_precac;
445 	rx_ops->dfs_set_current_channel =
446 		tgt_dfs_set_current_channel;
447 }
448 #endif
449 
450 static QDF_STATUS
451 wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
452 {
453 	struct wlan_lmac_if_dfs_rx_ops *dfs_rx_ops;
454 
455 	dfs_rx_ops = &rx_ops->dfs_rx_ops;
456 
457 	dfs_rx_ops->dfs_get_radars = tgt_dfs_get_radars;
458 	dfs_rx_ops->dfs_process_phyerr = tgt_dfs_process_phyerr;
459 	dfs_rx_ops->dfs_destroy_object = tgt_dfs_destroy_object;
460 	dfs_rx_ops->dfs_radar_enable = tgt_dfs_radar_enable;
461 	dfs_rx_ops->dfs_is_radar_enabled = tgt_dfs_is_radar_enabled;
462 	dfs_rx_ops->dfs_control = tgt_dfs_control;
463 	dfs_rx_ops->dfs_is_precac_timer_running =
464 		tgt_dfs_is_precac_timer_running;
465 	dfs_rx_ops->dfs_agile_precac_start =
466 		tgt_dfs_agile_precac_start;
467 	dfs_rx_ops->dfs_set_agile_precac_state =
468 		tgt_dfs_set_agile_precac_state;
469 	dfs_rx_ops->dfs_start_precac_timer = utils_dfs_start_precac_timer;
470 	dfs_rx_ops->dfs_cancel_precac_timer = utils_dfs_cancel_precac_timer;
471 	dfs_rx_ops->dfs_reset_adfs_config = ucfg_dfs_reset_agile_config;
472 	dfs_rx_ops->dfs_override_precac_timeout =
473 		ucfg_dfs_override_precac_timeout;
474 	dfs_rx_ops->dfs_set_precac_enable = ucfg_dfs_set_precac_enable;
475 	dfs_rx_ops->dfs_get_legacy_precac_enable =
476 		ucfg_dfs_get_legacy_precac_enable;
477 	dfs_rx_ops->dfs_get_agile_precac_enable =
478 		ucfg_dfs_get_agile_precac_enable;
479 	dfs_rx_ops->dfs_get_override_precac_timeout =
480 		ucfg_dfs_get_override_precac_timeout;
481 	dfs_rx_ops->dfs_process_radar_ind = tgt_dfs_process_radar_ind;
482 	dfs_rx_ops->dfs_dfs_cac_complete_ind = tgt_dfs_cac_complete;
483 	dfs_rx_ops->dfs_dfs_ocac_complete_ind = tgt_dfs_ocac_complete;
484 	dfs_rx_ops->dfs_stop = tgt_dfs_stop;
485 	dfs_rx_ops->dfs_reinit_timers = ucfg_dfs_reinit_timers;
486 	dfs_rx_ops->dfs_enable_stadfs = tgt_dfs_enable_stadfs;
487 	dfs_rx_ops->dfs_is_stadfs_enabled = tgt_dfs_is_stadfs_enabled;
488 	dfs_rx_ops->dfs_process_phyerr_filter_offload =
489 		tgt_dfs_process_phyerr_filter_offload;
490 	dfs_rx_ops->dfs_is_phyerr_filter_offload =
491 		tgt_dfs_is_phyerr_filter_offload;
492 	dfs_rx_ops->dfs_action_on_status = tgt_dfs_action_on_status_from_fw;
493 	dfs_rx_ops->dfs_override_status_timeout =
494 		ucfg_dfs_set_override_status_timeout;
495 	dfs_rx_ops->dfs_get_override_status_timeout =
496 		ucfg_dfs_get_override_status_timeout;
497 	dfs_rx_ops->dfs_reset_spoof_test =
498 		tgt_dfs_reset_spoof_test;
499 	dfs_rx_ops->dfs_is_disable_radar_marking_set =
500 		utils_dfs_get_disable_radar_marking;
501 	dfs_rx_ops->dfs_set_nol_subchannel_marking =
502 		ucfg_dfs_set_nol_subchannel_marking;
503 	dfs_rx_ops->dfs_get_nol_subchannel_marking =
504 		ucfg_dfs_get_nol_subchannel_marking;
505 	dfs_rx_ops->dfs_set_bw_reduction =
506 		utils_dfs_bw_reduce;
507 	dfs_rx_ops->dfs_is_bw_reduction_needed =
508 		utils_dfs_is_bw_reduce;
509 	dfs_rx_ops->dfs_allow_hw_pulses =
510 		ucfg_dfs_allow_hw_pulses;
511 	dfs_rx_ops->dfs_is_hw_pulses_allowed =
512 		ucfg_dfs_is_hw_pulses_allowed;
513 	dfs_rx_ops->dfs_set_fw_adfs_support =
514 		tgt_dfs_set_fw_adfs_support;
515 	dfs_rx_ops->dfs_reset_dfs_prevchan =
516 		utils_dfs_reset_dfs_prevchan;
517 
518 	register_precac_auto_chan_rx_ops(dfs_rx_ops);
519 	register_precac_auto_chan_rx_ops_ieee(dfs_rx_ops);
520 	register_precac_auto_chan_rx_ops_freq(dfs_rx_ops);
521 	register_dfs_rx_ops_for_freq(dfs_rx_ops);
522 	register_dfs_rx_ops_for_ieee(dfs_rx_ops);
523 
524 	return QDF_STATUS_SUCCESS;
525 }
526 #else
527 static QDF_STATUS
528 wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
529 {
530 	return QDF_STATUS_SUCCESS;
531 }
532 #endif
533 
534 #ifdef FEATURE_WLAN_TDLS
535 static QDF_STATUS
536 wlan_lmac_if_umac_tdls_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
537 {
538 	rx_ops->tdls_rx_ops.tdls_ev_handler = tgt_tdls_event_handler;
539 
540 	return QDF_STATUS_SUCCESS;
541 }
542 #else
543 static QDF_STATUS
544 wlan_lmac_if_umac_tdls_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
545 {
546 	return QDF_STATUS_SUCCESS;
547 }
548 #endif
549 
550 #ifdef WLAN_SUPPORT_GREEN_AP
551 static QDF_STATUS
552 wlan_lmac_if_umac_green_ap_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
553 {
554 	rx_ops->green_ap_rx_ops.is_ps_enabled = wlan_green_ap_is_ps_enabled;
555 	rx_ops->green_ap_rx_ops.is_dbg_print_enabled =
556 					ucfg_green_ap_get_debug_prints;
557 	rx_ops->green_ap_rx_ops.ps_set = ucfg_green_ap_set_ps_config;
558 	rx_ops->green_ap_rx_ops.ps_get = ucfg_green_ap_get_ps_config;
559 	rx_ops->green_ap_rx_ops.suspend_handle = wlan_green_ap_suspend_handle;
560 
561 	return QDF_STATUS_SUCCESS;
562 }
563 #else
564 static QDF_STATUS
565 wlan_lmac_if_umac_green_ap_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
566 {
567 	return QDF_STATUS_SUCCESS;
568 }
569 #endif
570 
571 #ifdef QCA_WIFI_FTM
572 static QDF_STATUS
573 wlan_lmac_if_umac_ftm_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
574 {
575 	struct wlan_lmac_if_ftm_rx_ops *ftm_rx_ops;
576 
577 	ftm_rx_ops = &rx_ops->ftm_rx_ops;
578 
579 	ftm_rx_ops->ftm_ev_handler = wlan_ftm_process_utf_event;
580 
581 	return QDF_STATUS_SUCCESS;
582 }
583 #else
584 static QDF_STATUS
585 wlan_lmac_if_umac_ftm_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
586 {
587 	return QDF_STATUS_SUCCESS;
588 }
589 #endif
590 /**
591  * wlan_lmac_if_umac_rx_ops_register() - UMAC rx handler register
592  * @rx_ops: Pointer to rx_ops structure to be populated
593  *
594  * Register umac RX callabacks which will be called by DA/OL/WMA/WMI
595  *
596  * Return: QDF_STATUS_SUCCESS - in case of success
597  */
598 QDF_STATUS
599 wlan_lmac_if_umac_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
600 {
601 	/* Component specific public api's to be called to register
602 	 * respective callbacks
603 	 * Ex: rx_ops->fp = function;
604 	 */
605 	struct wlan_lmac_if_mgmt_txrx_rx_ops *mgmt_txrx_rx_ops;
606 
607 	if (!rx_ops) {
608 		qdf_print("%s: lmac if rx ops pointer is NULL", __func__);
609 		return QDF_STATUS_E_INVAL;
610 	}
611 
612 	/* mgmt txrx rx ops */
613 	mgmt_txrx_rx_ops = &rx_ops->mgmt_txrx_rx_ops;
614 
615 	mgmt_txrx_rx_ops->mgmt_tx_completion_handler =
616 			tgt_mgmt_txrx_tx_completion_handler;
617 	mgmt_txrx_rx_ops->mgmt_rx_frame_handler =
618 			tgt_mgmt_txrx_rx_frame_handler;
619 	mgmt_txrx_rx_ops->mgmt_txrx_get_nbuf_from_desc_id =
620 			tgt_mgmt_txrx_get_nbuf_from_desc_id;
621 	mgmt_txrx_rx_ops->mgmt_txrx_get_peer_from_desc_id =
622 			tgt_mgmt_txrx_get_peer_from_desc_id;
623 	mgmt_txrx_rx_ops->mgmt_txrx_get_vdev_id_from_desc_id =
624 			tgt_mgmt_txrx_get_vdev_id_from_desc_id;
625 	mgmt_txrx_rx_ops->mgmt_txrx_get_free_desc_pool_count =
626 			tgt_mgmt_txrx_get_free_desc_pool_count;
627 
628 	/* scan rx ops */
629 	rx_ops->scan.scan_ev_handler = tgt_scan_event_handler;
630 	rx_ops->scan.scan_set_max_active_scans = tgt_scan_set_max_active_scans;
631 
632 	wlan_lmac_if_atf_rx_ops_register(rx_ops);
633 
634 	wlan_lmac_if_cp_stats_rx_ops_register(rx_ops);
635 
636 	wlan_lmac_if_sa_api_rx_ops_register(rx_ops);
637 
638 	wlan_lmac_if_cfr_rx_ops_register(rx_ops);
639 
640 	wlan_lmac_if_crypto_rx_ops_register(rx_ops);
641 	/* wifi_pos rx ops */
642 	wlan_lmac_if_umac_rx_ops_register_wifi_pos(rx_ops);
643 
644 	/* tdls rx ops */
645 	wlan_lmac_if_umac_tdls_rx_ops_register(rx_ops);
646 
647 	wlan_lmac_if_umac_reg_rx_ops_register(rx_ops);
648 
649 	/* p2p rx ops */
650 	wlan_lmac_if_umac_rx_ops_register_p2p(rx_ops);
651 
652 	/* DFS rx_ops */
653 	wlan_lmac_if_umac_dfs_rx_ops_register(rx_ops);
654 
655 	wlan_lmac_if_umac_green_ap_rx_ops_register(rx_ops);
656 
657 	/* FTM rx_ops */
658 	wlan_lmac_if_umac_ftm_rx_ops_register(rx_ops);
659 
660 	/* FILS Discovery */
661 	wlan_lmac_if_fd_rx_ops_register(rx_ops);
662 
663 	/* MLME rx_ops */
664 	tgt_vdev_mgr_rx_ops_register(rx_ops);
665 
666 	return QDF_STATUS_SUCCESS;
667 }
668 
669 /**
670  * wlan_lmac_if_set_umac_txops_registration_cb() - tx registration
671  * callback assignment
672  * @dev_type: Dev type can be either Direct attach or Offload
673  * @handler: handler to be called for LMAC tx ops registration
674  *
675  * API to assign appropriate tx registration callback handler based on the
676  * device type(Offload or Direct attach)
677  *
678  * Return: QDF_STATUS_SUCCESS - in case of success
679  */
680 QDF_STATUS wlan_lmac_if_set_umac_txops_registration_cb(QDF_STATUS (*handler)
681 				(struct wlan_lmac_if_tx_ops *))
682 {
683 	wlan_lmac_if_umac_tx_ops_register = handler;
684 	return QDF_STATUS_SUCCESS;
685 }
686 qdf_export_symbol(wlan_lmac_if_set_umac_txops_registration_cb);
687 
688