diff --git a/core/hdd/inc/wlan_hdd_regulatory.h b/core/hdd/inc/wlan_hdd_regulatory.h index 3fe46d95bcfa..789231c80035 100644 --- a/core/hdd/inc/wlan_hdd_regulatory.h +++ b/core/hdd/inc/wlan_hdd_regulatory.h @@ -32,6 +32,14 @@ struct hdd_context; #define IEEE80211_CHAN_NO_IBSS IEEE80211_CHAN_NO_IR #endif +/** + * hdd_update_regulatory_config() - API to update regulatory config parameters + * @hdd_ctx: HDD context + * + * Return: 0 on success, err on failure + */ +int hdd_update_regulatory_config(struct hdd_context *hdd_ctx); + int hdd_regulatory_init(struct hdd_context *hdd_ctx, struct wiphy *wiphy); void hdd_program_country_code(struct hdd_context *hdd_ctx); void hdd_reset_global_reg_params(void); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index a530c45949b7..fa8c705860b7 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -15442,6 +15442,10 @@ int hdd_update_components_config(struct hdd_context *hdd_ctx) return ret; ret = hdd_update_dfs_config(hdd_ctx); + if (ret) + return ret; + + ret = hdd_update_regulatory_config(hdd_ctx); return ret; } diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index 7e0f78e1a259..45065cac673a 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -1458,10 +1458,18 @@ static void hdd_regulatory_dyn_cbk(struct wlan_objmgr_psoc *psoc, hdd_ctx->reg.alpha2); } +int hdd_update_regulatory_config(struct hdd_context *hdd_ctx) +{ + struct reg_config_vars config_vars; + + reg_program_config_vars(hdd_ctx, &config_vars); + ucfg_reg_set_config_vars(hdd_ctx->psoc, config_vars); + return 0; +} + int hdd_regulatory_init(struct hdd_context *hdd_ctx, struct wiphy *wiphy) { bool offload_enabled; - struct reg_config_vars config_vars; struct regulatory_channel *cur_chan_list; enum country_src cc_src; uint8_t alpha2[REG_ALPHA2_LEN + 1]; @@ -1471,12 +1479,10 @@ int hdd_regulatory_init(struct hdd_context *hdd_ctx, struct wiphy *wiphy) return -ENOMEM; } - reg_program_config_vars(hdd_ctx, &config_vars); ucfg_reg_register_chan_change_callback(hdd_ctx->psoc, hdd_regulatory_dyn_cbk, NULL); - ucfg_reg_set_config_vars(hdd_ctx->psoc, config_vars); wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED; /* Check the kernel version for upstream commit aced43ce780dc5 that