diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 8a9c02de79b8..c6852dbf8a58 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -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; diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 7f77c959ff1e..c45e0e9c4469 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -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); diff --git a/core/sme/src/qos/sme_qos.c b/core/sme/src/qos/sme_qos.c index 7e953ac3ba0b..57c2359363ef 100644 --- a/core/sme/src/qos/sme_qos.c +++ b/core/sme/src/qos/sme_qos.c @@ -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; diff --git a/core/wma/src/wma_power.c b/core/wma/src/wma_power.c index 2b2aa8d2dd11..5ec69b26900f 100644 --- a/core/wma/src/wma_power.c +++ b/core/wma/src/wma_power.c @@ -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);