Browse Source

qcacld-3.0: Combine process_rate_update set param

Currently wma_process_rate_update_indicate sends
two vdev set params separately to firmware.

Combine two vdev set params of
wma_process_rate_update_indicate,
send to WMI to reduce number of transactions.
Also replace target wmi pdev/vdev params with host wmi
pdev/vdev params to fix existing broken layering
violation.

Change-Id: Icc50569bcc851c5ee269558b80a560b03e1fdcee
CRs-Fixed: 3333758
Divyajyothi Goparaju 2 years ago
parent
commit
c9808c04b6

+ 5 - 4
components/target_if/pmo/src/target_if_pmo_suspend_resume.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -62,16 +63,16 @@ QDF_STATUS target_if_pmo_send_vdev_update_param_req(
 
 	switch (param_id) {
 	case pmo_vdev_param_listen_interval:
-		param_id = WMI_VDEV_PARAM_LISTEN_INTERVAL;
+		param_id = wmi_vdev_param_listen_interval;
 		break;
 	case pmo_vdev_param_dtim_policy:
-		param_id = WMI_VDEV_PARAM_DTIM_POLICY;
+		param_id = wmi_vdev_param_dtim_policy;
 		break;
 	case pmo_vdev_param_forced_dtim_count:
-		param_id = WMI_VDEV_PARAM_FORCE_DTIM_CNT;
+		param_id = wmi_vdev_param_force_dtim_cnt;
 		break;
 	case pmo_vdev_param_moddtim:
-		param_id = WMI_VDEV_PARAM_MODDTIM_CNT;
+		param_id = wmi_vdev_param_moddtim_cnt;
 		break;
 	default:
 		target_if_err("invalid vdev param id %d", param_id);

+ 1 - 1
components/target_if/twt/src/target_if_ext_twt_cmd.c

@@ -137,7 +137,7 @@ target_if_twt_ac_param_send(struct wlan_objmgr_psoc *psoc,
 		return QDF_STATUS_E_NULL_VALUE;
 	}
 
-	params.param_id = WMI_PDEV_PARAM_TWT_AC_CONFIG;
+	params.param_id = wmi_pdev_param_twt_ac_config;
 	params.param_value = target_if_twt_convert_ac_value(twt_ac);
 
 	return wmi_unified_pdev_param_send(wmi_handle, &params, mac_id);

+ 1 - 1
core/hdd/src/wlan_hdd_cfg.c

@@ -2152,7 +2152,7 @@ int hdd_update_channel_width(struct hdd_adapter *adapter,
 	if (!sme_config)
 		return -ENOMEM;
 
-	ret = wma_cli_set_command(adapter->vdev_id, WMI_VDEV_PARAM_CHWIDTH,
+	ret = wma_cli_set_command(adapter->vdev_id, wmi_vdev_param_chwidth,
 				  chwidth, VDEV_CMD);
 	if (ret)
 		goto free_config;

+ 30 - 18
core/wma/src/wma_data.c

@@ -907,7 +907,7 @@ void wma_set_vht_txbf_cfg(struct mac_context *mac, uint8_t vdev_id)
 	txbf_en.sutxbfer = mac->mlme_cfg->vht_caps.vht_cap_info.su_bformer;
 
 	status = wma_vdev_set_param(wma->wmi_handle, vdev_id,
-				    WMI_VDEV_PARAM_TXBF,
+				    wmi_vdev_param_txbf,
 				    *((A_UINT8 *)&txbf_en));
 	if (QDF_IS_STATUS_ERROR(status))
 		wma_err("failed to set VHT TXBF(status = %d)", status);
@@ -940,7 +940,7 @@ int32_t wmi_unified_send_txbf(tp_wma_handle wma, tpAddStaParams params)
 
 	return wma_vdev_set_param(wma->wmi_handle,
 						params->smesessionId,
-						WMI_VDEV_PARAM_TXBF,
+						wmi_vdev_param_txbf,
 						*((A_UINT8 *) &txbf_en));
 }
 
@@ -1262,6 +1262,11 @@ QDF_STATUS wma_set_mcc_channel_time_quota(tp_wma_handle wma,
 						chan2_freq);
 }
 
+#define MAX_VDEV_PROCESS_RATE_PARAMS 2
+/* params being sent:
+ * wmi_vdev_param_sgi
+ * wmi_vdev_param_mcast_data_rate
+ */
 QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
 					    tSirRateUpdateInd *
 					    pRateUpdateParams)
@@ -1269,11 +1274,13 @@ QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
 	int32_t ret = 0;
 	uint8_t vdev_id = 0;
 	int32_t mbpsx10_rate = -1;
-	uint32_t paramId;
+	uint32_t paramid;
 	uint8_t rate = 0;
 	uint32_t short_gi, rate_flag;
 	struct wma_txrx_node *intr = wma->interfaces;
 	QDF_STATUS status;
+	struct dev_set_param setparam[MAX_VDEV_PROCESS_RATE_PARAMS] = {};
+	uint8_t index = 0;
 
 	/* Get the vdev id */
 	if (wma_find_vdev_id_by_addr(wma, pRateUpdateParams->bssid.bytes,
@@ -1299,16 +1306,16 @@ QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
 	 */
 	if (pRateUpdateParams->reliableMcastDataRateTxFlag > 0) {
 		mbpsx10_rate = pRateUpdateParams->reliableMcastDataRate;
-		paramId = WMI_VDEV_PARAM_MCAST_DATA_RATE;
+		paramid = wmi_vdev_param_mcast_data_rate;
 		if (pRateUpdateParams->
 		    reliableMcastDataRateTxFlag & TX_RATE_SGI)
 			short_gi = 1;   /* upper layer specified short GI */
 	} else if (pRateUpdateParams->bcastDataRate > -1) {
 		mbpsx10_rate = pRateUpdateParams->bcastDataRate;
-		paramId = WMI_VDEV_PARAM_BCAST_DATA_RATE;
+		paramid = wmi_vdev_param_bcast_data_rate;
 	} else {
 		mbpsx10_rate = pRateUpdateParams->mcastDataRate24GHz;
-		paramId = WMI_VDEV_PARAM_MCAST_DATA_RATE;
+		paramid = wmi_vdev_param_mcast_data_rate;
 		if (pRateUpdateParams->
 		    mcastDataRate24GHzTxFlag & TX_RATE_SGI)
 			short_gi = 1;   /* upper layer specified short GI */
@@ -1327,23 +1334,28 @@ QDF_STATUS wma_process_rate_update_indicate(tp_wma_handle wma,
 		qdf_mem_free(pRateUpdateParams);
 		return ret;
 	}
-	status = wma_vdev_set_param(wma->wmi_handle, vdev_id,
-					      WMI_VDEV_PARAM_SGI, short_gi);
+
+	ret = mlme_check_index_setparam(setparam, wmi_vdev_param_sgi, short_gi,
+					index++, MAX_VDEV_PROCESS_RATE_PARAMS);
 	if (QDF_IS_STATUS_ERROR(status)) {
-		wma_err("Fail to Set WMI_VDEV_PARAM_SGI(%d), status = %d",
-			short_gi, status);
-		qdf_mem_free(pRateUpdateParams);
-		return status;
+		wma_debug("failed at wmi_vdev_param_sgi");
+		goto error;
 	}
-	status = wma_vdev_set_param(wma->wmi_handle,
-					      vdev_id, paramId, rate);
-	qdf_mem_free(pRateUpdateParams);
+
+	ret = mlme_check_index_setparam(setparam, paramid, rate, index++,
+					MAX_VDEV_PROCESS_RATE_PARAMS);
 	if (QDF_IS_STATUS_ERROR(status)) {
-		wma_err("Fail to Set rate, status = %d", status);
-		return status;
+		wma_debug("failed at paramid:%d", paramid);
+		goto error;
 	}
 
-	return QDF_STATUS_SUCCESS;
+	ret = wma_send_multi_pdev_vdev_set_params(MLME_VDEV_SETPARAM,
+						  vdev_id, setparam, index);
+	if (QDF_IS_STATUS_ERROR(ret))
+		wma_debug("failed to send vdev set params");
+error:
+	qdf_mem_free(pRateUpdateParams);
+	return ret;
 }
 
 /**