summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/wma/inc/wma.h1
-rw-r--r--core/wma/src/wma_power.c76
2 files changed, 77 insertions, 0 deletions
diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h
index 49e46047d0e5..f43e3590deb0 100644
--- a/core/wma/inc/wma.h
+++ b/core/wma/inc/wma.h
@@ -1612,6 +1612,7 @@ typedef struct {
tp_wma_packetdump_cb wma_mgmt_rx_packetdump_cb;
tSirLLStatsResults *link_stats_results;
bool fw_mem_dump_enabled;
+ tSirAddonPsReq ps_setting;
} t_wma_handle, *tp_wma_handle;
/**
diff --git a/core/wma/src/wma_power.c b/core/wma/src/wma_power.c
index 4068ddd2ce2e..885b696c1f04 100644
--- a/core/wma/src/wma_power.c
+++ b/core/wma/src/wma_power.c
@@ -764,6 +764,8 @@ 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->ps_setting = ps_req->psSetting;
+
if (!iface->handle) {
WMA_LOGE("vdev id %d is not active", vdev_id);
return;
@@ -1796,6 +1798,31 @@ static void wma_set_vdev_suspend_dtim(tp_wma_handle wma, uint8_t vdev_id)
WMA_LOGE("Failed to disable Qpower in suspend mode!");
}
+ /*
+ * 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 = wma_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 = wma_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 = wma_vdev_set_param(wma->wmi_handle, vdev_id,
WMI_VDEV_PARAM_DTIM_POLICY,
NORMAL_DTIM);
@@ -1843,6 +1870,7 @@ static void wma_set_vdev_resume_dtim(tp_wma_handle wma, uint8_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->dtim_policy == NORMAL_DTIM)) {
@@ -1894,6 +1922,54 @@ static void wma_set_vdev_resume_dtim(tp_wma_handle wma, uint8_t vdev_id)
if (QDF_IS_STATUS_ERROR(ret))
WMA_LOGE("Failed to enable Qpower in resume mode!");
}
+
+ if (wlan_cfg_get_int(mac, WNI_CFG_PS_DATA_INACTIVITY_TIMEOUT,
+ &cfg_data_val) != eSIR_SUCCESS) {
+ QDF_TRACE(QDF_MODULE_ID_WMA, QDF_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 = wma_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_cfg_get_int(mac, WNI_CFG_MAX_PS_POLL,
+ &cfg_data_val) != eSIR_SUCCESS) {
+ QDF_TRACE(QDF_MODULE_ID_WMA,
+ QDF_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->ps_setting)
+ || ((eSIR_ADDON_NOTHING == wma->ps_setting)
+ && (!cfg_data_val))) {
+ WMA_LOGD("%s: Set the Tx Wake Threshold.", __func__);
+ ret = wma_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);
+ }
}
}