summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Zhang <paulz@codeaurora.org>2016-12-29 11:29:47 +0800
committerqcabuildsw <qcabuildsw@localhost>2016-12-29 13:23:30 -0800
commit93c5085568f746aab9deae5ddddb123227e1d232 (patch)
tree1328d90a1a81bec7abaca492d9f37ed65b348c5c
parent7890bbc0665f836a19b038d2534e2ef6fcb79997 (diff)
qcacld-3.0: sustain wlan in low PS mode
Propagation from qcacld-2.0 to qcacld-3.0. If DUT receives arp request every 100ms, it causes the DUT can't enter PS mode. Because: 1\ By default, inactivity time out is 200ms, 2\ Tx count before wake equals 0x1. To mitigate this issue, during WoW, 1\ change the inactivity time out to 50ms, 2\ change the tx count before wake to 0x0, which means tx will never cause to wake up. Change-Id: I6223ab27c2285c53c45fd388bd56cadc6d348324 CRs-Fixed: 1019565
-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);
+ }
}
}