xref: /wlan-dirver/qca-wifi-host-cmn/init_deinit/dispatcher/src/dispatcher_init_deinit.c (revision 6ecd284e5a94a1c96e26d571dd47419ac305990d)
1 /*
2  * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #include <qdf_types.h>
20 #include <qdf_trace.h>
21 #include <qdf_threads.h>
22 #include <qdf_module.h>
23 #include <dispatcher_init_deinit.h>
24 #include <scheduler_api.h>
25 #include <wlan_scan_ucfg_api.h>
26 #include <wlan_ftm_init_deinit_api.h>
27 #include <wlan_mgmt_txrx_utils_api.h>
28 #include <wlan_serialization_api.h>
29 #ifdef WLAN_POLICY_MGR_ENABLE
30 #include "wlan_policy_mgr_api.h"
31 #endif
32 #ifdef WLAN_ATF_ENABLE
33 #include <wlan_atf_utils_api.h>
34 #endif
35 #ifdef QCA_SUPPORT_SON
36 #include <wlan_son_pub.h>
37 #endif
38 #ifdef WLAN_SA_API_ENABLE
39 #include <wlan_sa_api_utils_api.h>
40 #endif
41 #ifdef WIFI_POS_CONVERGED
42 #include "wifi_pos_api.h"
43 #endif /* WIFI_POS_CONVERGED */
44 #ifdef WLAN_FEATURE_NAN_CONVERGENCE
45 #include "wlan_nan_api.h"
46 #endif /* WLAN_FEATURE_NAN_CONVERGENCE */
47 #ifdef CONVERGED_P2P_ENABLE
48 #include <wlan_cfg80211_p2p.h>
49 #include <wlan_p2p_ucfg_api.h>
50 #endif
51 #include <wlan_reg_services_api.h>
52 #ifdef WLAN_CONV_CRYPTO_SUPPORTED
53 #include "wlan_crypto_main.h"
54 #endif
55 #ifdef DFS_COMPONENT_ENABLE
56 #include <wlan_dfs_init_deinit_api.h>
57 #endif
58 
59 #ifdef WLAN_OFFCHAN_TXRX_ENABLE
60 #include <wlan_offchan_txrx_api.h>
61 #endif
62 
63 #ifdef CONVERGED_TDLS_ENABLE
64 #include "wlan_tdls_ucfg_api.h"
65 #endif
66 
67 #ifdef WLAN_SUPPORT_SPLITMAC
68 #include <wlan_splitmac.h>
69 #endif
70 
71 #include <wlan_spectral_utils_api.h>
72 #ifdef WLAN_SUPPORT_FILS
73 #include <wlan_fd_utils_api.h>
74 #endif
75 
76 #ifdef WLAN_SUPPORT_GREEN_AP
77 #include <wlan_green_ap_api.h>
78 #endif
79 
80 /**
81  * DOC: This file provides various init/deinit trigger point for new
82  * components.
83  */
84 
85 /* All new components needs to replace their dummy init/deinit
86  * psoc_open, psco_close, psoc_enable and psoc_disable APIs once
87  * thier actual handlers are ready
88  */
89 
90 spectral_pdev_open_handler dispatcher_spectral_pdev_open_handler_cb;
91 
92 #ifdef CONVERGED_P2P_ENABLE
93 static QDF_STATUS p2p_init(void)
94 {
95 	return ucfg_p2p_init();
96 }
97 
98 static QDF_STATUS p2p_deinit(void)
99 {
100 	return ucfg_p2p_deinit();
101 }
102 
103 static QDF_STATUS p2p_psoc_open(struct wlan_objmgr_psoc *psoc)
104 {
105 	return ucfg_p2p_psoc_open(psoc);
106 }
107 
108 static QDF_STATUS p2p_psoc_close(struct wlan_objmgr_psoc *psoc)
109 {
110 	return ucfg_p2p_psoc_close(psoc);
111 }
112 
113 static QDF_STATUS p2p_psoc_enable(struct wlan_objmgr_psoc *psoc)
114 {
115 	return wlan_p2p_start(psoc);
116 }
117 
118 static QDF_STATUS p2p_psoc_disable(struct wlan_objmgr_psoc *psoc)
119 {
120 	return wlan_p2p_stop(psoc);
121 }
122 #else
123 static QDF_STATUS p2p_init(void)
124 {
125 	return QDF_STATUS_SUCCESS;
126 }
127 
128 static QDF_STATUS p2p_deinit(void)
129 {
130 	return QDF_STATUS_SUCCESS;
131 }
132 
133 static QDF_STATUS p2p_psoc_open(struct wlan_objmgr_psoc *psoc)
134 {
135 	return QDF_STATUS_SUCCESS;
136 }
137 
138 static QDF_STATUS p2p_psoc_close(struct wlan_objmgr_psoc *psoc)
139 {
140 	return QDF_STATUS_SUCCESS;
141 }
142 
143 static QDF_STATUS p2p_psoc_enable(struct wlan_objmgr_psoc *psoc)
144 {
145 	return QDF_STATUS_SUCCESS;
146 }
147 
148 static QDF_STATUS p2p_psoc_disable(struct wlan_objmgr_psoc *psoc)
149 {
150 	return QDF_STATUS_SUCCESS;
151 }
152 #endif /* END of CONVERGED_P2P_ENABLE */
153 
154 #ifdef CONVERGED_TDLS_ENABLE
155 static QDF_STATUS tdls_init(void)
156 {
157 	return ucfg_tdls_init();
158 }
159 
160 static QDF_STATUS tdls_deinit(void)
161 {
162 	return ucfg_tdls_deinit();
163 }
164 
165 static QDF_STATUS tdls_psoc_open(struct wlan_objmgr_psoc *psoc)
166 {
167 	return ucfg_tdls_psoc_open(psoc);
168 }
169 
170 static QDF_STATUS tdls_psoc_close(struct wlan_objmgr_psoc *psoc)
171 {
172 	return ucfg_tdls_psoc_close(psoc);
173 }
174 
175 static QDF_STATUS tdls_psoc_enable(struct wlan_objmgr_psoc *psoc)
176 {
177 	return ucfg_tdls_psoc_enable(psoc);
178 }
179 
180 static QDF_STATUS tdls_psoc_disable(struct wlan_objmgr_psoc *psoc)
181 {
182 	return ucfg_tdls_psoc_disable(psoc);
183 }
184 #else
185 static QDF_STATUS tdls_init(void)
186 {
187 	return QDF_STATUS_SUCCESS;
188 }
189 
190 static QDF_STATUS tdls_deinit(void)
191 {
192 	return QDF_STATUS_SUCCESS;
193 }
194 
195 static QDF_STATUS tdls_psoc_open(struct wlan_objmgr_psoc *psoc)
196 {
197 	return QDF_STATUS_SUCCESS;
198 }
199 
200 static QDF_STATUS tdls_psoc_close(struct wlan_objmgr_psoc *psoc)
201 {
202 	return QDF_STATUS_SUCCESS;
203 }
204 
205 static QDF_STATUS tdls_psoc_enable(struct wlan_objmgr_psoc *psoc)
206 {
207 	return QDF_STATUS_SUCCESS;
208 }
209 
210 
211 static QDF_STATUS tdls_psoc_disable(struct wlan_objmgr_psoc *psoc)
212 {
213 	return QDF_STATUS_SUCCESS;
214 }
215 #endif
216 
217 #if defined QCA_SUPPORT_SON && QCA_SUPPORT_SON >= 1
218 static QDF_STATUS dispatcher_init_son(void)
219 {
220 	return wlan_son_init();
221 }
222 static QDF_STATUS son_psoc_open(struct wlan_objmgr_psoc *psoc)
223 {
224 	return wlan_son_psoc_open(psoc);
225 }
226 static QDF_STATUS dispatcher_deinit_son(void)
227 {
228 	return wlan_son_deinit();
229 }
230 
231 static QDF_STATUS son_psoc_close(struct wlan_objmgr_psoc *psoc)
232 {
233 	return wlan_son_psoc_close(psoc);
234 }
235 #else
236 static QDF_STATUS dispatcher_init_son(void)
237 {
238 	return QDF_STATUS_SUCCESS;
239 }
240 
241 static QDF_STATUS dispatcher_deinit_son(void)
242 {
243 	return QDF_STATUS_SUCCESS;
244 }
245 
246 static QDF_STATUS son_psoc_open(struct wlan_objmgr_psoc *psoc)
247 {
248 	return QDF_STATUS_SUCCESS;
249 }
250 
251 static QDF_STATUS son_psoc_close(struct wlan_objmgr_psoc *psoc)
252 {
253 	return QDF_STATUS_SUCCESS;
254 }
255 
256 #endif /* END of QCA_SUPPORT_SON */
257 
258 static QDF_STATUS dispatcher_regulatory_init(void)
259 {
260 	return wlan_regulatory_init();
261 }
262 
263 static QDF_STATUS dispatcher_regulatory_deinit(void)
264 {
265 	return wlan_regulatory_deinit();
266 }
267 
268 static QDF_STATUS dispatcher_regulatory_psoc_open(struct wlan_objmgr_psoc
269 						  *psoc)
270 {
271 	return regulatory_psoc_open(psoc);
272 }
273 
274 static QDF_STATUS dispatcher_regulatory_psoc_close(struct wlan_objmgr_psoc
275 						   *psoc)
276 {
277 	return regulatory_psoc_close(psoc);
278 }
279 
280 static QDF_STATUS dispatcher_regulatory_pdev_open(struct wlan_objmgr_pdev
281 						  *pdev)
282 {
283 	return regulatory_pdev_open(pdev);
284 }
285 
286 #ifdef CONFIG_WIN
287 QDF_STATUS dispatcher_register_spectral_pdev_open_handler(
288 			spectral_pdev_open_handler handler)
289 {
290 	dispatcher_spectral_pdev_open_handler_cb = handler;
291 
292 	return QDF_STATUS_SUCCESS;
293 }
294 qdf_export_symbol(dispatcher_register_spectral_pdev_open_handler);
295 
296 static QDF_STATUS dispatcher_spectral_pdev_open(struct wlan_objmgr_pdev
297 						  *pdev)
298 {
299 	return dispatcher_spectral_pdev_open_handler_cb(pdev);
300 }
301 
302 static QDF_STATUS dispatcher_spectral_pdev_close(struct wlan_objmgr_pdev *pdev)
303 {
304 	return QDF_STATUS_SUCCESS;
305 }
306 #else
307 static QDF_STATUS dispatcher_spectral_pdev_open(struct wlan_objmgr_pdev
308 						  *pdev)
309 {
310 	return spectral_pdev_open(pdev);
311 }
312 
313 static QDF_STATUS dispatcher_spectral_pdev_close(struct wlan_objmgr_pdev *pdev)
314 {
315 	return QDF_STATUS_SUCCESS;
316 }
317 #endif
318 
319 static QDF_STATUS dispatcher_regulatory_pdev_close(struct wlan_objmgr_pdev
320 						  *pdev)
321 {
322 	return regulatory_pdev_close(pdev);
323 }
324 
325 #ifdef WLAN_POLICY_MGR_ENABLE
326 static QDF_STATUS dispatcher_policy_mgr_init(void)
327 {
328 	return policy_mgr_init();
329 }
330 
331 static QDF_STATUS dispatcher_policy_mgr_deinit(void)
332 {
333 	return policy_mgr_deinit();
334 }
335 
336 static QDF_STATUS dispatcher_policy_mgr_psoc_open(
337 	struct wlan_objmgr_psoc *psoc)
338 {
339 	return policy_mgr_psoc_open(psoc);
340 }
341 
342 static QDF_STATUS dispatcher_policy_mgr_psoc_close(
343 	struct wlan_objmgr_psoc *psoc)
344 {
345 	return policy_mgr_psoc_close(psoc);
346 }
347 
348 static QDF_STATUS dispatcher_policy_mgr_psoc_enable(
349 	struct wlan_objmgr_psoc *psoc)
350 {
351 	return policy_mgr_psoc_enable(psoc);
352 }
353 
354 static QDF_STATUS dispatcher_policy_mgr_psoc_disable(
355 	struct wlan_objmgr_psoc *psoc)
356 {
357 	return policy_mgr_psoc_disable(psoc);
358 }
359 #else
360 static QDF_STATUS dispatcher_policy_mgr_init(void)
361 {
362 	return QDF_STATUS_SUCCESS;
363 }
364 
365 static QDF_STATUS dispatcher_policy_mgr_deinit(void)
366 {
367 	return QDF_STATUS_SUCCESS;
368 }
369 
370 static QDF_STATUS dispatcher_policy_mgr_psoc_open(
371 	struct wlan_objmgr_psoc *psoc)
372 {
373 	return QDF_STATUS_SUCCESS;
374 }
375 
376 static QDF_STATUS dispatcher_policy_mgr_psoc_close(
377 	struct wlan_objmgr_psoc *psoc)
378 {
379 	return QDF_STATUS_SUCCESS;
380 }
381 
382 static QDF_STATUS dispatcher_policy_mgr_psoc_enable(
383 	struct wlan_objmgr_psoc *psoc)
384 {
385 	return QDF_STATUS_SUCCESS;
386 }
387 
388 static QDF_STATUS dispatcher_policy_mgr_psoc_disable(
389 	struct wlan_objmgr_psoc *psoc)
390 {
391 	return QDF_STATUS_SUCCESS;
392 }
393 #endif /* END of WLAN_POLICY_MGR_ENABLE */
394 
395 #ifdef WLAN_SA_API_ENABLE
396 static QDF_STATUS dispatcher_init_sa_api(void)
397 {
398 	return wlan_sa_api_init();
399 }
400 
401 static QDF_STATUS dispatcher_deinit_sa_api(void)
402 {
403 	return wlan_sa_api_deinit();
404 }
405 
406 static QDF_STATUS sa_api_psoc_enable(struct wlan_objmgr_psoc *psoc)
407 {
408 	return wlan_sa_api_enable(psoc);
409 }
410 
411 static QDF_STATUS sa_api_psoc_disable(struct wlan_objmgr_psoc *psoc)
412 {
413 	return wlan_sa_api_disable(psoc);
414 }
415 #else
416 static QDF_STATUS dispatcher_init_sa_api(void)
417 {
418 	return QDF_STATUS_SUCCESS;
419 }
420 
421 static QDF_STATUS dispatcher_deinit_sa_api(void)
422 {
423 	return QDF_STATUS_SUCCESS;
424 }
425 
426 static QDF_STATUS sa_api_psoc_enable(struct wlan_objmgr_psoc *psoc)
427 {
428 	return QDF_STATUS_SUCCESS;
429 }
430 
431 static QDF_STATUS sa_api_psoc_disable(struct wlan_objmgr_psoc *psoc)
432 {
433 	return QDF_STATUS_SUCCESS;
434 }
435 #endif /* END of WLAN_SA_API_ENABLE */
436 
437 
438 #ifdef WLAN_ATF_ENABLE
439 static QDF_STATUS dispatcher_init_atf(void)
440 {
441 	return wlan_atf_init();
442 }
443 
444 static QDF_STATUS dispatcher_deinit_atf(void)
445 {
446 	return wlan_atf_deinit();
447 }
448 
449 static QDF_STATUS atf_psoc_open(struct wlan_objmgr_psoc *psoc)
450 {
451 	return wlan_atf_open(psoc);
452 }
453 
454 static QDF_STATUS atf_psoc_close(struct wlan_objmgr_psoc *psoc)
455 {
456 	return wlan_atf_close(psoc);
457 }
458 
459 static QDF_STATUS atf_psoc_enable(struct wlan_objmgr_psoc *psoc)
460 {
461 	return wlan_atf_enable(psoc);
462 }
463 
464 static QDF_STATUS atf_psoc_disable(struct wlan_objmgr_psoc *psoc)
465 {
466 	return wlan_atf_disable(psoc);
467 }
468 #else
469 static QDF_STATUS dispatcher_init_atf(void)
470 {
471 	return QDF_STATUS_SUCCESS;
472 }
473 
474 static QDF_STATUS dispatcher_deinit_atf(void)
475 {
476 	return QDF_STATUS_SUCCESS;
477 }
478 
479 static QDF_STATUS atf_psoc_open(struct wlan_objmgr_psoc *psoc)
480 {
481 	return QDF_STATUS_SUCCESS;
482 }
483 
484 static QDF_STATUS atf_psoc_close(struct wlan_objmgr_psoc *psoc)
485 {
486 	return QDF_STATUS_SUCCESS;
487 }
488 
489 static QDF_STATUS atf_psoc_enable(struct wlan_objmgr_psoc *psoc)
490 {
491 	return QDF_STATUS_SUCCESS;
492 }
493 
494 static QDF_STATUS atf_psoc_disable(struct wlan_objmgr_psoc *psoc)
495 {
496 	return QDF_STATUS_SUCCESS;
497 }
498 #endif /* END of WLAN_ATF_ENABLE */
499 
500 #ifdef WLAN_CONV_CRYPTO_SUPPORTED
501 static QDF_STATUS dispatcher_init_crypto(void)
502 {
503 	return wlan_crypto_init();
504 }
505 
506 static QDF_STATUS dispatcher_deinit_crypto(void)
507 {
508 	return wlan_crypto_deinit();
509 }
510 #else
511 static QDF_STATUS dispatcher_init_crypto(void)
512 {
513 	return QDF_STATUS_SUCCESS;
514 }
515 
516 static QDF_STATUS dispatcher_deinit_crypto(void)
517 {
518 	return QDF_STATUS_SUCCESS;
519 }
520 #endif /* END of WLAN_CONV_CRYPTO_SUPPORTED */
521 
522 #ifdef WIFI_POS_CONVERGED
523 static QDF_STATUS dispatcher_init_wifi_pos(void)
524 {
525 	return wifi_pos_init();
526 }
527 
528 static QDF_STATUS dispatcher_deinit_wifi_pos(void)
529 {
530 	return wifi_pos_deinit();
531 }
532 
533 static QDF_STATUS dispatcher_wifi_pos_enable(struct wlan_objmgr_psoc *psoc)
534 {
535 	return wifi_pos_psoc_enable(psoc);
536 }
537 
538 static QDF_STATUS dispatcher_wifi_pos_disable(struct wlan_objmgr_psoc *psoc)
539 {
540 	return wifi_pos_psoc_disable(psoc);
541 }
542 #else
543 static QDF_STATUS dispatcher_init_wifi_pos(void)
544 {
545 	return QDF_STATUS_SUCCESS;
546 }
547 
548 static QDF_STATUS dispatcher_deinit_wifi_pos(void)
549 {
550 	return QDF_STATUS_SUCCESS;
551 }
552 
553 static QDF_STATUS dispatcher_wifi_pos_enable(struct wlan_objmgr_psoc *psoc)
554 {
555 	return QDF_STATUS_SUCCESS;
556 }
557 
558 static QDF_STATUS dispatcher_wifi_pos_disable(struct wlan_objmgr_psoc *psoc)
559 {
560 	return QDF_STATUS_SUCCESS;
561 }
562 #endif
563 
564 #ifdef WLAN_FEATURE_NAN_CONVERGENCE
565 static QDF_STATUS dispatcher_init_nan(void)
566 {
567 	return nan_init();
568 }
569 
570 static QDF_STATUS dispatcher_deinit_nan(void)
571 {
572 	return nan_deinit();
573 }
574 
575 static QDF_STATUS dispatcher_nan_psoc_enable(struct wlan_objmgr_psoc *psoc)
576 {
577 	return nan_psoc_enable(psoc);
578 }
579 
580 static QDF_STATUS dispatcher_nan_psoc_disable(struct wlan_objmgr_psoc *psoc)
581 {
582 	return nan_psoc_disable(psoc);
583 }
584 #else
585 static QDF_STATUS dispatcher_init_nan(void)
586 {
587 	return QDF_STATUS_SUCCESS;
588 }
589 
590 static QDF_STATUS dispatcher_deinit_nan(void)
591 {
592 	return QDF_STATUS_SUCCESS;
593 }
594 
595 static QDF_STATUS dispatcher_nan_psoc_enable(struct wlan_objmgr_psoc *psoc)
596 {
597 	return QDF_STATUS_SUCCESS;
598 }
599 
600 static QDF_STATUS dispatcher_nan_psoc_disable(struct wlan_objmgr_psoc *psoc)
601 {
602 	return QDF_STATUS_SUCCESS;
603 }
604 #endif
605 
606 #ifdef DFS_COMPONENT_ENABLE
607 static QDF_STATUS dispatcher_init_dfs(void)
608 {
609 	return dfs_init();
610 }
611 
612 static QDF_STATUS dispatcher_deinit_dfs(void)
613 {
614 	return dfs_deinit();
615 }
616 
617 static QDF_STATUS dispatcher_dfs_psoc_enable(struct wlan_objmgr_psoc *psoc)
618 {
619 	return wifi_dfs_psoc_enable(psoc);
620 }
621 
622 static QDF_STATUS dispatcher_dfs_psoc_disable(struct wlan_objmgr_psoc *psoc)
623 {
624 	return wifi_dfs_psoc_disable(psoc);
625 }
626 #else
627 static QDF_STATUS dispatcher_init_dfs(void)
628 {
629 	return QDF_STATUS_SUCCESS;
630 }
631 
632 static QDF_STATUS dispatcher_deinit_dfs(void)
633 {
634 	return QDF_STATUS_SUCCESS;
635 }
636 
637 static QDF_STATUS dispatcher_dfs_psoc_enable(struct wlan_objmgr_psoc *psoc)
638 {
639 	return QDF_STATUS_SUCCESS;
640 }
641 
642 static QDF_STATUS dispatcher_dfs_psoc_disable(struct wlan_objmgr_psoc *psoc)
643 {
644 	return QDF_STATUS_SUCCESS;
645 }
646 #endif
647 
648 #ifdef WLAN_OFFCHAN_TXRX_ENABLE
649 static QDF_STATUS dispatcher_offchan_txrx_init(void)
650 {
651 	return wlan_offchan_txrx_init();
652 }
653 
654 static QDF_STATUS dispatcher_offchan_txrx_deinit(void)
655 {
656 	return wlan_offchan_txrx_deinit();
657 }
658 #else
659 static QDF_STATUS dispatcher_offchan_txrx_init(void)
660 {
661 	return QDF_STATUS_SUCCESS;
662 }
663 
664 static QDF_STATUS dispatcher_offchan_txrx_deinit(void)
665 {
666 	return QDF_STATUS_SUCCESS;
667 }
668 #endif /*WLAN_OFFCHAN_TXRX_ENABLE*/
669 
670 #ifdef WLAN_SUPPORT_SPLITMAC
671 static QDF_STATUS dispatcher_splitmac_init(void)
672 {
673 	return wlan_splitmac_init();
674 }
675 
676 static QDF_STATUS dispatcher_splitmac_deinit(void)
677 {
678 	return wlan_splitmac_deinit();
679 }
680 #else
681 static QDF_STATUS dispatcher_splitmac_init(void)
682 {
683 	return QDF_STATUS_SUCCESS;
684 }
685 
686 static QDF_STATUS dispatcher_splitmac_deinit(void)
687 {
688 	return QDF_STATUS_SUCCESS;
689 }
690 #endif  /* WLAN_SUPPORT_SPLITMAC */
691 
692 #ifdef CONFIG_MCL
693 static QDF_STATUS dispatcher_spectral_init(void)
694 {
695 	return wlan_spectral_init();
696 }
697 
698 static QDF_STATUS dispatcher_spectral_deinit(void)
699 {
700 	return wlan_spectral_deinit();
701 }
702 #else
703 static QDF_STATUS dispatcher_spectral_init(void)
704 {
705 	return QDF_STATUS_SUCCESS;
706 }
707 
708 static QDF_STATUS dispatcher_spectral_deinit(void)
709 {
710 	return QDF_STATUS_SUCCESS;
711 }
712 #endif /*CONFIG_MCL*/
713 
714 #ifdef DIRECT_BUF_RX_ENABLE
715 static QDF_STATUS dispatcher_dbr_psoc_enable(struct wlan_objmgr_psoc *psoc)
716 {
717 	struct wlan_lmac_if_tx_ops *tx_ops;
718 
719 	tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
720 	if (tx_ops->dbr_tx_ops.direct_buf_rx_register_events)
721 		return tx_ops->dbr_tx_ops.direct_buf_rx_register_events(psoc);
722 
723 	return QDF_STATUS_SUCCESS;
724 }
725 
726 static QDF_STATUS dispatcher_dbr_psoc_disable(struct wlan_objmgr_psoc *psoc)
727 {
728 	struct wlan_lmac_if_tx_ops *tx_ops;
729 
730 	tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
731 	if (tx_ops->dbr_tx_ops.direct_buf_rx_unregister_events)
732 		return tx_ops->dbr_tx_ops.direct_buf_rx_unregister_events(psoc);
733 
734 	return QDF_STATUS_SUCCESS;
735 }
736 #else
737 static QDF_STATUS dispatcher_dbr_psoc_enable(struct wlan_objmgr_psoc *psoc)
738 {
739 	return QDF_STATUS_SUCCESS;
740 }
741 
742 static QDF_STATUS dispatcher_dbr_psoc_disable(struct wlan_objmgr_psoc *psoc)
743 {
744 	return QDF_STATUS_SUCCESS;
745 }
746 #endif /* DIRECT_BUF_RX_ENABLE */
747 
748 #ifdef WLAN_SUPPORT_GREEN_AP
749 static QDF_STATUS dispatcher_green_ap_init(void)
750 {
751 	return wlan_green_ap_init();
752 }
753 
754 static QDF_STATUS dispatcher_green_ap_deinit(void)
755 {
756 	return wlan_green_ap_deinit();
757 }
758 #else
759 static QDF_STATUS dispatcher_green_ap_init(void)
760 {
761 	return QDF_STATUS_SUCCESS;
762 }
763 
764 static QDF_STATUS dispatcher_green_ap_deinit(void)
765 {
766 	return QDF_STATUS_SUCCESS;
767 }
768 #endif
769 
770 #ifdef WLAN_SUPPORT_FILS
771 static QDF_STATUS dispatcher_fd_init(void)
772 {
773 	return wlan_fd_init();
774 }
775 
776 static QDF_STATUS dispatcher_fd_deinit(void)
777 {
778 	return wlan_fd_deinit();
779 }
780 
781 static QDF_STATUS fd_psoc_enable(struct wlan_objmgr_psoc *psoc)
782 {
783 	return wlan_fd_enable(psoc);
784 }
785 
786 static QDF_STATUS fd_psoc_disable(struct wlan_objmgr_psoc *psoc)
787 {
788 	return wlan_fd_disable(psoc);
789 }
790 #else
791 static QDF_STATUS dispatcher_fd_init(void)
792 {
793 	return QDF_STATUS_SUCCESS;
794 }
795 
796 static QDF_STATUS dispatcher_fd_deinit(void)
797 {
798 	return QDF_STATUS_SUCCESS;
799 }
800 
801 static QDF_STATUS fd_psoc_enable(struct wlan_objmgr_psoc *psoc)
802 {
803 	return QDF_STATUS_SUCCESS;
804 }
805 
806 static QDF_STATUS fd_psoc_disable(struct wlan_objmgr_psoc *psoc)
807 {
808 	return QDF_STATUS_SUCCESS;
809 }
810 #endif /* WLAN_SUPPORT_FILS */
811 
812 QDF_STATUS dispatcher_init(void)
813 {
814 	if (QDF_STATUS_SUCCESS != wlan_objmgr_global_obj_init())
815 		goto out;
816 
817 	if (QDF_STATUS_SUCCESS != wlan_mgmt_txrx_init())
818 		goto mgmt_txrx_init_fail;
819 
820 	if (QDF_STATUS_SUCCESS != ucfg_scan_init())
821 		goto ucfg_scan_init_fail;
822 
823 	if (QDF_STATUS_SUCCESS != p2p_init())
824 		goto p2p_init_fail;
825 
826 	if (QDF_STATUS_SUCCESS != tdls_init())
827 		goto tdls_init_fail;
828 
829 	if (QDF_STATUS_SUCCESS != wlan_serialization_init())
830 		goto serialization_init_fail;
831 
832 	if (QDF_STATUS_SUCCESS != dispatcher_init_crypto())
833 		goto crypto_init_fail;
834 
835 	if (QDF_STATUS_SUCCESS != dispatcher_policy_mgr_init())
836 		goto policy_mgr_init_fail;
837 
838 	if (QDF_STATUS_SUCCESS != dispatcher_init_atf())
839 		goto atf_init_fail;
840 
841 	if (QDF_STATUS_SUCCESS != dispatcher_init_sa_api())
842 		goto sa_api_init_fail;
843 
844 	if (QDF_STATUS_SUCCESS != dispatcher_init_wifi_pos())
845 		goto wifi_pos_init_fail;
846 
847 	if (QDF_STATUS_SUCCESS != dispatcher_init_nan())
848 		goto nan_init_fail;
849 
850 	if (QDF_STATUS_SUCCESS != dispatcher_init_dfs())
851 		goto dfs_init_fail;
852 
853 	if (QDF_STATUS_SUCCESS != dispatcher_regulatory_init())
854 		goto regulatory_init_fail;
855 
856 	if (QDF_STATUS_SUCCESS != dispatcher_offchan_txrx_init())
857 		goto offchan_init_fail;
858 
859 	if (QDF_STATUS_SUCCESS != dispatcher_init_son())
860 		goto son_init_fail;
861 
862 	if (QDF_STATUS_SUCCESS != dispatcher_splitmac_init())
863 		goto splitmac_init_fail;
864 
865 	if (QDF_STATUS_SUCCESS != dispatcher_spectral_init())
866 		goto spectral_init_fail;
867 
868 	if (QDF_STATUS_SUCCESS != dispatcher_fd_init())
869 		goto fd_init_fail;
870 
871 	if (QDF_STATUS_SUCCESS != dispatcher_green_ap_init())
872 		goto green_ap_init_fail;
873 
874 	if (QDF_STATUS_SUCCESS != dispatcher_ftm_init())
875 		goto ftm_init_fail;
876 
877 	/*
878 	 * scheduler INIT has to be the last as each component's
879 	 * initialization has to happen first and then at the end
880 	 * scheduler needs to start accepting the service.
881 	 */
882 	if (QDF_STATUS_SUCCESS != scheduler_init())
883 		goto scheduler_init_fail;
884 
885 	return QDF_STATUS_SUCCESS;
886 
887 scheduler_init_fail:
888 	dispatcher_ftm_deinit();
889 ftm_init_fail:
890 	dispatcher_green_ap_deinit();
891 green_ap_init_fail:
892 	dispatcher_fd_deinit();
893 fd_init_fail:
894 	dispatcher_spectral_deinit();
895 spectral_init_fail:
896 	dispatcher_splitmac_deinit();
897 splitmac_init_fail:
898 	dispatcher_deinit_son();
899 son_init_fail:
900 	dispatcher_offchan_txrx_deinit();
901 offchan_init_fail:
902 	dispatcher_regulatory_deinit();
903 regulatory_init_fail:
904 	dispatcher_deinit_dfs();
905 dfs_init_fail:
906 	dispatcher_deinit_nan();
907 nan_init_fail:
908 	dispatcher_deinit_wifi_pos();
909 wifi_pos_init_fail:
910 	dispatcher_deinit_sa_api();
911 sa_api_init_fail:
912 	dispatcher_deinit_atf();
913 atf_init_fail:
914 	dispatcher_policy_mgr_deinit();
915 policy_mgr_init_fail:
916 	dispatcher_deinit_crypto();
917 crypto_init_fail:
918 	wlan_serialization_deinit();
919 serialization_init_fail:
920 	tdls_deinit();
921 tdls_init_fail:
922 	p2p_deinit();
923 p2p_init_fail:
924 	ucfg_scan_deinit();
925 ucfg_scan_init_fail:
926 	wlan_mgmt_txrx_deinit();
927 mgmt_txrx_init_fail:
928 	wlan_objmgr_global_obj_deinit();
929 
930 out:
931 	return QDF_STATUS_E_FAILURE;
932 }
933 qdf_export_symbol(dispatcher_init);
934 
935 QDF_STATUS dispatcher_deinit(void)
936 {
937 	QDF_BUG(QDF_STATUS_SUCCESS == scheduler_deinit());
938 
939 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_ftm_deinit());
940 
941 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_green_ap_deinit());
942 
943 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_fd_deinit());
944 
945 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_spectral_deinit());
946 
947 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_splitmac_deinit());
948 
949 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_son());
950 
951 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_offchan_txrx_deinit());
952 
953 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_regulatory_deinit());
954 
955 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_dfs());
956 
957 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_nan());
958 
959 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_wifi_pos());
960 
961 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_sa_api());
962 
963 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_atf());
964 
965 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_policy_mgr_deinit());
966 
967 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_crypto());
968 
969 	QDF_BUG(QDF_STATUS_SUCCESS == wlan_serialization_deinit());
970 
971 	QDF_BUG(QDF_STATUS_SUCCESS == tdls_deinit());
972 
973 	QDF_BUG(QDF_STATUS_SUCCESS == p2p_deinit());
974 
975 	QDF_BUG(QDF_STATUS_SUCCESS == ucfg_scan_deinit());
976 
977 	QDF_BUG(QDF_STATUS_SUCCESS == wlan_mgmt_txrx_deinit());
978 
979 	QDF_BUG(QDF_STATUS_SUCCESS == wlan_objmgr_global_obj_deinit());
980 
981 	return QDF_STATUS_SUCCESS;
982 }
983 qdf_export_symbol(dispatcher_deinit);
984 
985 QDF_STATUS dispatcher_enable(void)
986 {
987 	QDF_STATUS status;
988 
989 	status = scheduler_enable();
990 
991 	return status;
992 }
993 qdf_export_symbol(dispatcher_enable);
994 
995 QDF_STATUS dispatcher_disable(void)
996 {
997 	QDF_BUG(QDF_IS_STATUS_SUCCESS(scheduler_disable()));
998 
999 	return QDF_STATUS_SUCCESS;
1000 }
1001 qdf_export_symbol(dispatcher_disable);
1002 
1003 QDF_STATUS dispatcher_psoc_open(struct wlan_objmgr_psoc *psoc)
1004 {
1005 	if (QDF_STATUS_SUCCESS != wlan_mgmt_txrx_psoc_open(psoc))
1006 		goto out;
1007 
1008 	if (QDF_STATUS_SUCCESS != ucfg_scan_psoc_open(psoc))
1009 		goto scan_psoc_open_fail;
1010 
1011 	if (QDF_STATUS_SUCCESS != p2p_psoc_open(psoc))
1012 		goto p2p_psoc_open_fail;
1013 
1014 	if (QDF_STATUS_SUCCESS != tdls_psoc_open(psoc))
1015 		goto tdls_psoc_open_fail;
1016 
1017 	if (QDF_STATUS_SUCCESS != wlan_serialization_psoc_open(psoc))
1018 		goto serialization_psoc_open_fail;
1019 
1020 	if (QDF_STATUS_SUCCESS != atf_psoc_open(psoc))
1021 		goto atf_psoc_open_fail;
1022 
1023 	if (QDF_STATUS_SUCCESS != dispatcher_policy_mgr_psoc_open(psoc))
1024 		goto policy_mgr_psoc_open_fail;
1025 
1026 	if (QDF_STATUS_SUCCESS != dispatcher_regulatory_psoc_open(psoc))
1027 		goto regulatory_psoc_open_fail;
1028 
1029 	if (QDF_STATUS_SUCCESS != son_psoc_open(psoc))
1030 		goto psoc_son_fail;
1031 
1032 	if (QDF_STATUS_SUCCESS != dispatcher_ftm_psoc_open(psoc))
1033 		goto ftm_psoc_open_fail;
1034 
1035 	return QDF_STATUS_SUCCESS;
1036 
1037 ftm_psoc_open_fail:
1038 	son_psoc_close(psoc);
1039 psoc_son_fail:
1040 	regulatory_psoc_close(psoc);
1041 regulatory_psoc_open_fail:
1042 	dispatcher_policy_mgr_psoc_close(psoc);
1043 policy_mgr_psoc_open_fail:
1044 	atf_psoc_close(psoc);
1045 atf_psoc_open_fail:
1046 	wlan_serialization_psoc_close(psoc);
1047 serialization_psoc_open_fail:
1048 	tdls_psoc_close(psoc);
1049 tdls_psoc_open_fail:
1050 	p2p_psoc_close(psoc);
1051 p2p_psoc_open_fail:
1052 	ucfg_scan_psoc_close(psoc);
1053 scan_psoc_open_fail:
1054 	wlan_mgmt_txrx_psoc_close(psoc);
1055 
1056 out:
1057 	return QDF_STATUS_E_FAILURE;
1058 }
1059 qdf_export_symbol(dispatcher_psoc_open);
1060 
1061 QDF_STATUS dispatcher_psoc_close(struct wlan_objmgr_psoc *psoc)
1062 {
1063 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_ftm_psoc_close(psoc));
1064 
1065 	QDF_BUG(QDF_STATUS_SUCCESS == son_psoc_close(psoc));
1066 
1067 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_regulatory_psoc_close(psoc));
1068 
1069 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_policy_mgr_psoc_close(psoc));
1070 
1071 	QDF_BUG(QDF_STATUS_SUCCESS == atf_psoc_close(psoc));
1072 
1073 	QDF_BUG(QDF_STATUS_SUCCESS == wlan_serialization_psoc_close(psoc));
1074 
1075 	QDF_BUG(QDF_STATUS_SUCCESS == tdls_psoc_close(psoc));
1076 
1077 	QDF_BUG(QDF_STATUS_SUCCESS == p2p_psoc_close(psoc));
1078 
1079 	QDF_BUG(QDF_STATUS_SUCCESS == ucfg_scan_psoc_close(psoc));
1080 
1081 	QDF_BUG(QDF_STATUS_SUCCESS == wlan_mgmt_txrx_psoc_close(psoc));
1082 
1083 	return QDF_STATUS_SUCCESS;
1084 }
1085 qdf_export_symbol(dispatcher_psoc_close);
1086 
1087 QDF_STATUS dispatcher_psoc_enable(struct wlan_objmgr_psoc *psoc)
1088 {
1089 	if (QDF_STATUS_SUCCESS != ucfg_scan_psoc_enable(psoc))
1090 		goto out;
1091 
1092 	if (QDF_STATUS_SUCCESS != p2p_psoc_enable(psoc))
1093 		goto p2p_psoc_enable_fail;
1094 
1095 	if (QDF_STATUS_SUCCESS != tdls_psoc_enable(psoc))
1096 		goto tdls_psoc_enable_fail;
1097 
1098 	if (QDF_STATUS_SUCCESS != dispatcher_policy_mgr_psoc_enable(psoc))
1099 		goto policy_mgr_psoc_enable_fail;
1100 
1101 	if (QDF_STATUS_SUCCESS != sa_api_psoc_enable(psoc))
1102 		goto sa_api_psoc_enable_fail;
1103 
1104 	if (QDF_STATUS_SUCCESS != atf_psoc_enable(psoc))
1105 		goto atf_psoc_enable_fail;
1106 
1107 	if (QDF_STATUS_SUCCESS != dispatcher_wifi_pos_enable(psoc))
1108 		goto wifi_pos_psoc_enable_fail;
1109 
1110 	if (QDF_STATUS_SUCCESS != dispatcher_nan_psoc_enable(psoc))
1111 		goto nan_psoc_enable_fail;
1112 
1113 	if (QDF_STATUS_SUCCESS != dispatcher_dfs_psoc_enable(psoc))
1114 		goto wifi_dfs_psoc_enable_fail;
1115 
1116 	if (QDF_STATUS_SUCCESS != fd_psoc_enable(psoc))
1117 		goto fd_psoc_enable_fail;
1118 
1119 	if (QDF_STATUS_SUCCESS != dispatcher_dbr_psoc_enable(psoc))
1120 		goto dbr_psoc_enable_fail;
1121 
1122 	return QDF_STATUS_SUCCESS;
1123 
1124 dbr_psoc_enable_fail:
1125 	fd_psoc_disable(psoc);
1126 fd_psoc_enable_fail:
1127 	dispatcher_dfs_psoc_disable(psoc);
1128 wifi_dfs_psoc_enable_fail:
1129 	dispatcher_nan_psoc_disable(psoc);
1130 nan_psoc_enable_fail:
1131 	dispatcher_wifi_pos_disable(psoc);
1132 wifi_pos_psoc_enable_fail:
1133 	atf_psoc_disable(psoc);
1134 atf_psoc_enable_fail:
1135 	sa_api_psoc_disable(psoc);
1136 sa_api_psoc_enable_fail:
1137 	dispatcher_policy_mgr_psoc_disable(psoc);
1138 policy_mgr_psoc_enable_fail:
1139 	tdls_psoc_disable(psoc);
1140 tdls_psoc_enable_fail:
1141 	p2p_psoc_disable(psoc);
1142 p2p_psoc_enable_fail:
1143 	ucfg_scan_psoc_disable(psoc);
1144 
1145 out:
1146 	return QDF_STATUS_E_FAILURE;
1147 }
1148 qdf_export_symbol(dispatcher_psoc_enable);
1149 
1150 QDF_STATUS dispatcher_psoc_disable(struct wlan_objmgr_psoc *psoc)
1151 {
1152 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_dbr_psoc_disable(psoc));
1153 
1154 	QDF_BUG(QDF_STATUS_SUCCESS == fd_psoc_disable(psoc));
1155 
1156 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_dfs_psoc_disable(psoc));
1157 
1158 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_nan_psoc_disable(psoc));
1159 
1160 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_wifi_pos_disable(psoc));
1161 
1162 	QDF_BUG(QDF_STATUS_SUCCESS == atf_psoc_disable(psoc));
1163 
1164 	QDF_BUG(QDF_STATUS_SUCCESS == sa_api_psoc_disable(psoc));
1165 
1166 	QDF_BUG(QDF_STATUS_SUCCESS ==
1167 		dispatcher_policy_mgr_psoc_disable(psoc));
1168 
1169 	QDF_BUG(QDF_STATUS_SUCCESS == tdls_psoc_disable(psoc));
1170 
1171 	QDF_BUG(QDF_STATUS_SUCCESS == p2p_psoc_disable(psoc));
1172 
1173 	QDF_BUG(QDF_STATUS_SUCCESS == ucfg_scan_psoc_disable(psoc));
1174 
1175 	return QDF_STATUS_SUCCESS;
1176 }
1177 qdf_export_symbol(dispatcher_psoc_disable);
1178 
1179 QDF_STATUS dispatcher_pdev_open(struct wlan_objmgr_pdev *pdev)
1180 {
1181 	if (QDF_STATUS_SUCCESS != dispatcher_regulatory_pdev_open(pdev))
1182 		goto out;
1183 
1184 	if (QDF_STATUS_SUCCESS != dispatcher_spectral_pdev_open(pdev))
1185 		goto spectral_pdev_open_fail;
1186 
1187 	if (QDF_STATUS_SUCCESS != wlan_mgmt_txrx_pdev_open(pdev))
1188 		goto out;
1189 
1190 	return QDF_STATUS_SUCCESS;
1191 
1192 spectral_pdev_open_fail:
1193 	dispatcher_regulatory_pdev_close(pdev);
1194 
1195 out:
1196 	return QDF_STATUS_E_FAILURE;
1197 }
1198 qdf_export_symbol(dispatcher_pdev_open);
1199 
1200 QDF_STATUS dispatcher_pdev_close(struct wlan_objmgr_pdev *pdev)
1201 {
1202 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_regulatory_pdev_close(pdev));
1203 
1204 	QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_spectral_pdev_close(pdev));
1205 
1206 	QDF_BUG(QDF_STATUS_SUCCESS == wlan_mgmt_txrx_pdev_close(pdev));
1207 
1208 	return QDF_STATUS_SUCCESS;
1209 }
1210 qdf_export_symbol(dispatcher_pdev_close);
1211