From e704e226a7a25027ea8b714be3cf6cf024ae54f4 Mon Sep 17 00:00:00 2001 From: Amar Singhal Date: Tue, 19 Aug 2014 15:23:33 -0700 Subject: qcacld: Honour BandCapability setting from INI The BandCapability setting can come from the target as well as the INI. If the BandCapability from INI is a subset of BandCapability from target, it should take precedence. Also change the default INI setting to ALL. CRs-Fixed: 711797 Change-Id: I8dd8c46820908e95736439bb6d69b9aafb2bd446 --- CORE/HDD/inc/wlan_hdd_cfg.h | 2 +- CORE/HDD/src/wlan_hdd_main.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index c62fb1f079f7..f57c81b304a3 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -1404,7 +1404,7 @@ typedef enum #define CFG_BAND_CAPABILITY_NAME "BandCapability" #define CFG_BAND_CAPABILITY_MIN (0) #define CFG_BAND_CAPABILITY_MAX (2) -#define CFG_BAND_CAPABILITY_DEFAULT (1) +#define CFG_BAND_CAPABILITY_DEFAULT (0) #define CFG_ENABLE_BEACON_EARLY_TERMINATION_NAME "enableBeaconEarlyTermination" #define CFG_ENABLE_BEACON_EARLY_TERMINATION_MIN ( 0 ) diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 781f57ac6761..4c6e2aa50f72 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -6641,8 +6641,26 @@ void hdd_update_tgt_cfg(void *context, void *param) { hdd_context_t *hdd_ctx = (hdd_context_t *)context; struct hdd_tgt_cfg *cfg = (struct hdd_tgt_cfg *)param; + tANI_U8 temp_band_cap; + + /* first store the INI band capability */ + temp_band_cap = hdd_ctx->cfg_ini->nBandCapability; + hdd_ctx->cfg_ini->nBandCapability = cfg->band_cap; + /* now overwrite the target band capability with INI + setting if INI setting is a subset */ + + if ((hdd_ctx->cfg_ini->nBandCapability == eCSR_BAND_ALL) && + (temp_band_cap != eCSR_BAND_ALL)) + hdd_ctx->cfg_ini->nBandCapability = temp_band_cap; + else if ((hdd_ctx->cfg_ini->nBandCapability != eCSR_BAND_ALL) && + (temp_band_cap != eCSR_BAND_ALL) && + (hdd_ctx->cfg_ini->nBandCapability != temp_band_cap)) { + hddLog(VOS_TRACE_LEVEL_WARN, + FL("ini BandCapability not supported by the target")); + } + hdd_ctx->reg.reg_domain = cfg->reg_domain; hdd_ctx->reg.eeprom_rd_ext = cfg->eeprom_rd_ext; -- cgit v1.2.3