From 2613f207e0627e7ecc4cd18c08252c3d8eccc909 Mon Sep 17 00:00:00 2001 From: Namita Nair Date: Fri, 28 Apr 2023 11:15:06 -0700 Subject: [PATCH] Revert "qcacmn: WAR for opt_wifi_dp feature to disable IPA(1)" This reverts Change-Id: I7aad275f4d86a2ffc239f1fe343de31ec2988fad. Change-Id: I875e8d15430c3f0a0f4bf10d275b203b24023a64 CRs-Fixed: 3483264 --- dp/wifi3.0/dp_ipa.c | 4 +-- ipa/core/inc/wlan_ipa_core.h | 4 +-- ipa/core/inc/wlan_ipa_main.h | 17 ++++++++++- ipa/core/inc/wlan_ipa_priv.h | 3 +- ipa/core/src/wlan_ipa_core.c | 2 -- ipa/core/src/wlan_ipa_main.c | 33 +++++++++++++++++++--- ipa/core/src/wlan_ipa_rm.c | 2 -- ipa/core/src/wlan_ipa_stats.c | 2 -- ipa/dispatcher/src/wlan_ipa_obj_mgmt_api.c | 2 -- ipa/dispatcher/src/wlan_ipa_tgt_api.c | 5 ++-- ipa/dispatcher/src/wlan_ipa_ucfg_api.c | 2 -- target_if/ipa/src/target_if_ipa.c | 2 -- wlan_cfg/wlan_cfg.c | 9 +++--- 13 files changed, 58 insertions(+), 29 deletions(-) diff --git a/dp/wifi3.0/dp_ipa.c b/dp/wifi3.0/dp_ipa.c index 7d1658a1b7..f2106f4c9a 100644 --- a/dp/wifi3.0/dp_ipa.c +++ b/dp/wifi3.0/dp_ipa.c @@ -15,6 +15,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef IPA_OFFLOAD + #include #include #include @@ -43,8 +45,6 @@ #include #endif -#ifdef IPA_OFFLOAD - /* Hard coded config parameters until dp_ops_cfg.cfg_attach implemented */ #define CFG_IPA_UC_TX_BUF_SIZE_DEFAULT (2048) diff --git a/ipa/core/inc/wlan_ipa_core.h b/ipa/core/inc/wlan_ipa_core.h index 3eab16c0e6..2e9854fcfa 100644 --- a/ipa/core/inc/wlan_ipa_core.h +++ b/ipa/core/inc/wlan_ipa_core.h @@ -20,11 +20,11 @@ #ifndef _WLAN_IPA_CORE_H_ #define _WLAN_IPA_CORE_H_ +#ifdef IPA_OFFLOAD + #include "wlan_ipa_priv.h" #include "wlan_ipa_public_struct.h" -#ifdef IPA_OFFLOAD - /** * wlan_ipa_is_enabled() - Is IPA enabled? * @ipa_cfg: IPA config diff --git a/ipa/core/inc/wlan_ipa_main.h b/ipa/core/inc/wlan_ipa_main.h index 32dbfd68d7..fb460e8153 100644 --- a/ipa/core/inc/wlan_ipa_main.h +++ b/ipa/core/inc/wlan_ipa_main.h @@ -24,15 +24,22 @@ #ifndef _WLAN_IPA_MAIN_H_ #define _WLAN_IPA_MAIN_H_ +#ifdef IPA_OFFLOAD + #include #include #include #include +#include "cfg_ucfg_api.h" -#ifdef IPA_OFFLOAD /* Declare a variable for IPA instancess added based on pdev */ extern uint8_t g_instances_added; #define IPA_INVALID_HDL 0xFF +#define IPA_OFFLOAD_CFG 0x7D + +#define INTRL_MODE_DISABLE 0xEEEEEEEE +#define INTRL_MODE_ENABLE 0x27D + #define ipa_fatal(params...) \ QDF_TRACE_FATAL(QDF_MODULE_ID_IPA, params) #define ipa_err(params...) \ @@ -111,6 +118,14 @@ ipa_pdev_get_priv_obj(struct wlan_objmgr_pdev *pdev) return pdev_obj; } +/** + * get_ipa_config() - API to get IPAConfig INI + * @psoc : psoc handle + * + * Return: IPA config value + */ +uint32_t get_ipa_config(struct wlan_objmgr_psoc *psoc); + /** * ipa_priv_obj_get_pdev() - API to get pdev from IPA object * @ipa_obj: IPA object diff --git a/ipa/core/inc/wlan_ipa_priv.h b/ipa/core/inc/wlan_ipa_priv.h index 3f03e19c6f..47318b5d8a 100644 --- a/ipa/core/inc/wlan_ipa_priv.h +++ b/ipa/core/inc/wlan_ipa_priv.h @@ -25,6 +25,8 @@ #ifndef _WLAN_IPA_PRIV_STRUCT_H_ #define _WLAN_IPA_PRIV_STRUCT_H_ +#ifdef IPA_OFFLOAD + #include #include @@ -46,7 +48,6 @@ #include "cdp_txrx_ipa.h" #endif -#ifdef IPA_OFFLOAD #define WLAN_IPA_RX_INACTIVITY_MSEC_DELAY 1000 #define WLAN_IPA_UC_WLAN_8023_HDR_SIZE 14 diff --git a/ipa/core/src/wlan_ipa_core.c b/ipa/core/src/wlan_ipa_core.c index 64364d4e14..9c3d3ab142 100644 --- a/ipa/core/src/wlan_ipa_core.c +++ b/ipa/core/src/wlan_ipa_core.c @@ -30,7 +30,6 @@ #include #include #include -#ifdef IPA_OFFLOAD #ifdef IPA_OPT_WIFI_DP #include "init_deinit_lmac.h" #endif @@ -5344,4 +5343,3 @@ void wlan_ipa_wdi_opt_dpath_notify_flt_add_rem_cb(int flt0_rslt, int flt1_rslt) qdf_event_set(&ipa_obj->ipa_flt_evnt); } #endif /* IPA_OPT_WIFI_DP */ -#endif /* IPA_OFFLOAD */ diff --git a/ipa/core/src/wlan_ipa_main.c b/ipa/core/src/wlan_ipa_main.c index c345934c71..73fb6e0fb0 100644 --- a/ipa/core/src/wlan_ipa_main.c +++ b/ipa/core/src/wlan_ipa_main.c @@ -27,7 +27,6 @@ #include "cfg_ucfg_api.h" #include "wlan_ipa_obj_mgmt_api.h" -#ifdef IPA_OFFLOAD static struct wlan_ipa_config *g_ipa_config; static bool g_ipa_hw_support; static bool g_ipa_pld_enable = true; @@ -824,6 +823,34 @@ void ipa_fw_rejuvenate_send_msg(struct wlan_objmgr_pdev *pdev) return wlan_ipa_fw_rejuvenate_send_msg(ipa_obj); } +#ifdef IPA_OPT_WIFI_DP +uint32_t get_ipa_config(struct wlan_objmgr_psoc *psoc) +{ + uint32_t val = cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG); + + if (val == INTRL_MODE_DISABLE) { + val = 0; + } else { + if (val == IPA_OFFLOAD_CFG) + ipa_err("Invalid IPA Config 0x%x", val); + val = INTRL_MODE_ENABLE; + } + ipa_info("IPAConfig set as 0x%x", val); + return val; +} +#else +uint32_t get_ipa_config(struct wlan_objmgr_psoc *psoc) +{ + uint32_t val = cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG); + + if (val & WLAN_IPA_OPT_WIFI_DP) { + val &= ~WLAN_IPA_OPT_WIFI_DP; + ipa_info("Resetting IPAConfig val to 0x%x", val); + } + return val; +} +#endif + void ipa_component_config_update(struct wlan_objmgr_psoc *psoc) { QDF_STATUS status; @@ -835,8 +862,7 @@ void ipa_component_config_update(struct wlan_objmgr_psoc *psoc) } if (g_ipa_pld_enable) { - g_ipa_config->ipa_config = cfg_get(psoc, - CFG_DP_IPA_OFFLOAD_CONFIG); + g_ipa_config->ipa_config = get_ipa_config(psoc); ipa_info("IPA ini configuration: 0x%x", g_ipa_config->ipa_config); } else { @@ -921,4 +947,3 @@ bool ipa_is_wds_enabled(void) { return g_ipa_config ? g_ipa_config->ipa_wds : 0; } -#endif /* IPA_OFFLOAD */ diff --git a/ipa/core/src/wlan_ipa_rm.c b/ipa/core/src/wlan_ipa_rm.c index 2670f5e569..c80d93fef8 100644 --- a/ipa/core/src/wlan_ipa_rm.c +++ b/ipa/core/src/wlan_ipa_rm.c @@ -25,7 +25,6 @@ #include "host_diag_core_event.h" #include "wlan_reg_services_api.h" -#ifdef IPA_OFFLOAD QDF_STATUS wlan_ipa_set_perf_level(struct wlan_ipa_priv *ipa_ctx, uint64_t tx_packets, uint64_t rx_packets) @@ -543,4 +542,3 @@ bool wlan_ipa_is_rm_released(struct wlan_ipa_priv *ipa_ctx) return true; } #endif /* CONFIG_IPA_WDI_UNIFIED_API */ -#endif diff --git a/ipa/core/src/wlan_ipa_stats.c b/ipa/core/src/wlan_ipa_stats.c index 5701eedfb4..bb13b4b91a 100644 --- a/ipa/core/src/wlan_ipa_stats.c +++ b/ipa/core/src/wlan_ipa_stats.c @@ -23,7 +23,6 @@ #include "cdp_txrx_ipa.h" #include "qdf_platform.h" -#ifdef IPA_OFFLOAD /** * wlan_ipa_uc_rt_debug_host_fill - fill rt debug buffer * @ctext: pointer to ipa context. @@ -1033,4 +1032,3 @@ void wlan_ipa_wdi_meter_notifier_cb(qdf_ipa_wdi_meter_evt_type_t evt, qdf_op_unprotect(op_sync); } #endif /* FEATURE_METERING */ -#endif /* IPA_OFFLOAD */ diff --git a/ipa/dispatcher/src/wlan_ipa_obj_mgmt_api.c b/ipa/dispatcher/src/wlan_ipa_obj_mgmt_api.c index f11e42e8e2..a82652c24c 100644 --- a/ipa/dispatcher/src/wlan_ipa_obj_mgmt_api.c +++ b/ipa/dispatcher/src/wlan_ipa_obj_mgmt_api.c @@ -29,7 +29,6 @@ #include "qdf_platform.h" #include "qdf_module.h" -#ifdef IPA_OFFLOAD /* This is as per IPA capbility */ #define MAX_INSTANCES_SUPPORTED 2 @@ -373,4 +372,3 @@ bool wlan_ipa_is_vlan_enabled(void) } qdf_export_symbol(wlan_ipa_is_vlan_enabled); -#endif diff --git a/ipa/dispatcher/src/wlan_ipa_tgt_api.c b/ipa/dispatcher/src/wlan_ipa_tgt_api.c index 16fb90a6c1..730c763232 100644 --- a/ipa/dispatcher/src/wlan_ipa_tgt_api.c +++ b/ipa/dispatcher/src/wlan_ipa_tgt_api.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2018, 2020-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021, 2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021,2023 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -27,7 +27,6 @@ #include #include -#ifdef IPA_OFFLOAD QDF_STATUS tgt_ipa_uc_offload_enable_disable(struct wlan_objmgr_pdev *pdev, struct ipa_uc_offload_control_params *req) { @@ -80,4 +79,4 @@ tgt_ipa_intrabss_enable_disable(struct wlan_objmgr_pdev *pdev, IPA_EXIT(); return status; } -#endif + diff --git a/ipa/dispatcher/src/wlan_ipa_ucfg_api.c b/ipa/dispatcher/src/wlan_ipa_ucfg_api.c index ee91bd68f9..a6057f2838 100644 --- a/ipa/dispatcher/src/wlan_ipa_ucfg_api.c +++ b/ipa/dispatcher/src/wlan_ipa_ucfg_api.c @@ -25,7 +25,6 @@ #include "cfg_ucfg_api.h" #include "qdf_module.h" -#ifdef IPA_OFFLOAD void ucfg_ipa_set_pld_enable(bool flag) { ipa_set_pld_enable(flag); @@ -362,4 +361,3 @@ bool ucfg_ipa_is_wds_enabled(void) } qdf_export_symbol(ucfg_ipa_is_wds_enabled); -#endif diff --git a/target_if/ipa/src/target_if_ipa.c b/target_if/ipa/src/target_if_ipa.c index a509836b03..3dbe19713e 100644 --- a/target_if/ipa/src/target_if_ipa.c +++ b/target_if/ipa/src/target_if_ipa.c @@ -30,7 +30,6 @@ #include #include -#ifdef IPA_OFFLOAD /** * target_if_ipa_uc_offload_control_req() - send IPA offload control to FW * @psoc: pointer to PSOC object @@ -90,4 +89,3 @@ target_if_ipa_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) return QDF_STATUS_SUCCESS; } -#endif diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index 89cde319bd..624384b29a 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -18,6 +18,7 @@ */ #include "wlan_ipa_ucfg_api.h" +#include "wlan_ipa_main.h" #if defined(CONFIG_HL_SUPPORT) #include "wlan_tgt_def_config_hl.h" #else @@ -3534,8 +3535,8 @@ wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, { if (ucfg_ipa_get_pld_enable()) { wlan_cfg_ctx->ipa_enabled = - (cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG) & - WLAN_CFG_IPA_ENABLE_MASK); + (get_ipa_config((struct wlan_objmgr_psoc *)psoc) & + WLAN_CFG_IPA_ENABLE_MASK); dp_info("is IPA enabled from ini: %d", wlan_cfg_ctx->ipa_enabled); } else { @@ -3566,8 +3567,8 @@ wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, { if (ucfg_ipa_get_pld_enable()) { wlan_cfg_ctx->ipa_enabled = - (cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG) & - WLAN_CFG_IPA_ENABLE_MASK); + (get_ipa_config((struct wlan_objmgr_psoc *)psoc) & + WLAN_CFG_IPA_ENABLE_MASK); dp_info("is IPA enabled from ini: %d", wlan_cfg_ctx->ipa_enabled); } else {