Browse Source

qcacld-3.0: Disable IMPS when LPC mode is enabled

LPC mode needs IMPS to be disabled to avoid FW umac
enter power save. Change adds enable/disable operation
in LPC mode.

Change-Id: I78cc52098a489700c426f6001112e5cce216b5b3
CRs-Fixed: 3663762
Randy Tian 1 year ago
parent
commit
1218fb2c21
3 changed files with 37 additions and 0 deletions
  1. 6 0
      core/hdd/src/wlan_hdd_main.c
  2. 1 0
      core/wma/inc/wma_api.h
  3. 30 0
      core/wma/src/wma_power.c

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

@@ -2690,6 +2690,9 @@ static void hdd_lpc_enable_powersave(struct hdd_context *hdd_ctx)
 
 	ucfg_fwol_configure_global_params(hdd_ctx->psoc, hdd_ctx->pdev);
 
+	if (wma_enable_disable_imps(hdd_ctx->pdev->pdev_objmgr.wlan_pdev_id, 1))
+		hdd_err("IMPS feature enable failed");
+
 	sta_adapter = hdd_get_adapter(hdd_ctx, QDF_STA_MODE);
 	if (!sta_adapter) {
 		hdd_debug("STA adapter does not exist");
@@ -2708,6 +2711,9 @@ static void hdd_lpc_disable_powersave(struct hdd_context *hdd_ctx)
 
 	ucfg_fwol_set_ilp_config(hdd_ctx->psoc, hdd_ctx->pdev, 0);
 
+	if (wma_enable_disable_imps(hdd_ctx->pdev->pdev_objmgr.wlan_pdev_id, 0))
+		hdd_err("IMPS feature disable failed");
+
 	sta_adapter = hdd_get_adapter(hdd_ctx, QDF_STA_MODE);
 	if (!sta_adapter) {
 		hdd_err("STA adapter does not exist");

+ 1 - 0
core/wma/inc/wma_api.h

@@ -288,6 +288,7 @@ QDF_STATUS wma_send_dbs_scan_selection_params(WMA_HANDLE handle,
 			struct wmi_dbs_scan_sel_params *dbs_scan_params);
 QDF_STATUS wma_set_tx_power_scale(uint8_t vdev_id, int value);
 QDF_STATUS wma_set_tx_power_scale_decr_db(uint8_t vdev_id, int value);
+QDF_STATUS wma_enable_disable_imps(uint32_t pdev_id, uint32_t param_val);
 
 bool wma_is_csa_offload_enabled(void);
 /**

+ 30 - 0
core/wma/src/wma_power.c

@@ -1696,5 +1696,35 @@ QDF_STATUS wma_set_tx_power_scale_decr_db(uint8_t vdev_id, int value)
 
 	return ret;
 }
+
+/**
+ * wma_enable_disable_imps() - enable/disable FW IMPS feature
+ * @pdev_id: pdev id
+ * @param_val: value
+ *
+ * Return: QDF_STATUS_SUCCESS for success or error code.
+ */
+QDF_STATUS wma_enable_disable_imps(uint32_t pdev_id, uint32_t param_val)
+{
+	tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
+	struct pdev_params pparam = {0};
+	QDF_STATUS status;
+
+	if (!wma)
+		return QDF_STATUS_E_FAILURE;
+
+	pparam.is_host_pdev_id = false;
+
+	/* Enable-disable IMPS */
+	pparam.param_id = WMI_PDEV_PARAM_IDLE_PS_CONFIG;
+	pparam.param_value = param_val;
+	status = wmi_unified_pdev_param_send(wma->wmi_handle,
+					     &pparam, pdev_id);
+	if (QDF_IS_STATUS_ERROR(status))
+		wma_err("Unable to enable/disable:(%d) IMPS",
+			param_val);
+
+	return status;
+}
 #endif /* FEATURE_TX_POWER */