diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index bd9bd2dd5a..27ae9b3682 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -2918,29 +2918,6 @@ lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session, goto send; } - if (wlan_reg_is_6ghz_chan_freq(bss_desc->chan_freq)) { - if (!ie_struct->Country.present) - pe_debug("Channel is 6G but country IE not present"); - wlan_reg_read_current_country(mac_ctx->psoc, - programmed_country); - status = wlan_reg_get_6g_power_type_for_ctry(mac_ctx->psoc, - ie_struct->Country.country, - programmed_country, &power_type_6g, - &ctry_code_match); - if (QDF_IS_STATUS_ERROR(status)) { - status = QDF_STATUS_E_NOSUPPORT; - goto send; - } - session->ap_power_type_6g = power_type_6g; - session->same_ctry_code = ctry_code_match; - - lim_iterate_triplets(ie_struct->Country); - - if (!ie_struct->num_transmit_power_env || - !ie_struct->transmit_power_env[0].present) - pe_debug("TPE not present for 6G channel"); - } - /* * Join timeout: if we find a BeaconInterval in the BssDescription, * then set the Join Timeout to be 10 x the BeaconInterval. @@ -3087,6 +3064,29 @@ lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session, &session->gLimCurrentBssUapsd, &local_power_constraint, session, &is_pwr_constraint); + if (wlan_reg_is_6ghz_chan_freq(bss_desc->chan_freq)) { + if (!ie_struct->Country.present) + pe_debug("Channel is 6G but country IE not present"); + wlan_reg_read_current_country(mac_ctx->psoc, + programmed_country); + status = wlan_reg_get_6g_power_type_for_ctry( + mac_ctx->psoc, ie_struct->Country.country, + programmed_country, &power_type_6g, + &ctry_code_match, session->ap_power_type); + if (QDF_IS_STATUS_ERROR(status)) { + status = QDF_STATUS_E_NOSUPPORT; + goto send; + } + session->ap_power_type_6g = power_type_6g; + session->same_ctry_code = ctry_code_match; + + lim_iterate_triplets(ie_struct->Country); + + if (!ie_struct->num_transmit_power_env || + !ie_struct->transmit_power_env[0].present) + pe_debug("TPE not present for 6G channel"); + } + if (wlan_reg_is_ext_tpc_supported(mac_ctx->psoc)) { mlme_obj->reg_tpc_obj.ap_constraint_power = local_power_constraint; diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index c8f78fcc62..5bbd30b84b 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -761,10 +761,11 @@ static void __sch_beacon_process_for_session(struct mac_context *mac_ctx, } wlan_reg_read_current_country(mac_ctx->psoc, programmed_country); - status = wlan_reg_get_6g_power_type_for_ctry(mac_ctx->psoc, - bcn->countryInfoParam.countryString, - programmed_country, &pwr_type_6g, - &ctry_code_match); + status = wlan_reg_get_6g_power_type_for_ctry( + mac_ctx->psoc, + bcn->countryInfoParam.countryString, + programmed_country, &pwr_type_6g, + &ctry_code_match, REG_MAX_AP_TYPE); if (QDF_IS_STATUS_ERROR(status)) return; }