diff options
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 75 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.h | 1 |
2 files changed, 76 insertions, 0 deletions
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index c7ab7ae7fd22..81d4d758911f 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -19297,6 +19297,8 @@ static void wma_enable_sta_ps_mode(tp_wma_handle wma, tpEnablePsParams ps_req) enum powersave_qpower_mode qpower_config = wma_get_qpower_config(wma); struct wma_txrx_node *iface = &wma->interfaces[vdev_id]; + wma->psSetting = ps_req->psSetting; + if (eSIR_ADDON_NOTHING == ps_req->psSetting) { WMA_LOGD("Enable Sta Mode Ps vdevId %d", vdev_id); ret = wmi_unified_set_sta_ps_param(wma->wmi_handle, vdev_id, @@ -36355,6 +36357,31 @@ static void wma_set_vdev_suspend_dtim(tp_wma_handle wma, v_U8_t vdev_id) iface->ps_enabled = TRUE; } + /* + * Set inactivity time to 50ms when DUT is in WoW mode. + * It will be recovered to the cfg value when DUT resumes. + * + * The value 50ms inherits from Pronto. Pronto has different + * inactivity for broadcast frames (worst case inactivity + * is 50ms). 200ms Inactivity timer is applicable only to + * unicast data traffic. + */ + WMA_LOGD("%s: Set inactivity_time to 50.", __func__); + ret = wmi_unified_set_sta_ps_param(wma->wmi_handle, vdev_id, + WMI_STA_PS_PARAM_INACTIVITY_TIME, 50); + if (ret) + WMA_LOGE("%s: Setting InActivity time Failed.", + __func__); + + WMA_LOGD("%s: Set the Tx Wake Threshold 0.", __func__); + ret = wmi_unified_set_sta_ps_param( + wma->wmi_handle, vdev_id, + WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD, + WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER); + if (ret) + WMA_LOGE("%s: Setting TxWake Threshold Failed.", + __func__); + ret = wmi_unified_vdev_set_param_send(wma->wmi_handle, vdev_id, WMI_VDEV_PARAM_DTIM_POLICY , NORMAL_DTIM); @@ -36389,6 +36416,7 @@ static void wma_set_vdev_resume_dtim(tp_wma_handle wma, v_U8_t vdev_id) { struct wma_txrx_node *iface = &wma->interfaces[vdev_id]; enum powersave_qpower_mode qpower_config = wma_get_qpower_config(wma); + u_int32_t inactivity_time; if ((iface->type == WMI_VDEV_TYPE_STA) && (iface->ps_enabled == TRUE) && @@ -36440,6 +36468,53 @@ static void wma_set_vdev_resume_dtim(tp_wma_handle wma, v_U8_t vdev_id) if (ret) WMA_LOGE("Failed to enable Qpower in resume mode!"); } + + if (wlan_cfgGetInt(mac, WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT, + &cfg_data_val ) != eSIR_SUCCESS) { + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failed to get WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT"); + cfg_data_val = POWERSAVE_DEFAULT_INACTIVITY_TIME; + } + + inactivity_time = (u_int32_t)cfg_data_val; + WMA_LOGD("%s: Setting InActivity time %d.", __func__, + inactivity_time); + ret = wmi_unified_set_sta_ps_param(wma->wmi_handle, vdev_id, + WMI_STA_PS_PARAM_INACTIVITY_TIME, + inactivity_time); + if (ret) + WMA_LOGE("%s: Setting InActivity time Failed.", + __func__); + + if (wlan_cfgGetInt(mac, WNI_CFG_MAX_PS_POLL, + &cfg_data_val ) != eSIR_SUCCESS) { + VOS_TRACE(VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR, + "Failed to get value for WNI_CFG_MAX_PS_POLL"); + cfg_data_val = 0; + } + + /* + * Recover the Tx Wake Threshold + * 1, do not recover the value, because driver sets + * WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER before suspend, + * 2, recover the value, because driver sets + * WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS before suspend, + * 3, recover the value WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS, + * which is defined by fw as default and driver does + * not set it when psSetting is eSIR_ADDON_DISABLE_UAPSD. + */ + if ((eSIR_ADDON_DISABLE_UAPSD == wma->psSetting) + || ((eSIR_ADDON_NOTHING == wma->psSetting) + && (!cfg_data_val))) { + WMA_LOGD("%s: Set the Tx Wake Threshold.", __func__); + ret = wmi_unified_set_sta_ps_param( + wma->wmi_handle, vdev_id, + WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD, + WMI_STA_PS_TX_WAKE_THRESHOLD_ALWAYS); + if (ret) + WMA_LOGE("Setting TxWake Threshold vdevId %d", + vdev_id); + } } } diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h index e239070592a2..4c2790cdbe01 100644 --- a/CORE/SERVICES/WMA/wma.h +++ b/CORE/SERVICES/WMA/wma.h @@ -904,6 +904,7 @@ typedef struct wma_handle { tSirLLStatsResults *link_stats_results; vos_timer_t wma_fw_time_sync_timer; struct sir_allowed_action_frames allowed_action_frames; + tSirAddonPsReq psSetting; }t_wma_handle, *tp_wma_handle; struct wma_target_cap { |
