Browse Source

qcacld-3.0: Add support to configure auto PS timer

Add support to disable/configure the auto BMPS timer using INI
configuration.

The default value for the auto BMPS timer was set to 20 sec and
when the connection is established from cmd line, DUT enters into
power save once the timeout happens which can lead to issue in
DHCP completion. Framework disables the power save during DHCP and
enables it when DHCP is done, hence disable the auto BMPS timer by
default and provide the INI configuration to configure it.

Change-Id: I9732f915dd0fb552dd4943b70a6026a7a2bc80a0
CRs-Fixed: 1092305
Kiran Kumar Lokere 8 years ago
parent
commit
0ac679c910

+ 7 - 0
core/hdd/inc/wlan_hdd_cfg.h

@@ -123,6 +123,12 @@
 #define CFG_ENABLE_PS_MAX                      (1)
 #define CFG_ENABLE_PS_DEFAULT                  (1)
 
+/* Auto BMPS timer value in sec */
+#define CFG_AUTO_PS_ENABLE_TIMER_NAME          "gAutoBmpsTimerValue"
+#define CFG_AUTO_PS_ENABLE_TIMER_MIN           (0)
+#define CFG_AUTO_PS_ENABLE_TIMER_MAX           (120)
+#define CFG_AUTO_PS_ENABLE_TIMER_DEFAULT       (0)
+
 #define CFG_BMPS_MINIMUM_LI_NAME               "gBmpsMinListenInterval"
 #define CFG_BMPS_MINIMUM_LI_MIN                (1)
 #define CFG_BMPS_MINIMUM_LI_MAX                (65535)
@@ -3641,6 +3647,7 @@ struct hdd_config {
 	char PowerUsageControl[4];
 	bool fIsImpsEnabled;
 	bool is_ps_enabled;
+	uint32_t auto_bmps_timer_val;
 	uint32_t nBmpsModListenInterval;
 	uint32_t nBmpsMaxListenInterval;
 	uint32_t nBmpsMinListenInterval;

+ 2 - 1
core/hdd/src/wlan_hdd_assoc.c

@@ -2067,10 +2067,11 @@ static int hdd_change_sta_state_authenticated(hdd_adapter_t *adapter,
 	int ret;
 	uint32_t timeout;
 	hdd_station_ctx_t *hddstactx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
+	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 
 	timeout = hddstactx->hdd_ReassocScenario ?
 		AUTO_PS_ENTRY_TIMER_DEFAULT_VALUE :
-		AUTO_DEFERRED_PS_ENTRY_TIMER_DEFAULT_VALUE;
+		hdd_ctx->config->auto_bmps_timer_val * 1000;
 
 	hdd_info("Changing TL state to AUTHENTICATED for StaId= %d",
 		 hddstactx->conn_info.staId[0]);

+ 9 - 0
core/hdd/src/wlan_hdd_cfg.c

@@ -428,6 +428,13 @@ REG_TABLE_ENTRY g_registry_table[] = {
 		     CFG_ENABLE_PS_MIN,
 		     CFG_ENABLE_PS_MAX),
 
+	REG_VARIABLE(CFG_AUTO_PS_ENABLE_TIMER_NAME, WLAN_PARAM_Integer,
+		     struct hdd_config, auto_bmps_timer_val,
+		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		     CFG_AUTO_PS_ENABLE_TIMER_DEFAULT,
+		     CFG_AUTO_PS_ENABLE_TIMER_MIN,
+		     CFG_AUTO_PS_ENABLE_TIMER_MAX),
+
 	REG_VARIABLE(CFG_BMPS_MINIMUM_LI_NAME, WLAN_PARAM_Integer,
 		     struct hdd_config, nBmpsMinListenInterval,
 		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -7163,6 +7170,8 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx)
 		pHddCtx->config->prefer_non_dfs_on_radar;
 
 	smeConfig->csrConfig.is_ps_enabled = pHddCtx->config->is_ps_enabled;
+	smeConfig->csrConfig.auto_bmps_timer_val =
+		pHddCtx->config->auto_bmps_timer_val;
 	hdd_set_fine_time_meas_cap(pHddCtx, smeConfig);
 
 	cds_set_multicast_logging(pHddCtx->config->multicast_host_fw_msgs);

+ 1 - 0
core/sme/inc/csr_api.h

@@ -1283,6 +1283,7 @@ typedef struct tagCsrConfigParam {
 #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
 	uint8_t f_prefer_non_dfs_on_radar;
 	bool is_ps_enabled;
+	uint32_t auto_bmps_timer_val;
 	uint32_t fine_time_meas_cap;
 	uint32_t dual_mac_feature_disable;
 	uint32_t roam_dense_traffic_thresh;

+ 1 - 0
core/sme/inc/sme_power_save.h

@@ -127,6 +127,7 @@ struct ps_params {
  */
 struct ps_global_info {
 	bool ps_enabled;
+	uint32_t auto_bmps_timer_val;
 	struct ps_params ps_params[MAX_SME_SESSIONS];
 	/* Remain in Power active till DHCP completes */
 	bool remain_in_power_active_till_dhcp;

+ 5 - 0
core/sme/src/common/sme_power_save.c

@@ -1001,6 +1001,11 @@ QDF_STATUS sme_ps_enable_auto_ps_timer(tHalHandle hal_ctx,
 	struct ps_params *ps_param = &ps_global_info->ps_params[session_id];
 	QDF_STATUS qdf_status;
 
+	if (!ps_global_info->auto_bmps_timer_val) {
+		sms_log(mac_ctx, LOGE, FL("auto_ps_timer is disabled in INI"));
+		return QDF_STATUS_SUCCESS;
+	}
+
 	sms_log(mac_ctx, LOGE, FL("Start auto_ps_timer for %d ms"),
 		timeout);
 

+ 4 - 0
core/sme/src/csr/csr_api_roam.c

@@ -2581,6 +2581,8 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac,
 
 		pMac->sme.ps_global_info.ps_enabled =
 			pParam->is_ps_enabled;
+		pMac->sme.ps_global_info.auto_bmps_timer_val =
+			pParam->auto_bmps_timer_val;
 		pMac->roam.configParam.ignore_peer_ht_opmode =
 			pParam->ignore_peer_ht_opmode;
 		pMac->fine_time_meas_cap = pParam->fine_time_meas_cap;
@@ -2787,6 +2789,8 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam)
 	pParam->dual_mac_feature_disable =
 		pMac->dual_mac_feature_disable;
 	pParam->is_ps_enabled = pMac->sme.ps_global_info.ps_enabled;
+	pParam->auto_bmps_timer_val =
+		pMac->sme.ps_global_info.auto_bmps_timer_val;
 	pParam->fEnableDebugLog = pMac->fEnableDebugLog;
 	pParam->enable5gEBT = pMac->enable5gEBT;
 	pParam->f_sta_miracast_mcc_rest_time_val =