From 97bf376926ae5f43ff9f4af60944c3ca1b1aab01 Mon Sep 17 00:00:00 2001 From: Sheenam Monga Date: Tue, 20 Feb 2024 10:33:46 +0530 Subject: [PATCH] qcacld-3.0: Select transmit power as per 11.7.6 IEEE Section Currently, if power constraint is advertised by AP then local max tx power is calculated as per the rule defined in 9.4.2.13 (Power Constraint element) i.e regulatory power - local constraint advertised by AP. As per the rule defined in 11.7.6 (Transmit power selection) transmit power for STA should be less than or equal to the minimum of the local maximum transmit power level and regulatory client maximum power. Fix is instead of populating max_tx_power as diff of regulatory power and derived local max tx power, populate max_tx_power to the MIN of regulatory power and local max tx power to align with IEEE standard. Change-Id: I65fe4c9c6a4c7dd80540530c25b7ac2b1952633c CRs-Fixed: 3740468 --- core/mac/src/pe/lim/lim_process_sme_req_messages.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 e483c03cb0..0891dcfe4a 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 @@ -6306,9 +6306,11 @@ void lim_calculate_tpc(struct mac_context *mac, } else { max_tx_power = QDF_MIN(reg_max, local_constraint); + if (!max_tx_power) + max_tx_power = reg_max; } } else { - max_tx_power = reg_max - local_constraint; + max_tx_power = QDF_MIN(reg_max, local_constraint); if (!max_tx_power) max_tx_power = reg_max; }