From fbc87b72300546c762e5439459777e5e35e907b5 Mon Sep 17 00:00:00 2001 From: Sravan Kumar Kairam Date: Mon, 9 Apr 2018 14:09:52 +0530 Subject: [PATCH] qcacld-3.0: Fix wlan_ipa_set_perf_level failure for UNIFIED_WDI_API Add Unified WDI API support for ol_txrx_ipa_set_perf_level and fix client parameter for ipa_wdi_set_perf_profile. Change-Id: Ieaaf7cf5231f74cd6ba358c02032ae173d9618f0 CRs-Fixed: 2211504 --- components/ipa/core/inc/wlan_ipa_core.h | 29 ++++++---------- components/ipa/core/src/wlan_ipa_rm.c | 23 ++++++------- core/dp/txrx/ol_txrx_ipa.c | 45 +++++++++++++++++++++++-- 3 files changed, 64 insertions(+), 33 deletions(-) diff --git a/components/ipa/core/inc/wlan_ipa_core.h b/components/ipa/core/inc/wlan_ipa_core.h index 7c0652a9c021..df6123cfee21 100644 --- a/components/ipa/core/inc/wlan_ipa_core.h +++ b/components/ipa/core/inc/wlan_ipa_core.h @@ -125,17 +125,6 @@ QDF_STATUS wlan_ipa_uc_enable_pipes(struct wlan_ipa_priv *ipa_ctx); */ QDF_STATUS wlan_ipa_uc_disable_pipes(struct wlan_ipa_priv *ipa_ctx); -/** - * wlan_ipa_get_iface() - Get IPA interface - * @ipa_ctx: IPA context - * @mode: Interface device mode - * - * Return: IPA interface address - */ -struct wlan_ipa_iface_context -*wlan_ipa_get_iface(struct wlan_ipa_priv *ipa_ctx, uint8_t mode); - -#ifndef CONFIG_IPA_WDI_UNIFIED_API /** * wlan_ipa_set_perf_level() - Set IPA performance level * @ipa_ctx: IPA context @@ -147,6 +136,17 @@ struct wlan_ipa_iface_context QDF_STATUS wlan_ipa_set_perf_level(struct wlan_ipa_priv *ipa_ctx, uint64_t tx_packets, uint64_t rx_packets); +/** + * wlan_ipa_get_iface() - Get IPA interface + * @ipa_ctx: IPA context + * @mode: Interface device mode + * + * Return: IPA interface address + */ +struct wlan_ipa_iface_context +*wlan_ipa_get_iface(struct wlan_ipa_priv *ipa_ctx, uint8_t mode); + +#ifndef CONFIG_IPA_WDI_UNIFIED_API /** * wlan_ipa_wdi_rm_request_resource() - IPA WDI request resource * @ipa_ctx: IPA context @@ -225,13 +225,6 @@ int wlan_ipa_wdi_rm_inactivity_timer_destroy( #else /* CONFIG_IPA_WDI_UNIFIED_API */ -static inline -QDF_STATUS wlan_ipa_set_perf_level(struct wlan_ipa_priv *ipa_ctx, - uint64_t tx_packets, uint64_t rx_packets) -{ - return QDF_STATUS_SUCCESS; -} - static inline int wlan_ipa_wdi_rm_request_resource( struct wlan_ipa_priv *ipa_ctx, qdf_ipa_rm_resource_name_t res_name) diff --git a/components/ipa/core/src/wlan_ipa_rm.c b/components/ipa/core/src/wlan_ipa_rm.c index a7ae85ef5553..8110c9305da5 100644 --- a/components/ipa/core/src/wlan_ipa_rm.c +++ b/components/ipa/core/src/wlan_ipa_rm.c @@ -22,16 +22,6 @@ #include "cdp_txrx_ipa.h" #include "host_diag_core_event.h" - -#ifdef FEATURE_METERING -void wlan_ipa_init_metering(struct wlan_ipa_priv *ipa_ctx) -{ - qdf_event_create(&ipa_ctx->ipa_uc_sharing_stats_comp); - qdf_event_create(&ipa_ctx->ipa_uc_set_quota_comp); -} -#endif - -#ifndef CONFIG_IPA_WDI_UNIFIED_API QDF_STATUS wlan_ipa_set_perf_level(struct wlan_ipa_priv *ipa_ctx, uint64_t tx_packets, uint64_t rx_packets) @@ -69,7 +59,7 @@ QDF_STATUS wlan_ipa_set_perf_level(struct wlan_ipa_priv *ipa_ctx, ipa_debug("Requesting CONS perf curr: %d, next: %d", ipa_ctx->curr_cons_bw, next_cons_bw); ret = cdp_ipa_set_perf_level(ipa_ctx->dp_soc, - QDF_IPA_RM_RESOURCE_WLAN_CONS, + QDF_IPA_CLIENT_WLAN1_CONS, next_cons_bw); if (ret) { ipa_err("RM CONS set perf profile failed: %d", ret); @@ -84,7 +74,7 @@ QDF_STATUS wlan_ipa_set_perf_level(struct wlan_ipa_priv *ipa_ctx, ipa_debug("Requesting PROD perf curr: %d, next: %d", ipa_ctx->curr_prod_bw, next_prod_bw); ret = cdp_ipa_set_perf_level(ipa_ctx->dp_soc, - QDF_IPA_RM_RESOURCE_WLAN_PROD, + QDF_IPA_CLIENT_WLAN1_PROD, next_prod_bw); if (ret) { ipa_err("RM PROD set perf profile failed: %d", ret); @@ -97,6 +87,15 @@ QDF_STATUS wlan_ipa_set_perf_level(struct wlan_ipa_priv *ipa_ctx, return QDF_STATUS_SUCCESS; } +#ifdef FEATURE_METERING +void wlan_ipa_init_metering(struct wlan_ipa_priv *ipa_ctx) +{ + qdf_event_create(&ipa_ctx->ipa_uc_sharing_stats_comp); + qdf_event_create(&ipa_ctx->ipa_uc_set_quota_comp); +} +#endif + +#ifndef CONFIG_IPA_WDI_UNIFIED_API /** * wlan_ipa_rm_cons_release() - WLAN consumer resource release handler * diff --git a/core/dp/txrx/ol_txrx_ipa.c b/core/dp/txrx/ol_txrx_ipa.c index c406dd5d61fa..84cad30a49ba 100644 --- a/core/dp/txrx/ol_txrx_ipa.c +++ b/core/dp/txrx/ol_txrx_ipa.c @@ -758,6 +758,34 @@ QDF_STATUS ol_txrx_ipa_disable_pipes(struct cdp_pdev *ppdev) return QDF_STATUS_SUCCESS; } +/** + * ol_txrx_ipa_set_perf_level() - Set IPA clock bandwidth based on data rates + * @client: Client type + * @max_supported_bw_mbps: Maximum bandwidth needed (in Mbps) + * + * Return: QDF_STATUS + */ +QDF_STATUS ol_txrx_ipa_set_perf_level(int client, + uint32_t max_supported_bw_mbps) +{ + qdf_ipa_wdi_perf_profile_t profile; + int result; + + QDF_IPA_WDI_PERF_PROFILE_CLIENT(&profile) = client; + QDF_IPA_WDI_PERF_PROFILE_MAX_SUPPORTED_BW_MBPS(&profile) = + max_supported_bw_mbps; + result = qdf_ipa_wdi_set_perf_profile(&profile); + + if (result) { + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, + "Set perf profile failed, code %d", result); + + return QDF_STATUS_E_FAILURE; + } + + return QDF_STATUS_SUCCESS; +} + #else /* CONFIG_IPA_WDI_UNIFIED_API */ #ifdef ENABLE_SMMU_S1_TRANSLATION @@ -1490,8 +1518,6 @@ QDF_STATUS ol_txrx_ipa_disable_pipes(struct cdp_pdev *ppdev) return QDF_STATUS_SUCCESS; } -#endif /* CONFIG_IPA_WDI_UNIFIED_API */ - /** * ol_txrx_ipa_set_perf_level() - Set IPA clock bandwidth based on data rates * @client: Client type @@ -1502,12 +1528,23 @@ QDF_STATUS ol_txrx_ipa_disable_pipes(struct cdp_pdev *ppdev) QDF_STATUS ol_txrx_ipa_set_perf_level(int client, uint32_t max_supported_bw_mbps) { + qdf_ipa_rm_resource_name_t resource_name; qdf_ipa_rm_perf_profile_t profile; int result; + if (client == QDF_IPA_CLIENT_WLAN1_PROD) { + resource_name = QDF_IPA_RM_RESOURCE_WLAN_PROD; + } else if (client == QDF_IPA_CLIENT_WLAN1_CONS) { + resource_name = QDF_IPA_RM_RESOURCE_WLAN_CONS; + } else { + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, + "not supported client %d", client); + return QDF_STATUS_E_FAILURE; + } + QDF_IPA_RM_PERF_PROFILE_MAX_SUPPORTED_BANDWIDTH_MBPS(&profile) = max_supported_bw_mbps; - result = qdf_ipa_rm_set_perf_profile(client, &profile); + result = qdf_ipa_rm_set_perf_profile(resource_name, &profile); if (result) { QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR, @@ -1519,6 +1556,8 @@ QDF_STATUS ol_txrx_ipa_set_perf_level(int client, return QDF_STATUS_SUCCESS; } +#endif /* CONFIG_IPA_WDI_UNIFIED_API */ + #ifdef FEATURE_METERING QDF_STATUS ol_txrx_ipa_uc_get_share_stats(struct cdp_pdev *ppdev, uint8_t reset_stats)