qcacld-3.0: Register cp stats legacy ops

Support has been added in common code to register both
common tx ops and MC/WIN specific tx ops. Add support to
register and tx ops for MC specific stats.

Change-Id: I4e5263e4685a707008ec3c5e96f50c707b071fe9
CRs-Fixed: 2851256
This commit is contained in:
Rajasekaran Kalidoss 2021-01-07 13:13:56 +05:30 • committed by snandini
commit 34d700eacc
2 changed files with 77 additions and 16 deletions

1
Kbuild
View file

@ -2657,6 +2657,7 @@ cppflags-$(CONFIG_WLAN_FEATURE_FILS) += -DWLAN_FEATURE_FILS_SK
cppflags-$(CONFIG_CP_STATS) += -DWLAN_SUPPORT_INFRA_CTRL_PATH_STATS
cppflags-$(CONFIG_CP_STATS) += -DQCA_SUPPORT_CP_STATS
cppflags-$(CONFIG_CP_STATS) += -DQCA_SUPPORT_MC_CP_STATS
cppflags-$(CONFIG_CP_STATS) += -DWLAN_SUPPORT_LEGACY_CP_STATS_HANDLERS
cppflags-$(CONFIG_DCS) += -DDCS_INTERFERENCE_DETECTION
cppflags-$(CONFIG_FEATURE_INTEROP_ISSUES_AP) += -DWLAN_FEATURE_INTEROP_ISSUES_AP
cppflags-$(CONFIG_FEATURE_MEMDUMP_ENABLE) += -DWLAN_FEATURE_MEMDUMP_ENABLE

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2013-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
@ -1079,7 +1079,7 @@ static void target_if_cp_stats_inc_wake_lock_stats(uint32_t reason,
}
static QDF_STATUS
target_if_cp_stats_register_event_handler(struct wlan_objmgr_psoc *psoc)
target_if_mc_cp_stats_register_event_handler(struct wlan_objmgr_psoc *psoc)
{
int ret_val;
struct wmi_unified *wmi_handle;
@ -1114,7 +1114,7 @@ target_if_cp_stats_register_event_handler(struct wlan_objmgr_psoc *psoc)
}
static QDF_STATUS
target_if_cp_stats_unregister_event_handler(struct wlan_objmgr_psoc *psoc)
target_if_mc_cp_stats_unregister_event_handler(struct wlan_objmgr_psoc *psoc)
{
struct wmi_unified *wmi_handle;
@ -1191,43 +1191,44 @@ static QDF_STATUS target_if_cp_stats_send_stats_req(
}
/**
* target_if_cp_stats_unregister_handlers() - Un-registers wmi event handlers
* target_if_mc_cp_stats_unregister_handlers() - Unregisters wmi event handlers
* of control plane stats & twt session stats info
* @psoc: PSOC object
*
* Return: QDF_STATUS_SUCCESS on success or QDF error values on failure
*/
static QDF_STATUS
target_if_cp_stats_unregister_handlers(struct wlan_objmgr_psoc *psoc)
target_if_mc_cp_stats_unregister_handlers(struct wlan_objmgr_psoc *psoc)
{
QDF_STATUS qdf_status;
qdf_status = target_if_twt_session_params_unregister_evt_hdlr(psoc);
if (qdf_status == QDF_STATUS_SUCCESS)
qdf_status = target_if_cp_stats_unregister_event_handler(psoc);
qdf_status =
target_if_mc_cp_stats_unregister_event_handler(psoc);
return qdf_status;
}
/**
* target_if_cp_stats_register_handlers() - Registers wmi event handlers for
* target_if_mc_cp_stats_register_handlers() - Registers wmi event handlers for
* control plane stats & twt session stats info
* @psoc: PSOC object
*
* Return: QDF_STATUS_SUCCESS on success or QDF error values on failure
*/
static QDF_STATUS
target_if_cp_stats_register_handlers(struct wlan_objmgr_psoc *psoc)
target_if_mc_cp_stats_register_handlers(struct wlan_objmgr_psoc *psoc)
{
QDF_STATUS qdf_status;
qdf_status = target_if_cp_stats_register_event_handler(psoc);
qdf_status = target_if_mc_cp_stats_register_event_handler(psoc);
if (qdf_status != QDF_STATUS_SUCCESS)
return qdf_status;
qdf_status = target_if_twt_session_params_register_evt_hdlr(psoc);
if (qdf_status != QDF_STATUS_SUCCESS)
target_if_cp_stats_unregister_event_handler(psoc);
target_if_mc_cp_stats_unregister_event_handler(psoc);
return qdf_status;
}
@ -1262,8 +1263,8 @@ target_if_cp_stats_send_peer_stats_req(struct wlan_objmgr_psoc *psoc,
return wmi_unified_peer_stats_request_send(wmi_handle, &param);
}
QDF_STATUS
target_if_cp_stats_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
static QDF_STATUS
target_if_mc_cp_stats_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
{
struct wlan_lmac_if_cp_stats_tx_ops *cp_stats_tx_ops;
@ -1278,10 +1279,6 @@ target_if_cp_stats_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
return QDF_STATUS_E_FAILURE;
}
cp_stats_tx_ops->cp_stats_attach =
target_if_cp_stats_register_handlers;
cp_stats_tx_ops->cp_stats_detach =
target_if_cp_stats_unregister_handlers;
cp_stats_tx_ops->inc_wake_lock_stats =
target_if_cp_stats_inc_wake_lock_stats;
cp_stats_tx_ops->send_req_stats = target_if_cp_stats_send_stats_req;
@ -1291,3 +1288,66 @@ target_if_cp_stats_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS
target_if_mc_cp_stats_unregister_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
{
struct wlan_lmac_if_cp_stats_tx_ops *cp_stats_tx_ops;
if (!tx_ops) {
cp_stats_err("lmac tx ops is NULL!");
return QDF_STATUS_E_INVAL;
}
cp_stats_tx_ops = &tx_ops->cp_stats_tx_ops;
if (!cp_stats_tx_ops) {
cp_stats_err("lmac tx ops is NULL!");
return QDF_STATUS_E_FAILURE;
}
cp_stats_tx_ops->inc_wake_lock_stats = NULL;
cp_stats_tx_ops->send_req_stats = NULL;
cp_stats_tx_ops->send_req_peer_stats = NULL;
return QDF_STATUS_SUCCESS;
}
#ifdef WLAN_SUPPORT_LEGACY_CP_STATS_HANDLERS
QDF_STATUS
target_if_cp_stats_register_legacy_event_handler(struct wlan_objmgr_psoc *psoc)
{
QDF_STATUS status;
struct wlan_lmac_if_tx_ops *tx_ops;
tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
if (!tx_ops) {
cp_stats_err("lmac tx ops is NULL!");
return QDF_STATUS_E_FAILURE;
}
status = target_if_mc_cp_stats_register_tx_ops(tx_ops);
if (QDF_IS_STATUS_ERROR(status))
return status;
return target_if_mc_cp_stats_register_handlers(psoc);
}
QDF_STATUS
target_if_cp_stats_unregister_legacy_event_handler(
struct wlan_objmgr_psoc *psoc)
{
QDF_STATUS status;
struct wlan_lmac_if_tx_ops *tx_ops;
tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
if (!tx_ops) {
cp_stats_err("lmac tx ops is NULL!");
return QDF_STATUS_E_FAILURE;
}
status = target_if_mc_cp_stats_unregister_tx_ops(tx_ops);
if (QDF_IS_STATUS_ERROR(status))
return status;
return target_if_mc_cp_stats_unregister_handlers(psoc);
}
#endif