summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmar Singhal <asinghal@codeaurora.org>2017-08-01 13:43:54 -0700
committersnandini <snandini@codeaurora.org>2017-08-02 00:36:26 -0700
commitb5aa885176ecbec836df3393225a763a2a1029d6 (patch)
tree5bba74505f38e0d9af1b997ab90a910664e7c489
parent27096b3da82fa18fc0fe919b0b180c7fba5a8868 (diff)
qcacld-3.0: Cache the current band value
Add a separate variable to store the band value. Apply the configuration restrictions while calculating this band value. Change-Id: Id6df155b7ecfbe9ca84e489b2dd099cdd0cbcc8f CRs-Fixed: 2085746
-rw-r--r--core/hdd/inc/wlan_hdd_main.h2
-rw-r--r--core/hdd/src/wlan_hdd_main.c4
-rw-r--r--core/hdd/src/wlan_hdd_regulatory.c2
-rw-r--r--core/hdd/src/wlan_hdd_wext.c3
4 files changed, 7 insertions, 4 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index ce350584d615..c3ab6ed94495 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -1956,7 +1956,7 @@ struct hdd_context_s {
bool rcpi_enabled;
bool imps_enabled;
int user_configured_pkt_filter_rules;
-
+ uint8_t curr_band;
uint32_t no_of_probe_req_ouis;
uint32_t *probe_req_voui;
struct hdd_nud_stats_context nud_stats_context;
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 5d5947e2a7d0..16bbbdb2bc29 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -1512,6 +1512,8 @@ void hdd_update_tgt_cfg(void *context, void *param)
hdd_warn("ini BandCapability not supported by the target");
}
+ hdd_ctx->curr_band = hdd_ctx->config->nBandCapability;
+
if (!cds_is_driver_recovering() || cds_is_driver_in_bad_state()) {
hdd_ctx->reg.reg_domain = cfg->reg_domain;
hdd_ctx->reg.eeprom_rd_ext = cfg->eeprom_rd_ext;
@@ -6052,7 +6054,7 @@ bool hdd_is_5g_supported(hdd_context_t *hdd_ctx)
if (!hdd_ctx || !hdd_ctx->config)
return true;
- if (hdd_ctx->config->nBandCapability != eCSR_BAND_24)
+ if (hdd_ctx->curr_band != eCSR_BAND_24)
return true;
else
return false;
diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c
index 62b0a33d5f8d..460042321b39 100644
--- a/core/hdd/src/wlan_hdd_regulatory.c
+++ b/core/hdd/src/wlan_hdd_regulatory.c
@@ -380,7 +380,7 @@ static void hdd_process_regulatory_data(hdd_context_t *hdd_ctx,
struct regulatory_channel *cds_chan;
uint8_t band_capability;
- band_capability = hdd_ctx->config->nBandCapability;
+ band_capability = hdd_ctx->curr_band;
for (band_num = 0; band_num < NUM_NL80211_BANDS; band_num++) {
diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c
index 05ed5c26182b..cd902a13087c 100644
--- a/core/hdd/src/wlan_hdd_wext.c
+++ b/core/hdd/src/wlan_hdd_wext.c
@@ -7497,7 +7497,6 @@ int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal,
sme_update_config(hal, &smeconfig);
phddctx->config->dot11Mode = hdd_dot11mode;
- phddctx->config->nBandCapability = curr_band;
phddctx->config->nChannelBondingMode24GHz =
smeconfig.csrConfig.channelBondingMode24GHz;
phddctx->config->nChannelBondingMode5GHz =
@@ -12233,6 +12232,8 @@ int hdd_set_band(struct net_device *dev, u8 ui_band)
band = pHddCtx->config->nBandCapability;
}
+ pHddCtx->curr_band = band;
+
if (QDF_STATUS_SUCCESS != sme_get_freq_band(hHal, &currBand)) {
hdd_debug("Failed to get current band config");
return -EIO;