summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrinivas Girigowda <sgirigow@qca.qualcomm.com>2016-07-12 16:18:56 -0700
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-07-13 19:02:59 +0530
commitdbce4b3c15c76be2bb4e619dae354b187c231c25 (patch)
tree92bc21f656307275cf1f61d3b16ce20d2183a5e8
parenta2e4519ce812df081f302378cf00db31aff36538 (diff)
qcacld-2.0: Remove hardcoded value and set qpower appropriately
The issue is when host re-enables QPower after resume, it is setting WMI_STA_PS_ENABLE_QPOWER to 1 (which is for QPower = 2) always and never WMI_STA_PS_ENABLE_QPOWER to 2 (which is for QPower = 5). This means one suspend/resume is enough to disable QPower = 5 and change to QPower = 2. Fix this by removing the hardcoded value of 1 and use qpower_config instead. Change-Id: I553c1691d5d7e98c2db8c9e56e2ba68ae27af506 CRs-Fixed: 1040737
-rw-r--r--CORE/SERVICES/WMA/wma.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c
index 6b35c515f052..d616752a3ffd 100644
--- a/CORE/SERVICES/WMA/wma.c
+++ b/CORE/SERVICES/WMA/wma.c
@@ -221,6 +221,7 @@ static int wma_nlo_scan_cmp_evt_handler(void *handle, u_int8_t *event,
u_int32_t len);
#endif
+static enum powersave_qpower_mode wma_get_qpower_config(tp_wma_handle wma);
#ifdef FEATURE_WLAN_EXTSCAN
/**
* enum extscan_report_events_type - extscan report events type
@@ -19237,6 +19238,7 @@ int32_t wma_set_qpower_force_sleep(tp_wma_handle wma, u_int32_t vdev_id,
(struct sAniSirGlobal*)vos_get_context(VOS_MODULE_ID_PE,
wma->vos_context);
u_int32_t pspoll_count = WMA_DEFAULT_MAX_PSPOLL_BEFORE_WAKE;
+ enum powersave_qpower_mode qpower_config = wma_get_qpower_config(wma);
WMA_LOGE("Set QPower Force(1)/Normal(0) Sleep vdevId %d val %d",
vdev_id, enable);
@@ -19256,15 +19258,17 @@ int32_t wma_set_qpower_force_sleep(tp_wma_handle wma, u_int32_t vdev_id,
pspoll_count = (u_int32_t)cfg_data_val;
}
- /* Enable QPower */
- ret = wmi_unified_set_sta_ps_param(wma->wmi_handle, vdev_id,
- WMI_STA_PS_ENABLE_QPOWER, 1);
+ if (qpower_config) {
+ /* Enable QPower */
+ ret = wmi_unified_set_sta_ps_param(wma->wmi_handle, vdev_id,
+ WMI_STA_PS_ENABLE_QPOWER, qpower_config);
- if (ret) {
- WMA_LOGE("Enable QPower Failed vdevId %d", vdev_id);
- return ret;
+ if (ret) {
+ WMA_LOGE("Enable QPower Failed vdevId %d", vdev_id);
+ return ret;
+ }
+ WMA_LOGD("QPower Enabled vdevId %d", vdev_id);
}
- WMA_LOGD("QPower Enabled vdevId %d", vdev_id);
/* Set the Wake Policy to WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD*/
ret = wmi_unified_set_sta_ps_param(wma->wmi_handle, vdev_id,
@@ -36757,7 +36761,7 @@ static void wma_set_vdev_resume_dtim(tp_wma_handle wma, v_U8_t vdev_id)
ret = wmi_unified_set_sta_ps_param(wma->wmi_handle,
vdev_id,
WMI_STA_PS_ENABLE_QPOWER,
- 1);
+ qpower_config);
if (ret)
WMA_LOGE("Failed to enable Qpower in resume mode!");
}