dispatcher_init_deinit.c 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035
  1. /*
  2. * Copyright (c) 2016-2019 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. #include "cfg_dispatcher.h"
  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. #include <wlan_vdev_mlme_main.h>
  30. #ifdef WLAN_ATF_ENABLE
  31. #include <wlan_atf_utils_api.h>
  32. #endif
  33. #ifdef QCA_SUPPORT_SON
  34. #include <wlan_son_pub.h>
  35. #endif
  36. #ifdef WLAN_SA_API_ENABLE
  37. #include <wlan_sa_api_utils_api.h>
  38. #endif
  39. #ifdef WIFI_POS_CONVERGED
  40. #include "wifi_pos_api.h"
  41. #endif /* WIFI_POS_CONVERGED */
  42. #include <wlan_reg_services_api.h>
  43. #ifdef WLAN_CONV_CRYPTO_SUPPORTED
  44. #include "wlan_crypto_main.h"
  45. #endif
  46. #ifdef DFS_COMPONENT_ENABLE
  47. #include <wlan_dfs_init_deinit_api.h>
  48. #endif
  49. #ifdef WLAN_OFFCHAN_TXRX_ENABLE
  50. #include <wlan_offchan_txrx_api.h>
  51. #endif
  52. #ifdef WLAN_SUPPORT_SPLITMAC
  53. #include <wlan_splitmac.h>
  54. #endif
  55. #ifdef WLAN_CONV_SPECTRAL_ENABLE
  56. #include <wlan_spectral_utils_api.h>
  57. #endif
  58. #ifdef WLAN_SUPPORT_FILS
  59. #include <wlan_fd_utils_api.h>
  60. #endif
  61. #ifdef WLAN_SUPPORT_GREEN_AP
  62. #include <wlan_green_ap_api.h>
  63. #endif
  64. #ifdef QCA_SUPPORT_CP_STATS
  65. #include <wlan_cp_stats_utils_api.h>
  66. #endif
  67. /**
  68. * DOC: This file provides various init/deinit trigger point for new
  69. * components.
  70. */
  71. /* All new components needs to replace their dummy init/deinit
  72. * psoc_open, psco_close, psoc_enable and psoc_disable APIs once
  73. * their actual handlers are ready
  74. */
  75. spectral_pdev_open_handler dispatcher_spectral_pdev_open_handler_cb;
  76. #ifdef QCA_SUPPORT_CP_STATS
  77. static QDF_STATUS dispatcher_init_cp_stats(void)
  78. {
  79. return wlan_cp_stats_init();
  80. }
  81. static QDF_STATUS dispatcher_deinit_cp_stats(void)
  82. {
  83. return wlan_cp_stats_deinit();
  84. }
  85. static QDF_STATUS cp_stats_psoc_open(struct wlan_objmgr_psoc *psoc)
  86. {
  87. return wlan_cp_stats_open(psoc);
  88. }
  89. static QDF_STATUS cp_stats_psoc_close(struct wlan_objmgr_psoc *psoc)
  90. {
  91. return wlan_cp_stats_close(psoc);
  92. }
  93. static QDF_STATUS cp_stats_psoc_enable(struct wlan_objmgr_psoc *psoc)
  94. {
  95. return wlan_cp_stats_enable(psoc);
  96. }
  97. static QDF_STATUS cp_stats_psoc_disable(struct wlan_objmgr_psoc *psoc)
  98. {
  99. return wlan_cp_stats_disable(psoc);
  100. }
  101. #else
  102. static QDF_STATUS dispatcher_init_cp_stats(void)
  103. {
  104. return QDF_STATUS_SUCCESS;
  105. }
  106. static QDF_STATUS dispatcher_deinit_cp_stats(void)
  107. {
  108. return QDF_STATUS_SUCCESS;
  109. }
  110. static QDF_STATUS cp_stats_psoc_open(struct wlan_objmgr_psoc *psoc)
  111. {
  112. return QDF_STATUS_SUCCESS;
  113. }
  114. static QDF_STATUS cp_stats_psoc_close(struct wlan_objmgr_psoc *psoc)
  115. {
  116. return QDF_STATUS_SUCCESS;
  117. }
  118. static QDF_STATUS cp_stats_psoc_enable(struct wlan_objmgr_psoc *psoc)
  119. {
  120. return QDF_STATUS_SUCCESS;
  121. }
  122. static QDF_STATUS cp_stats_psoc_disable(struct wlan_objmgr_psoc *psoc)
  123. {
  124. return QDF_STATUS_SUCCESS;
  125. }
  126. #endif
  127. #if defined QCA_SUPPORT_SON && QCA_SUPPORT_SON >= 1
  128. static QDF_STATUS dispatcher_init_son(void)
  129. {
  130. return wlan_son_init();
  131. }
  132. static QDF_STATUS son_psoc_open(struct wlan_objmgr_psoc *psoc)
  133. {
  134. return wlan_son_psoc_open(psoc);
  135. }
  136. static QDF_STATUS dispatcher_deinit_son(void)
  137. {
  138. return wlan_son_deinit();
  139. }
  140. static QDF_STATUS son_psoc_close(struct wlan_objmgr_psoc *psoc)
  141. {
  142. return wlan_son_psoc_close(psoc);
  143. }
  144. #else
  145. static QDF_STATUS dispatcher_init_son(void)
  146. {
  147. return QDF_STATUS_SUCCESS;
  148. }
  149. static QDF_STATUS dispatcher_deinit_son(void)
  150. {
  151. return QDF_STATUS_SUCCESS;
  152. }
  153. static QDF_STATUS son_psoc_open(struct wlan_objmgr_psoc *psoc)
  154. {
  155. return QDF_STATUS_SUCCESS;
  156. }
  157. static QDF_STATUS son_psoc_close(struct wlan_objmgr_psoc *psoc)
  158. {
  159. return QDF_STATUS_SUCCESS;
  160. }
  161. #endif /* END of QCA_SUPPORT_SON */
  162. static QDF_STATUS dispatcher_regulatory_init(void)
  163. {
  164. return wlan_regulatory_init();
  165. }
  166. static QDF_STATUS dispatcher_regulatory_deinit(void)
  167. {
  168. return wlan_regulatory_deinit();
  169. }
  170. static QDF_STATUS dispatcher_regulatory_psoc_open(struct wlan_objmgr_psoc
  171. *psoc)
  172. {
  173. return regulatory_psoc_open(psoc);
  174. }
  175. static QDF_STATUS dispatcher_regulatory_psoc_close(struct wlan_objmgr_psoc
  176. *psoc)
  177. {
  178. return regulatory_psoc_close(psoc);
  179. }
  180. static QDF_STATUS dispatcher_regulatory_pdev_open(struct wlan_objmgr_pdev
  181. *pdev)
  182. {
  183. return regulatory_pdev_open(pdev);
  184. }
  185. #ifdef WLAN_CONV_SPECTRAL_ENABLE
  186. #ifdef CONFIG_WIN
  187. QDF_STATUS dispatcher_register_spectral_pdev_open_handler(
  188. spectral_pdev_open_handler handler)
  189. {
  190. dispatcher_spectral_pdev_open_handler_cb = handler;
  191. return QDF_STATUS_SUCCESS;
  192. }
  193. qdf_export_symbol(dispatcher_register_spectral_pdev_open_handler);
  194. static QDF_STATUS dispatcher_spectral_pdev_open(struct wlan_objmgr_pdev
  195. *pdev)
  196. {
  197. return dispatcher_spectral_pdev_open_handler_cb(pdev);
  198. }
  199. static QDF_STATUS dispatcher_spectral_pdev_close(struct wlan_objmgr_pdev *pdev)
  200. {
  201. return QDF_STATUS_SUCCESS;
  202. }
  203. #else
  204. static QDF_STATUS dispatcher_spectral_pdev_open(struct wlan_objmgr_pdev
  205. *pdev)
  206. {
  207. return spectral_pdev_open(pdev);
  208. }
  209. static QDF_STATUS dispatcher_spectral_pdev_close(struct wlan_objmgr_pdev *pdev)
  210. {
  211. return QDF_STATUS_SUCCESS;
  212. }
  213. #endif
  214. #else
  215. static QDF_STATUS dispatcher_spectral_pdev_open(struct wlan_objmgr_pdev
  216. *pdev)
  217. {
  218. return QDF_STATUS_SUCCESS;
  219. }
  220. static QDF_STATUS dispatcher_spectral_pdev_close(struct wlan_objmgr_pdev *pdev)
  221. {
  222. return QDF_STATUS_SUCCESS;
  223. }
  224. #endif
  225. static QDF_STATUS dispatcher_regulatory_pdev_close(struct wlan_objmgr_pdev
  226. *pdev)
  227. {
  228. return regulatory_pdev_close(pdev);
  229. }
  230. #ifdef WLAN_SA_API_ENABLE
  231. static QDF_STATUS dispatcher_init_sa_api(void)
  232. {
  233. return wlan_sa_api_init();
  234. }
  235. static QDF_STATUS dispatcher_deinit_sa_api(void)
  236. {
  237. return wlan_sa_api_deinit();
  238. }
  239. static QDF_STATUS sa_api_psoc_enable(struct wlan_objmgr_psoc *psoc)
  240. {
  241. return wlan_sa_api_enable(psoc);
  242. }
  243. static QDF_STATUS sa_api_psoc_disable(struct wlan_objmgr_psoc *psoc)
  244. {
  245. return wlan_sa_api_disable(psoc);
  246. }
  247. #else
  248. static QDF_STATUS dispatcher_init_sa_api(void)
  249. {
  250. return QDF_STATUS_SUCCESS;
  251. }
  252. static QDF_STATUS dispatcher_deinit_sa_api(void)
  253. {
  254. return QDF_STATUS_SUCCESS;
  255. }
  256. static QDF_STATUS sa_api_psoc_enable(struct wlan_objmgr_psoc *psoc)
  257. {
  258. return QDF_STATUS_SUCCESS;
  259. }
  260. static QDF_STATUS sa_api_psoc_disable(struct wlan_objmgr_psoc *psoc)
  261. {
  262. return QDF_STATUS_SUCCESS;
  263. }
  264. #endif /* END of WLAN_SA_API_ENABLE */
  265. #ifdef WLAN_ATF_ENABLE
  266. static QDF_STATUS dispatcher_init_atf(void)
  267. {
  268. return wlan_atf_init();
  269. }
  270. static QDF_STATUS dispatcher_deinit_atf(void)
  271. {
  272. return wlan_atf_deinit();
  273. }
  274. static QDF_STATUS atf_psoc_open(struct wlan_objmgr_psoc *psoc)
  275. {
  276. return wlan_atf_open(psoc);
  277. }
  278. static QDF_STATUS atf_psoc_close(struct wlan_objmgr_psoc *psoc)
  279. {
  280. return wlan_atf_close(psoc);
  281. }
  282. static QDF_STATUS atf_psoc_enable(struct wlan_objmgr_psoc *psoc)
  283. {
  284. return wlan_atf_enable(psoc);
  285. }
  286. static QDF_STATUS atf_psoc_disable(struct wlan_objmgr_psoc *psoc)
  287. {
  288. return wlan_atf_disable(psoc);
  289. }
  290. #else
  291. static QDF_STATUS dispatcher_init_atf(void)
  292. {
  293. return QDF_STATUS_SUCCESS;
  294. }
  295. static QDF_STATUS dispatcher_deinit_atf(void)
  296. {
  297. return QDF_STATUS_SUCCESS;
  298. }
  299. static QDF_STATUS atf_psoc_open(struct wlan_objmgr_psoc *psoc)
  300. {
  301. return QDF_STATUS_SUCCESS;
  302. }
  303. static QDF_STATUS atf_psoc_close(struct wlan_objmgr_psoc *psoc)
  304. {
  305. return QDF_STATUS_SUCCESS;
  306. }
  307. static QDF_STATUS atf_psoc_enable(struct wlan_objmgr_psoc *psoc)
  308. {
  309. return QDF_STATUS_SUCCESS;
  310. }
  311. static QDF_STATUS atf_psoc_disable(struct wlan_objmgr_psoc *psoc)
  312. {
  313. return QDF_STATUS_SUCCESS;
  314. }
  315. #endif /* END of WLAN_ATF_ENABLE */
  316. #ifdef WLAN_CONV_CRYPTO_SUPPORTED
  317. static QDF_STATUS dispatcher_init_crypto(void)
  318. {
  319. return wlan_crypto_init();
  320. }
  321. static QDF_STATUS dispatcher_deinit_crypto(void)
  322. {
  323. return wlan_crypto_deinit();
  324. }
  325. #else
  326. static QDF_STATUS dispatcher_init_crypto(void)
  327. {
  328. return QDF_STATUS_SUCCESS;
  329. }
  330. static QDF_STATUS dispatcher_deinit_crypto(void)
  331. {
  332. return QDF_STATUS_SUCCESS;
  333. }
  334. #endif /* END of WLAN_CONV_CRYPTO_SUPPORTED */
  335. #ifdef WIFI_POS_CONVERGED
  336. static QDF_STATUS dispatcher_init_wifi_pos(void)
  337. {
  338. return wifi_pos_init();
  339. }
  340. static QDF_STATUS dispatcher_deinit_wifi_pos(void)
  341. {
  342. return wifi_pos_deinit();
  343. }
  344. static QDF_STATUS dispatcher_wifi_pos_enable(struct wlan_objmgr_psoc *psoc)
  345. {
  346. return wifi_pos_psoc_enable(psoc);
  347. }
  348. static QDF_STATUS dispatcher_wifi_pos_disable(struct wlan_objmgr_psoc *psoc)
  349. {
  350. return wifi_pos_psoc_disable(psoc);
  351. }
  352. #else
  353. static QDF_STATUS dispatcher_init_wifi_pos(void)
  354. {
  355. return QDF_STATUS_SUCCESS;
  356. }
  357. static QDF_STATUS dispatcher_deinit_wifi_pos(void)
  358. {
  359. return QDF_STATUS_SUCCESS;
  360. }
  361. static QDF_STATUS dispatcher_wifi_pos_enable(struct wlan_objmgr_psoc *psoc)
  362. {
  363. return QDF_STATUS_SUCCESS;
  364. }
  365. static QDF_STATUS dispatcher_wifi_pos_disable(struct wlan_objmgr_psoc *psoc)
  366. {
  367. return QDF_STATUS_SUCCESS;
  368. }
  369. #endif
  370. #ifdef DFS_COMPONENT_ENABLE
  371. static QDF_STATUS dispatcher_init_dfs(void)
  372. {
  373. return dfs_init();
  374. }
  375. static QDF_STATUS dispatcher_deinit_dfs(void)
  376. {
  377. return dfs_deinit();
  378. }
  379. static QDF_STATUS dispatcher_dfs_psoc_enable(struct wlan_objmgr_psoc *psoc)
  380. {
  381. return wifi_dfs_psoc_enable(psoc);
  382. }
  383. static QDF_STATUS dispatcher_dfs_psoc_disable(struct wlan_objmgr_psoc *psoc)
  384. {
  385. return wifi_dfs_psoc_disable(psoc);
  386. }
  387. #else
  388. static QDF_STATUS dispatcher_init_dfs(void)
  389. {
  390. return QDF_STATUS_SUCCESS;
  391. }
  392. static QDF_STATUS dispatcher_deinit_dfs(void)
  393. {
  394. return QDF_STATUS_SUCCESS;
  395. }
  396. static QDF_STATUS dispatcher_dfs_psoc_enable(struct wlan_objmgr_psoc *psoc)
  397. {
  398. return QDF_STATUS_SUCCESS;
  399. }
  400. static QDF_STATUS dispatcher_dfs_psoc_disable(struct wlan_objmgr_psoc *psoc)
  401. {
  402. return QDF_STATUS_SUCCESS;
  403. }
  404. #endif
  405. #ifdef WLAN_OFFCHAN_TXRX_ENABLE
  406. static QDF_STATUS dispatcher_offchan_txrx_init(void)
  407. {
  408. return wlan_offchan_txrx_init();
  409. }
  410. static QDF_STATUS dispatcher_offchan_txrx_deinit(void)
  411. {
  412. return wlan_offchan_txrx_deinit();
  413. }
  414. #else
  415. static QDF_STATUS dispatcher_offchan_txrx_init(void)
  416. {
  417. return QDF_STATUS_SUCCESS;
  418. }
  419. static QDF_STATUS dispatcher_offchan_txrx_deinit(void)
  420. {
  421. return QDF_STATUS_SUCCESS;
  422. }
  423. #endif /*WLAN_OFFCHAN_TXRX_ENABLE*/
  424. #ifdef WLAN_SUPPORT_SPLITMAC
  425. static QDF_STATUS dispatcher_splitmac_init(void)
  426. {
  427. return wlan_splitmac_init();
  428. }
  429. static QDF_STATUS dispatcher_splitmac_deinit(void)
  430. {
  431. return wlan_splitmac_deinit();
  432. }
  433. #else
  434. static QDF_STATUS dispatcher_splitmac_init(void)
  435. {
  436. return QDF_STATUS_SUCCESS;
  437. }
  438. static QDF_STATUS dispatcher_splitmac_deinit(void)
  439. {
  440. return QDF_STATUS_SUCCESS;
  441. }
  442. #endif /* WLAN_SUPPORT_SPLITMAC */
  443. #ifdef WLAN_CONV_SPECTRAL_ENABLE
  444. #ifdef CONFIG_MCL
  445. static QDF_STATUS dispatcher_spectral_init(void)
  446. {
  447. return wlan_spectral_init();
  448. }
  449. static QDF_STATUS dispatcher_spectral_deinit(void)
  450. {
  451. return wlan_spectral_deinit();
  452. }
  453. #else
  454. static QDF_STATUS dispatcher_spectral_init(void)
  455. {
  456. return QDF_STATUS_SUCCESS;
  457. }
  458. static QDF_STATUS dispatcher_spectral_deinit(void)
  459. {
  460. return QDF_STATUS_SUCCESS;
  461. }
  462. #endif
  463. #else
  464. static QDF_STATUS dispatcher_spectral_init(void)
  465. {
  466. return QDF_STATUS_SUCCESS;
  467. }
  468. static QDF_STATUS dispatcher_spectral_deinit(void)
  469. {
  470. return QDF_STATUS_SUCCESS;
  471. }
  472. #endif
  473. #ifdef DIRECT_BUF_RX_ENABLE
  474. static QDF_STATUS dispatcher_dbr_psoc_enable(struct wlan_objmgr_psoc *psoc)
  475. {
  476. struct wlan_lmac_if_tx_ops *tx_ops;
  477. tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
  478. if (tx_ops->dbr_tx_ops.direct_buf_rx_register_events)
  479. return tx_ops->dbr_tx_ops.direct_buf_rx_register_events(psoc);
  480. return QDF_STATUS_SUCCESS;
  481. }
  482. static QDF_STATUS dispatcher_dbr_psoc_disable(struct wlan_objmgr_psoc *psoc)
  483. {
  484. struct wlan_lmac_if_tx_ops *tx_ops;
  485. tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
  486. if (tx_ops->dbr_tx_ops.direct_buf_rx_unregister_events)
  487. return tx_ops->dbr_tx_ops.direct_buf_rx_unregister_events(psoc);
  488. return QDF_STATUS_SUCCESS;
  489. }
  490. #else
  491. static QDF_STATUS dispatcher_dbr_psoc_enable(struct wlan_objmgr_psoc *psoc)
  492. {
  493. return QDF_STATUS_SUCCESS;
  494. }
  495. static QDF_STATUS dispatcher_dbr_psoc_disable(struct wlan_objmgr_psoc *psoc)
  496. {
  497. return QDF_STATUS_SUCCESS;
  498. }
  499. #endif /* DIRECT_BUF_RX_ENABLE */
  500. #ifdef WLAN_SUPPORT_GREEN_AP
  501. static QDF_STATUS dispatcher_green_ap_init(void)
  502. {
  503. return wlan_green_ap_init();
  504. }
  505. static QDF_STATUS dispatcher_green_ap_pdev_open(
  506. struct wlan_objmgr_pdev *pdev)
  507. {
  508. return wlan_green_ap_pdev_open(pdev);
  509. }
  510. static QDF_STATUS dispatcher_green_ap_deinit(void)
  511. {
  512. return wlan_green_ap_deinit();
  513. }
  514. #else
  515. static QDF_STATUS dispatcher_green_ap_init(void)
  516. {
  517. return QDF_STATUS_SUCCESS;
  518. }
  519. static QDF_STATUS dispatcher_green_ap_pdev_open(
  520. struct wlan_objmgr_pdev *pdev)
  521. {
  522. return QDF_STATUS_SUCCESS;
  523. }
  524. static QDF_STATUS dispatcher_green_ap_deinit(void)
  525. {
  526. return QDF_STATUS_SUCCESS;
  527. }
  528. #endif
  529. #ifdef WLAN_SUPPORT_FILS
  530. static QDF_STATUS dispatcher_fd_init(void)
  531. {
  532. return wlan_fd_init();
  533. }
  534. static QDF_STATUS dispatcher_fd_deinit(void)
  535. {
  536. return wlan_fd_deinit();
  537. }
  538. static QDF_STATUS fd_psoc_enable(struct wlan_objmgr_psoc *psoc)
  539. {
  540. return wlan_fd_enable(psoc);
  541. }
  542. static QDF_STATUS fd_psoc_disable(struct wlan_objmgr_psoc *psoc)
  543. {
  544. return wlan_fd_disable(psoc);
  545. }
  546. #else
  547. static QDF_STATUS dispatcher_fd_init(void)
  548. {
  549. return QDF_STATUS_SUCCESS;
  550. }
  551. static QDF_STATUS dispatcher_fd_deinit(void)
  552. {
  553. return QDF_STATUS_SUCCESS;
  554. }
  555. static QDF_STATUS fd_psoc_enable(struct wlan_objmgr_psoc *psoc)
  556. {
  557. return QDF_STATUS_SUCCESS;
  558. }
  559. static QDF_STATUS fd_psoc_disable(struct wlan_objmgr_psoc *psoc)
  560. {
  561. return QDF_STATUS_SUCCESS;
  562. }
  563. #endif /* WLAN_SUPPORT_FILS */
  564. QDF_STATUS dispatcher_init(void)
  565. {
  566. if (QDF_STATUS_SUCCESS != wlan_objmgr_global_obj_init())
  567. goto out;
  568. if (QDF_STATUS_SUCCESS != wlan_mgmt_txrx_init())
  569. goto mgmt_txrx_init_fail;
  570. if (QDF_STATUS_SUCCESS != ucfg_scan_init())
  571. goto ucfg_scan_init_fail;
  572. if (QDF_STATUS_SUCCESS != wlan_serialization_init())
  573. goto serialization_init_fail;
  574. if (QDF_STATUS_SUCCESS != dispatcher_init_crypto())
  575. goto crypto_init_fail;
  576. if (QDF_STATUS_SUCCESS != dispatcher_init_cp_stats())
  577. goto cp_stats_init_fail;
  578. if (QDF_STATUS_SUCCESS != dispatcher_init_atf())
  579. goto atf_init_fail;
  580. if (QDF_STATUS_SUCCESS != dispatcher_init_sa_api())
  581. goto sa_api_init_fail;
  582. if (QDF_STATUS_SUCCESS != dispatcher_init_wifi_pos())
  583. goto wifi_pos_init_fail;
  584. if (QDF_STATUS_SUCCESS != dispatcher_init_dfs())
  585. goto dfs_init_fail;
  586. if (QDF_STATUS_SUCCESS != dispatcher_regulatory_init())
  587. goto regulatory_init_fail;
  588. if (QDF_STATUS_SUCCESS != dispatcher_offchan_txrx_init())
  589. goto offchan_init_fail;
  590. if (QDF_STATUS_SUCCESS != dispatcher_init_son())
  591. goto son_init_fail;
  592. if (QDF_STATUS_SUCCESS != dispatcher_splitmac_init())
  593. goto splitmac_init_fail;
  594. if (QDF_STATUS_SUCCESS != dispatcher_fd_init())
  595. goto fd_init_fail;
  596. if (QDF_STATUS_SUCCESS != dispatcher_green_ap_init())
  597. goto green_ap_init_fail;
  598. if (QDF_STATUS_SUCCESS != dispatcher_ftm_init())
  599. goto ftm_init_fail;
  600. if (QDF_IS_STATUS_ERROR(cfg_dispatcher_init()))
  601. goto cfg_init_fail;
  602. if (QDF_STATUS_SUCCESS != dispatcher_spectral_init())
  603. goto spectral_init_fail;
  604. if (QDF_STATUS_SUCCESS != wlan_vdev_mlme_init())
  605. goto vdev_mlme_init_fail;
  606. /*
  607. * scheduler INIT has to be the last as each component's
  608. * initialization has to happen first and then at the end
  609. * scheduler needs to start accepting the service.
  610. */
  611. if (QDF_STATUS_SUCCESS != scheduler_init())
  612. goto scheduler_init_fail;
  613. return QDF_STATUS_SUCCESS;
  614. scheduler_init_fail:
  615. wlan_vdev_mlme_deinit();
  616. vdev_mlme_init_fail:
  617. dispatcher_spectral_deinit();
  618. spectral_init_fail:
  619. cfg_dispatcher_deinit();
  620. cfg_init_fail:
  621. dispatcher_ftm_deinit();
  622. ftm_init_fail:
  623. dispatcher_green_ap_deinit();
  624. green_ap_init_fail:
  625. dispatcher_fd_deinit();
  626. fd_init_fail:
  627. dispatcher_splitmac_deinit();
  628. splitmac_init_fail:
  629. dispatcher_deinit_son();
  630. son_init_fail:
  631. dispatcher_offchan_txrx_deinit();
  632. offchan_init_fail:
  633. dispatcher_regulatory_deinit();
  634. regulatory_init_fail:
  635. dispatcher_deinit_dfs();
  636. dfs_init_fail:
  637. dispatcher_deinit_wifi_pos();
  638. wifi_pos_init_fail:
  639. dispatcher_deinit_sa_api();
  640. sa_api_init_fail:
  641. dispatcher_deinit_atf();
  642. atf_init_fail:
  643. dispatcher_deinit_cp_stats();
  644. cp_stats_init_fail:
  645. dispatcher_deinit_crypto();
  646. crypto_init_fail:
  647. wlan_serialization_deinit();
  648. serialization_init_fail:
  649. ucfg_scan_deinit();
  650. ucfg_scan_init_fail:
  651. wlan_mgmt_txrx_deinit();
  652. mgmt_txrx_init_fail:
  653. wlan_objmgr_global_obj_deinit();
  654. out:
  655. return QDF_STATUS_E_FAILURE;
  656. }
  657. qdf_export_symbol(dispatcher_init);
  658. QDF_STATUS dispatcher_deinit(void)
  659. {
  660. QDF_STATUS status;
  661. QDF_BUG(QDF_STATUS_SUCCESS == scheduler_deinit());
  662. QDF_BUG(QDF_STATUS_SUCCESS == wlan_vdev_mlme_deinit());
  663. status = cfg_dispatcher_deinit();
  664. QDF_BUG(QDF_IS_STATUS_SUCCESS(status));
  665. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_ftm_deinit());
  666. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_green_ap_deinit());
  667. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_fd_deinit());
  668. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_spectral_deinit());
  669. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_splitmac_deinit());
  670. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_son());
  671. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_offchan_txrx_deinit());
  672. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_regulatory_deinit());
  673. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_dfs());
  674. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_wifi_pos());
  675. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_sa_api());
  676. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_atf());
  677. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_cp_stats());
  678. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_crypto());
  679. QDF_BUG(QDF_STATUS_SUCCESS == wlan_serialization_deinit());
  680. QDF_BUG(QDF_STATUS_SUCCESS == ucfg_scan_deinit());
  681. QDF_BUG(QDF_STATUS_SUCCESS == wlan_mgmt_txrx_deinit());
  682. QDF_BUG(QDF_STATUS_SUCCESS == wlan_objmgr_global_obj_deinit());
  683. return QDF_STATUS_SUCCESS;
  684. }
  685. qdf_export_symbol(dispatcher_deinit);
  686. QDF_STATUS dispatcher_enable(void)
  687. {
  688. QDF_STATUS status;
  689. status = scheduler_enable();
  690. return status;
  691. }
  692. qdf_export_symbol(dispatcher_enable);
  693. QDF_STATUS dispatcher_disable(void)
  694. {
  695. QDF_BUG(QDF_IS_STATUS_SUCCESS(scheduler_disable()));
  696. return QDF_STATUS_SUCCESS;
  697. }
  698. qdf_export_symbol(dispatcher_disable);
  699. QDF_STATUS dispatcher_psoc_open(struct wlan_objmgr_psoc *psoc)
  700. {
  701. if (QDF_STATUS_SUCCESS != wlan_mgmt_txrx_psoc_open(psoc))
  702. goto out;
  703. if (QDF_STATUS_SUCCESS != ucfg_scan_psoc_open(psoc))
  704. goto scan_psoc_open_fail;
  705. if (QDF_STATUS_SUCCESS != wlan_serialization_psoc_open(psoc))
  706. goto serialization_psoc_open_fail;
  707. if (QDF_STATUS_SUCCESS != cp_stats_psoc_open(psoc))
  708. goto cp_stats_psoc_open_fail;
  709. if (QDF_STATUS_SUCCESS != atf_psoc_open(psoc))
  710. goto atf_psoc_open_fail;
  711. if (QDF_STATUS_SUCCESS != dispatcher_regulatory_psoc_open(psoc))
  712. goto regulatory_psoc_open_fail;
  713. if (QDF_STATUS_SUCCESS != son_psoc_open(psoc))
  714. goto psoc_son_fail;
  715. if (QDF_STATUS_SUCCESS != dispatcher_ftm_psoc_open(psoc))
  716. goto ftm_psoc_open_fail;
  717. return QDF_STATUS_SUCCESS;
  718. ftm_psoc_open_fail:
  719. son_psoc_close(psoc);
  720. psoc_son_fail:
  721. regulatory_psoc_close(psoc);
  722. regulatory_psoc_open_fail:
  723. atf_psoc_close(psoc);
  724. atf_psoc_open_fail:
  725. cp_stats_psoc_close(psoc);
  726. cp_stats_psoc_open_fail:
  727. wlan_serialization_psoc_close(psoc);
  728. serialization_psoc_open_fail:
  729. ucfg_scan_psoc_close(psoc);
  730. scan_psoc_open_fail:
  731. wlan_mgmt_txrx_psoc_close(psoc);
  732. out:
  733. return QDF_STATUS_E_FAILURE;
  734. }
  735. qdf_export_symbol(dispatcher_psoc_open);
  736. QDF_STATUS dispatcher_psoc_close(struct wlan_objmgr_psoc *psoc)
  737. {
  738. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_ftm_psoc_close(psoc));
  739. QDF_BUG(QDF_STATUS_SUCCESS == son_psoc_close(psoc));
  740. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_regulatory_psoc_close(psoc));
  741. QDF_BUG(QDF_STATUS_SUCCESS == atf_psoc_close(psoc));
  742. QDF_BUG(QDF_STATUS_SUCCESS == cp_stats_psoc_close(psoc));
  743. QDF_BUG(QDF_STATUS_SUCCESS == wlan_serialization_psoc_close(psoc));
  744. QDF_BUG(QDF_STATUS_SUCCESS == ucfg_scan_psoc_close(psoc));
  745. QDF_BUG(QDF_STATUS_SUCCESS == wlan_mgmt_txrx_psoc_close(psoc));
  746. return QDF_STATUS_SUCCESS;
  747. }
  748. qdf_export_symbol(dispatcher_psoc_close);
  749. QDF_STATUS dispatcher_psoc_enable(struct wlan_objmgr_psoc *psoc)
  750. {
  751. if (QDF_STATUS_SUCCESS != ucfg_scan_psoc_enable(psoc))
  752. goto out;
  753. if (QDF_STATUS_SUCCESS != sa_api_psoc_enable(psoc))
  754. goto sa_api_psoc_enable_fail;
  755. if (QDF_STATUS_SUCCESS != cp_stats_psoc_enable(psoc))
  756. goto cp_stats_psoc_enable_fail;
  757. if (QDF_STATUS_SUCCESS != atf_psoc_enable(psoc))
  758. goto atf_psoc_enable_fail;
  759. if (QDF_STATUS_SUCCESS != dispatcher_wifi_pos_enable(psoc))
  760. goto wifi_pos_psoc_enable_fail;
  761. if (QDF_STATUS_SUCCESS != dispatcher_dfs_psoc_enable(psoc))
  762. goto wifi_dfs_psoc_enable_fail;
  763. if (QDF_STATUS_SUCCESS != fd_psoc_enable(psoc))
  764. goto fd_psoc_enable_fail;
  765. if (QDF_STATUS_SUCCESS != dispatcher_dbr_psoc_enable(psoc))
  766. goto dbr_psoc_enable_fail;
  767. if (QDF_STATUS_SUCCESS != wlan_mlme_psoc_enable(psoc))
  768. goto mlme_psoc_enable_fail;
  769. return QDF_STATUS_SUCCESS;
  770. mlme_psoc_enable_fail:
  771. dispatcher_dbr_psoc_disable(psoc);
  772. dbr_psoc_enable_fail:
  773. fd_psoc_disable(psoc);
  774. fd_psoc_enable_fail:
  775. dispatcher_dfs_psoc_disable(psoc);
  776. wifi_dfs_psoc_enable_fail:
  777. dispatcher_wifi_pos_disable(psoc);
  778. wifi_pos_psoc_enable_fail:
  779. atf_psoc_disable(psoc);
  780. atf_psoc_enable_fail:
  781. cp_stats_psoc_disable(psoc);
  782. cp_stats_psoc_enable_fail:
  783. sa_api_psoc_disable(psoc);
  784. sa_api_psoc_enable_fail:
  785. ucfg_scan_psoc_disable(psoc);
  786. out:
  787. return QDF_STATUS_E_FAILURE;
  788. }
  789. qdf_export_symbol(dispatcher_psoc_enable);
  790. QDF_STATUS dispatcher_psoc_disable(struct wlan_objmgr_psoc *psoc)
  791. {
  792. QDF_BUG(QDF_STATUS_SUCCESS == wlan_mlme_psoc_disable(psoc));
  793. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_dbr_psoc_disable(psoc));
  794. QDF_BUG(QDF_STATUS_SUCCESS == fd_psoc_disable(psoc));
  795. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_dfs_psoc_disable(psoc));
  796. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_wifi_pos_disable(psoc));
  797. QDF_BUG(QDF_STATUS_SUCCESS == atf_psoc_disable(psoc));
  798. QDF_BUG(QDF_STATUS_SUCCESS == cp_stats_psoc_disable(psoc));
  799. QDF_BUG(QDF_STATUS_SUCCESS == sa_api_psoc_disable(psoc));
  800. QDF_BUG(QDF_STATUS_SUCCESS == ucfg_scan_psoc_disable(psoc));
  801. return QDF_STATUS_SUCCESS;
  802. }
  803. qdf_export_symbol(dispatcher_psoc_disable);
  804. QDF_STATUS dispatcher_pdev_open(struct wlan_objmgr_pdev *pdev)
  805. {
  806. QDF_STATUS status;
  807. if (QDF_STATUS_SUCCESS != dispatcher_regulatory_pdev_open(pdev))
  808. goto out;
  809. status = dispatcher_spectral_pdev_open(pdev);
  810. if (status != QDF_STATUS_SUCCESS && status != QDF_STATUS_COMP_DISABLED)
  811. goto spectral_pdev_open_fail;
  812. if (QDF_STATUS_SUCCESS != wlan_mgmt_txrx_pdev_open(pdev))
  813. goto out;
  814. if (QDF_IS_STATUS_ERROR(dispatcher_green_ap_pdev_open(pdev)))
  815. goto out;
  816. return QDF_STATUS_SUCCESS;
  817. spectral_pdev_open_fail:
  818. dispatcher_regulatory_pdev_close(pdev);
  819. out:
  820. return QDF_STATUS_E_FAILURE;
  821. }
  822. qdf_export_symbol(dispatcher_pdev_open);
  823. QDF_STATUS dispatcher_pdev_close(struct wlan_objmgr_pdev *pdev)
  824. {
  825. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_regulatory_pdev_close(pdev));
  826. QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_spectral_pdev_close(pdev));
  827. QDF_BUG(QDF_STATUS_SUCCESS == wlan_mgmt_txrx_pdev_close(pdev));
  828. return QDF_STATUS_SUCCESS;
  829. }
  830. qdf_export_symbol(dispatcher_pdev_close);