From 64ea8064b110ac0fabe57076bac8600629a8db04 Mon Sep 17 00:00:00 2001 From: Amar Singhal Date: Mon, 12 Nov 2018 11:24:10 -0800 Subject: [PATCH] qcacmn: Avoid setting SOURCE_DRIVER for non-BDF CC event Firmware could send same channel list for each pdev. Since SOURCE DRIVER is default, it would be set for the second event. Avoid that. Remember the source of the first event itself. Change-Id: Ib9db58da1fa27673b04a4c62e10f2a05702348ad CRs-Fixed: 2352151 --- umac/regulatory/core/src/reg_services.c | 26 ++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/umac/regulatory/core/src/reg_services.c b/umac/regulatory/core/src/reg_services.c index ef39e24e3a..4fc5f87b28 100644 --- a/umac/regulatory/core/src/reg_services.c +++ b/umac/regulatory/core/src/reg_services.c @@ -3220,12 +3220,8 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info soc_reg->user_ctry_set = false; reg_run_11d_state_machine(psoc); } else { - soc_reg->cc_src = SOURCE_DRIVER; - - if (reg_is_world_alpha2(regulat_info->alpha2)) { - soc_reg->cc_src = SOURCE_CORE; - reg_run_11d_state_machine(psoc); - } + if (soc_reg->cc_src == SOURCE_UNKNOWN) + soc_reg->cc_src = SOURCE_DRIVER; qdf_mem_copy(soc_reg->mas_chan_params[phy_id].default_country, regulat_info->alpha2, @@ -3236,12 +3232,20 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info soc_reg->mas_chan_params[phy_id].def_region_domain = regulat_info->reg_dmn_pair; - qdf_mem_copy(soc_reg->def_country, - regulat_info->alpha2, - REG_ALPHA2_LEN + 1); + if (soc_reg->cc_src == SOURCE_DRIVER) { + qdf_mem_copy(soc_reg->def_country, + regulat_info->alpha2, + REG_ALPHA2_LEN + 1); - soc_reg->def_country_code = regulat_info->ctry_code; - soc_reg->def_region_domain = regulat_info->reg_dmn_pair; + soc_reg->def_country_code = regulat_info->ctry_code; + soc_reg->def_region_domain = + regulat_info->reg_dmn_pair; + } + + if (reg_is_world_alpha2(regulat_info->alpha2)) { + soc_reg->cc_src = SOURCE_CORE; + reg_run_11d_state_machine(psoc); + } } pdev = wlan_objmgr_get_pdev_by_id(psoc, phy_id, dbg_id);