qcacld-3.0: Disable Qpower with UAPSD or max ps-poll enabled

Disable Qpower when UAPSD is enabled or if the max ps poll is
configured by user.

Change-Id: If9c747406d65a6f89fa123592c3f9d79724b8ae0
CRs-Fixed: 2017432
This commit is contained in:
Kiran Kumar Lokere 2017-03-07 19:28:36 -08:00 • committed by qcabuildsw
commit 7006e0ad76
4 changed files with 47 additions and 2 deletions

View file

@ -7496,8 +7496,23 @@ static int hdd_update_cds_config(hdd_context_t *hdd_ctx)
}
cds_cfg->driver_type = DRIVER_TYPE_PRODUCTION;
cds_cfg->powersave_offload_enabled =
hdd_ctx->config->enablePowersaveOffload;
if (!hdd_ctx->config->nMaxPsPoll ||
!hdd_ctx->config->enablePowersaveOffload) {
cds_cfg->powersave_offload_enabled =
hdd_ctx->config->enablePowersaveOffload;
} else {
if ((hdd_ctx->config->enablePowersaveOffload ==
PS_QPOWER_NODEEPSLEEP) ||
(hdd_ctx->config->enablePowersaveOffload ==
PS_LEGACY_NODEEPSLEEP))
cds_cfg->powersave_offload_enabled =
PS_LEGACY_NODEEPSLEEP;
else
cds_cfg->powersave_offload_enabled =
PS_LEGACY_DEEPSLEEP;
hdd_info("Qpower disabled in cds config, %d",
cds_cfg->powersave_offload_enabled);
}
cds_cfg->sta_dynamic_dtim = hdd_ctx->config->enableDynamicDTIM;
cds_cfg->sta_mod_dtim = hdd_ctx->config->enableModulatedDTIM;
cds_cfg->sta_maxlimod_dtim = hdd_ctx->config->fMaxLIModulatedDTIM;

View file

@ -2251,6 +2251,14 @@ int hdd_set_qpower_config(hdd_context_t *hddctx, hdd_adapter_t *adapter,
return -EINVAL;
}
if (hddctx->config->nMaxPsPoll) {
if ((qpower == PS_QPOWER_NODEEPSLEEP) ||
(qpower == PS_LEGACY_NODEEPSLEEP))
qpower = PS_LEGACY_NODEEPSLEEP;
else
qpower = PS_LEGACY_DEEPSLEEP;
hdd_info("Qpower disabled, %d", qpower);
}
status = wma_set_qpower_config(adapter->sessionId, qpower);
if (status != QDF_STATUS_SUCCESS) {
hdd_err("failed to configure qpower: %d", status);

View file

@ -4257,6 +4257,7 @@ QDF_STATUS sme_qos_process_del_ts_ind(tpAniSirGlobal pMac, void *pMsgBuf)
uint8_t sessionId = pdeltsind->sessionId;
sme_QosEdcaAcType ac;
sme_QosSearchInfo search_key;
tSirMacTSInfo *tsinfo;
sme_QosWmmUpType up =
(sme_QosWmmUpType) pdeltsind->rsp.tspec.tsinfo.traffic.userPrio;
#ifdef FEATURE_WLAN_DIAG_SUPPORT
@ -4265,6 +4266,7 @@ QDF_STATUS sme_qos_process_del_ts_ind(tpAniSirGlobal pMac, void *pMsgBuf)
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO_HIGH,
"%s: %d: Invoked on session %d for UP %d",
__func__, __LINE__, sessionId, up);
tsinfo = &pdeltsind->rsp.tspec.tsinfo;
ac = sme_qos_up_to_ac(up);
if (SME_QOS_EDCA_AC_MAX == ac) {
/* err msg */
@ -4291,6 +4293,7 @@ QDF_STATUS sme_qos_process_del_ts_ind(tpAniSirGlobal pMac, void *pMsgBuf)
QDF_ASSERT(0);
return QDF_STATUS_E_FAILURE;
}
sme_set_tspec_uapsd_mask_per_session(pMac, tsinfo, sessionId);
/* event: EVENT_WLAN_QOS */
#ifdef FEATURE_WLAN_DIAG_SUPPORT
qos.eventId = SME_QOS_DIAG_DELTS;

View file

@ -767,6 +767,10 @@ void wma_enable_sta_ps_mode(tp_wma_handle wma, tpEnablePsParams ps_req)
return;
}
if (eSIR_ADDON_NOTHING == ps_req->psSetting) {
if (qpower_config && iface->uapsd_cached_val) {
qpower_config = 0;
WMA_LOGD("Qpower is disabled");
}
WMA_LOGD("Enable Sta Mode Ps vdevId %d", vdev_id);
ret = wma_unified_set_sta_ps_param(wma->wmi_handle, vdev_id,
WMI_STA_PS_PARAM_UAPSD, 0);
@ -804,6 +808,10 @@ void wma_enable_sta_ps_mode(tp_wma_handle wma, tpEnablePsParams ps_req)
vdev_id, uapsd_val);
}
if (qpower_config && iface->uapsd_cached_val) {
qpower_config = 0;
WMA_LOGD("Qpower is disabled");
}
WMA_LOGD("Enable Forced Sleep vdevId %d", vdev_id);
ret = wma_set_force_sleep(wma, vdev_id, true,
qpower_config, true);
@ -882,6 +890,12 @@ void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req)
uint32_t vdev_id = ps_req->sessionid;
uint32_t uapsd_val = 0;
enum powersave_qpower_mode qpower_config = wma_get_qpower_config(wma);
struct wma_txrx_node *iface = &wma->interfaces[vdev_id];
if (!iface->handle) {
WMA_LOGE("vdev id %d is not active", vdev_id);
return;
}
/* Disable Sta Mode Power save */
ret = wmi_unified_set_sta_ps(wma->wmi_handle, vdev_id, false);
@ -900,6 +914,11 @@ void wma_enable_uapsd_mode(tp_wma_handle wma, tpEnableUapsdParams ps_req)
return;
}
if (qpower_config && uapsd_val) {
qpower_config = 0;
WMA_LOGD("Disable Qpower %d", vdev_id);
}
iface->uapsd_cached_val = uapsd_val;
WMA_LOGD("Enable Forced Sleep vdevId %d", vdev_id);
ret = wma_set_force_sleep(wma, vdev_id, true,
qpower_config, ps_req->uapsdParams.enable_ps);