From 849fd2c75977e46383aa42459abf854b12b7e685 Mon Sep 17 00:00:00 2001 From: Wu Gao Date: Thu, 23 Mar 2017 10:14:39 +0800 Subject: [PATCH] qcacmn: Init and deinit P2P This is a change to init and de-init P2P component in host common. Add P2P component name in qdf trace. Change-Id: I0a9d56afe851e3414bf860bed944c4e0fe661fbc CRs-Fixed: 2006260 --- .../dispatcher/src/dispatcher_init_deinit.c | 76 ++++++++++++++----- qdf/linux/src/qdf_trace.c | 1 + .../lmac_if/src/wlan_lmac_if.c | 20 +++++ 3 files changed, 76 insertions(+), 21 deletions(-) diff --git a/init_deinit/dispatcher/src/dispatcher_init_deinit.c b/init_deinit/dispatcher/src/dispatcher_init_deinit.c index 601ed5bcc3..52ff2f92fe 100644 --- a/init_deinit/dispatcher/src/dispatcher_init_deinit.c +++ b/init_deinit/dispatcher/src/dispatcher_init_deinit.c @@ -39,6 +39,10 @@ #ifdef WLAN_FEATURE_NAN_CONVERGENCE #include "wlan_nan_api.h" #endif /* WLAN_FEATURE_NAN_CONVERGENCE */ +#ifdef CONVERGED_P2P_ENABLE +#include +#include +#endif #ifdef WLAN_CONV_CRYPTO_SUPPORTED #include "wlan_crypto_main.h" @@ -53,6 +57,37 @@ * thier actual handlers are ready */ +#ifdef CONVERGED_P2P_ENABLE +static QDF_STATUS p2p_init(void) +{ + return ucfg_p2p_init(); +} + +static QDF_STATUS p2p_deinit(void) +{ + return ucfg_p2p_deinit(); +} + +static QDF_STATUS p2p_psoc_open(struct wlan_objmgr_psoc *psoc) +{ + return ucfg_p2p_psoc_open(psoc); +} + +static QDF_STATUS p2p_psoc_close(struct wlan_objmgr_psoc *psoc) +{ + return ucfg_p2p_psoc_close(psoc); +} + +static QDF_STATUS p2p_psoc_enable(struct wlan_objmgr_psoc *psoc) +{ + return wlan_p2p_start(psoc); +} + +static QDF_STATUS p2p_psoc_disable(struct wlan_objmgr_psoc *psoc) +{ + return wlan_p2p_stop(psoc); +} +#else static QDF_STATUS p2p_init(void) { return QDF_STATUS_SUCCESS; @@ -63,17 +98,6 @@ static QDF_STATUS p2p_deinit(void) return QDF_STATUS_SUCCESS; } - -static QDF_STATUS tdls_init(void) -{ - return QDF_STATUS_SUCCESS; -} - -static QDF_STATUS tdls_deinit(void) -{ - return QDF_STATUS_SUCCESS; -} - static QDF_STATUS p2p_psoc_open(struct wlan_objmgr_psoc *psoc) { return QDF_STATUS_SUCCESS; @@ -84,16 +108,6 @@ static QDF_STATUS p2p_psoc_close(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_SUCCESS; } -static QDF_STATUS tdls_psoc_open(struct wlan_objmgr_psoc *psoc) -{ - return QDF_STATUS_SUCCESS; -} - -static QDF_STATUS tdls_psoc_close(struct wlan_objmgr_psoc *psoc) -{ - return QDF_STATUS_SUCCESS; -} - static QDF_STATUS p2p_psoc_enable(struct wlan_objmgr_psoc *psoc) { return QDF_STATUS_SUCCESS; @@ -103,7 +117,27 @@ static QDF_STATUS p2p_psoc_disable(struct wlan_objmgr_psoc *psoc) { return QDF_STATUS_SUCCESS; } +#endif /* END of CONVERGED_P2P_ENABLE */ +static QDF_STATUS tdls_init(void) +{ + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS tdls_deinit(void) +{ + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS tdls_psoc_open(struct wlan_objmgr_psoc *psoc) +{ + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS tdls_psoc_close(struct wlan_objmgr_psoc *psoc) +{ + return QDF_STATUS_SUCCESS; +} static QDF_STATUS tdls_psoc_enable(struct wlan_objmgr_psoc *psoc) { diff --git a/qdf/linux/src/qdf_trace.c b/qdf/linux/src/qdf_trace.c index 5e6faca86c..e12e3e762a 100644 --- a/qdf/linux/src/qdf_trace.c +++ b/qdf/linux/src/qdf_trace.c @@ -1807,6 +1807,7 @@ struct category_name_info g_qdf_category_name[MAX_SUPPORTED_CATEGORY] = { [QDF_MODULE_ID_PMO] = {"PMO"}, [QDF_MODULE_ID_POLICY_MGR] = {"POLICY_MGR"}, [QDF_MODULE_ID_NAN] = {"NAN"}, + [QDF_MODULE_ID_P2P] = {"P2P"}, [QDF_MODULE_ID_ANY] = {"ANY"}, }; diff --git a/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c b/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c index af28e731ad..d910b32e34 100644 --- a/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c +++ b/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c @@ -32,6 +32,9 @@ #include "target_if_nan.h" #endif /* WLAN_FEATURE_NAN_CONVERGENCE */ #include "wlan_reg_tgt_api.h" +#ifdef CONVERGED_P2P_ENABLE +#include "wlan_p2p_tgt_api.h" +#endif #ifdef WLAN_CONV_CRYPTO_SUPPORTED #include "wlan_crypto_global_api.h" @@ -137,6 +140,20 @@ static void wlan_lmac_if_register_nan_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops) } #endif /* WLAN_FEATURE_NAN_CONVERGENCE */ +#ifdef CONVERGED_P2P_ENABLE +static void wlan_lmac_if_umac_rx_ops_register_p2p( + struct wlan_lmac_if_rx_ops *rx_ops) +{ + rx_ops->p2p.lo_ev_handler = tgt_p2p_lo_event_cb; + rx_ops->p2p.noa_ev_handler = tgt_p2p_noa_event_cb; +} +#else +static void wlan_lmac_if_umac_rx_ops_register_p2p( + struct wlan_lmac_if_rx_ops *rx_ops) +{ +} +#endif + /** * wlan_lmac_if_umac_rx_ops_register() - UMAC rx handler register * @rx_ops: Pointer to rx_ops structure to be populated @@ -187,6 +204,9 @@ wlan_lmac_if_umac_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) rx_ops->reg_rx_ops.master_list_handler = tgt_reg_process_master_chan_list; + /* p2p rx ops */ + wlan_lmac_if_umac_rx_ops_register_p2p(rx_ops); + return QDF_STATUS_SUCCESS; }