qcacld-3.0: User country set based on INI config params

Ignore user regulatory country set when below INIs are set as:
gCountryCodePriority=0
g11dSupportEnabled=1

Change-Id: I8ba5624bbe7aa9d3b06ab4eaffb0b9ab19f1f0fd
CRs-Fixed: 3498489
This commit is contained in:
Vishal Miskin
2023-05-04 15:33:26 +05:30
committed by Rahul Choudhary
parent a90c3498d8
commit d243a443ff
2 changed files with 7 additions and 1 deletions

View File

@@ -4187,7 +4187,8 @@ static void hdd_skip_acs_scan_timer_deinit(struct hdd_context *hdd_ctx) {}
*/
int hdd_update_country_code(struct hdd_context *hdd_ctx)
{
if (!country_code)
if (!country_code ||
!ucfg_reg_is_user_country_set_allowed(hdd_ctx->psoc))
return 0;
return hdd_reg_set_country(hdd_ctx, country_code);

View File

@@ -867,6 +867,11 @@ int hdd_reg_set_country(struct hdd_context *hdd_ctx, char *country_code)
return -EINVAL;
}
if (!ucfg_reg_is_user_country_set_allowed(hdd_ctx->psoc)) {
hdd_err("user_country is not allowed");
return -EINVAL;
}
qdf_mem_copy(cc, country_code, REG_ALPHA2_LEN);
cc[REG_ALPHA2_LEN] = '\0';