qcacmn: Enable IPA if enabled in platform driver and ini

Enable IPA only if it is enabled from both platform driver
and ini file.
Change-Id: Ifc4bcd2c5b29b91c0eb72a844906cf11a65686e4
CRs-Fixed: 3148731
Tento commit je obsažen v:
Ananya Gupta
2022-03-10 15:39:08 +05:30
odevzdal Madan Koyyalamudi
rodič 52181cceb1
revize 0afac9d12e
5 změnil soubory, kde provedl 96 přidání a 8 odebrání

Zobrazit soubor

@@ -67,6 +67,21 @@ extern uint8_t g_instances_added;
#define IPA_EXIT() \
QDF_TRACE_EXIT(QDF_MODULE_ID_IPA, "exit")
/**
* ipa_set_pld_enable() - set g_ipa_pld_enable
* @flag: flag to set g_ipa_pld_enable
*
* Return: None
*/
void ipa_set_pld_enable(bool flag);
/**
* ipa_get_pld_enable() - check if IPA is disabled in pld
*
* Return: g_ipa_pld_enable
*/
bool ipa_get_pld_enable(void);
/**
* ipa_check_hw_present() - get IPA hw status
*

Zobrazit soubor

@@ -29,6 +29,17 @@
static struct wlan_ipa_config *g_ipa_config;
static bool g_ipa_hw_support;
static bool g_ipa_pld_enable = true;
void ipa_set_pld_enable(bool flag)
{
g_ipa_pld_enable = flag;
}
bool ipa_get_pld_enable(void)
{
return g_ipa_pld_enable;
}
bool ipa_check_hw_present(void)
{
@@ -805,8 +816,16 @@ void ipa_component_config_update(struct wlan_objmgr_psoc *psoc)
return;
}
g_ipa_config->ipa_config =
cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG);
if (g_ipa_pld_enable) {
g_ipa_config->ipa_config = cfg_get(psoc,
CFG_DP_IPA_OFFLOAD_CONFIG);
ipa_info("IPA ini configuration: 0x%x",
g_ipa_config->ipa_config);
} else {
g_ipa_config->ipa_config = 0;
ipa_info("IPA disabled from platform driver");
}
g_ipa_config->desc_size =
cfg_get(psoc, CFG_DP_IPA_DESC_SIZE);
g_ipa_config->txbuf_count =

Zobrazit soubor

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2022 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
@@ -31,6 +31,21 @@
#ifdef IPA_OFFLOAD
/**
* ucfg_ipa_set_pld_enable() - set g_ipa_pld_enable
* @flag: flag to set g_ipa_pld_enable
*
* Return: None
*/
void ucfg_ipa_set_pld_enable(bool flag);
/**
* ucfg_ipa_get_pld_enable() - check if IPA is disabled in pld
*
* Return: g_ipa_pld_enable
*/
bool ucfg_ipa_get_pld_enable(void);
/**
* ucfg_ipa_is_present() - get IPA hw status
*
@@ -435,6 +450,14 @@ void ucfg_ipa_update_tx_stats(struct wlan_objmgr_pdev *pdev, uint64_t sta_tx,
void ucfg_ipa_flush_pending_vdev_events(struct wlan_objmgr_pdev *pdev,
uint8_t vdev_id);
#else
static inline void ucfg_ipa_set_pld_enable(bool flag)
{
}
static inline bool ucfg_ipa_get_pld_enable(void)
{
return true;
}
static inline bool ucfg_ipa_is_present(void)
{

Zobrazit soubor

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2022 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
@@ -25,6 +25,20 @@
#include "cfg_ucfg_api.h"
#include "qdf_module.h"
void ucfg_ipa_set_pld_enable(bool flag)
{
ipa_set_pld_enable(flag);
}
qdf_export_symbol(ucfg_ipa_set_pld_enable);
bool ucfg_ipa_get_pld_enable(void)
{
return ipa_get_pld_enable();
}
qdf_export_symbol(ucfg_ipa_get_pld_enable);
bool ucfg_ipa_is_present(void)
{
return ipa_is_hw_support();

Zobrazit soubor

@@ -17,6 +17,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
#include "wlan_ipa_ucfg_api.h"
#if defined(CONFIG_HL_SUPPORT)
#include "wlan_tgt_def_config_hl.h"
#else
@@ -1719,8 +1720,16 @@ static void
wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
{
wlan_cfg_ctx->ipa_enabled = (cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG) &
if (ucfg_ipa_get_pld_enable()) {
wlan_cfg_ctx->ipa_enabled =
(cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG) &
WLAN_CFG_IPA_ENABLE_MASK);
dp_info("is IPA enabled from ini: %d",
wlan_cfg_ctx->ipa_enabled);
} else {
wlan_cfg_ctx->ipa_enabled = false;
dp_info("IPA disabled from platform driver");
}
wlan_cfg_ctx->ipa_tx_ring_size =
cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE);
wlan_cfg_ctx->ipa_tx_comp_ring_size =
@@ -1743,8 +1752,16 @@ static void
wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
{
wlan_cfg_ctx->ipa_enabled = (cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG) &
if (ucfg_ipa_get_pld_enable()) {
wlan_cfg_ctx->ipa_enabled =
(cfg_get(psoc, CFG_DP_IPA_OFFLOAD_CONFIG) &
WLAN_CFG_IPA_ENABLE_MASK);
dp_info("is IPA enabled from ini: %d",
wlan_cfg_ctx->ipa_enabled);
} else {
wlan_cfg_ctx->ipa_enabled = false;
dp_info("IPA disabled from platform driver");
}
wlan_cfg_ctx->ipa_tx_ring_size =
cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE);
wlan_cfg_ctx->ipa_tx_comp_ring_size =