From d528d19d105e14d019f7ed9f0effab8656733888 Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Fri, 9 Mar 2018 17:31:12 +0530 Subject: [PATCH] qcacld-3.0: Use max tx power allowed to compute link report power Driver uses max tx power allowed for a particular channel to calculate link report power and updates max tx power allowed with calculated link report power. This can result in usage of MIN_TX_PWR_CAP as max tx power if AP requests power below MIN_TX_PWR_CAP in link request. Once max tx power reaches MIN_TX_PWR_CAP, the driver will always use MIN_TX_PWR_CAP in the link report which could be much less than power allowed for a particular channel. Use max tx power allowed for a particular channel always to compute link report power to fix this issue. Change-Id: I0060500f23e6131481baa00cd76f41419281e41a CRs-Fixed: 2195960 --- core/mac/src/pe/include/lim_session.h | 1 + core/mac/src/pe/lim/lim_process_sme_req_messages.c | 1 + core/mac/src/pe/rrm/rrm_api.c | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index dc9bb138bce5..14e29c6dbad6 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -563,6 +563,7 @@ typedef struct sPESession /* Added to Support BT-AMP */ bool deauth_disassoc_rc; enum wmi_obss_color_collision_evt_type obss_color_collision_dec_evt; bool is_session_obss_color_collision_det_enabled; + int8_t def_max_tx_pwr; } tPESession, *tpPESession; /*------------------------------------------------------------------------- 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 e37996e3490a..c3dde63034b5 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 @@ -1607,6 +1607,7 @@ __lim_process_sme_join_req(tpAniSirGlobal mac_ctx, uint32_t *msg_buf) session->maxTxPower = lim_get_max_tx_power(reg_max, local_power_constraint, mac_ctx->roam.configParam.nTxPowerCap); + session->def_max_tx_pwr = session->maxTxPower; pe_debug("Reg max %d local power con %d max tx pwr %d", reg_max, local_power_constraint, session->maxTxPower); diff --git a/core/mac/src/pe/rrm/rrm_api.c b/core/mac/src/pe/rrm/rrm_api.c index 5f65252a5b95..2dc7996e0c2d 100644 --- a/core/mac/src/pe/rrm/rrm_api.c +++ b/core/mac/src/pe/rrm/rrm_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -270,7 +270,7 @@ rrm_process_link_measurement_request(tpAniSirGlobal pMac, } pHdr = WMA_GET_RX_MAC_HEADER(pRxPacketInfo); - LinkReport.txPower = lim_get_max_tx_power(pSessionEntry->maxTxPower, + LinkReport.txPower = lim_get_max_tx_power(pSessionEntry->def_max_tx_pwr, pLinkReq->MaxTxPower.maxTxPower, pMac->roam.configParam. nTxPowerCap);