qcacld-3.0: Override powersave configuration for monitor mode

Currently, powersave configuration is being overwritten before INIs
are initialized by mlme component. As a result INI configuration is
not being overwritten in case of monitor mode.

To resolve this issue, overwrite PS configuration during start
modules and restore it in stop modules.

Change-Id: I2707b431b81881c943104b211d55c6f48f348ba9
CRs-Fixed: 2682164
This commit is contained in:
Bapiraju Alla
2020-06-22 17:42:15 +05:30
committed by nshrivas
parent 9858a65c74
commit 9a61eedc9b
4 changed files with 65 additions and 6 deletions

View File

@@ -2240,7 +2240,6 @@ QDF_STATUS wlan_mlme_is_bmps_enabled(struct wlan_objmgr_psoc *psoc,
/**
* wlan_mlme_override_bmps_imps() - disable imps/bmps
* @psoc: pointer to psoc object
* @value: value that is requested by the caller
*
* Return: QDF_STATUS_SUCCESS - in case of success
*/

View File

@@ -341,6 +341,15 @@ QDF_STATUS hdd_get_nss(struct hdd_adapter *adapter, uint8_t *nss);
*/
bool hdd_dfs_indicate_radar(struct hdd_context *hdd_ctx);
/**
* hdd_restore_all_ps() - Restore all the powersave configuration overwritten
* by hdd_override_all_ps.
* @hdd_ctx: Pointer to HDD context.
*
* Return: None
*/
void hdd_restore_all_ps(struct hdd_context *hdd_ctx);
/**
* hdd_override_all_ps() - overrides to disables all the powersave features.
* @hdd_ctx: Pointer to HDD context.

View File

@@ -339,40 +339,86 @@ config_exit:
return qdf_status;
}
#ifdef FEATURE_RUNTIME_PM
/**
* hdd_disable_runtime_pm() - Override to disable runtime_pm.
* @cfg_ini: Handle to struct hdd_config
*
* Return: None
*/
#ifdef FEATURE_RUNTIME_PM
static void hdd_disable_runtime_pm(struct hdd_config *cfg_ini)
{
cfg_ini->runtime_pm = 0;
}
/**
* hdd_restore_runtime_pm() - Restore runtime_pm configuration.
* @cfg_ini: Handle to struct hdd_config
*
* Return: None
*/
static void hdd_restore_runtime_pm(struct hdd_context *hdd_ctx)
{
struct hdd_config *cfg_ini = hdd_ctx->config;
cfg_ini->runtime_pm = cfg_get(hdd_ctx->psoc, CFG_ENABLE_RUNTIME_PM);
}
#else
static void hdd_disable_runtime_pm(struct hdd_config *cfg_ini)
{
}
static void hdd_restore_runtime_pm(struct hdd_context *hdd_ctx)
{
}
#endif
#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
/**
* hdd_disable_auto_shutdown() - Override to disable auto_shutdown.
* @cfg_ini: Handle to struct hdd_config
*
* Return: None
*/
#ifdef FEATURE_WLAN_AUTO_SHUTDOWN
static void hdd_disable_auto_shutdown(struct hdd_config *cfg_ini)
{
cfg_ini->wlan_auto_shutdown = 0;
}
/**
* hdd_restore_auto_shutdown() - Restore auto_shutdown configuration.
* @cfg_ini: Handle to struct hdd_config
*
* Return: None
*/
static void hdd_restore_auto_shutdown(struct hdd_context *hdd_ctx)
{
struct hdd_config *cfg_ini = hdd_ctx->config;
cfg_ini->wlan_auto_shutdown = cfg_get(hdd_ctx->psoc,
CFG_WLAN_AUTO_SHUTDOWN);
}
#else
static void hdd_disable_auto_shutdown(struct hdd_config *cfg_ini)
{
}
static void hdd_restore_auto_shutdown(struct hdd_context *hdd_ctx)
{
}
#endif
void hdd_restore_all_ps(struct hdd_context *hdd_ctx)
{
/*
* imps/bmps configuration will be restored in driver mode change
* sequence as part of hdd_wlan_start_modules
*/
hdd_restore_runtime_pm(hdd_ctx);
hdd_restore_auto_shutdown(hdd_ctx);
}
void hdd_override_all_ps(struct hdd_context *hdd_ctx)
{
struct hdd_config *cfg_ini = hdd_ctx->config;

View File

@@ -3883,6 +3883,10 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, bool reinit)
break;
}
/* Override PS params for monitor mode */
if (hdd_get_conparam() == QDF_GLOBAL_MONITOR_MODE)
hdd_override_all_ps(hdd_ctx);
ret = hdd_configure_cds(hdd_ctx);
if (ret) {
hdd_err("Failed to Enable cds modules; errno: %d", ret);
@@ -10735,9 +10739,6 @@ static void hdd_override_ini_config(struct hdd_context *hdd_ctx)
hdd_ctx->config->action_oui_enable = 0;
hdd_err("Ignore action oui ini, since no action_oui component");
}
if (QDF_GLOBAL_MONITOR_MODE == cds_get_conparam())
hdd_override_all_ps(hdd_ctx);
}
#ifdef ENABLE_MTRACE_LOG
@@ -13201,6 +13202,10 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode)
case DRIVER_MODULES_ENABLED:
hdd_debug("Wlan transitioning (CLOSED <- ENABLED)");
/* Restore PS params for monitor mode */
if (hdd_get_conparam() == QDF_GLOBAL_MONITOR_MODE)
hdd_restore_all_ps(hdd_ctx);
if (hdd_get_conparam() == QDF_GLOBAL_FTM_MODE) {
hdd_disable_power_management(hdd_ctx);
break;