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
This commit is contained in:
@@ -436,6 +436,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.
|
||||
|
@@ -2451,6 +2451,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;
|
||||
|
@@ -3124,6 +3124,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.
|
||||
|
@@ -708,6 +708,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,
|
||||
@@ -715,6 +718,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);
|
||||
|
Reference in New Issue
Block a user