From 215ebfec3c8a6a15a317c75b36bebe1627ebc574 Mon Sep 17 00:00:00 2001 From: Asutosh Mohapatra Date: Sat, 15 Oct 2022 20:22:13 +0530 Subject: [PATCH] qcacld-3.0: Add support to convert SAR_V3 Currently host converts SAR_V1 to SAR_V2 if fw supports SAR_V2 and userspace has given SAR_V1 and host does not check if fw supports SAR_V3 but userspace has given SAR_V1. To address this issue add modify code to check if fw supports SAR_V2 or SAR_V3 but userspace has given SAR_V1. Convert SAR_V1 to SAR_V2 in both the cases. CRs-Fixed: 3313783 Change-Id: I37efa41ec65684a9bb362c894878525bd71704a5 --- core/hdd/src/wlan_hdd_sar_limits.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_sar_limits.c b/core/hdd/src/wlan_hdd_sar_limits.c index c160040f8f..5d8e78dfa2 100644 --- a/core/hdd/src/wlan_hdd_sar_limits.c +++ b/core/hdd/src/wlan_hdd_sar_limits.c @@ -548,7 +548,8 @@ hdd_convert_sarv1_to_sarv2(struct hdd_context *hdd_ctx, struct sar_limit_cmd_row *row; hdd_enter(); - if (hdd_ctx->sar_version != SAR_VERSION_2) { + if (hdd_ctx->sar_version != SAR_VERSION_2 && + hdd_ctx->sar_version != SAR_VERSION_3) { hdd_debug("SAR version: %d", hdd_ctx->sar_version); return false; } @@ -772,13 +773,14 @@ static int __wlan_hdd_set_sar_power_limits(struct wiphy *wiphy, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_BDF0 && sar_enable <= QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_BDF4) && - hdd_ctx->sar_version == SAR_VERSION_2 && + (hdd_ctx->sar_version == SAR_VERSION_2 || + hdd_ctx->sar_version == SAR_VERSION_3) && !hdd_ctx->config->enable_sar_conversion) { hdd_err("SARV1 to SARV2 is disabled from ini"); return -EINVAL; } else if (sar_enable == QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_V2_0 && - hdd_ctx->sar_version == SAR_VERSION_1) { + hdd_ctx->sar_version == SAR_VERSION_1) { hdd_err("FW expects SARV1 given command is SARV2"); return -EINVAL; }