Эх сурвалжийг харах

qcacld-3.0: Optimize pdev set param command frequency

Currently wlan_mlme_configure_chain_mask API sends many
pdev set param commands separately to firmware.

Combine all pdev set params of wlan_mlme_configure_chain_mask
send to WMI to reduce number of transactions.
Also replace target wmi pdev params with host wmi
pdev params to fix existing broken layering
violation.

Change-Id: If0b7bce9a7c87d0f07e7a9f1d2cd80139f027308
CRs-Fixed: 3151438
Divyajyothi Goparaju 2 жил өмнө
parent
commit
ee4ca3b005

+ 1 - 0
Kbuild

@@ -3474,6 +3474,7 @@ cppflags-$(CONFIG_WIFI_MONITOR_SUPPORT) += -DWIFI_MONITOR_SUPPORT
 cppflags-$(CONFIG_QCA_MONITOR_PKT_SUPPORT) += -DQCA_MONITOR_PKT_SUPPORT
 cppflags-$(CONFIG_MONITOR_MODULARIZED_ENABLE) += -DMONITOR_MODULARIZED_ENABLE
 cppflags-$(CONFIG_DP_PKT_ADD_TIMESTAMP) += -DCONFIG_DP_PKT_ADD_TIMESTAMP
+cppflags-$(CONFIG_WLAN_PDEV_VDEV_SEND_MULTI_PARAM) += -DWLAN_PDEV_VDEV_SEND_MULTI_PARAM
 
 ifeq ($(CONFIG_LEAK_DETECTION), y)
 cppflags-y += \

+ 85 - 36
components/mlme/dispatcher/src/wlan_mlme_api.c

@@ -1372,14 +1372,26 @@ bool wlan_mlme_is_chain_mask_supported(struct wlan_objmgr_psoc *psoc)
 	return true;
 
 }
+
+#define MAX_PDEV_CHAIN_MASK_PARAMS 6
+/* params being sent:
+ * wmi_pdev_param_tx_chain_mask
+ * wmi_pdev_param_rx_chain_mask
+ * wmi_pdev_param_tx_chain_mask_2g
+ * wmi_pdev_param_rx_chain_mask_2g
+ * wmi_pdev_param_tx_chain_mask_5g
+ * wmi_pdev_param_rx_chain_mask_5g
+ */
 QDF_STATUS wlan_mlme_configure_chain_mask(struct wlan_objmgr_psoc *psoc,
 					  uint8_t session_id)
 {
-	int ret_val;
+	QDF_STATUS ret_val = QDF_STATUS_E_FAILURE;
 	uint8_t ch_msk_val;
 	struct wlan_mlme_psoc_ext_obj *mlme_obj = mlme_get_psoc_ext_obj(psoc);
 	bool mrc_disabled_2g_rx, mrc_disabled_2g_tx;
 	bool mrc_disabled_5g_rx, mrc_disabled_5g_tx;
+	struct dev_set_param setparam[MAX_PDEV_CHAIN_MASK_PARAMS];
+	uint8_t index = 0;
 
 	if (!mlme_obj)
 		return QDF_STATUS_E_FAILURE;
@@ -1410,72 +1422,109 @@ QDF_STATUS wlan_mlme_configure_chain_mask(struct wlan_objmgr_psoc *psoc,
 	if (!wlan_mlme_configure_chain_mask_supported(psoc))
 		return QDF_STATUS_E_FAILURE;
 
-
 	if (mlme_obj->cfg.chainmask_cfg.txchainmask1x1) {
 		ch_msk_val = mlme_obj->cfg.chainmask_cfg.txchainmask1x1;
-		ret_val = wma_cli_set_command(session_id,
-					      WMI_PDEV_PARAM_TX_CHAIN_MASK,
-					      ch_msk_val, PDEV_CMD);
-		if (ret_val)
-			return QDF_STATUS_E_FAILURE;
+		if (wma_validate_txrx_chain_mask(wmi_pdev_param_tx_chain_mask,
+						 ch_msk_val)) {
+			goto error;
+		}
+		ret_val = mlme_check_index_setparam(
+					      setparam,
+					      wmi_pdev_param_tx_chain_mask,
+					      ch_msk_val, index++,
+					      MAX_PDEV_CHAIN_MASK_PARAMS);
+		if (QDF_IS_STATUS_ERROR(ret_val)) {
+			mlme_err("failed at  wmi_pdev_param_tx_chain_mask");
+			goto error;
+		}
 	}
 
 	if (mlme_obj->cfg.chainmask_cfg.rxchainmask1x1) {
 		ch_msk_val = mlme_obj->cfg.chainmask_cfg.rxchainmask1x1;
-		ret_val = wma_cli_set_command(session_id,
-					      WMI_PDEV_PARAM_RX_CHAIN_MASK,
-					      ch_msk_val, PDEV_CMD);
-		if (ret_val)
-			return QDF_STATUS_E_FAILURE;
+		if (wma_validate_txrx_chain_mask(wmi_pdev_param_rx_chain_mask,
+								ch_msk_val)) {
+			goto error;
+		}
+		ret_val = mlme_check_index_setparam(
+					      setparam,
+					      wmi_pdev_param_rx_chain_mask,
+					      ch_msk_val, index++,
+					      MAX_PDEV_CHAIN_MASK_PARAMS);
+		if (QDF_IS_STATUS_ERROR(ret_val)) {
+			mlme_err("failed at wmi_pdev_param_rx_chain_mask");
+			goto error;
+		}
 	}
 
 	if (mlme_obj->cfg.chainmask_cfg.txchainmask1x1 ||
 	    mlme_obj->cfg.chainmask_cfg.rxchainmask1x1) {
 		mlme_legacy_debug("band agnostic tx/rx chain mask set. skip per band chain mask");
-		return QDF_STATUS_SUCCESS;
+		goto sendparam;
 	}
 
 	if (mlme_obj->cfg.chainmask_cfg.tx_chain_mask_2g &&
 	    mrc_disabled_2g_tx) {
 		ch_msk_val = mlme_obj->cfg.chainmask_cfg.tx_chain_mask_2g;
-		ret_val = wma_cli_set_command(session_id,
-					      WMI_PDEV_PARAM_TX_CHAIN_MASK_2G,
-					      ch_msk_val, PDEV_CMD);
-		if (0 != ret_val)
-			return QDF_STATUS_E_FAILURE;
+		ret_val = mlme_check_index_setparam(
+					      setparam,
+					      wmi_pdev_param_tx_chain_mask_2g,
+					      ch_msk_val, index++,
+					      MAX_PDEV_CHAIN_MASK_PARAMS);
+		if (QDF_IS_STATUS_ERROR(ret_val)) {
+			mlme_err("failed at  wmi_pdev_param_tx_chain_mask_2g");
+			goto error;
+		}
 	}
 
 	if (mlme_obj->cfg.chainmask_cfg.rx_chain_mask_2g &&
 	    mrc_disabled_2g_rx) {
 		ch_msk_val = mlme_obj->cfg.chainmask_cfg.rx_chain_mask_2g;
-		ret_val = wma_cli_set_command(session_id,
-					      WMI_PDEV_PARAM_RX_CHAIN_MASK_2G,
-					      ch_msk_val, PDEV_CMD);
-		if (0 != ret_val)
-			return QDF_STATUS_E_FAILURE;
+		ret_val = mlme_check_index_setparam(
+					      setparam,
+					      wmi_pdev_param_rx_chain_mask_2g,
+					      ch_msk_val, index++,
+					      MAX_PDEV_CHAIN_MASK_PARAMS);
+		if (QDF_IS_STATUS_ERROR(ret_val)) {
+			mlme_err("failed at wmi_pdev_param_rx_chain_mask_2g");
+			goto error;
+		}
 	}
 
 	if (mlme_obj->cfg.chainmask_cfg.tx_chain_mask_5g &&
 	    mrc_disabled_5g_tx) {
 		ch_msk_val = mlme_obj->cfg.chainmask_cfg.tx_chain_mask_5g;
-		ret_val = wma_cli_set_command(session_id,
-					      WMI_PDEV_PARAM_TX_CHAIN_MASK_5G,
-					      ch_msk_val, PDEV_CMD);
-		if (0 != ret_val)
-			return QDF_STATUS_E_FAILURE;
+		ret_val = mlme_check_index_setparam(
+					      setparam,
+					      wmi_pdev_param_tx_chain_mask_5g,
+					      ch_msk_val, index++,
+					      MAX_PDEV_CHAIN_MASK_PARAMS);
+		if (QDF_IS_STATUS_ERROR(ret_val)) {
+			mlme_err("failed at  wmi_pdev_param_tx_chain_mask_5g");
+			goto error;
+		}
 	}
 
 	if (mlme_obj->cfg.chainmask_cfg.rx_chain_mask_5g &&
 	    mrc_disabled_5g_rx) {
 		ch_msk_val = mlme_obj->cfg.chainmask_cfg.rx_chain_mask_5g;
-		ret_val = wma_cli_set_command(session_id,
-					      WMI_PDEV_PARAM_RX_CHAIN_MASK_5G,
-					      ch_msk_val, PDEV_CMD);
-		if (0 != ret_val)
-			return QDF_STATUS_E_FAILURE;
+		ret_val = mlme_check_index_setparam(
+					      setparam,
+					      wmi_pdev_param_rx_chain_mask_5g,
+					      ch_msk_val, index++,
+					      MAX_PDEV_CHAIN_MASK_PARAMS);
+		if (QDF_IS_STATUS_ERROR(ret_val)) {
+			mlme_err("failed at wmi_pdev_param_rx_chain_mask_5g");
+			goto error;
+		}
 	}
-
-	return QDF_STATUS_SUCCESS;
+sendparam:
+	ret_val = wma_send_multi_pdev_vdev_set_params(MLME_PDEV_SETPARAM,
+						      WMI_PDEV_ID_SOC, setparam,
+						      index);
+	if (QDF_IS_STATUS_ERROR(ret_val))
+		mlme_err("failed to send chainmask params");
+error:
+	return ret_val;
 }
 
 QDF_STATUS
@@ -2607,7 +2656,7 @@ static void wlan_mlme_send_oce_flags_fw(struct wlan_objmgr_pdev *pdev,
 		*dynamic_fw_value = *updated_fw_value;
 		vdev_id = wlan_vdev_get_id(vdev);
 		if (wma_cli_set_command(vdev_id,
-					WMI_VDEV_PARAM_ENABLE_DISABLE_OCE_FEATURES,
+					wmi_vdev_param_enable_disable_oce_features,
 					*updated_fw_value, VDEV_CMD))
 			mlme_legacy_err("Failed to send OCE update to FW");
 	}

+ 1 - 1
configs/default_defconfig

@@ -388,7 +388,7 @@ endif
 	CONFIG_WLAN_FREQ_LIST := y
 	CONFIG_DP_PKT_ADD_TIMESTAMP := y
 endif
-
+CONFIG_WLAN_PDEV_VDEV_SEND_MULTI_PARAM := y
 CONFIG_WLAN_POWER_DEBUG := y
 #Enable Beacon Reception Stats
 CONFIG_FEATURE_BECN_STATS := y