From 5e7f1dc1d130645518c4dda553c6a8803f08b27a Mon Sep 17 00:00:00 2001 From: Amar Singhal Date: Thu, 23 Mar 2017 17:38:49 -0700 Subject: [PATCH] qcacmn: Activate init and deinit for regulatory component Call APIs to register regulatory component for pdev/psoc messages. Also call regulatory APIs for dispatcher psoc open. Change-Id: Ib0e735dfaf7ab9b9960196774d77ad070cf04406 CRs-Fixed: 2002892 --- .../dispatcher/src/dispatcher_init_deinit.c | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/init_deinit/dispatcher/src/dispatcher_init_deinit.c b/init_deinit/dispatcher/src/dispatcher_init_deinit.c index 57bb0ade0851..055009e49fc2 100644 --- a/init_deinit/dispatcher/src/dispatcher_init_deinit.c +++ b/init_deinit/dispatcher/src/dispatcher_init_deinit.c @@ -43,6 +43,7 @@ #include #include #endif +#include #ifdef WLAN_CONV_CRYPTO_SUPPORTED #include "wlan_crypto_main.h" @@ -176,6 +177,30 @@ static QDF_STATUS dispatcher_deinit_pmo(void) } #endif /* END of WLAN_PMO_ENABLE */ + +static QDF_STATUS dispatcher_regulatory_init(void) +{ + return wlan_regulatory_init(); +} + +static QDF_STATUS dispatcher_regulatory_deinit(void) +{ + return wlan_regulatory_deinit(); +} + +static QDF_STATUS dispatcher_regulatory_psoc_open(struct wlan_objmgr_psoc + *psoc) +{ + return regulatory_psoc_open(psoc); +} + +static QDF_STATUS dispatcher_regulatory_psoc_close(struct wlan_objmgr_psoc + *psoc) +{ + return regulatory_psoc_close(psoc); +} + + #ifdef WLAN_POLICY_MGR_ENABLE static QDF_STATUS dispatcher_policy_mgr_init(void) { @@ -456,8 +481,13 @@ QDF_STATUS dispatcher_init(void) if (QDF_STATUS_SUCCESS != dispatcher_init_dfs()) goto dfs_init_fail; + if (QDF_STATUS_SUCCESS != dispatcher_regulatory_init()) + goto regulatory_init_fail; + return QDF_STATUS_SUCCESS; +regulatory_init_fail: + dispatcher_deinit_dfs(); dfs_init_fail: dispatcher_deinit_nan(); nan_init_fail: @@ -492,6 +522,8 @@ EXPORT_SYMBOL(dispatcher_init); QDF_STATUS dispatcher_deinit(void) { + QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_regulatory_deinit()); + QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_dfs()); QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_nan()); @@ -541,8 +573,13 @@ QDF_STATUS dispatcher_psoc_open(struct wlan_objmgr_psoc *psoc) if (QDF_STATUS_SUCCESS != atf_psoc_open(psoc)) goto atf_psoc_open_fail; + if (QDF_STATUS_SUCCESS != dispatcher_regulatory_psoc_open(psoc)) + goto regulatory_psoc_open_fail; + return QDF_STATUS_SUCCESS; +regulatory_psoc_open_fail: + atf_psoc_close(psoc); atf_psoc_open_fail: wlan_serialization_psoc_close(psoc); serialization_psoc_open_fail: @@ -559,6 +596,8 @@ EXPORT_SYMBOL(dispatcher_psoc_open); QDF_STATUS dispatcher_psoc_close(struct wlan_objmgr_psoc *psoc) { + QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_regulatory_psoc_close(psoc)); + QDF_BUG(QDF_STATUS_SUCCESS == atf_psoc_close(psoc)); QDF_BUG(QDF_STATUS_SUCCESS == wlan_serialization_psoc_close(psoc));