diff --git a/components/pmo/core/src/wlan_pmo_main.c b/components/pmo/core/src/wlan_pmo_main.c index 81a2755d07a2e..fdf56824db98a 100644 --- a/components/pmo/core/src/wlan_pmo_main.c +++ b/components/pmo/core/src/wlan_pmo_main.c @@ -203,6 +203,8 @@ static void wlan_pmo_init_cfg(struct wlan_objmgr_psoc *psoc, psoc_cfg->enable_sap_suspend = cfg_get(psoc, CFG_ENABLE_SAP_SUSPEND); psoc_cfg->wow_data_inactivity_timeout = cfg_get(psoc, CFG_PMO_WOW_DATA_INACTIVITY_TIMEOUT); + psoc_cfg->ps_data_inactivity_timeout = + cfg_get(psoc, CFG_PS_DATA_INACTIVITY_TIMEOUT); psoc_cfg->active_uc_apf_mode = cfg_get(psoc, CFG_ACTIVE_UC_APF_MODE); psoc_cfg->active_mc_bc_apf_mode = diff --git a/components/pmo/core/src/wlan_pmo_suspend_resume.c b/components/pmo/core/src/wlan_pmo_suspend_resume.c index dbab29bb9801f..1173183b65b48 100644 --- a/components/pmo/core/src/wlan_pmo_suspend_resume.c +++ b/components/pmo/core/src/wlan_pmo_suspend_resume.c @@ -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); } } @@ -495,6 +550,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); } } diff --git a/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h b/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h index 8f55de0b539da..b6c8863e30cde 100644 --- a/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h +++ b/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h @@ -63,10 +63,12 @@ * @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 }; @@ -339,6 +341,8 @@ enum active_apf_mode { * @wow_pulse_interval_low: The interval of low level in the pulse * @packet_filters_bitmap: Packet filter bitmap configuration * @wow_data_inactivity_timeout: power save wow data inactivity timeout + * @ps_data_inactivity_timeout: Power save data inactivity timeout for non + * wow mode * @active_uc_apf_mode: Setting that determines how APF is applied in active * mode for uc packets * @active_mc_bc_apf_mode: Setting that determines how APF is applied in @@ -401,6 +405,7 @@ struct pmo_psoc_cfg { #endif bool enable_sap_suspend; uint8_t wow_data_inactivity_timeout; + uint8_t ps_data_inactivity_timeout; enum active_apf_mode active_uc_apf_mode; enum active_apf_mode active_mc_bc_apf_mode; }; diff --git a/components/target_if/pmo/src/target_if_pmo_suspend_resume.c b/components/target_if/pmo/src/target_if_pmo_suspend_resume.c index aa379abab0590..e784b8abbf0c9 100644 --- a/components/target_if/pmo/src/target_if_pmo_suspend_resume.c +++ b/components/target_if/pmo/src/target_if_pmo_suspend_resume.c @@ -1,5 +1,5 @@ /* - * 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;