qcacld-3.0: Refactor one mlme sta INI

Based on new cfg component, refactor CFG_TX_POWER_CTRL_NAME and clean
up related legacy codes.

Change-Id: I6dd317d5065c4111b71a9fe94d9b9af1f7d3d664
CRs-Fixed: 2355918
This commit is contained in:
Wu Gao
2018-11-26 11:49:00 +08:00
committed by nshrivas
parent c8baa90f9e
commit 4f8938a510
10 changed files with 29 additions and 41 deletions

View File

@@ -1216,6 +1216,7 @@ static void mlme_init_sta_cfg(struct wlan_objmgr_psoc *psoc,
(uint32_t)cfg_default(CFG_WT_CNF_TIMEOUT);
sta->current_rssi =
(uint32_t)cfg_default(CFG_CURRENT_RSSI);
sta->allow_tpc_from_ap = cfg_get(psoc, CFG_TX_POWER_CTRL);
}
static void mlme_init_lfr_cfg(struct wlan_objmgr_psoc *psoc,

View File

@@ -375,6 +375,28 @@
CFG_VALUE_OR_DEFAULT, \
"Current RSSI")
/*
* <ini>
* gAllowTPCfromAP - Support for AP power constraint
* @Min: 0
* @Max: 1
* @Default: 1
*
* This ini controls driver to honor/dishonor power constraint from AP.
*
* Related: None.
*
* Supported Feature: Concurrency
*
* Usage: Internal/External
*
* </ini>
*/
#define CFG_TX_POWER_CTRL CFG_INI_BOOL( \
"gAllowTPCfromAP", \
1, \
"Support for AP power constraint")
#define CFG_STA_ALL \
CFG(CFG_INFRA_STA_KEEP_ALIVE_PERIOD) \
CFG(CFG_TGT_GTX_USR_CFG) \
@@ -390,6 +412,7 @@
CFG(CFG_FORCE_RSNE_OVERRIDE) \
CFG(CFG_SINGLE_TID_RC) \
CFG(CFG_WT_CNF_TIMEOUT) \
CFG(CFG_CURRENT_RSSI)
CFG(CFG_CURRENT_RSSI) \
CFG(CFG_TX_POWER_CTRL)
#endif /* CFG_MLME_STA_H__ */

View File

@@ -1020,6 +1020,7 @@ struct wlan_mlme_nss_chains {
* @qcn_ie_support: QCN IE support
* @force_rsne_override: Force rsnie override from user
* @single_tid: Set replay counter for all TID
* @allow_tpc_from_ap: Support for AP power constraint
*/
struct wlan_mlme_sta_cfg {
uint32_t sta_keep_alive_period;
@@ -1037,6 +1038,7 @@ struct wlan_mlme_sta_cfg {
bool qcn_ie_support;
bool force_rsne_override;
bool single_tid;
bool allow_tpc_from_ap;
};
/*

View File

@@ -2407,29 +2407,6 @@ enum hdd_dot11_mode {
/* 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
/*
* <ini>
* gAllowTPCfromAP - Support for AP power constraint
* @Min: 0
* @Max: 1
* @Default: 1
*
* This ini controls driver to honor/dishonor power constraint from AP.
*
* Related: None.
*
* Supported Feature: Concurrency
*
* Usage: Internal/External
*
* </ini>
*/
#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)
/*
* <ini>
* gFWMccRtsCtsProtection - RTS-CTS protection in MCC.
@@ -5929,7 +5906,6 @@ struct hdd_config {
bool apProtEnabled;
enum station_keepalive_method sta_keepalive_method;
uint8_t nTxPowerCap; /* In dBm */
bool allow_tpc_from_ap;
uint8_t disablePacketFilter;
bool fRrmEnable;
uint16_t nRrmRandnIntvl;

View File

@@ -597,13 +597,6 @@ struct 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,
struct hdd_config, 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_FW_MCC_RTS_CTS_PROT_NAME, WLAN_PARAM_Integer,
struct hdd_config, mcc_rts_cts_prot_enable,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -3744,7 +3737,6 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx)
smeConfig->csrConfig.HeartbeatThresh50 = 40;
smeConfig->csrConfig.Is11hSupportEnabled = pConfig->Is11hSupportEnabled;
smeConfig->csrConfig.nTxPowerCap = pConfig->nTxPowerCap;
smeConfig->csrConfig.allow_tpc_from_ap = pConfig->allow_tpc_from_ap;
smeConfig->csrConfig.fEnableDFSChnlScan = pConfig->enableDFSChnlScan;
smeConfig->csrConfig.nRoamPrefer5GHz = pConfig->nRoamPrefer5GHz;
smeConfig->csrConfig.nRoamIntraBand = pConfig->nRoamIntraBand;

View File

@@ -384,7 +384,7 @@ lim_extract_ap_capability(tpAniSirGlobal mac_ctx, uint8_t *p_ie,
if (beacon_struct->wmeEdcaPresent)
*uapsd = beacon_struct->edcaParams.qosInfo.uapsd;
if (mac_ctx->roam.configParam.allow_tpc_from_ap) {
if (mac_ctx->mlme_cfg->sta.allow_tpc_from_ap) {
if (beacon_struct->powerConstraintPresent) {
*local_constraint -=
beacon_struct->localPowerConstraint.

View File

@@ -863,7 +863,7 @@ static void __sch_beacon_process_for_session(tpAniSirGlobal mac_ctx,
local_constraint = regMax;
if (mac_ctx->roam.configParam.allow_tpc_from_ap) {
if (mac_ctx->mlme_cfg->sta.allow_tpc_from_ap) {
get_local_power_constraint_beacon(bcn, &local_constraint);
pe_debug("ESE localPowerConstraint = %d,",
local_constraint);

View File

@@ -1093,7 +1093,6 @@ typedef struct tagCsrConfigParam {
* default setting.
*/
uint8_t nTxPowerCap;
bool allow_tpc_from_ap;
/* stats request frequency from PE while in full power */
uint32_t statsReqPeriodicity;
/* stats request frequency from PE while in power save */

View File

@@ -448,7 +448,6 @@ struct csr_config {
* value & 11d. If 11d is disable, the lesser of this & default setting.
*/
uint8_t nTxPowerCap;
bool allow_tpc_from_ap;
uint32_t statsReqPeriodicity; /* stats req freq while in fullpower */
uint32_t statsReqPeriodicityInPS;/* stats req freq while in powersave */
uint32_t dtimPeriod;

View File

@@ -1691,7 +1691,6 @@ static void init_config_param(tpAniSirGlobal mac)
mac->roam.configParam.min_rest_time_conc = CSR_MIN_REST_TIME_CONC;
mac->roam.configParam.idle_time_conc = CSR_IDLE_TIME_CONC;
mac->roam.configParam.nTxPowerCap = CSR_MAX_TX_POWER;
mac->roam.configParam.allow_tpc_from_ap = true;
mac->roam.configParam.statsReqPeriodicity =
CSR_MIN_GLOBAL_STAT_QUERY_PERIOD;
mac->roam.configParam.statsReqPeriodicityInPS =
@@ -2637,8 +2636,6 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal mac,
pParam->statsReqPeriodicityInPS;
/* Assign this before calling csr_init11d_info */
mac->roam.configParam.nTxPowerCap = pParam->nTxPowerCap;
mac->roam.configParam.allow_tpc_from_ap =
pParam->allow_tpc_from_ap;
if (wlan_reg_11d_enabled_on_host(mac->psoc))
status = csr_init11d_info(mac, &pParam->Csr11dinfo);
else
@@ -2911,7 +2908,6 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal mac, tCsrConfigParam *pParam)
pParam->nScanResultAgeCount = cfg_params->agingCount;
pParam->bCatRssiOffset = cfg_params->bCatRssiOffset;
pParam->nTxPowerCap = cfg_params->nTxPowerCap;
pParam->allow_tpc_from_ap = cfg_params->allow_tpc_from_ap;
pParam->statsReqPeriodicity = cfg_params->statsReqPeriodicity;
pParam->statsReqPeriodicityInPS = cfg_params->statsReqPeriodicityInPS;
pParam->fEnableDFSChnlScan = mac->scan.fEnableDFSChnlScan;