瀏覽代碼

qcacld-3.0: Remove the pdev level antenna mode

If the new feature of per vdev antenna mode is enabled, there
is no need of per pdev level antenna mode, as it may happen that
one vdev configures its antennas as 2, and the other vdev configures
its antennas as 1, which could lead to change of pdev level antenna
mode, by a vdev level command.

Fix is to keep the antenna mode only if the feature is not enabled.

Change-Id: I67011a5b88f8750cab22d76b1bf6d8ccc1f5375d
CRs-Fixed: 2347495
gaurank kathpalia 6 年之前
父節點
當前提交
f95ae68380
共有 1 個文件被更改,包括 19 次插入18 次删除
  1. 19 18
      core/hdd/src/wlan_hdd_ioctl.c

+ 19 - 18
core/hdd/src/wlan_hdd_ioctl.c

@@ -6730,24 +6730,6 @@ int hdd_set_antenna_mode(struct hdd_adapter *adapter,
 		.timeout_ms = WLAN_WAIT_TIME_ANTENNA_MODE_REQ,
 	};
 
-	if (hdd_ctx->current_antenna_mode == mode) {
-		hdd_err("System already in the requested mode");
-		goto exit;
-	}
-
-	if ((HDD_ANTENNA_MODE_2X2 == mode) &&
-	    (!hdd_is_supported_chain_mask_2x2(hdd_ctx))) {
-		hdd_err("System does not support 2x2 mode");
-		ret = -EPERM;
-		goto exit;
-	}
-
-	if ((HDD_ANTENNA_MODE_1X1 == mode) &&
-	    hdd_is_supported_chain_mask_1x1(hdd_ctx)) {
-		hdd_err("System only supports 1x1 mode");
-		goto exit;
-	}
-
 	switch (mode) {
 	case HDD_ANTENNA_MODE_1X1:
 		params.num_rx_chains = 1;
@@ -6768,6 +6750,25 @@ int hdd_set_antenna_mode(struct hdd_adapter *adapter,
 						    params.num_rx_chains,
 						    params.num_tx_chains);
 
+	if (hdd_ctx->current_antenna_mode == mode) {
+		hdd_err("System already in the requested mode");
+		goto exit;
+	}
+
+	if ((HDD_ANTENNA_MODE_2X2 == mode) &&
+	    (!hdd_is_supported_chain_mask_2x2(hdd_ctx))) {
+		hdd_err("System does not support 2x2 mode");
+		ret = -EPERM;
+		goto exit;
+	}
+
+	if ((HDD_ANTENNA_MODE_1X1 == mode) &&
+	    hdd_is_supported_chain_mask_1x1(hdd_ctx)) {
+		hdd_err("System only supports 1x1 mode");
+		goto exit;
+	}
+
+
 	/* Check TDLS status and update antenna mode */
 	if ((QDF_STA_MODE == adapter->device_mode) &&
 	    policy_mgr_is_sta_active_connection_exists(hdd_ctx->psoc)) {