Prechádzať zdrojové kódy

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
Asutosh Mohapatra 2 rokov pred
rodič
commit
215ebfec3c
1 zmenil súbory, kde vykonal 5 pridanie a 3 odobranie
  1. 5 3
      core/hdd/src/wlan_hdd_sar_limits.c

+ 5 - 3
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;
 		}