diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 2d4deeda24c7..3d5efe59eeab 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -138,6 +138,21 @@ #define CFG_MAX_RX_AMPDU_FACTOR_MAX WNI_CFG_MAX_RX_AMPDU_FACTOR_STAMAX #define CFG_MAX_RX_AMPDU_FACTOR_DEFAULT WNI_CFG_MAX_RX_AMPDU_FACTOR_STADEF +/* Configuration option for HT MPDU density (Table 8-125 802.11-2012) + * 0 for no restriction + * 1 for 1/4 micro sec + * 2 for 1/2 micro sec + * 3 for 1 micro sec + * 4 for 2 micro sec + * 5 for 4 micro sec + * 6 for 8 micro sec + * 7 for 16 micro sec + */ +#define CFG_HT_MPDU_DENSITY_NAME "ght_mpdu_density" +#define CFG_HT_MPDU_DENSITY_MIN WNI_CFG_MPDU_DENSITY_STAMIN +#define CFG_HT_MPDU_DENSITY_MAX WNI_CFG_MPDU_DENSITY_STAMAX +#define CFG_HT_MPDU_DENSITY_DEFAULT WNI_CFG_MPDU_DENSITY_STADEF + /* Configuration added to enable/disable CTS2SELF in */ /* Adaptive RX drain feature */ #define CFG_ENABLE_ADAPT_RX_DRAIN_NAME "gEnableAdaptRxDrain" @@ -3384,6 +3399,7 @@ struct hdd_config { int8_t early_stop_scan_min_threshold; int8_t early_stop_scan_max_threshold; int8_t first_scan_bucket_threshold; + uint8_t ht_mpdu_density; }; #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var)) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 7113499ec329..5192d0b5a493 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -500,6 +500,13 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_MAX_RX_AMPDU_FACTOR_MIN, CFG_MAX_RX_AMPDU_FACTOR_MAX), + REG_VARIABLE(CFG_HT_MPDU_DENSITY_NAME, WLAN_PARAM_Integer, + struct hdd_config, ht_mpdu_density, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK , + CFG_HT_MPDU_DENSITY_DEFAULT, + CFG_HT_MPDU_DENSITY_MIN, + CFG_HT_MPDU_DENSITY_MAX), + REG_VARIABLE(CFG_FIXED_RATE_NAME, WLAN_PARAM_Integer, struct hdd_config, TxRate, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK, @@ -5182,6 +5189,10 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) hddLog(LOGE, "Name = [%s] Value = [%d]", CFG_FIRST_SCAN_BUCKET_THRESHOLD_NAME, pHddCtx->config->first_scan_bucket_threshold); + hddLog(LOGE, "Name = [%s] Value = [%u]", + CFG_HT_MPDU_DENSITY_NAME, + pHddCtx->config->ht_mpdu_density); + } @@ -5609,6 +5620,14 @@ bool hdd_update_config_dat(hdd_context_t *pHddCtx) "Could not pass on WNI_CFG_HT_AMPDU_PARAMS_MAX_RX_AMPDU_FACTOR to CFG"); } + if (sme_cfg_set_int(pHddCtx->hHal, WNI_CFG_MPDU_DENSITY, + pConfig->ht_mpdu_density) == + CDF_STATUS_E_FAILURE) { + fStatus = false; + hddLog(LOGE, + "Could not pass on WNI_CFG_MPDU_DENSITY to CFG"); + } + if (sme_cfg_set_int (pHddCtx->hHal, WNI_CFG_SHORT_PREAMBLE, pConfig->fIsShortPreamble) == CDF_STATUS_E_FAILURE) { diff --git a/core/mac/inc/wni_cfg.h b/core/mac/inc/wni_cfg.h index 53a1c8b77f4c..adc9e6513d56 100644 --- a/core/mac/inc/wni_cfg.h +++ b/core/mac/inc/wni_cfg.h @@ -1158,7 +1158,7 @@ enum { #define WNI_CFG_MPDU_DENSITY_STAMIN 0 #define WNI_CFG_MPDU_DENSITY_STAMAX 7 -#define WNI_CFG_MPDU_DENSITY_STADEF 0 +#define WNI_CFG_MPDU_DENSITY_STADEF 7 #define WNI_CFG_NUM_BUFF_ADVERT_STAMIN 0 #define WNI_CFG_NUM_BUFF_ADVERT_STAMAX 128 diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index 2ed29da641de..bb825e71cc70 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -449,22 +449,24 @@ static tSirRetStatus __lim_init_config(tpAniSirGlobal pMac) if (wlan_cfg_get_int(pMac, WNI_CFG_HT_AMPDU_PARAMS, &val1) != eSIR_SUCCESS) { - PELOGE(lim_log - (pMac, LOGE, - FL("could not retrieve HT AMPDU Param CFG")); - ) + lim_log(pMac, LOGE, FL("could not retrieve HT AMPDU Param")); return eSIR_FAILURE; } if (wlan_cfg_get_int(pMac, WNI_CFG_MAX_RX_AMPDU_FACTOR, &val2) != eSIR_SUCCESS) { - PELOGE(lim_log - (pMac, LOGE, FL("could not retrieve AMPDU Factor CFG")); - ) + lim_log(pMac, LOGE, FL("could not retrieve AMPDU Factor CFG")); return eSIR_FAILURE; } + if (wlan_cfg_get_int(pMac, WNI_CFG_MPDU_DENSITY, &val3) != + eSIR_SUCCESS) { + lim_log(pMac, LOGE, FL("could not retrieve MPDU Density CFG")); + return eSIR_FAILURE; + } + val16 = (uint16_t) val1; pAmpduParamInfo = (tSirMacHTParametersInfo *) &val16; pAmpduParamInfo->maxRxAMPDUFactor = (uint8_t) val2; + pAmpduParamInfo->mpduDensity = (uint8_t)val3; if (cfg_set_int (pMac, WNI_CFG_HT_AMPDU_PARAMS, *(uint8_t *) pAmpduParamInfo) != eSIR_SUCCESS) {