From 90fe84b4f94c1df4a5d8a42b322d205150c8844b 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 --- core/mac/src/pe/lim/lim_prop_exts_utils.c | 15 +++++++++++++-- core/mac/src/pe/sch/sch_beacon_process.c | 2 +- core/sme/inc/csr_internal.h | 3 +++ core/sme/src/csr/csr_api_roam.c | 5 +++-- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/core/mac/src/pe/lim/lim_prop_exts_utils.c b/core/mac/src/pe/lim/lim_prop_exts_utils.c index ebfae02ac923..008928feb372 100644 --- a/core/mac/src/pe/lim/lim_prop_exts_utils.c +++ b/core/mac/src/pe/lim/lim_prop_exts_utils.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -129,9 +130,9 @@ static void lim_extract_he_op(struct pe_session *session, session->he_op.oper_info_6g.info.center_freq_seg1; session->ap_power_type = session->he_op.oper_info_6g.info.reg_info; - pe_debug("6G op info: ch_wd %d cntr_freq_seg0 %d cntr_freq_seg1 %d", + pe_debug("6G op info: ch_wd %d cntr_freq_seg0 %d cntr_freq_seg1 %d ap pwr type %d", session->ch_width, session->ch_center_freq_seg0, - session->ch_center_freq_seg1); + session->ch_center_freq_seg1, session->ap_power_type); if (!session->ch_center_freq_seg1) return; @@ -466,11 +467,18 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie, tDot11fIEVHTCaps *vht_caps; uint8_t channel = 0; struct mlme_vht_capabilities_info *mlme_vht_cap; + uint8_t session_id; beacon_struct = qdf_mem_malloc(sizeof(tSirProbeRespBeacon)); if (!beacon_struct) return; + session_id = session->smeSessionId; + if (session_id >= WLAN_MAX_VDEVS) { + pe_err("Invalid session_id %d", session_id); + return; + } + *qos_cap = 0; *uapsd = 0; pe_debug("The IE's being received:"); @@ -698,6 +706,9 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie, } } + mac_ctx->roam.roamSession[session_id].ap_power_type = + session->ap_power_type; + get_ese_version_ie_probe_response(mac_ctx, beacon_struct, session); session->country_info_present = false; diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index 1a2b0b23e34d..bb6f30baf728 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -764,7 +764,7 @@ static void __sch_beacon_process_for_session(struct mac_context *mac_ctx, status = wlan_reg_get_6g_power_type_for_ctry(mac_ctx->psoc, bcn->countryInfoParam.countryString, programmed_country, &pwr_type_6g, - &ctry_code_match); + &ctry_code_match, REG_MAX_AP_TYPE); if (QDF_IS_STATUS_ERROR(status)) return; } diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 4ac1888d320a..b06016c19949 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -620,6 +621,8 @@ struct csr_roam_session { qdf_mc_timer_t roam_invoke_timer; struct csr_timer_info roam_invoke_timer_info; #endif + /* AP power type */ + uint8_t ap_power_type; }; struct csr_roamstruct { diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index ee7b33b59832..69b3c240573e 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -15799,10 +15799,11 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId, sme_debug("Channel is 6G but country IE not present"); wlan_reg_read_current_country(mac->psoc, programmed_country); - status = wlan_reg_get_6g_power_type_for_ctry( + status = wlan_reg_get_6g_power_type_for_ctry(mac->psoc, pIes->Country.country, programmed_country, &power_type_6g, - &ctry_code_match); + &ctry_code_match, + pSession->ap_power_type); if (QDF_IS_STATUS_ERROR(status)) break; csr_join_req->ap_power_type_6g = power_type_6g;