diff --git a/target_if/regulatory/src/target_if_reg.c b/target_if/regulatory/src/target_if_reg.c index 31feb4bedf94..abff6e2b3174 100644 --- a/target_if/regulatory/src/target_if_reg.c +++ b/target_if/regulatory/src/target_if_reg.c @@ -30,7 +30,6 @@ #include #include #include -#include static inline uint32_t get_chan_list_cc_event_id(void) { @@ -113,11 +112,6 @@ static int tgt_reg_chan_list_update_handler(ol_scn_t handle, TARGET_IF_ENTER(); - if (qdf_is_recovering()) { - target_if_debug("ignore chan list update evt in ssr"); - return 0; - } - psoc = target_if_get_psoc_from_scn_hdl(handle); if (!psoc) { target_if_err("psoc ptr is NULL"); diff --git a/umac/regulatory/core/src/reg_services.c b/umac/regulatory/core/src/reg_services.c index 9f670e8fc7ef..336f8bb0f934 100644 --- a/umac/regulatory/core/src/reg_services.c +++ b/umac/regulatory/core/src/reg_services.c @@ -27,6 +27,7 @@ #include "reg_host_11d.h" #include #include +#include #define CHAN_12_CENT_FREQ 2467 #define MAX_PWR_FCC_CHAN_12 8 @@ -1573,7 +1574,7 @@ QDF_STATUS reg_reset_country(struct wlan_objmgr_psoc *psoc) qdf_mem_copy(psoc_reg->cur_country, psoc_reg->def_country, REG_ALPHA2_LEN + 1); - + reg_debug("set cur_country %.2s", psoc_reg->cur_country); return QDF_STATUS_SUCCESS; } @@ -3046,8 +3047,7 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info struct wlan_objmgr_pdev *pdev; struct wlan_lmac_if_reg_tx_ops *tx_ops; struct reg_rule_info *reg_rules; - - reg_debug("process reg master chan list"); + struct set_country country_code; psoc = regulat_info->psoc; soc_reg = reg_get_psoc_obj(psoc); @@ -3057,6 +3057,29 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info return QDF_STATUS_E_FAILURE; } + tx_ops = reg_get_psoc_tx_ops(psoc); + + if (qdf_is_recovering()) { + if (soc_reg->offload_enabled && + qdf_mem_cmp(soc_reg->cur_country, + regulat_info->alpha2, + REG_ALPHA2_LEN)) { + reg_debug("target cc:%.2s, restore %.2s to target", + regulat_info->alpha2, + soc_reg->cur_country); + qdf_mem_copy(country_code.country, + soc_reg->cur_country, + REG_ALPHA2_LEN + 1); + country_code.pdev_id = regulat_info->phy_id; + if (tx_ops && tx_ops->set_country_code) + tx_ops->set_country_code(psoc, &country_code); + } + reg_debug("ignore chan list update in ssr"); + return QDF_STATUS_SUCCESS; + } + + reg_debug("process reg master chan list"); + phy_id = regulat_info->phy_id; if (soc_reg->offload_enabled) { @@ -3078,7 +3101,6 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info } wlan_objmgr_pdev_release_ref(pdev, dbg_id); - tx_ops = reg_get_psoc_tx_ops(psoc); if (tx_ops->set_country_failed) tx_ops->set_country_failed(pdev); @@ -3117,6 +3139,7 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info qdf_mem_copy(soc_reg->cur_country, regulat_info->alpha2, REG_ALPHA2_LEN + 1); + reg_debug("set cur_country %.2s", soc_reg->cur_country); min_bw_2g = regulat_info->min_bw_2g; max_bw_2g = regulat_info->max_bw_2g; @@ -4092,7 +4115,7 @@ void reg_program_mas_chan_list(struct wlan_objmgr_psoc *psoc, qdf_mem_copy(psoc_priv_obj->cur_country, alpha2, REG_ALPHA2_LEN); - + reg_debug("set cur_country %.2s", psoc_priv_obj->cur_country); for (count = 0; count < NUM_CHANNELS; count++) { reg_channels[count].chan_num = channel_map[count].chan_num;