From 6bebc81e607bfa2f80969c13613b1a8940665be3 Mon Sep 17 00:00:00 2001 From: Krupali Dhanvijay Date: Fri, 21 Feb 2025 17:43:55 +0530 Subject: [PATCH] qcacld-3.0: Recalculate TX power post CSA Currently, host doesn't recalculate TX power post CSA if no change in power constraint or TPE IE, this can cause issue if local regulatory power is different for new CSA frequency. To address this issue, add support to recalculate TX power for first beacon received post CSA. Change-Id: I91f4609c552d579c24e781d382e647b6617e9315 CRs-Fixed: 3809724 --- core/mac/src/pe/include/lim_session.h | 4 +++- core/mac/src/pe/lim/lim_send_sme_rsp_messages.c | 2 ++ core/mac/src/pe/sch/sch_beacon_process.c | 5 +++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index 5488a180a145..25f2f90143c5 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. - * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2024-2025 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 @@ -140,6 +140,7 @@ struct obss_detection_cfg { * @prev_auth_seq_num: Sequence number of previously received auth frame to * detect duplicate frames. * @prev_auth_mac_addr: mac_addr of the sta correspond to @prev_auth_seq_num + * @cal_tpc_post_csa: Recalculate tx power power csa */ struct pe_session { /* To check session table is in use or free */ @@ -580,6 +581,7 @@ struct pe_session { uint32_t dfs_regdomain; uint8_t ap_defined_power_type_6g; uint8_t best_6g_power_type; + bool cal_tpc_post_csa; }; /*------------------------------------------------------------------------- diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index 8b6a073ea59e..639fac0c3c4f 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2025 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 @@ -1884,6 +1885,7 @@ void lim_handle_csa_offload_msg(struct mac_context *mac_ctx, err: qdf_mem_free(csa_params); + session_entry->cal_tpc_post_csa = true; } /*-------------------------------------------------------------------------- diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c index 3c0914e6c71a..8ffa424d5962 100644 --- a/core/mac/src/pe/sch/sch_beacon_process.c +++ b/core/mac/src/pe/sch/sch_beacon_process.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2025 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 @@ -704,8 +704,9 @@ static void __sch_beacon_process_for_session(struct mac_context *mac_ctx, } if ((ap_constraint_change && local_constraint) || - (tpe_change && !skip_tpe)) { + (tpe_change && !skip_tpe) || session->cal_tpc_post_csa) { lim_calculate_tpc(mac_ctx, session); + session->cal_tpc_post_csa = false; if (tx_ops->set_tpc_power) tx_ops->set_tpc_power(mac_ctx->psoc,