diff --git a/components/pmo/core/src/wlan_pmo_main.c b/components/pmo/core/src/wlan_pmo_main.c index 5e03130007..4942d33444 100644 --- a/components/pmo/core/src/wlan_pmo_main.c +++ b/components/pmo/core/src/wlan_pmo_main.c @@ -281,6 +281,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->wow_spec_wake_interval = + cfg_get(psoc, CFG_PMO_WOW_SPEC_WAKE_INTERVAL); 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 0f833d29d2..d3444d3d09 100644 --- a/components/pmo/core/src/wlan_pmo_suspend_resume.c +++ b/components/pmo/core/src/wlan_pmo_suspend_resume.c @@ -196,8 +196,15 @@ static void pmo_configure_vdev_suspend_params( pmo_sta_ps_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_err("Failed to Set wow inactivity timeout vdevId %d", + vdev_id); + } + ret = pmo_tgt_send_vdev_sta_ps_param(vdev, + pmo_sta_ps_param_spec_wake_interval, + psoc_cfg->wow_spec_wake_interval); + if (QDF_IS_STATUS_ERROR(ret)) { + pmo_err("Failed to Set wow spec wake interval vdevId %d", + vdev_id); } non_wow_inactivity_time = PS_DATA_INACTIVITY_TIMEOUT; @@ -239,8 +246,15 @@ static void pmo_configure_vdev_resume_params( pmo_sta_ps_param_inactivity_time, PS_DATA_INACTIVITY_TIMEOUT); if (QDF_IS_STATUS_ERROR(ret)) { - pmo_debug("Failed to Set inactivity timeout vdevId %d", - vdev_id); + pmo_err("Failed to Set inactivity timeout vdevId %d", + vdev_id); + } + ret = pmo_tgt_send_vdev_sta_ps_param(vdev, + pmo_sta_ps_param_spec_wake_interval, + PS_DATA_SPEC_WAKE); + if (QDF_IS_STATUS_ERROR(ret)) { + pmo_err("Failed to Set wow spec wake interval vdevId %d", + vdev_id); } } diff --git a/components/pmo/dispatcher/inc/wlan_pmo_common_cfg.h b/components/pmo/dispatcher/inc/wlan_pmo_common_cfg.h index 807d45add2..6396c91f4c 100644 --- a/components/pmo/dispatcher/inc/wlan_pmo_common_cfg.h +++ b/components/pmo/dispatcher/inc/wlan_pmo_common_cfg.h @@ -250,13 +250,14 @@ * * gOptimizedPowerManagement - Optimized Power Management * @Min: 0 - * @Max: 1 + * @Max: 2 * @Default: 1 * * This ini is used to set Optimized Power Management configuration: * Current values of gOptimizedPowerManagement: * 0 -> Disable optimized power management * 1 -> Enable optimized power management + * 2 -> User Defined * * Related: None * @@ -269,7 +270,7 @@ #define CFG_PMO_POWERSAVE_MODE CFG_INI_UINT( \ "gOptimizedPowerManagement", \ 0, \ - 1, \ + 2, \ 1, \ CFG_VALUE_OR_DEFAULT, \ "Optimized Power Management") @@ -472,7 +473,8 @@ * @Max: 255 * @Default: 50 * - * This ini is used to set data inactivity timeout in wow mode. + * This ini is used to set data inactivity timeout in wow mode and + * the value is honored in firmware when User defined OPM is set * * Supported Feature: inactivity timeout in wow mode * @@ -487,6 +489,29 @@ 50, \ CFG_VALUE_OR_DEFAULT, \ "Data activity timeout in wow mode") +/* + * + * g_wow_spec_wake_interval - OPM Speculative wake interval in wow mode. + * @Min: 0 + * @Max: 255 + * @Default: 0 + * + * This ini is used to set OPM speculative wake interval in wow mode and + * the value is honored in firmware when User defined OPM is set + * + * Supported Feature: OPM Speculative wake interval in wow mode + * + * Usage: External + * + * + */ +#define CFG_PMO_WOW_SPEC_WAKE_INTERVAL CFG_INI_UINT( \ + "g_wow_spec_wake_interval", \ + 0, \ + 255, \ + 0, \ + CFG_VALUE_OR_DEFAULT, \ + "Speculative wake interval in wow mode") /* * * gRArateLimitInterval - RA rate limit interval @@ -757,6 +782,7 @@ CFG(CFG_PMO_ACTIVE_MODE) \ CFG(CFG_PMO_PWR_FAILURE) \ CFG(CFG_PMO_WOW_DATA_INACTIVITY_TIMEOUT) \ + CFG(CFG_PMO_WOW_SPEC_WAKE_INTERVAL) \ CFG(CFG_RA_RATE_LIMIT_INTERVAL) \ CFG(CFG_PMO_MOD_DTIM_ON_SYS_SUSPEND) \ CFG(CFG_ENABLE_BUS_SUSPEND_IN_SAP_MODE) \ 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 75235fb655..43dd0b4120 100644 --- a/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h +++ b/components/pmo/dispatcher/inc/wlan_pmo_common_public_struct.h @@ -102,6 +102,7 @@ enum pmo_beacon_dtim_policy { * @pmo_sta_ps_param_advanced_power_max_tx_before_wake: Number of TX frames * before the entering the Active state * @pmo_sta_ps_param_ito_repeat_count: Indicates ito repeated count + * @pmo_sta_ps_param_spec_wake_interval: OPM speculative wake interval */ enum pmo_sta_powersave_param { pmo_sta_ps_param_rx_wake_policy = 0, @@ -113,6 +114,7 @@ enum pmo_sta_powersave_param { pmo_sta_ps_enable_advanced_power = 6, pmo_sta_ps_param_advanced_power_max_tx_before_wake = 7, pmo_sta_ps_param_ito_repeat_count = 8, + pmo_sta_ps_param_spec_wake_interval = 9, }; /** @@ -167,10 +169,12 @@ enum pmo_wow_enable_type { * enum powersave_mode - powersave_mode * @PMO_PS_ADVANCED_POWER_SAVE_DISABLE: Disable advanced power save mode * @PMO_PS_ADVANCED_POWER_SAVE_ENABLE: Enable power save mode + * @PMO_PS_ADVANCED_POWER_SAVE_USER_DEFINED: User Defined */ enum powersave_mode { PMO_PS_ADVANCED_POWER_SAVE_DISABLE = 0, - PMO_PS_ADVANCED_POWER_SAVE_ENABLE = 1 + PMO_PS_ADVANCED_POWER_SAVE_ENABLE = 1, + PMO_PS_ADVANCED_POWER_SAVE_USER_DEFINED = 2 }; /** @@ -380,6 +384,7 @@ struct pmo_icmp_offload { * @enable_sap_suspend: enable SoftAP suspend * @wow_data_inactivity_timeout: power save wow data inactivity timeout * wow mode + * @wow_spec_wake_interval: OPM speculatvie wkae interval in 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 @@ -465,6 +470,7 @@ struct pmo_psoc_cfg { #endif bool enable_sap_suspend; uint8_t wow_data_inactivity_timeout; + uint8_t wow_spec_wake_interval; enum active_apf_mode active_uc_apf_mode; enum active_apf_mode active_mc_bc_apf_mode; uint8_t ito_repeat_count; 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 f5801a83b5..24f06412f0 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 @@ -162,6 +162,9 @@ QDF_STATUS target_if_pmo_send_vdev_ps_param_req( case pmo_sta_ps_param_ito_repeat_count: param_id = WMI_STA_PS_PARAM_MAX_RESET_ITO_COUNT_ON_TIM_NO_TXRX; break; + case pmo_sta_ps_param_spec_wake_interval: + param_id = WMI_STA_PS_PARAM_SPEC_WAKE_INTERVAL; + break; default: target_if_err("invalid vdev param id %d", param_id); return QDF_STATUS_E_INVAL; diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index e98e434480..688fbb9f65 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -3410,7 +3410,7 @@ int hdd_set_power_config(struct hdd_context *hddctx, return -EINVAL; } - if (power > PMO_PS_ADVANCED_POWER_SAVE_ENABLE || + if (power > PMO_PS_ADVANCED_POWER_SAVE_USER_DEFINED || power < PMO_PS_ADVANCED_POWER_SAVE_DISABLE) { hdd_err("invalid power value: %d", power); return -EINVAL; diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index fb93914275..99a6cd9376 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -58,6 +58,7 @@ struct mac_context; * PS_DATA_INACTIVITY_TIMEOUT with the ini's default value. */ #define PS_DATA_INACTIVITY_TIMEOUT (200) +#define PS_DATA_SPEC_WAKE (0) #define OFFSET_OF(structType, fldName) (&((structType *)0)->fldName) #define WLAN_DOT11_BASIC_RATE_MASK (0x80)