qcacld-3.0: Add chipset stats for NAN operations

Add chipset stats for NAN operations

Change-Id: Iced9198240eed0bcddead32977b160cd8aeeedf8
CRs-Fixed: 3783059
This commit is contained in:
Prasanna JS
2024-04-03 11:42:18 -07:00
committato da Ravindra Konda
parent 7643b9b9f7
commit 019b2fff7f
8 ha cambiato i file con 766 aggiunte e 8 eliminazioni

Vedi File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. 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
@@ -27,6 +27,8 @@
#include "wlan_objmgr_peer_obj.h"
#include "wlan_policy_mgr_public_struct.h"
#include "qdf_status.h"
#include <nan_public_structs.h>
#include <wlan_cp_stats_chipset_stats.h>
#ifdef WLAN_FEATURE_NAN
@@ -317,4 +319,40 @@ wlan_is_mlo_sta_nan_ndi_allowed(struct wlan_objmgr_psoc *psoc)
return false;
}
#endif
#if defined(WLAN_FEATURE_NAN) && defined(WLAN_CHIPSET_STATS)
/**
* nan_cstats_log_nan_enable_resp_evt() - Chipset stats NAN enable
* response event
*
* @nan_event: pointer to nan_event_params object
*
* Return: void
*/
void nan_cstats_log_nan_enable_resp_evt(struct nan_event_params *nan_event);
/**
* nan_cstats_log_nan_disable_resp_evt() - Chipset stats NAN disable
* response event
*
* @vdev_id: vdev ID
* @psoc: pointer to psoc object
*
* Return: void
*/
void
nan_cstats_log_nan_disable_resp_evt(uint8_t vdev_id,
struct wlan_objmgr_psoc *psoc);
#else
static inline void
nan_cstats_log_nan_enable_resp_evt(struct nan_event_params *nan_event)
{
}
static inline void
nan_cstats_log_nan_disable_resp_evt(uint8_t vdev_id,
struct wlan_objmgr_psoc *psoc)
{
}
#endif /* WLAN_FEATURE_NAN && WLAN_CHIPSET_STATS */
#endif /* _WLAN_NAN_API_H_ */

Vedi File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. 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
@@ -487,3 +487,57 @@ bool wlan_is_mlo_sta_nan_ndi_allowed(struct wlan_objmgr_psoc *psoc)
return psoc_nan_obj->nan_caps.mlo_sta_nan_ndi_allowed;
}
#endif
#if defined(WLAN_FEATURE_NAN) && defined(WLAN_CHIPSET_STATS)
void nan_cstats_log_nan_enable_resp_evt(struct nan_event_params *nan_event)
{
struct cstats_nan_disc_enable_resp stat = {0};
struct wlan_objmgr_vdev *vdev;
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(nan_event->psoc,
nan_event->vdev_id,
WLAN_NAN_ID);
if (!vdev) {
nan_err("Invalid vdev!");
return;
}
stat.cmn.hdr.evt_id =
WLAN_CHIPSET_STATS_NAN_DISCOVERY_ENABLE_RESP_EVENT_ID;
stat.cmn.hdr.length = sizeof(struct cstats_nan_disc_enable_resp) -
sizeof(struct cstats_hdr);
stat.cmn.opmode = wlan_vdev_mlme_get_opmode(vdev);
stat.cmn.vdev_id = wlan_vdev_get_id(vdev);
stat.cmn.timestamp_us = qdf_get_time_of_the_day_us();
stat.cmn.time_tick = qdf_get_log_timestamp();
stat.is_enable_success = nan_event->is_nan_enable_success;
stat.mac_id = nan_event->mac_id;
stat.disc_state = nan_get_discovery_state(nan_event->psoc);
wlan_objmgr_vdev_release_ref(vdev, WLAN_NAN_ID);
wlan_cstats_host_stats(sizeof(struct cstats_nan_disc_enable_resp),
&stat);
}
void nan_cstats_log_nan_disable_resp_evt(uint8_t vdev_id,
struct wlan_objmgr_psoc *psoc)
{
struct cstats_nan_disc_disable_resp stat = {0};
stat.cmn.hdr.evt_id =
WLAN_CHIPSET_STATS_NAN_DISCOVERY_DISABLE_RESP_EVENT_ID;
stat.cmn.hdr.length =
sizeof(struct cstats_nan_disc_disable_resp) -
sizeof(struct cstats_hdr);
stat.cmn.opmode = QDF_NAN_DISC_MODE;
stat.cmn.vdev_id = vdev_id;
stat.cmn.timestamp_us = qdf_get_time_of_the_day_us();
stat.cmn.time_tick = qdf_get_log_timestamp();
stat.disc_state = nan_get_discovery_state(psoc);
wlan_cstats_host_stats(sizeof(struct cstats_nan_disc_disable_resp),
&stat);
}
#endif /* WLAN_CHIPSET_STATS */

Vedi File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. 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
@@ -899,6 +899,8 @@ static QDF_STATUS nan_handle_enable_rsp(struct nan_event_params *nan_event)
/* NAN Enable has failed, restore changes */
goto fail;
}
nan_cstats_log_nan_enable_resp_evt(nan_event);
fail:
psoc_nan_obj->nan_social_ch_2g_freq = 0;
psoc_nan_obj->nan_social_ch_5g_freq = 0;
@@ -957,6 +959,7 @@ QDF_STATUS nan_disable_cleanup(struct wlan_objmgr_psoc *psoc)
nan_handle_emlsr_concurrency(psoc, false);
policy_mgr_nan_sap_post_disable_conc_check(psoc);
nan_cstats_log_nan_disable_resp_evt(vdev_id, psoc);
} else {
/* Should not happen, NAN state can always be disabled */
nan_err("Cannot set NAN state to disabled!");