Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9128022c authored by Alan Chen's avatar Alan Chen Committed by snandini
Browse files

qcacmn: Add an ini item for stats over QMI

Currently, stats over QMI features can only be disabled over build flags,
which is not flexible. Hence, add a CFG ini item to enable/disable stats
over QMI.

Change-Id: If5d57d2fc781fecc8817c2da8f61a2f7977d9c77
CRs-Fixed: 2752310
parent cd92dc47
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -423,6 +423,36 @@ void wmi_set_target_suspend(wmi_unified_t wmi_handle, bool val);
 */
bool wmi_is_target_suspended(struct wmi_unified *wmi_handle);

#ifdef WLAN_FEATURE_WMI_SEND_RECV_QMI
/**
 *  wmi_set_qmi_stats() - WMI API to set qmi stats enabled/disabled
 *  @wmi_handle: handle to WMI.
 *  @val: suspend state boolean
 */
void wmi_set_qmi_stats(wmi_unified_t wmi_handle, bool val);

/**
 * wmi_is_qmi_stats_enabled() - WMI API to check if periodic stats
 * over qmi is enableid
 * @wmi_handle: handle to WMI.
 *
 * WMI API to check if periodic stats over qmi is enabled
 *
 * Return: true if qmi stats is enabled, else false.
 */
bool wmi_is_qmi_stats_enabled(struct wmi_unified *wmi_handle);
#else
static inline
void wmi_set_qmi_stats(wmi_unified_t wmi_handle, bool val)
{}

static inline
bool wmi_is_qmi_stats_enabled(struct wmi_unified *wmi_handle)
{
	return false;
}
#endif /* end if of WLAN_FEATURE_WMI_SEND_RECV_QMI */

/**
 * WMI API to set bus suspend state
 * @param wmi_handle:	handle to WMI.
+3 −0
Original line number Diff line number Diff line
@@ -2290,6 +2290,9 @@ struct wmi_unified {
#endif /*WMI_INTERFACE_EVENT_LOGGING */

	qdf_atomic_t is_target_suspended;
#ifdef WLAN_FEATURE_WMI_SEND_RECV_QMI
	bool is_qmi_stats_enabled;
#endif

#ifdef FEATURE_RUNTIME_PM
	qdf_atomic_t runtime_pm_inprogress;
+12 −0
Original line number Diff line number Diff line
@@ -3116,6 +3116,18 @@ bool wmi_is_target_suspended(struct wmi_unified *wmi_handle)
	return qdf_atomic_read(&wmi_handle->is_target_suspended);
}

#ifdef WLAN_FEATURE_WMI_SEND_RECV_QMI
void wmi_set_qmi_stats(wmi_unified_t wmi_handle, bool val)
{
	wmi_handle->is_qmi_stats_enabled = val;
}

bool wmi_is_qmi_stats_enabled(struct wmi_unified *wmi_handle)
{
	return wmi_handle->is_qmi_stats_enabled;
}
#endif

/**
 * WMI API to set crash injection state
 * @param wmi_handle:	handle to WMI.
+4 −0
Original line number Diff line number Diff line
@@ -678,6 +678,9 @@ static QDF_STATUS wmi_unified_cmd_send_pm_chk(struct wmi_unified *wmi_handle,
					      wmi_buf_t buf,
					      uint32_t buflen, uint32_t cmd_id)
{
	if (!wmi_is_qmi_stats_enabled(wmi_handle))
		goto send_over_wmi;

	if (wmi_is_target_suspended(wmi_handle)) {
		if (QDF_IS_STATUS_SUCCESS(
		    wmi_unified_cmd_send_over_qmi(wmi_handle, buf,
@@ -685,6 +688,7 @@ static QDF_STATUS wmi_unified_cmd_send_pm_chk(struct wmi_unified *wmi_handle,
			return QDF_STATUS_SUCCESS;
	}

send_over_wmi:
	qdf_atomic_set(&wmi_handle->num_stats_over_qmi, 0);

	return wmi_unified_cmd_send(wmi_handle, buf, buflen, cmd_id);