Explorar el Código

qcacld-3.0: Get dynamic nss configuration for STA

For STA, get dynamic nss configuration if it is supported by FW.

Change-Id: Ie1fce5896e473e361672f7e021d3acf6653cb964
CRs-Fixed: 2822062
Min Liu hace 4 años
padre
commit
2dc9d8c956
Se han modificado 1 ficheros con 23 adiciones y 10 borrados
  1. 23 10
      core/hdd/src/wlan_hdd_cfg.c

+ 23 - 10
core/hdd/src/wlan_hdd_cfg.c

@@ -1257,18 +1257,31 @@ QDF_STATUS hdd_get_nss(struct hdd_adapter *adapter, uint8_t *nss)
 {
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	bool bval;
-	QDF_STATUS status;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
-	status = ucfg_mlme_get_vht_enable2x2(hdd_ctx->psoc, &bval);
-	if (!QDF_IS_STATUS_SUCCESS(status)) {
-		hdd_err("unable to get vht_enable2x2");
-		return status;
-	}
+	/*
+	 * If FW is supporting the dynamic nss update, this command is meant to
+	 * be per vdev, so get nss in the ini params of that particular vdev
+	 * otherwise get it from the global param enable2x2
+	 */
+	if (hdd_ctx->dynamic_nss_chains_support) {
+		uint8_t nss_2g, nss_5g;
 
-	*nss = (bval) ? 2 : 1;
-	if (!policy_mgr_is_hw_dbs_2x2_capable(hdd_ctx->psoc) &&
-	    policy_mgr_is_current_hwmode_dbs(hdd_ctx->psoc))
-		*nss = *nss - 1;
+		sme_get_vdev_type_nss(adapter->device_mode, &nss_2g, &nss_5g);
+		/* Different settings in 2G and 5G is not supported */
+		*nss = nss_2g;
+	} else {
+		status = ucfg_mlme_get_vht_enable2x2(hdd_ctx->psoc, &bval);
+		if (!QDF_IS_STATUS_SUCCESS(status)) {
+			hdd_err("unable to get vht_enable2x2");
+			return status;
+		}
+
+		*nss = (bval) ? 2 : 1;
+		if (!policy_mgr_is_hw_dbs_2x2_capable(hdd_ctx->psoc) &&
+		    policy_mgr_is_current_hwmode_dbs(hdd_ctx->psoc))
+			*nss = *nss - 1;
+	}
 
 	return status;
 }