From f8c3145190f2f5c0b08e7fc8c8af47b3dbb44a80 Mon Sep 17 00:00:00 2001 From: Ashok Ponnaiah Date: Fri, 24 Mar 2017 06:22:24 +0530 Subject: [PATCH] qcacmn: move crypto init from umac to cmn code move crypto init from umac to cmn code Move wlan_crypto_main.h file from src folder to include folder Change #if to #ifdef Change-Id: I363d4b2e7b2c2fc3291f1dd5ef8a6f3837a82df5 --- .../dispatcher/src/dispatcher_init_deinit.c | 32 +++++++++++++++++++ .../crypto/{src => inc}/wlan_crypto_main.h | 0 .../lmac_if/inc/wlan_lmac_if_def.h | 6 ++-- .../lmac_if/src/wlan_lmac_if.c | 19 ++++++++--- 4 files changed, 50 insertions(+), 7 deletions(-) rename umac/cmn_services/crypto/{src => inc}/wlan_crypto_main.h (100%) diff --git a/init_deinit/dispatcher/src/dispatcher_init_deinit.c b/init_deinit/dispatcher/src/dispatcher_init_deinit.c index be6d3e9cc01c..7f609f54f76a 100644 --- a/init_deinit/dispatcher/src/dispatcher_init_deinit.c +++ b/init_deinit/dispatcher/src/dispatcher_init_deinit.c @@ -39,6 +39,9 @@ #include "wlan_nan_api.h" #endif /* WLAN_FEATURE_NAN_CONVERGENCE */ +#ifdef WLAN_CONV_CRYPTO_SUPPORTED +#include "wlan_crypto_main.h" +#endif /** * DOC: This file provides various init/deinit trigger point for new * components. @@ -273,6 +276,28 @@ static QDF_STATUS atf_psoc_disable(struct wlan_objmgr_psoc *psoc) } #endif /* END of WLAN_ATF_ENABLE */ +#ifdef WLAN_CONV_CRYPTO_SUPPORTED +static QDF_STATUS dispatcher_init_crypto(void) +{ + return wlan_crypto_init(); +} + +static QDF_STATUS dispatcher_deinit_crypto(void) +{ + return wlan_crypto_deinit(); +} +#else +static QDF_STATUS dispatcher_init_crypto(void) +{ + return QDF_STATUS_SUCCESS; +} + +static QDF_STATUS dispatcher_deinit_crypto(void) +{ + return QDF_STATUS_SUCCESS; +} +#endif /* END of WLAN_CONV_CRYPTO_SUPPORTED */ + #ifdef WIFI_POS_CONVERGED static QDF_STATUS dispatcher_init_wifi_pos(void) { @@ -383,6 +408,9 @@ QDF_STATUS dispatcher_init(void) if (QDF_STATUS_SUCCESS != dispatcher_init_pmo()) goto pmo_init_fail; + if (QDF_STATUS_SUCCESS != dispatcher_init_crypto()) + goto crypto_init_fail; + if (QDF_STATUS_SUCCESS != dispatcher_policy_mgr_init()) goto policy_mgr_init_fail; @@ -404,6 +432,8 @@ wifi_pos_init_fail: atf_init_fail: dispatcher_policy_mgr_deinit(); policy_mgr_init_fail: + dispatcher_deinit_crypto(); +crypto_init_fail: dispatcher_deinit_pmo(); pmo_init_fail: scheduler_deinit(); @@ -435,6 +465,8 @@ QDF_STATUS dispatcher_deinit(void) QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_policy_mgr_deinit()); + QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_crypto()); + QDF_BUG(QDF_STATUS_SUCCESS == dispatcher_deinit_pmo()); QDF_BUG(QDF_STATUS_SUCCESS == scheduler_deinit()); diff --git a/umac/cmn_services/crypto/src/wlan_crypto_main.h b/umac/cmn_services/crypto/inc/wlan_crypto_main.h similarity index 100% rename from umac/cmn_services/crypto/src/wlan_crypto_main.h rename to umac/cmn_services/crypto/inc/wlan_crypto_main.h diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index a9ecfb3a5fd4..b958c4599dd9 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -28,7 +28,7 @@ #include "wlan_atf_utils_defs.h" #endif -#if WLAN_CONV_CRYPTO_SUPPORTED +#ifdef WLAN_CONV_CRYPTO_SUPPORTED #include "wlan_crypto_global_def.h" #endif @@ -372,7 +372,7 @@ struct wlan_lmac_if_tx_ops { #ifdef WLAN_ATF_ENABLE struct wlan_lmac_if_atf_tx_ops atf_tx_ops; #endif -#if WLAN_CONV_CRYPTO_SUPPORTED +#ifdef WLAN_CONV_CRYPTO_SUPPORTED struct wlan_lmac_if_crypto_tx_ops crypto_tx_ops; #endif #ifdef WIFI_POS_CONVERGED @@ -596,7 +596,7 @@ struct wlan_lmac_if_rx_ops { #ifdef WLAN_ATF_ENABLE struct wlan_lmac_if_atf_rx_ops atf_rx_ops; #endif -#if WLAN_CONV_CRYPTO_SUPPORTED +#ifdef WLAN_CONV_CRYPTO_SUPPORTED struct wlan_lmac_if_crypto_rx_ops crypto_rx_ops; #endif #ifdef WIFI_POS_CONVERGED 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 1111e792a884..cfc91f586045 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,7 +32,7 @@ #include "target_if_nan.h" #endif /* WLAN_FEATURE_NAN_CONVERGENCE */ -#if WLAN_CONV_CRYPTO_SUPPORTED +#ifdef WLAN_CONV_CRYPTO_SUPPORTED #include "wlan_crypto_global_api.h" #endif /* Function pointer for OL/WMA specific UMAC tx_ops @@ -99,6 +99,19 @@ wlan_lmac_if_atf_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) } #endif +#ifdef WLAN_CONV_CRYPTO_SUPPORTED +static void +wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) +{ + wlan_crypto_register_crypto_rx_ops(&rx_ops->crypto_rx_ops); +} +#else +static void +wlan_lmac_if_crypto_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) +{ +} +#endif + #ifdef WIFI_POS_CONVERGED static void wlan_lmac_if_umac_rx_ops_register_wifi_pos( struct wlan_lmac_if_rx_ops *rx_ops) @@ -162,9 +175,7 @@ wlan_lmac_if_umac_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) rx_ops->scan.scan_ev_handler = tgt_scan_event_handler; wlan_lmac_if_atf_rx_ops_register(rx_ops); -#if WLAN_CONV_CRYPTO_SUPPORTED - wlan_crypto_register_crypto_rx_ops(&rx_ops->crypto_rx_ops); -#endif + wlan_lmac_if_crypto_rx_ops_register(rx_ops); /* wifi_pos rx ops */ wlan_lmac_if_umac_rx_ops_register_wifi_pos(rx_ops);