From 6f248a774bccdbd471a43301a305fcb02ef5eec0 Mon Sep 17 00:00:00 2001 From: Gururaj Pandurangi Date: Thu, 2 Dec 2021 03:59:19 -0800 Subject: [PATCH] qcacld-3.0: Update caller APIs of get power type for 6G API Update the caller functions of wlan_reg_get_6g_power_type_for_ctry to include AP's power type as a factor along with existing ctry codes to determine STA's power type for 6G. Change-Id: I8e1c54a5e760b173532fc001790fb76c70120c54 CRs-Fixed: 3087093 --- .../src/pe/lim/lim_process_sme_req_messages.c | 46 +++++++++---------- core/mac/src/pe/sch/sch_beacon_process.c | 9 ++-- 2 files changed, 28 insertions(+), 27 deletions(-) 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; }