Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c89eb05 authored by Ashish Kumar Dhanotiya's avatar Ashish Kumar Dhanotiya Committed by nshrivas
Browse files

qcacld-3.0: Add support to set inactivity timout for PMO

Currently there is no support to configure the inactivity
timeout when driver goes to wow mode or when driver resumes
from wow mode.

Add support for PMO component to configure the wow mode
inactivity timeout with ini g_wow_data_inactivity_timeout
when driver enters into wow mode and when driver resumes
from wow mode add support to configure the inactivity
timeout for non wow mode with ini gDataInactivityTimeout.

CRs-fixed: 2412866
Change-Id: I0672f22a5dfec870e5e67b23058db2729b9a0848
parent d3e67d30
Loading
Loading
Loading
Loading
+56 −0
Original line number Diff line number Diff line
@@ -161,6 +161,60 @@ static QDF_STATUS pmo_core_calculate_listen_interval(
	return QDF_STATUS_SUCCESS;
}

static void pmo_configure_vdev_suspend_params(
					struct wlan_objmgr_psoc *psoc,
					struct wlan_objmgr_vdev *vdev,
					struct pmo_vdev_priv_obj *vdev_ctx)
{
	QDF_STATUS ret;
	uint8_t vdev_id;
	enum QDF_OPMODE opmode = pmo_core_get_vdev_op_mode(vdev);
	struct pmo_psoc_cfg *psoc_cfg = &vdev_ctx->pmo_psoc_ctx->psoc_cfg;

	pmo_enter();

	vdev_id = pmo_vdev_get_id(vdev);
	if (!PMO_VDEV_IN_STA_MODE(opmode))
		return;
	ret = pmo_tgt_vdev_update_param_req(
				vdev,
				pmo_vdev_param_inactivity_time,
				psoc_cfg->wow_data_inactivity_timeout);
	if (QDF_IS_STATUS_ERROR(ret)) {
		pmo_debug("Failed to Set wow inactivity timeout vdevId %d",
			  vdev_id);
	}

	pmo_exit();
}

static void pmo_configure_vdev_resume_params(
					struct wlan_objmgr_psoc *psoc,
					struct wlan_objmgr_vdev *vdev,
					struct pmo_vdev_priv_obj *vdev_ctx)
{
	QDF_STATUS ret;
	uint8_t vdev_id;
	enum QDF_OPMODE opmode = pmo_core_get_vdev_op_mode(vdev);
	struct pmo_psoc_cfg *psoc_cfg = &vdev_ctx->pmo_psoc_ctx->psoc_cfg;

	pmo_enter();

	vdev_id = pmo_vdev_get_id(vdev);
	if (!PMO_VDEV_IN_STA_MODE(opmode))
		return;
	ret = pmo_tgt_vdev_update_param_req(
					vdev,
					pmo_vdev_param_inactivity_time,
					psoc_cfg->ps_data_inactivity_timeout);
	if (QDF_IS_STATUS_ERROR(ret)) {
		pmo_debug("Failed to Set inactivity timeout vdevId %d",
			  vdev_id);
	}

	pmo_exit();
}

/**
 * pmo_core_set_vdev_suspend_dtim() - set suspend dtim parameters in fw
 * @psoc: objmgr psoc handle
@@ -259,6 +313,7 @@ static void pmo_core_set_suspend_dtim(struct wlan_objmgr_psoc *psoc)
		if (!pmo_is_listen_interval_user_set(vdev_ctx)
		    && !li_offload_support)
			pmo_core_set_vdev_suspend_dtim(psoc, vdev, vdev_ctx);
		pmo_configure_vdev_suspend_params(psoc, vdev, vdev_ctx);
		pmo_vdev_put_ref(vdev);
	}
}
@@ -497,6 +552,7 @@ static void pmo_core_set_resume_dtim(struct wlan_objmgr_psoc *psoc)
		if (!pmo_is_listen_interval_user_set(vdev_ctx)
		    && !li_offload_support)
			pmo_core_set_vdev_resume_dtim(psoc, vdev, vdev_ctx);
		pmo_configure_vdev_resume_params(psoc, vdev, vdev_ctx);
		pmo_vdev_put_ref(vdev);
	}
}
+7 −0
Original line number Diff line number Diff line
@@ -75,10 +75,12 @@ enum pmo_offload_type {
 * @pmo_vdev_param_listen_interval: vdev listen interval param id
 * @pmo_vdev_param_dtim_policy: vdev param dtim policy
 * @pmo_vdev_max_param: Max vdev param id
 * @pmo_vdev_param_inactivity_time: inactivity time value
 */
enum pmo_vdev_param_id {
	pmo_vdev_param_listen_interval = 0,
	pmo_vdev_param_dtim_policy,
	pmo_vdev_param_inactivity_time,
	pmo_vdev_max_param
};

@@ -285,6 +287,9 @@ enum pmo_auto_pwr_detect_failure_mode {
 * @sta_max_li_mod_dtim: station max listen interval DTIM value
 * @power_save_mode: power save mode for psoc
 * @auto_power_save_fail_mode: auto detect power save failure
 * @wow_data_inactivity_timeout: power save wow data inactivity timeout
 * @ps_data_inactivity_timeout: Power save data inactivity timeout for non
 * wow mode
 */
struct pmo_psoc_cfg {
	bool ptrn_match_enable_all_vdev;
@@ -312,6 +317,8 @@ struct pmo_psoc_cfg {
	uint8_t sta_max_li_mod_dtim;
	uint8_t power_save_mode;
	enum pmo_auto_pwr_detect_failure_mode auto_power_save_fail_mode;
	uint8_t wow_data_inactivity_timeout;
	uint8_t ps_data_inactivity_timeout;
};

/**
+4 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -57,6 +57,9 @@ QDF_STATUS target_if_pmo_send_vdev_update_param_req(
	case pmo_vdev_param_dtim_policy:
		param_id = WMI_VDEV_PARAM_DTIM_POLICY;
		break;
	case pmo_vdev_param_inactivity_time:
		param_id = WMI_STA_PS_PARAM_INACTIVITY_TIME;
		break;
	default:
		target_if_err("invalid vdev param id %d", param_id);
		return QDF_STATUS_E_INVAL;
+4 −0
Original line number Diff line number Diff line
@@ -14112,6 +14112,10 @@ static int hdd_update_pmo_config(struct hdd_context *hdd_ctx)
	psoc_cfg.power_save_mode = hdd_ctx->config->enablePowersaveOffload;
	psoc_cfg.auto_power_save_fail_mode =
		hdd_ctx->config->auto_pwr_save_fail_mode;
	psoc_cfg.wow_data_inactivity_timeout =
			hdd_ctx->config->wow_data_inactivity_timeout;
	psoc_cfg.ps_data_inactivity_timeout =
		hdd_ctx->config->nDataInactivityTimeout;

	hdd_ra_populate_pmo_config(&psoc_cfg, hdd_ctx);
	hdd_nan_populate_pmo_config(&psoc_cfg, hdd_ctx);