diff --git a/core/dp/txrx3.0/dp_swlm.c b/core/dp/txrx3.0/dp_swlm.c index a22e2eda73..32c022807d 100644 --- a/core/dp/txrx3.0/dp_swlm.c +++ b/core/dp/txrx3.0/dp_swlm.c @@ -16,6 +16,9 @@ #ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR +#include +#include +#include #include "dp_swlm.h" /** @@ -210,15 +213,25 @@ static inline QDF_STATUS dp_soc_swlm_tcl_detach(struct dp_soc *soc) QDF_STATUS dp_soc_swlm_attach(struct dp_soc *soc) { + struct wlan_cfg_dp_soc_ctxt *cfg = soc->wlan_cfg_ctx; struct dp_swlm *swlm = &soc->swlm; QDF_STATUS ret; + /* Check if it is enabled in the INI */ + if (!wlan_cfg_is_swlm_enabled(cfg)) { + dp_err("SWLM feature is disabled"); + swlm->is_init = false; + swlm->is_enabled = false; + return QDF_STATUS_E_NOSUPPORT; + } + swlm->ops = &dp_latency_mgr_ops; ret = dp_soc_swlm_tcl_attach(soc); if (QDF_IS_STATUS_ERROR(ret)) goto swlm_tcl_setup_fail; + swlm->is_init = true; swlm->is_enabled = true; return QDF_STATUS_SUCCESS; diff --git a/core/dp/txrx3.0/dp_swlm.h b/core/dp/txrx3.0/dp_swlm.h index 6872b5c0fb..cdf9bcbe3b 100644 --- a/core/dp/txrx3.0/dp_swlm.h +++ b/core/dp/txrx3.0/dp_swlm.h @@ -19,9 +19,6 @@ #ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR -#include -#include - #define DP_SWLM_TCL_TPUT_PASS_THRESH 3 #define DP_SWLM_TCL_RX_TRAFFIC_THRESH 50