qcacmn: Add MIB statistics
Add new stats_id WMI_REQUEST_MIB_STATS & WMI_REQUEST_MIB_EXTD_STATS in WMI_REQUEST_STATS_CMDID to retrieve MIB statistics from fw. Change-Id: I17bccc2673d1a2ce035db04d8426bab49db80790 CRs-Fixed: 2548165
This commit is contained in:
@@ -35,6 +35,17 @@
|
||||
#include <wlan_cp_stats_mc_tgt_api.h>
|
||||
#include "../../../umac/cmn_services/utils/inc/wlan_utility.h"
|
||||
|
||||
#ifdef WLAN_FEATURE_MIB_STATS
|
||||
static void target_if_cp_stats_free_mib_stats(struct stats_event *ev)
|
||||
{
|
||||
qdf_mem_free(ev->mib_stats);
|
||||
ev->mib_stats = NULL;
|
||||
}
|
||||
#else
|
||||
static void target_if_cp_stats_free_mib_stats(struct stats_event *ev)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
static void target_if_cp_stats_free_stats_event(struct stats_event *ev)
|
||||
{
|
||||
qdf_mem_free(ev->pdev_stats);
|
||||
@@ -51,6 +62,7 @@ static void target_if_cp_stats_free_stats_event(struct stats_event *ev)
|
||||
ev->vdev_summary_stats = NULL;
|
||||
qdf_mem_free(ev->vdev_chain_rssi);
|
||||
ev->vdev_chain_rssi = NULL;
|
||||
target_if_cp_stats_free_mib_stats(ev);
|
||||
}
|
||||
|
||||
static QDF_STATUS target_if_cp_stats_extract_pdev_stats(
|
||||
@@ -232,6 +244,51 @@ static QDF_STATUS target_if_cp_stats_extract_cca_stats(
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_MIB_STATS
|
||||
static QDF_STATUS target_if_cp_stats_extract_mib_stats(
|
||||
struct wmi_unified *wmi_hdl,
|
||||
wmi_host_stats_event *stats_param,
|
||||
struct stats_event *ev, uint8_t *data)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
|
||||
if (!stats_param->num_mib_stats) {
|
||||
cp_stats_debug("no mib stats");
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
if (stats_param->num_mib_stats != MAX_MIB_STATS ||
|
||||
(stats_param->num_mib_extd_stats &&
|
||||
stats_param->num_mib_extd_stats != MAX_MIB_STATS)) {
|
||||
cp_stats_err("number of mib stats wrong, num_mib_stats %d, num_mib_extd_stats %d",
|
||||
stats_param->num_mib_stats,
|
||||
stats_param->num_mib_extd_stats);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
ev->num_mib_stats = stats_param->num_mib_stats;
|
||||
|
||||
ev->mib_stats = qdf_mem_malloc(sizeof(*ev->mib_stats));
|
||||
if (!ev->mib_stats)
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
|
||||
status = wmi_extract_mib_stats(wmi_hdl, data, ev->mib_stats);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
cp_stats_err("wmi_extract_mib_stats failed");
|
||||
return status;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#else
|
||||
static QDF_STATUS target_if_cp_stats_extract_mib_stats(
|
||||
struct wmi_unified *wmi_hdl,
|
||||
wmi_host_stats_event *stats_param,
|
||||
struct stats_event *ev, uint8_t *data)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
static QDF_STATUS target_if_cp_stats_extract_vdev_summary_stats(
|
||||
struct wmi_unified *wmi_hdl,
|
||||
wmi_host_stats_event *stats_param,
|
||||
@@ -358,9 +415,11 @@ static QDF_STATUS target_if_cp_stats_extract_event(struct wmi_unified *wmi_hdl,
|
||||
cp_stats_err("stats param extract failed: %d", status);
|
||||
return status;
|
||||
}
|
||||
cp_stats_debug("num: pdev: %d, vdev: %d, peer: %d, rssi: %d",
|
||||
cp_stats_debug("num: pdev: %d, vdev: %d, peer: %d, rssi: %d, mib %d, mib_extd %d",
|
||||
stats_param.num_pdev_stats, stats_param.num_vdev_stats,
|
||||
stats_param.num_peer_stats, stats_param.num_rssi_stats);
|
||||
stats_param.num_peer_stats, stats_param.num_rssi_stats,
|
||||
stats_param.num_mib_stats,
|
||||
stats_param.num_mib_extd_stats);
|
||||
|
||||
ev->last_event = stats_param.last_event;
|
||||
status = target_if_cp_stats_extract_pdev_stats(wmi_hdl, &stats_param,
|
||||
@@ -390,6 +449,12 @@ static QDF_STATUS target_if_cp_stats_extract_event(struct wmi_unified *wmi_hdl,
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
return status;
|
||||
|
||||
status = target_if_cp_stats_extract_mib_stats(wmi_hdl,
|
||||
&stats_param,
|
||||
ev, data);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
return status;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -591,6 +656,8 @@ static uint32_t get_stats_id(enum stats_req_type type)
|
||||
WMI_REQUEST_PDEV_STAT |
|
||||
WMI_REQUEST_PEER_EXTD2_STAT |
|
||||
WMI_REQUEST_RSSI_PER_CHAIN_STAT);
|
||||
case TYPE_MIB_STATS:
|
||||
return (WMI_REQUEST_MIB_STAT | WMI_REQUEST_MIB_EXTD_STAT);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user