diff options
| author | Amar Singhal <asinghal@codeaurora.org> | 2017-10-19 18:36:09 -0700 |
|---|---|---|
| committer | snandini <snandini@codeaurora.org> | 2017-10-26 13:43:10 -0700 |
| commit | 76d753057d5beee069ccfd22b3af39268c0768dc (patch) | |
| tree | dd3580cdec26211795a735d8bac4baa226b4d10b | |
| parent | b3a4cf5a8cb7871652860ab8827d112dca0d8141 (diff) | |
qcacld-3.0: Cache the country info when modules are closed
When modules are closed, the country information cannot be applied
to the wlan sub-system since most of the modules, including firmware
are de-allocated. So do the necessary computations and cache the
information till the modules are opened.
Change-Id: I559a9c80d7349122278e00da265c2c04adb5a4c8
CRs-Fixed: 2128664
| -rw-r--r-- | core/cds/inc/cds_reg_service.h | 4 | ||||
| -rw-r--r-- | core/hdd/inc/wlan_hdd_regulatory.h | 8 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 3 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_regulatory.c | 34 | ||||
| -rw-r--r-- | core/sme/src/common/sme_api.c | 8 | ||||
| -rw-r--r-- | core/sme/src/csr/csr_api_scan.c | 1 |
6 files changed, 34 insertions, 24 deletions
diff --git a/core/cds/inc/cds_reg_service.h b/core/cds/inc/cds_reg_service.h index 137e8512d980..dc9e8f7d7723 100644 --- a/core/cds/inc/cds_reg_service.h +++ b/core/cds/inc/cds_reg_service.h @@ -291,8 +291,9 @@ enum country_src { * @ctl_2g: 2G CTL value * @ctl_5g: 5G CTL value * @reg_pair: pointer to regulatory pair - * @cc_src: country code src + * @cc_src: hdd country code src * @reg_flags: kernel regulatory flags + * @reset: whether to reset to 00 */ struct regulatory { uint32_t reg_domain; @@ -304,6 +305,7 @@ struct regulatory { const void *regpair; enum country_src cc_src; uint32_t reg_flags; + bool reset; }; /** diff --git a/core/hdd/inc/wlan_hdd_regulatory.h b/core/hdd/inc/wlan_hdd_regulatory.h index 41fa29ac60a9..30ece607e7a1 100644 --- a/core/hdd/inc/wlan_hdd_regulatory.h +++ b/core/hdd/inc/wlan_hdd_regulatory.h @@ -72,4 +72,12 @@ void hdd_modify_indoor_channel_state_flags( struct regulatory_channel *cds_chan, enum channel_enum chan_enum, int chan_num, bool disable); +/** + * hdd_apply_cached_country_info() - apply cached ctry info + * @hdd_ctx: hdd context + * + * Return: void + */ +void hdd_apply_cached_country_info(hdd_context_t *hdd_ctx); + #endif diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index cd49402fc87f..27d7e37f9d11 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9157,6 +9157,9 @@ static int hdd_pre_enable_configure(hdd_context_t *hdd_ctx) goto out; } + hdd_apply_cached_country_info(hdd_ctx); + + cds_fill_and_send_ctl_to_fw(&hdd_ctx->reg); status = hdd_set_sme_chan_list(hdd_ctx); if (status != QDF_STATUS_SUCCESS) { diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index 5156d65420f5..f035474ffa04 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -700,6 +700,16 @@ static void hdd_restore_reg_flags(struct wiphy *wiphy, uint32_t flags) } #endif +void hdd_apply_cached_country_info(hdd_context_t *hdd_ctx) +{ + + hdd_update_regulatory_info(hdd_ctx); + + hdd_process_regulatory_data(hdd_ctx, hdd_ctx->wiphy, + hdd_ctx->reg.reset); + + sme_set_cc_src(hdd_ctx->hHal, hdd_ctx->reg.cc_src); +} /** * hdd_reg_notifier() - regulatory notifier @@ -733,11 +743,6 @@ void hdd_reg_notifier(struct wiphy *wiphy, return; } - if (hdd_ctx->driver_status == DRIVER_MODULES_CLOSED) { - hdd_err("Driver module is closed; dropping request"); - return; - } - if (hdd_ctx->isWiphySuspended == true) { hdd_err("%s: system/cfg80211 is already suspend", __func__); return; @@ -789,15 +794,11 @@ void hdd_reg_notifier(struct wiphy *wiphy, hdd_ctx->reg.cc_src = SOURCE_CORE; pld_set_cc_source(hdd_ctx->parent_dev, PLD_SOURCE_CORE); - sme_set_cc_src(hdd_ctx->hHal, SOURCE_CORE); if (is_wiphy_custom_regulatory(wiphy)) reset = true; } else if (NL80211_REGDOM_SET_BY_DRIVER == request->initiator) { hdd_ctx->reg.cc_src = SOURCE_DRIVER; - sme_set_cc_src(hdd_ctx->hHal, SOURCE_DRIVER); } else { - sme_set_cc_src(hdd_ctx->hHal, SOURCE_USERSPACE); - if (pld_get_cc_source(hdd_ctx->parent_dev) == PLD_SOURCE_11D) hdd_ctx->reg.cc_src = SOURCE_11D; @@ -811,18 +812,23 @@ void hdd_reg_notifier(struct wiphy *wiphy, hdd_ctx->reg.alpha2[0] = request->alpha2[0]; hdd_ctx->reg.alpha2[1] = request->alpha2[1]; - hdd_update_regulatory_info(hdd_ctx); + hdd_set_dfs_region(hdd_ctx, + (enum dfs_region) request->dfs_region); + + + if (hdd_ctx->driver_status == DRIVER_MODULES_CLOSED) { + hdd_ctx->reg.reset = reset; + hdd_debug("Driver module is closed, apply it later"); + return; + } - hdd_process_regulatory_data(hdd_ctx, wiphy, reset); + hdd_apply_cached_country_info(hdd_ctx); sme_generic_change_country_code(hdd_ctx->hHal, hdd_ctx->reg.alpha2); cds_fill_and_send_ctl_to_fw(&hdd_ctx->reg); - hdd_set_dfs_region(hdd_ctx, - (enum dfs_region) request->dfs_region); - cds_get_dfs_region(&dfs_reg); cds_set_wma_dfs_region(dfs_reg); break; diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index dd17209265c7..de7fcc9da50c 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -7540,14 +7540,6 @@ void sme_set_cc_src(tHalHandle hHal, enum country_src cc_src) { tpAniSirGlobal mac_ctx = PMAC_STRUCT(hHal); - /* - * in reg callback from kernel, for 11d source also - * the source is SOURCE_USERSPACE - */ - if ((cc_src == SOURCE_USERSPACE) && - (SOURCE_11D == mac_ctx->reg_hint_src)) - return; - mac_ctx->reg_hint_src = cc_src; } diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 07a333992704..87a0d7980265 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -4452,7 +4452,6 @@ bool csr_learn_11dcountry_information(tpAniSirGlobal pMac, goto free_ie; } - pMac->reg_hint_src = SOURCE_11D; status = csr_get_regulatory_domain_for_country(pMac, pCountryCodeSelected, &domainId, SOURCE_11D); if (status != QDF_STATUS_SUCCESS) { |
