Ver código fonte

qcacld-3.0: Dont disable the ps conf to firmware

Presently, host driver is sending the exit power save
configuration request to firmware when an interface up comes
before iface_change_timer which is not required because firmware
is the master and decides to enter/exit imps.
To mitigate the issue, don't send the exit IMPS request to firmware
before interface change timer expires and re-configure the same
incase of loadonce-unload never in case of firmware is de-initialzied.

Change-Id: Ia47687cdcfc5a5fb7be1a8066e163c3248305bba
CRs-Fixed: 2002110
Arunk Khandavalli 7 anos atrás
pai
commit
847969de19

+ 1 - 1
core/hdd/inc/wlan_hdd_cfg.h

@@ -13163,7 +13163,7 @@ QDF_STATUS hdd_execute_global_config_command(struct hdd_context *hdd_ctx,
 					     char *command);
 
 bool hdd_is_okc_mode_enabled(struct hdd_context *hdd_ctx);
-QDF_STATUS hdd_set_idle_ps_config(struct hdd_context *hdd_ctx, uint32_t val);
+QDF_STATUS hdd_set_idle_ps_config(struct hdd_context *hdd_ctx, bool val);
 void hdd_get_pmkid_modes(struct hdd_context *hdd_ctx,
 			 struct pmkid_mode_bits *pmkid_modes);
 

+ 1 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -1822,6 +1822,7 @@ struct hdd_context {
 	struct hdd_nud_stats_context nud_stats_context;
 	eCsrBand curr_band;
 	bool fw_mem_dump_enabled;
+	bool imps_enabled;
 };
 
 /**

+ 13 - 3
core/hdd/src/wlan_hdd_cfg.c

@@ -6941,15 +6941,25 @@ eCsrPhyMode hdd_cfg_xlate_to_csr_phy_mode(enum hdd_dot11_mode dot11Mode)
  * Return: QDF_STATUS_SUCCESS if command set correctly,
  *		otherwise the QDF_STATUS return from SME layer
  */
-QDF_STATUS hdd_set_idle_ps_config(struct hdd_context *hdd_ctx, uint32_t val)
+QDF_STATUS hdd_set_idle_ps_config(struct hdd_context *hdd_ctx, bool val)
 {
 	QDF_STATUS status;
 
 	hdd_debug("Enter Val %d", val);
 
-	status = sme_set_idle_powersave_config(hdd_ctx->hHal, val);
-	if (QDF_STATUS_SUCCESS != status)
+	if (hdd_ctx->imps_enabled == val) {
+		hdd_notice("Already in the requested power state:%d", val);
+		return QDF_STATUS_SUCCESS;
+	}
+
+	status = sme_set_idle_powersave_config(val);
+	if (QDF_STATUS_SUCCESS != status) {
 		hdd_err("Fail to Set Idle PS Config val %d", val);
+		return status;
+	}
+
+	hdd_ctx->imps_enabled = val;
+
 	return status;
 }
 

+ 3 - 0
core/hdd/src/wlan_hdd_main.c

@@ -9484,6 +9484,9 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode)
 			hdd_err("CNSS power down failed put device into Low power mode:%d",
 				ret);
 	}
+
+	/* Once the firmware sequence is completed reset this flag */
+	hdd_ctx->imps_enabled = false;
 	hdd_ctx->driver_status = DRIVER_MODULES_CLOSED;
 	/*
 	 * Reset total mac phy during module stop such that during

+ 0 - 2
core/mac/inc/ani_global.h

@@ -929,8 +929,6 @@ typedef struct sAniSirGlobal {
 
 	uint8_t isCoalesingInIBSSAllowed;
 
-	bool imps_enabled;
-
 	csr_readyToSuspendCallback readyToSuspendCallback;
 	void *readyToSuspendContext;
 	uint8_t lteCoexAntShare;

+ 1 - 1
core/sme/inc/sme_api.h

@@ -710,7 +710,7 @@ QDF_STATUS sme_send_cesium_enable_ind(tHalHandle hHal, uint32_t sessionId);
  * This should be called only if powersave offload
  * is enabled
  */
-QDF_STATUS sme_set_idle_powersave_config(tHalHandle hHal, uint32_t value);
+QDF_STATUS sme_set_idle_powersave_config(bool value);
 QDF_STATUS sme_notify_modem_power_state(tHalHandle hHal, uint32_t value);
 
 /*SME API to convert convert the ini value to the ENUM used in csr and MAC*/

+ 2 - 5
core/sme/src/common/sme_api.c

@@ -10383,10 +10383,9 @@ QDF_STATUS sme_set_ht2040_mode(tHalHandle hHal, uint8_t sessionId,
  * This should be called only if powersave offload
  * is enabled
  */
-QDF_STATUS sme_set_idle_powersave_config(tHalHandle hHal, uint32_t value)
+QDF_STATUS sme_set_idle_powersave_config(bool value)
 {
 	void *wmaContext = cds_get_context(QDF_MODULE_ID_WMA);
-	tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
 
 	if (NULL == wmaContext) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
@@ -10396,14 +10395,12 @@ QDF_STATUS sme_set_idle_powersave_config(tHalHandle hHal, uint32_t value)
 	QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_DEBUG,
 		  " Idle Ps Set Value %d", value);
 
-	pMac->imps_enabled = false;
 	if (QDF_STATUS_SUCCESS != wma_set_idle_ps_config(wmaContext, value)) {
 		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
 			  " Failed to Set Idle Ps Value %d", value);
 		return QDF_STATUS_E_FAILURE;
 	}
-	if (value)
-		pMac->imps_enabled = true;
+
 	return QDF_STATUS_SUCCESS;
 }