diff options
| author | Padma, Santhosh Kumar <skpadma@qti.qualcomm.com> | 2016-05-13 18:02:40 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-05-18 14:36:31 +0530 |
| commit | e79e87f02d4b69b9cbb75dfccd61478c8ecd76c8 (patch) | |
| tree | 2ede1de2233b749af4b3db7abd9abef8d50085a2 | |
| parent | c82dfa7ec4bc7bd58c865ee9aff837be2a8f513d (diff) | |
qcacld-2.0: Add ini control to honor power constraint
Add changes to honor power constraint based on ini. Also, enhance
logging for power sent to fw.
Change-Id: Iefd497d76076527ca4c388cade46644a88a51932
CRs-Fixed: 1016876
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg.h | 5 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg.c | 9 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c | 16 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limPropExtsUtils.c | 39 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/sch/schBeaconProcess.c | 52 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 9 | ||||
| -rw-r--r-- | CORE/SME/inc/csrApi.h | 1 | ||||
| -rw-r--r-- | CORE/SME/inc/csrInternal.h | 1 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrApiRoam.c | 3 |
9 files changed, 80 insertions, 55 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index 325e5bd9373f..168c907f0760 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -637,6 +637,10 @@ enum //Not to use CFG default because if no registry setting, this is ignored by SME. #define CFG_MAX_TX_POWER_DEFAULT WNI_CFG_CURRENT_TX_POWER_LEVEL_STAMAX +#define CFG_TX_POWER_CTRL_NAME "gAllowTPCfromAP" +#define CFG_TX_POWER_CTRL_DEFAULT (1) +#define CFG_TX_POWER_CTRL_MIN (0) +#define CFG_TX_POWER_CTRL_MAX (1) #define CFG_LOW_GAIN_OVERRIDE_NAME "gLowGainOverride" #define CFG_LOW_GAIN_OVERRIDE_MIN WNI_CFG_LOW_GAIN_OVERRIDE_STAMIN @@ -3894,6 +3898,7 @@ struct hdd_config { v_U32_t goLinkMonitorPeriod; v_U32_t nBeaconInterval; v_U8_t nTxPowerCap; //In dBm + v_BOOL_t allow_tpc_from_ap; v_BOOL_t fIsLowGainOverride; v_U8_t disablePacketFilter; #if defined WLAN_FEATURE_VOWIFI diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c index 710e9c3528b1..6130a7f54faa 100644 --- a/CORE/HDD/src/wlan_hdd_cfg.c +++ b/CORE/HDD/src/wlan_hdd_cfg.c @@ -995,6 +995,13 @@ REG_TABLE_ENTRY g_registry_table[] = CFG_MAX_TX_POWER_MIN, CFG_MAX_TX_POWER_MAX ), + REG_VARIABLE( CFG_TX_POWER_CTRL_NAME, WLAN_PARAM_Integer, + hdd_config_t, allow_tpc_from_ap, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_POWER_CTRL_DEFAULT, + CFG_TX_POWER_CTRL_MIN, + CFG_TX_POWER_CTRL_MAX ), + REG_VARIABLE( CFG_LOW_GAIN_OVERRIDE_NAME, WLAN_PARAM_Integer, hdd_config_t, fIsLowGainOverride, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, @@ -4923,6 +4930,7 @@ void print_hdd_cfg(hdd_context_t *pHddCtx) VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [FastTransitionEnabled] Value = [%u] ",pHddCtx->cfg_ini->isFastTransitionEnabled); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gTxPowerCap] Value = [%u] dBm ",pHddCtx->cfg_ini->nTxPowerCap); #endif + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gAllowTPCfromAP] Value = [%u] dBm ", pHddCtx->cfg_ini->allow_tpc_from_ap); #ifdef FEATURE_WLAN_LFR VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [FastRoamEnabled] Value = [%u] ",pHddCtx->cfg_ini->isFastRoamIniFeatureEnabled); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [MAWCEnabled] Value = [%u] ",pHddCtx->cfg_ini->MAWCEnabled); @@ -7096,6 +7104,7 @@ VOS_STATUS hdd_set_sme_config( hdd_context_t *pHddCtx ) smeConfig->csrConfig.bgScanInterval = 0; smeConfig->csrConfig.eBand = pConfig->nBandCapability; smeConfig->csrConfig.nTxPowerCap = pConfig->nTxPowerCap; + smeConfig->csrConfig.allow_tpc_from_ap = pConfig->allow_tpc_from_ap; smeConfig->csrConfig.fEnableBypass11d = pConfig->enableBypass11d; smeConfig->csrConfig.fEnableDFSChnlScan = pConfig->enableDFSChnlScan; #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c index 61fb63a11f16..1ca46f890c5f 100644 --- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c +++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c @@ -2197,6 +2197,8 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) regMax = cfgGetRegulatoryMaxTransmitPower( pMac, psessionEntry->currentOperChannel ); + localPowerConstraint = regMax; + if(!pMac->psOffloadEnabled) { limExtractApCapability( pMac, @@ -2224,16 +2226,9 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) ); } - /* If power constraint is zero then update it with Region max. - * MaxTxpower will be the MIN of regmax and power constraint */ - if (localPowerConstraint == 0) - localPowerConstraint = regMax; + psessionEntry->maxTxPower = limGetMaxTxPower(regMax, + localPowerConstraint, pMac->roam.configParam.nTxPowerCap); -#ifdef FEATURE_WLAN_ESE - psessionEntry->maxTxPower = limGetMaxTxPower(regMax, localPowerConstraint, pMac->roam.configParam.nTxPowerCap); -#else - psessionEntry->maxTxPower = VOS_MIN( regMax, (localPowerConstraint) ); -#endif if(!pMac->psOffloadEnabled) { if (pMac->lim.gLimCurrentBssUapsd) @@ -2257,7 +2252,8 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) } } limLog(pMac, LOG1, - FL("regMax = %d, localPowerConstraint = %d, max tx = %d, UAPSD flag for all AC - 0x%2x"), + FL("regMax = %d, localPowerConstraint = %d," + "max tx pwr = %d, UAPSD flag for all AC - 0x%2x"), regMax, localPowerConstraint, psessionEntry->maxTxPower, psessionEntry->gUapsdPerAcBitmask); diff --git a/CORE/MAC/src/pe/lim/limPropExtsUtils.c b/CORE/MAC/src/pe/lim/limPropExtsUtils.c index 088c5969ea6e..752c1fc81d8e 100644 --- a/CORE/MAC/src/pe/lim/limPropExtsUtils.c +++ b/CORE/MAC/src/pe/lim/limPropExtsUtils.c @@ -193,25 +193,32 @@ limExtractApCapability(tpAniSirGlobal pMac, tANI_U8 *pIE, tANI_U16 ieLen, // Extract the UAPSD flag from WMM Parameter element if (pBeaconStruct->wmeEdcaPresent) *uapsd = pBeaconStruct->edcaParams.qosInfo.uapsd; -#if defined FEATURE_WLAN_ESE - /* If there is Power Constraint Element specifically, - * adapt to it. Hence there is else condition check - * for this if statement. - */ - if ( pBeaconStruct->eseTxPwr.present) - { - *localConstraint = pBeaconStruct->eseTxPwr.power_limit; - } - psessionEntry->is_ese_version_ie_present = - pBeaconStruct->is_ese_ver_ie_present; -#endif - if (pBeaconStruct->powerConstraintPresent) - { + + if (pMac->roam.configParam.allow_tpc_from_ap) { + + if (pBeaconStruct->powerConstraintPresent) { #if defined WLAN_FEATURE_VOWIFI - *localConstraint -= pBeaconStruct->localPowerConstraint.localPowerConstraints; + *localConstraint -= + pBeaconStruct->localPowerConstraint.localPowerConstraints; #else - localPowerConstraints = (tANI_U32)pBeaconStruct->localPowerConstraint.localPowerConstraints; + localPowerConstraints = + (tANI_U32)pBeaconStruct->localPowerConstraint. + localPowerConstraints; #endif + } + else { +#if defined FEATURE_WLAN_ESE + /* If there is Power Constraint Element specifically, + * adapt to it. Hence there is else condition check + * for this if statement. + */ + if ( pBeaconStruct->eseTxPwr.present) + *localConstraint = pBeaconStruct->eseTxPwr.power_limit; + + psessionEntry->is_ese_version_ie_present = + pBeaconStruct->is_ese_ver_ie_present; +#endif + } } #if !defined WLAN_FEATURE_VOWIFI if (cfgSetInt(pMac, WNI_CFG_LOCAL_POWER_CONSTRAINT, localPowerConstraints) != eSIR_SUCCESS) diff --git a/CORE/MAC/src/pe/sch/schBeaconProcess.c b/CORE/MAC/src/pe/sch/schBeaconProcess.c index ef0e9f806301..cd18335a60a4 100644 --- a/CORE/MAC/src/pe/sch/schBeaconProcess.c +++ b/CORE/MAC/src/pe/sch/schBeaconProcess.c @@ -353,6 +353,7 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, tPowerdBm regMax = 0,maxTxPower = 0; #endif tANI_U8 cbMode; + tPowerdBm localPowerConstraint; vos_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams)); beaconParams.paramChangeBitmap = 0; @@ -651,43 +652,42 @@ static void __schBeaconProcessForSession( tpAniSirGlobal pMac, regMax = cfgGetRegulatoryMaxTransmitPower( pMac, psessionEntry->currentOperChannel ); #endif -#if defined WLAN_FEATURE_VOWIFI - { - tPowerdBm localRRMConstraint = 0; - if ( pMac->rrm.rrmPEContext.rrmEnable && pBeacon->powerConstraintPresent ) - { - localRRMConstraint = pBeacon->localPowerConstraint.localPowerConstraints; - } - else - { - localRRMConstraint = 0; + localPowerConstraint = regMax; + + if (pMac->roam.configParam.allow_tpc_from_ap) { +#if defined FEATURE_WLAN_ESE + if (pBeacon->eseTxPwr.present) { + localPowerConstraint = pBeacon->eseTxPwr.power_limit; + schLog(pMac, LOG1, "ESE localPowerConstraint = %d,", + localPowerConstraint); } - maxTxPower = limGetMaxTxPower(regMax, regMax - localRRMConstraint, - pMac->roam.configParam.nTxPowerCap); - } -#elif defined FEATURE_WLAN_ESE - maxTxPower = regMax; #endif -#if defined FEATURE_WLAN_ESE - if( psessionEntry->isESEconnection ) - { - tPowerdBm localESEConstraint = 0; - if (pBeacon->eseTxPwr.present) - { - localESEConstraint = pBeacon->eseTxPwr.power_limit; - maxTxPower = limGetMaxTxPower(maxTxPower, localESEConstraint, pMac->roam.configParam.nTxPowerCap); +#if defined WLAN_FEATURE_VOWIFI + if (pMac->rrm.rrmPEContext.rrmEnable && + pBeacon->powerConstraintPresent) { + localPowerConstraint = regMax; + localPowerConstraint -= pBeacon->localPowerConstraint. + localPowerConstraints; + schLog(pMac, LOG1, "localPowerConstraint = %d,", + localPowerConstraint); } - schLog( pMac, LOG1, "RegMax = %d, localEseCons = %d, MaxTx = %d", regMax, localESEConstraint, maxTxPower ); - } #endif + } + + maxTxPower = limGetMaxTxPower(regMax, localPowerConstraint, + pMac->roam.configParam.nTxPowerCap); + + schLog(pMac, LOG1, "RegMax = %d, MaxTx pwr = %d", + regMax, maxTxPower); #if defined (FEATURE_WLAN_ESE) || defined (WLAN_FEATURE_VOWIFI) { //If maxTxPower is increased or decreased if( maxTxPower != psessionEntry->maxTxPower ) { - schLog( pMac, LOG1, "Local power constraint change..updating new maxTx power %d to HAL",maxTxPower); + schLog(pMac, LOG1, "Local power constraint change..updating new maxTx power %d to HAL from old pwr %d", + maxTxPower, psessionEntry->maxTxPower); if( limSendSetMaxTxPowerReq ( pMac, maxTxPower, psessionEntry ) == eSIR_SUCCESS ) psessionEntry->maxTxPower = maxTxPower; } diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 0b0a97f8efb0..a99bb596ad15 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -9808,7 +9808,7 @@ VOS_STATUS wma_update_channel_list(WMA_HANDLE handle, WMI_SET_CHANNEL_REG_POWER(chan_info, chan_list->chanParam[i].pwr); - WMA_LOGD(FL("Channel %u[%d] DFS[%d] TX power = %d "), + WMA_LOGI(FL("Channel %u[%d] DFS[%d] TX pwr = %d "), chan_info->mhz, i, chan_list->chanParam[i].dfsSet, chan_list->chanParam[i].pwr); /*TODO: Set WMI_SET_CHANNEL_MIN_POWER */ @@ -15382,6 +15382,9 @@ wma_vdev_set_bss_params(tp_wma_handle wma, int vdev_id, WMA_LOGW("Setting Tx power limit to 0"); } + WMA_LOGI("%s: Set maxTx pwr [WMI_VDEV_PARAM_TX_PWRLIMIT] to %d", + __func__, maxTxPower); + ret = wmi_unified_vdev_set_param_send(wma->wmi_handle, vdev_id, WMI_VDEV_PARAM_TX_PWRLIMIT, maxTxPower); @@ -18031,7 +18034,7 @@ static void wma_set_tx_power(WMA_HANDLE handle, if (wma_handle->interfaces[vdev_id].tx_power != tx_pwr_params->power) { /* tx_power changed, Push the tx_power to FW */ - WMA_LOGW("%s: Set TX power limit [WMI_VDEV_PARAM_TX_PWRLIMIT] to %d", + WMA_LOGI("%s: Set TX pwr limit WMI_VDEV_PARAM_TX_PWRLIMIT %d", __func__, tx_pwr_params->power); ret = wmi_unified_vdev_set_param_send(wma_handle->wmi_handle, vdev_id, WMI_VDEV_PARAM_TX_PWRLIMIT, tx_pwr_params->power); @@ -18087,7 +18090,7 @@ static void wma_set_max_tx_power(WMA_HANDLE handle, ret = 0; goto end; } - WMA_LOGW("Set MAX TX power limit [WMI_VDEV_PARAM_TX_PWRLIMIT] to %d", + WMA_LOGI("Set MAX TX pwr limit [WMI_VDEV_PARAM_TX_PWRLIMIT] to %d", wma_handle->interfaces[vdev_id].max_tx_power); ret = wmi_unified_vdev_set_param_send(wma_handle->wmi_handle, vdev_id, WMI_VDEV_PARAM_TX_PWRLIMIT, diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h index 0fe9739937d3..0b5fa746c524 100644 --- a/CORE/SME/inc/csrApi.h +++ b/CORE/SME/inc/csrApi.h @@ -1232,6 +1232,7 @@ typedef struct tagCsrConfigParam //The actual TX power is the lesser of this value and 11d. //If 11d is disable, the lesser of this and default setting. tANI_U8 nTxPowerCap; + tANI_BOOLEAN allow_tpc_from_ap; tANI_U32 statsReqPeriodicity; //stats request frequency from PE while in full power tANI_U32 statsReqPeriodicityInPS;//stats request frequency from PE while in power save #ifdef WLAN_FEATURE_VOWIFI_11R diff --git a/CORE/SME/inc/csrInternal.h b/CORE/SME/inc/csrInternal.h index 1f2afe9e95b4..8d2ae8df0342 100644 --- a/CORE/SME/inc/csrInternal.h +++ b/CORE/SME/inc/csrInternal.h @@ -625,6 +625,7 @@ typedef struct tagCsrConfig //The actual TX power is the lesser of this value and 11d. //If 11d is disable, the lesser of this and default setting. tANI_U8 nTxPowerCap; + tANI_BOOLEAN allow_tpc_from_ap; tANI_U32 statsReqPeriodicity; //stats request frequency from PE while in full power tANI_U32 statsReqPeriodicityInPS;//stats request frequency from PE while in power save tANI_U32 dtimPeriod; diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index d031172f4c1d..452cf6997d96 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -1258,6 +1258,7 @@ static void initConfigParam(tpAniSirGlobal pMac) #endif pMac->roam.configParam.IsIdleScanEnabled = TRUE; //enable the idle scan by default pMac->roam.configParam.nTxPowerCap = CSR_MAX_TX_POWER; + pMac->roam.configParam.allow_tpc_from_ap = TRUE; pMac->roam.configParam.statsReqPeriodicity = CSR_MIN_GLOBAL_STAT_QUERY_PERIOD; pMac->roam.configParam.statsReqPeriodicityInPS = CSR_MIN_GLOBAL_STAT_QUERY_PERIOD_IN_BMPS; #ifdef WLAN_FEATURE_VOWIFI_11R @@ -1946,6 +1947,7 @@ eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pPa pMac->roam.configParam.statsReqPeriodicityInPS = pParam->statsReqPeriodicityInPS; //Assign this before calling CsrInit11dInfo pMac->roam.configParam.nTxPowerCap = pParam->nTxPowerCap; + pMac->roam.configParam.allow_tpc_from_ap = pParam->allow_tpc_from_ap; if( csrIs11dSupported( pMac ) ) { status = CsrInit11dInfo(pMac, &pParam->Csr11dinfo); @@ -2177,6 +2179,7 @@ eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pParam->vccUlMacLossThreshold = pMac->roam.configParam.vccUlMacLossThreshold; pParam->IsIdleScanEnabled = pMac->roam.configParam.IsIdleScanEnabled; pParam->nTxPowerCap = pMac->roam.configParam.nTxPowerCap; + pParam->allow_tpc_from_ap = pMac->roam.configParam.allow_tpc_from_ap; pParam->statsReqPeriodicity = pMac->roam.configParam.statsReqPeriodicity; pParam->statsReqPeriodicityInPS = pMac->roam.configParam.statsReqPeriodicityInPS; pParam->addTSWhenACMIsOff = pMac->roam.configParam.addTSWhenACMIsOff; |
