Browse Source

qcacld-3.0: Configure FW flags for each latency level in FW

As per the new design, If the multi-client Low latency feature
enabled then the host should configure the below value to FW
at the time of driver init time via multiple SET_VDEV_PARAMS
commands:
1. Latency Level Flags for each latency level
2. Default latency level for all clients
3. INI configurations for multi-client Low latency Feature

If the multi-client Low latency feature is enabled, FW uses
these configurations while processing command
WMI_WLM_CONFIG_CMDID.

Change-Id: If46c253ab8b3b22a5c7723a278feb4daaed0ab2b
CRs-Fixed: 3180934
abhinav kumar 3 years ago
parent
commit
4a0777d862
1 changed files with 153 additions and 0 deletions
  1. 153 0
      core/wma/src/wma_dev_if.c

+ 153 - 0
core/wma/src/wma_dev_if.c

@@ -2678,6 +2678,155 @@ QDF_STATUS wma_vdev_self_peer_create(struct vdev_mlme_obj *vdev_mlme)
 	return status;
 }
 
+#ifdef MULTI_CLIENT_LL_SUPPORT
+/**
+ * wma_set_vdev_latency_level_param() - Set per vdev latency level params in FW
+ * @wma_handle: wma handle
+ * @mac: mac context
+ * @vdev_id: vdev id
+ *
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS wma_set_vdev_latency_level_param(tp_wma_handle wma_handle,
+						   struct mac_context *mac,
+						   uint8_t vdev_id)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	bool multi_client_ll_ini_support, multi_client_ll_caps;
+	uint32_t latency_flags;
+	static uint32_t ll[4] = {100, 60, 40, 20};
+	uint32_t ul_latency, dl_latency, ul_dl_latency;
+	uint8_t default_latency_level;
+
+	multi_client_ll_ini_support =
+			mac->mlme_cfg->wlm_config.multi_client_ll_support;
+	multi_client_ll_caps =
+			wlan_mlme_get_wlm_multi_client_ll_caps(mac->psoc);
+	wma_debug("[MULTI_CLIENT] INI support: %d, fw capability:%d",
+		  multi_client_ll_ini_support, multi_client_ll_caps);
+	/*
+	 * Multi-Client arbiter functionality is enabled only if both INI is
+	 * set, and Service bit is configured.
+	 */
+	if (!(multi_client_ll_ini_support && multi_client_ll_caps))
+		return status;
+
+	status  = wma_vdev_set_param(wma_handle->wmi_handle, vdev_id,
+			WMI_VDEV_PARAM_MULTI_CLIENT_LL_FEATURE_CONFIGURATION,
+			multi_client_ll_ini_support);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wma_err("failed to configure low latency feature");
+		return status;
+	}
+
+	/* wlm latency level index:0 - normal, 1 - xr, 2 - low, 3 - ultralow */
+	wma_debug("Setting vdev params for latency level flags");
+
+	latency_flags = mac->mlme_cfg->wlm_config.latency_flags[0];
+	status  = wma_vdev_set_param(wma_handle->wmi_handle, vdev_id,
+			WMI_VDEV_PARAM_NORMAL_LATENCY_FLAGS_CONFIGURATION,
+			latency_flags);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wma_err("failed to configure normal latency flag");
+		return status;
+	}
+
+	latency_flags = mac->mlme_cfg->wlm_config.latency_flags[1];
+	status  = wma_vdev_set_param(wma_handle->wmi_handle, vdev_id,
+			WMI_VDEV_PARAM_XR_LATENCY_FLAGS_CONFIGURATION,
+			latency_flags);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wma_err("failed to configure xr latency flag");
+		return status;
+	}
+
+	latency_flags = mac->mlme_cfg->wlm_config.latency_flags[2];
+	status  = wma_vdev_set_param(wma_handle->wmi_handle, vdev_id,
+			WMI_VDEV_PARAM_LOW_LATENCY_FLAGS_CONFIGURATION,
+			latency_flags);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wma_err("failed to configure low latency flag");
+		return status;
+	}
+
+	latency_flags = mac->mlme_cfg->wlm_config.latency_flags[3];
+	status  = wma_vdev_set_param(wma_handle->wmi_handle, vdev_id,
+			WMI_VDEV_PARAM_ULTRA_LOW_LATENCY_FLAGS_CONFIGURATION,
+			latency_flags);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wma_err("failed to configure ultra low latency flag");
+		return status;
+	}
+
+	wma_debug("Setting vdev params for Latency level UL/DL flags");
+	/*
+	 * Latency level UL/DL
+	 * 0-15 bits: UL and 16-31 bits: DL
+	 */
+	dl_latency = ll[0];
+	ul_latency = ll[0];
+	ul_dl_latency = dl_latency << 16 | ul_latency;
+	status  = wma_vdev_set_param(wma_handle->wmi_handle, vdev_id,
+			WMI_VDEV_PARAM_NORMAL_LATENCY_UL_DL_CONFIGURATION,
+			ul_dl_latency);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wma_err("failed to configure normal latency ul dl flag");
+		return status;
+	}
+
+	dl_latency = ll[1];
+	ul_latency = ll[1];
+	ul_dl_latency = dl_latency << 16 | ul_latency;
+	status  = wma_vdev_set_param(wma_handle->wmi_handle, vdev_id,
+			WMI_VDEV_PARAM_XR_LATENCY_UL_DL_CONFIGURATION,
+			ul_dl_latency);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wma_err("failed to configure normal latency ul dl flag");
+		return status;
+	}
+
+	dl_latency = ll[2];
+	ul_latency = ll[2];
+	ul_dl_latency = dl_latency << 16 | ul_latency;
+	status  = wma_vdev_set_param(wma_handle->wmi_handle, vdev_id,
+			WMI_VDEV_PARAM_LOW_LATENCY_UL_DL_CONFIGURATION,
+			ul_dl_latency);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wma_err("failed to configure normal latency ul dl flag");
+		return status;
+	}
+
+	dl_latency = ll[3];
+	ul_latency = ll[3];
+	ul_dl_latency = dl_latency << 16 | ul_latency;
+	status  = wma_vdev_set_param(wma_handle->wmi_handle, vdev_id,
+			WMI_VDEV_PARAM_ULTRA_LOW_LATENCY_UL_DL_CONFIGURATION,
+			ul_dl_latency);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wma_err("failed to configure normal latency ul dl flag");
+		return status;
+	}
+
+	default_latency_level = mac->mlme_cfg->wlm_config.latency_level;
+	status  = wma_vdev_set_param(wma_handle->wmi_handle, vdev_id,
+			WMI_VDEV_PARAM_DEFAULT_LATENCY_LEVEL_CONFIGURATION,
+			default_latency_level);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		wma_err("failed to configure low latency feature");
+		return status;
+	}
+
+	return status;
+}
+#else
+static QDF_STATUS wma_set_vdev_latency_level_param(tp_wma_handle wma_handle,
+						   struct mac_context *mac,
+						   uint8_t vdev_id)
+{
+	return QDF_STATUS_E_FAILURE;
+}
+#endif
+
 QDF_STATUS wma_post_vdev_create_setup(struct wlan_objmgr_vdev *vdev)
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
@@ -2914,6 +3063,10 @@ QDF_STATUS wma_post_vdev_create_setup(struct wlan_objmgr_vdev *vdev)
 			wma_err("Failed to configure active APF mode");
 	}
 
+	if (vdev_mlme->mgmt.generic.type == WMI_VDEV_TYPE_STA &&
+	    vdev_mlme->mgmt.generic.subtype == 0)
+		wma_set_vdev_latency_level_param(wma_handle, mac, vdev_id);
+
 	wma_vdev_set_data_tx_callback(vdev);
 
 	return QDF_STATUS_SUCCESS;