Explorar o código

qcacld-3.0: Optimize retry_threshold pdev set param command

Currently wma_set_sw_retry_threshold sends two
pdev set param commands separately to firmware

Combine two sw retry threshold pdev set params,
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: Ia66a3e8e50002691008f66253d8cd76d2a1e9aa8
CRs-Fixed: 3333454
Divyajyothi Goparaju %!s(int64=2) %!d(string=hai) anos
pai
achega
c10fb5b507

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

@@ -206,7 +206,7 @@ void __hdd_cm_disconnect_handler_post_user_update(struct hdd_adapter *adapter,
 	ucfg_dp_remove_conn_info(vdev);
 
 	/* Setting the RTS profile to original value */
-	if (sme_cli_set_command(adapter->vdev_id, WMI_VDEV_PARAM_ENABLE_RTSCTS,
+	if (sme_cli_set_command(adapter->vdev_id, wmi_vdev_param_enable_rtscts,
 				cfg_get(hdd_ctx->psoc,
 					CFG_ENABLE_FW_RTS_PROFILE),
 				VDEV_CMD))

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

@@ -300,7 +300,7 @@ int hdd_set_11be_rate_code(struct hdd_adapter *adapter, uint16_t rate_code)
 		  rate_code, rix, preamble, nss);
 
 	ret = wma_cli_set_command(adapter->vdev_id,
-				  WMI_VDEV_PARAM_FIXED_RATE,
+				  wmi_vdev_param_fixed_rate,
 				  rate_code, VDEV_CMD);
 
 	return ret;

+ 2 - 2
core/hdd/src/wlan_hdd_hostapd.c

@@ -4219,11 +4219,11 @@ QDF_STATUS hdd_init_ap_mode(struct hdd_adapter *adapter, bool reinit)
 		hdd_err("Failed to get sifs burst value, use default");
 
 	ret = wma_cli_set_command(adapter->vdev_id,
-				  WMI_PDEV_PARAM_BURST_ENABLE,
+				  wmi_pdev_param_burst_enable,
 				  enable_sifs_burst,
 				  PDEV_CMD);
 	if (0 != ret)
-		hdd_err("WMI_PDEV_PARAM_BURST_ENABLE set failed: %d", ret);
+		hdd_err("wmi_pdev_param_burst_enable set failed: %d", ret);
 
 
 	ucfg_mlme_is_6g_sap_fd_enabled(hdd_ctx->psoc, &is_6g_sap_fd_enabled);

+ 42 - 20
core/wma/src/wma_features.c

@@ -502,7 +502,7 @@ QDF_STATUS wma_set_tsf_gpio_pin(WMA_HANDLE handle, uint32_t pin)
 
 	wma_debug("set tsf gpio pin: %d", pin);
 
-	pdev_param.param_id = WMI_PDEV_PARAM_WNTS_CONFIG;
+	pdev_param.param_id = wmi_pdev_param_wnts_config;
 	pdev_param.param_value = pin;
 	ret = wmi_unified_pdev_param_send(wmi_handle,
 					 &pdev_param,
@@ -635,7 +635,7 @@ QDF_STATUS wma_process_dhcp_ind(WMA_HANDLE handle,
 
 	/* fill in values */
 	peer_set_param_fp.vdev_id = vdev_id;
-	peer_set_param_fp.param_id = WMI_PEER_CRIT_PROTO_HINT_ENABLED;
+	peer_set_param_fp.param_id = WMI_HOST_PEER_CRIT_PROTO_HINT_ENABLED;
 	if (WMA_DHCP_START_IND == ta_dhcp_ind->msgType)
 		peer_set_param_fp.param_value = 1;
 	else
@@ -3852,7 +3852,7 @@ void wma_send_regdomain_info_to_fw(uint32_t reg_dmn, uint16_t regdmn2G,
 		cck_mask_val = 1;
 
 	cck_mask_val |= (wma->self_gen_frm_pwr << 16);
-	pdev_param.param_id = WMI_PDEV_PARAM_TX_CHAIN_MASK_CCK;
+	pdev_param.param_id = wmi_pdev_param_tx_chain_mask_cck;
 	pdev_param.param_value = cck_mask_val;
 	ret = wmi_unified_pdev_param_send(wma->wmi_handle,
 					 &pdev_param,
@@ -4667,28 +4667,50 @@ QDF_STATUS wma_set_sw_retry_threshold_per_ac(WMA_HANDLE handle,
 	return QDF_STATUS_SUCCESS;
 }
 
-QDF_STATUS wma_set_sw_retry_threshold(uint8_t vdev_id, uint32_t retry,
-				      uint32_t param_id)
-{
-	uint32_t max, min;
-	uint32_t ret;
+#define MAX_PDEV_SW_RETRY_PARAMS 2
+/* params being sent:
+ * 1.wmi_pdev_param_agg_sw_retry_th
+ * 2.wmi_pdev_param_non_agg_sw_retry_th
+ */
 
-	if (param_id == WMI_PDEV_PARAM_AGG_SW_RETRY_TH) {
-		max = cfg_max(CFG_TX_AGGR_SW_RETRY);
-		min = cfg_min(CFG_TX_AGGR_SW_RETRY);
-	} else {
-		max = cfg_max(CFG_TX_NON_AGGR_SW_RETRY);
-		min = cfg_min(CFG_TX_NON_AGGR_SW_RETRY);
-	}
+QDF_STATUS wma_set_sw_retry_threshold(struct wlan_mlme_qos *qos_aggr)
+{
+	uint32_t max, min, retry;
+	struct dev_set_param setparam[MAX_PDEV_SW_RETRY_PARAMS];
+	QDF_STATUS ret;
+	uint8_t index = 0;
 
+	retry = qos_aggr->tx_aggr_sw_retry_threshold;
+	max = cfg_max(CFG_TX_AGGR_SW_RETRY);
+	min = cfg_min(CFG_TX_AGGR_SW_RETRY);
 	retry = (retry > max) ? max : retry;
 	retry = (retry < min) ? min : retry;
 
-	ret = wma_cli_set_command(vdev_id, param_id, retry, PDEV_CMD);
-	if (ret)
-		return QDF_STATUS_E_IO;
-
-	return QDF_STATUS_SUCCESS;
+	ret = mlme_check_index_setparam(setparam,
+					wmi_pdev_param_agg_sw_retry_th,
+					retry, index++,
+					MAX_PDEV_SW_RETRY_PARAMS);
+	if (QDF_IS_STATUS_ERROR(ret)) {
+		wma_debug("failed to set wmi_pdev_param_agg_sw_retry_th");
+		return ret;
+	}
+	retry = qos_aggr->tx_non_aggr_sw_retry_threshold;
+	max = cfg_max(CFG_TX_NON_AGGR_SW_RETRY);
+	min = cfg_min(CFG_TX_NON_AGGR_SW_RETRY);
+	retry = (retry > max) ? max : retry;
+	retry = (retry < min) ? min : retry;
+	ret = mlme_check_index_setparam(setparam,
+					wmi_pdev_param_non_agg_sw_retry_th,
+					retry, index++,
+					MAX_PDEV_SW_RETRY_PARAMS);
+	if (QDF_IS_STATUS_ERROR(ret)) {
+		wma_debug("failed to set wmi_pdev_param_non_agg_sw_retry_th");
+		return ret;
+	}
+	ret = wma_send_multi_pdev_vdev_set_params(MLME_PDEV_SETPARAM,
+						  WMI_PDEV_ID_SOC, setparam,
+						  index);
+	return ret;
 }
 
 /**