mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
qcacld-3.0: Update regulatory configs before use
Currently regulatory comnfigs are getting updated from wiphy init inside regulatory init api which is too late in the driver init sequence. There are some apis in driver init sequence which uses these ini configs before wiphy init, one such example is scm_11d_cc_db_init. since the ini configs are not populated this may lead to undefined behaviour. To resolve above issue, populate ini configs at the same place where all other components inis are getting populated. Change-Id: I9cb2f069fba3eb76a2c8f7285b6d371cf5fa8de4 CRs-Fixed: 2570148
This commit is contained in:
parent
a267b8b5d5
commit
ee0332a413
3 changed files with 21 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue