qcacld-3.0: Add support for big data stats

Add support of big data stats in the cpstats
component.

Change-Id: I3642035d9f25237c80b529da78c51bb1ccf0035a
CRs-Fixed: 2868949
This commit is contained in:
sheenam monga
2021-03-08 11:46:47 +05:30
committed by snandini
parent 41a02e5258
commit 72c7917fa9
13 changed files with 616 additions and 2 deletions

View File

@@ -67,11 +67,46 @@ tgt_cp_stats_register_infra_cp_stats_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
}
#endif
#ifdef WLAN_FEATURE_BIG_DATA_STATS
static void
tgt_cp_stats_register_big_data_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
{
rx_ops->cp_stats_rx_ops.process_big_data_stats_event =
tgt_mc_cp_stats_process_big_data_stats_event;
}
static QDF_STATUS
send_big_data_stats_req(struct wlan_lmac_if_cp_stats_tx_ops *tx_ops,
struct wlan_objmgr_psoc *psoc,
struct request_info *req)
{
if (!tx_ops->send_req_big_data_stats) {
cp_stats_err("could not get send_req_big_data_stats");
return QDF_STATUS_E_NULL_VALUE;
}
return tx_ops->send_req_big_data_stats(psoc, req);
}
#else
static void
tgt_cp_stats_register_big_data_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
{}
static QDF_STATUS
send_big_data_stats_req(struct wlan_lmac_if_cp_stats_tx_ops *tx_ops,
struct wlan_objmgr_psoc *psoc,
struct request_info *req)
{
return QDF_STATUS_SUCCESS;
}
#endif
void tgt_cp_stats_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
{
rx_ops->cp_stats_rx_ops.process_stats_event =
tgt_mc_cp_stats_process_stats_event;
tgt_cp_stats_register_infra_cp_stats_rx_ops(rx_ops);
tgt_cp_stats_register_big_data_rx_ops(rx_ops);
}
static void tgt_mc_cp_stats_extract_tx_power(struct wlan_objmgr_psoc *psoc,
@@ -1168,6 +1203,43 @@ QDF_STATUS tgt_mc_cp_stats_process_stats_event(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS;
}
#ifdef WLAN_FEATURE_BIG_DATA_STATS
QDF_STATUS
tgt_mc_cp_stats_process_big_data_stats_event(struct wlan_objmgr_psoc *psoc,
struct big_data_stats_event *ev)
{
QDF_STATUS status;
struct request_info last_req = {0};
bool pending = false;
if (!ev) {
cp_stats_err("invalid data");
return QDF_STATUS_E_INVAL;
}
status = ucfg_mc_cp_stats_get_pending_req(psoc,
TYPE_BIG_DATA_STATS,
&last_req);
if (QDF_IS_STATUS_ERROR(status)) {
cp_stats_err("ucfg_mc_cp_stats_get_pending_req failed");
return QDF_STATUS_E_FAILURE;
}
ucfg_mc_cp_stats_reset_pending_req(psoc, TYPE_BIG_DATA_STATS,
&last_req, &pending);
if (last_req.u.get_big_data_stats_cb && pending) {
last_req.u.get_big_data_stats_cb(ev, last_req.cookie);
last_req.u.get_big_data_stats_cb = NULL;
} else {
cp_stats_err("callback to send big data stats not found");
return QDF_STATUS_E_FAILURE;
}
return QDF_STATUS_SUCCESS;
}
#endif
QDF_STATUS tgt_mc_cp_stats_inc_wake_lock_stats(struct wlan_objmgr_psoc *psoc,
uint32_t reason,
struct wake_lock_stats *stats,
@@ -1205,6 +1277,9 @@ QDF_STATUS tgt_send_mc_cp_stats_req(struct wlan_objmgr_psoc *psoc,
}
status = tx_ops->send_req_peer_stats(psoc, req);
break;
case TYPE_BIG_DATA_STATS:
status = send_big_data_stats_req(tx_ops, psoc, req);
break;
default:
if (!tx_ops->send_req_stats) {
cp_stats_err("could not get send_req_stats");

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -706,6 +706,24 @@ QDF_STATUS ucfg_mc_cp_stats_send_stats_request(struct wlan_objmgr_vdev *vdev,
return tgt_send_mc_cp_stats_req(wlan_vdev_get_psoc(vdev), type, info);
}
#ifdef WLAN_FEATURE_BIG_DATA_STATS
QDF_STATUS ucfg_send_big_data_stats_request(struct wlan_objmgr_vdev *vdev,
enum stats_req_type type,
struct request_info *info)
{
QDF_STATUS status;
status = ucfg_mc_cp_stats_set_pending_req(wlan_vdev_get_psoc(vdev),
type, info);
if (QDF_IS_STATUS_ERROR(status)) {
cp_stats_err("ucfg_mc_cp_stats_set_pending_req pdev failed: %d",
status);
return status;
}
return tgt_send_mc_cp_stats_req(wlan_vdev_get_psoc(vdev), type, info);
}
#endif
QDF_STATUS ucfg_mc_cp_stats_get_tx_power(struct wlan_objmgr_vdev *vdev,
int *dbm)
{