diff options
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 8 | ||||
| -rw-r--r-- | core/sme/src/common/sme_api.c | 7 |
2 files changed, 12 insertions, 3 deletions
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 97e01bf424d0..f473c90679e7 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -5563,8 +5563,12 @@ static int hdd_wiphy_init(hdd_context_t *hdd_ctx) /* registration of wiphy dev with cfg80211 */ ret_val = wlan_hdd_cfg80211_register(wiphy); - if (0 > ret_val) + if (0 > ret_val) { hdd_err("wiphy registration failed"); + return ret_val; + } + + hdd_program_country_code(hdd_ctx); return ret_val; } @@ -8019,8 +8023,6 @@ static int hdd_pre_enable_configure(hdd_context_t *hdd_ctx) if (ret) goto out; - hdd_program_country_code(hdd_ctx); - ret = wma_cli_set_command(0, WMI_PDEV_PARAM_ARP_AC_OVERRIDE, hdd_ctx->config->arp_ac_category, PDEV_CMD); diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 2c0dd6f748db..1c6ded649923 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -1330,6 +1330,7 @@ QDF_STATUS sme_get_soft_ap_domain(tHalHandle hHal, v_REGDOMAIN_t *domainIdSoftAp QDF_STATUS sme_set_reg_info(tHalHandle hHal, uint8_t *apCntryCode) { QDF_STATUS status = QDF_STATUS_E_FAILURE; + int32_t ctry_val; MTRACE(qdf_trace(QDF_MODULE_ID_SME, TRACE_CODE_SME_RX_HDD_MSG_SET_REGINFO, NO_SESSION, 0)); @@ -1338,6 +1339,12 @@ QDF_STATUS sme_set_reg_info(tHalHandle hHal, uint8_t *apCntryCode) return status; } + ctry_val = cds_get_country_from_alpha2(apCntryCode); + if (ctry_val == CTRY_DEFAULT) { + sme_err("invalid AP alpha2"); + return status; + } + status = csr_set_reg_info(hHal, apCntryCode); if (!QDF_IS_STATUS_SUCCESS(status)) { sme_err("csr_set_reg_info failed with status: %d", status); |
