From 6f0eadf7be81e5318769c87450901494205b2b74 Mon Sep 17 00:00:00 2001 From: Naga Date: Thu, 8 Feb 2018 15:23:36 +0530 Subject: [PATCH] qcacmn: Add support for cp stats in init_deinit Add support for cp stats component initialization and deinitization, and invoke cp stats for psoc open, close, enable and disable CRs-Fixed: 2192386 Change-Id: I6295f86d3c9570815fe9648b3320e1d31d79bbef --- .../dispatcher/src/dispatcher_init_deinit.c | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/init_deinit/dispatcher/src/dispatcher_init_deinit.c b/init_deinit/dispatcher/src/dispatcher_init_deinit.c index 6eb06b6ba9..f7ca4271b1 100644 --- a/init_deinit/dispatcher/src/dispatcher_init_deinit.c +++ b/init_deinit/dispatcher/src/dispatcher_init_deinit.c @@ -77,6 +77,10 @@ #include #endif +#ifdef QCA_SUPPORT_CP_STATS +#include +#endif + /** * DOC: This file provides various init/deinit trigger point for new * components. @@ -89,6 +93,68 @@ spectral_pdev_open_handler dispatcher_spectral_pdev_open_handler_cb; +#ifdef QCA_SUPPORT_CP_STATS +static QDF_STATUS dispatcher_init_cp_stats(void) +{ + return wlan_cp_stats_init(); +} + +static QDF_STATUS dispatcher_deinit_cp_stats(void) +{ + return wlan_cp_stats_deinit(); +} + +static QDF_STATUS cp_stats_psoc_open(struct wlan_objmgr_psoc *psoc) +{ + return wlan_cp_stats_open(psoc); +} + +static QDF_STATUS cp_stats_psoc_close(struct wlan_objmgr_psoc *psoc) +{ + return wlan_cp_stats_close(psoc); +} + +static QDF_STATUS cp_stats_psoc_enable(struct wlan_objmgr_psoc *psoc) +{ + return wlan_cp_stats_enable(psoc); +} + +static QDF_STATUS cp_stats_psoc_disable(struct wlan_objmgr_psoc *psoc) +{ + return wlan_cp_stats_disable(psoc); +} +#else +static QDF_STATUS dispatcher_init_cp_stats(void) +{ + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS dispatcher_deinit_cp_stats(void) +{ + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS cp_stats_psoc_open(struct wlan_objmgr_psoc *psoc) +{ + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS cp_stats_psoc_close(struct wlan_objmgr_psoc *psoc) +{ + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS cp_stats_psoc_enable(struct wlan_objmgr_psoc *psoc) +{ + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS cp_stats_psoc_disable(struct wlan_objmgr_psoc *psoc) +{ + return QDF_STATUS_SUCCESS; +} +#endif + #ifdef CONVERGED_P2P_ENABLE static QDF_STATUS p2p_init(void) { @@ -835,6 +901,9 @@ QDF_STATUS dispatcher_init(void) if (QDF_STATUS_SUCCESS != dispatcher_policy_mgr_init()) goto policy_mgr_init_fail; + if (QDF_STATUS_SUCCESS != dispatcher_init_cp_stats()) + goto cp_stats_init_fail; + if (QDF_STATUS_SUCCESS != dispatcher_init_atf()) goto atf_init_fail; @@ -911,6 +980,8 @@ wifi_pos_init_fail: sa_api_init_fail: dispatcher_deinit_atf(); atf_init_fail: + dispatcher_deinit_cp_stats(); +cp_stats_init_fail: dispatcher_policy_mgr_deinit(); policy_mgr_init_fail: dispatcher_deinit_crypto(); @@ -962,6 +1033,8 @@ QDF_STATUS dispatcher_deinit(void) QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_atf()); + QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_cp_stats()); + QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_policy_mgr_deinit()); QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_crypto()); @@ -1017,6 +1090,9 @@ QDF_STATUS dispatcher_psoc_open(struct wlan_objmgr_psoc *psoc) if (QDF_STATUS_SUCCESS != wlan_serialization_psoc_open(psoc)) goto serialization_psoc_open_fail; + if (QDF_STATUS_SUCCESS != cp_stats_psoc_open(psoc)) + goto cp_stats_psoc_open_fail; + if (QDF_STATUS_SUCCESS != atf_psoc_open(psoc)) goto atf_psoc_open_fail; @@ -1043,6 +1119,8 @@ regulatory_psoc_open_fail: policy_mgr_psoc_open_fail: atf_psoc_close(psoc); atf_psoc_open_fail: + cp_stats_psoc_close(psoc); +cp_stats_psoc_open_fail: wlan_serialization_psoc_close(psoc); serialization_psoc_open_fail: tdls_psoc_close(psoc); @@ -1070,6 +1148,8 @@ QDF_STATUS dispatcher_psoc_close(struct wlan_objmgr_psoc *psoc) QDF_BUG(QDF_STATUS_SUCCESS == atf_psoc_close(psoc)); + QDF_BUG(QDF_STATUS_SUCCESS == cp_stats_psoc_close(psoc)); + QDF_BUG(QDF_STATUS_SUCCESS == wlan_serialization_psoc_close(psoc)); QDF_BUG(QDF_STATUS_SUCCESS == tdls_psoc_close(psoc)); @@ -1101,6 +1181,9 @@ QDF_STATUS dispatcher_psoc_enable(struct wlan_objmgr_psoc *psoc) if (QDF_STATUS_SUCCESS != sa_api_psoc_enable(psoc)) goto sa_api_psoc_enable_fail; + if (QDF_STATUS_SUCCESS != cp_stats_psoc_enable(psoc)) + goto cp_stats_psoc_enable_fail; + if (QDF_STATUS_SUCCESS != atf_psoc_enable(psoc)) goto atf_psoc_enable_fail; @@ -1132,6 +1215,8 @@ nan_psoc_enable_fail: wifi_pos_psoc_enable_fail: atf_psoc_disable(psoc); atf_psoc_enable_fail: + cp_stats_psoc_disable(psoc); +cp_stats_psoc_enable_fail: sa_api_psoc_disable(psoc); sa_api_psoc_enable_fail: dispatcher_policy_mgr_psoc_disable(psoc); @@ -1161,6 +1246,8 @@ QDF_STATUS dispatcher_psoc_disable(struct wlan_objmgr_psoc *psoc) QDF_BUG(QDF_STATUS_SUCCESS == atf_psoc_disable(psoc)); + QDF_BUG(QDF_STATUS_SUCCESS == cp_stats_psoc_disable(psoc)); + QDF_BUG(QDF_STATUS_SUCCESS == sa_api_psoc_disable(psoc)); QDF_BUG(QDF_STATUS_SUCCESS ==