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