From cda0961ecc7f52f07eb2e030328c1159a3bd7bc0 Mon Sep 17 00:00:00 2001 From: Frank Liu Date: Wed, 29 Mar 2017 14:43:17 +0800 Subject: [PATCH] qcacmn: Enable TDLS component Enable TDLS module in dispatcher Change-Id: I4b1fe09278115a90eb6b19ed6ce8fef57143a910 CRs-Fixed: 2011330 --- .../dispatcher/src/dispatcher_init_deinit.c | 36 +++++++++++++++++++ umac/tdls/dispatcher/inc/wlan_tdls_ucfg_api.h | 12 +++++-- umac/tdls/dispatcher/src/wlan_tdls_ucfg_api.c | 28 +++++++++++++-- 3 files changed, 71 insertions(+), 5 deletions(-) diff --git a/init_deinit/dispatcher/src/dispatcher_init_deinit.c b/init_deinit/dispatcher/src/dispatcher_init_deinit.c index 4f3900adfa0a..dbe9910a6d7f 100644 --- a/init_deinit/dispatcher/src/dispatcher_init_deinit.c +++ b/init_deinit/dispatcher/src/dispatcher_init_deinit.c @@ -55,6 +55,10 @@ #ifdef WLAN_OFFCHAN_TXRX_ENABLE #include #endif + +#ifdef CONVERGED_TDLS_ENABLE +#include "wlan_tdls_ucfg_api.h" +#endif /** * DOC: This file provides various init/deinit trigger point for new * components. @@ -127,6 +131,37 @@ static QDF_STATUS p2p_psoc_disable(struct wlan_objmgr_psoc *psoc) } #endif /* END of CONVERGED_P2P_ENABLE */ +#ifdef CONVERGED_TDLS_ENABLE +static QDF_STATUS tdls_init(void) +{ + return ucfg_tdls_init(); +} + +static QDF_STATUS tdls_deinit(void) +{ + return ucfg_tdls_deinit(); +} + +static QDF_STATUS tdls_psoc_open(struct wlan_objmgr_psoc *psoc) +{ + return ucfg_tdls_psoc_open(psoc); +} + +static QDF_STATUS tdls_psoc_close(struct wlan_objmgr_psoc *psoc) +{ + return ucfg_tdls_psoc_close(psoc); +} + +static QDF_STATUS tdls_psoc_enable(struct wlan_objmgr_psoc *psoc) +{ + return ucfg_tdls_psoc_enable(psoc); +} + +static QDF_STATUS tdls_psoc_disable(struct wlan_objmgr_psoc *psoc) +{ + return ucfg_tdls_psoc_disable(psoc); +} +#else static QDF_STATUS tdls_init(void) { return QDF_STATUS_SUCCESS; @@ -157,6 +192,7 @@ static QDF_STATUS tdls_psoc_disable(struct wlan_objmgr_psoc *psoc) { return QDF_STATUS_SUCCESS; } +#endif #ifdef WLAN_PMO_ENABLE static QDF_STATUS dispatcher_init_pmo(void) diff --git a/umac/tdls/dispatcher/inc/wlan_tdls_ucfg_api.h b/umac/tdls/dispatcher/inc/wlan_tdls_ucfg_api.h index a3aa7b34a4af..70a6c450a23f 100644 --- a/umac/tdls/dispatcher/inc/wlan_tdls_ucfg_api.h +++ b/umac/tdls/dispatcher/inc/wlan_tdls_ucfg_api.h @@ -73,12 +73,20 @@ QDF_STATUS ucfg_tdls_update_config(struct wlan_objmgr_psoc *psoc, struct tdls_start_params *req); /** - * ucfg_tdls_psoc_stop() - TDLS module stop + * ucfg_tdls_psoc_enable() - TDLS module enable API * @psoc: psoc object * * Return: QDF_STATUS */ -QDF_STATUS ucfg_tdls_psoc_stop(struct wlan_objmgr_psoc *psoc); +QDF_STATUS ucfg_tdls_psoc_enable(struct wlan_objmgr_psoc *psoc); + +/** + * ucfg_tdls_psoc_disable() - TDLS moudle disable API + * @psoc: psoc object + * + * Return: QDF_STATUS + */ +QDF_STATUS ucfg_tdls_psoc_disable(struct wlan_objmgr_psoc *psoc); /** * ucfg_tdls_add_peer() - handle TDLS add peer diff --git a/umac/tdls/dispatcher/src/wlan_tdls_ucfg_api.c b/umac/tdls/dispatcher/src/wlan_tdls_ucfg_api.c index c867af0274e9..37a94d249592 100644 --- a/umac/tdls/dispatcher/src/wlan_tdls_ucfg_api.c +++ b/umac/tdls/dispatcher/src/wlan_tdls_ucfg_api.c @@ -23,6 +23,7 @@ */ #include +#include #include "../../core/src/wlan_tdls_main.h" #include "../../core/src/wlan_tdls_cmds_process.h" #include @@ -213,11 +214,32 @@ QDF_STATUS ucfg_tdls_update_config(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } -QDF_STATUS ucfg_tdls_psoc_stop(struct wlan_objmgr_psoc *psoc) +QDF_STATUS ucfg_tdls_psoc_enable(struct wlan_objmgr_psoc *psoc) { + QDF_STATUS status; + + tdls_notice("psoc tdls enable: 0x%p", psoc); + if (!psoc) { + tdls_err("NULL psoc"); + return QDF_STATUS_E_FAILURE; + } + + status = tgt_tdls_register_ev_handler(psoc); + + return status; +} + +QDF_STATUS ucfg_tdls_psoc_disable(struct wlan_objmgr_psoc *psoc) +{ + QDF_STATUS status; struct tdls_soc_priv_obj *soc_obj = NULL; - tdls_notice("tdls psoc stop"); + tdls_notice("psoc tdls disable: 0x%p", psoc); + if (!psoc) { + tdls_err("NULL psoc"); + return QDF_STATUS_E_FAILURE; + } + status = tgt_tdls_unregister_ev_handler(psoc); soc_obj = wlan_objmgr_psoc_get_comp_private_obj(psoc, WLAN_UMAC_COMP_TDLS); if (!soc_obj) { @@ -231,7 +253,7 @@ QDF_STATUS ucfg_tdls_psoc_stop(struct wlan_objmgr_psoc *psoc) soc_obj->tdls_tx_cnf_cb = NULL; soc_obj->tx_ack_cnf_cb_data = NULL; - return QDF_STATUS_SUCCESS; + return status; } QDF_STATUS ucfg_tdls_psoc_close(struct wlan_objmgr_psoc *psoc)