diff --git a/core/hdd/src/wlan_hdd_debugfs_llstat.c b/core/hdd/src/wlan_hdd_debugfs_llstat.c index 6b8e4fc2a1..4f9e4e1ae2 100644 --- a/core/hdd/src/wlan_hdd_debugfs_llstat.c +++ b/core/hdd/src/wlan_hdd_debugfs_llstat.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 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 @@ -46,6 +47,7 @@ void hdd_debugfs_process_iface_stats(struct hdd_adapter *adapter, wmi_iface_link_stats *link_stats; wmi_wmm_ac_stats *ac_stats; wmi_iface_offload_stats *offload_stats; + wmi_iface_powersave_stats *powersave_stats; uint64_t average_tsf_offset; int i; ssize_t len = 0; @@ -147,6 +149,14 @@ void hdd_debugfs_process_iface_stats(struct hdd_adapter *adapter, offload_stats->fwd_count); } + powersave_stats = &iface_stat->powersave_stats; + buffer += len; + ll_stats.len += len; + len = scnprintf(buffer, DEBUGFS_LLSTATS_BUF_SIZE - ll_stats.len, + "\ntot_tim_bcn: %u tot_err_tim_bcn: %u", + powersave_stats->tot_tim_bcn, + powersave_stats->tot_err_tim_bcn); + ll_stats.len += len; mutex_unlock(&llstats_mutex); hdd_exit(); diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 4efd7041c6..0e73276ad5 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -819,6 +819,17 @@ static bool put_wifi_iface_stats(struct wifi_interface_stats *if_stat, nla_nest_end(vendor_event, wmm_stats); } nla_nest_end(vendor_event, wmm_info); + + if (nla_put_u32(vendor_event, + QCA_WLAN_VENDOR_ATTR_LL_STATS_TIM_BEACON, + if_stat->powersave_stats.tot_tim_bcn) || + nla_put_u32(vendor_event, + QCA_WLAN_VENDOR_ATTR_LL_STATS_TIM_BEACON_ERR, + if_stat->powersave_stats.tot_err_tim_bcn)) { + hdd_err("QCA_WLAN_VENDOR_ATTR put powersave_stat fail"); + return false; + } + return true; } diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index dcd036263f..95bae8557f 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -3144,6 +3144,7 @@ struct wifi_peer_info { * @ac_stats: per-Access Category statistics * @num_offload_stats: @offload_stats record count * @offload_stats: per-offload statistics + * @powersave_stats: powersave statistics * @vdev_id: vdev id * * Statistics corresponding to 2nd most LSB in wifi statistics bitmap @@ -3159,6 +3160,7 @@ struct wifi_interface_stats { wmi_wmm_ac_stats ac_stats[WIFI_AC_MAX]; uint32_t num_offload_stats; wmi_iface_offload_stats offload_stats[WMI_OFFLOAD_STATS_TYPE_MAX]; + wmi_iface_powersave_stats powersave_stats; uint8_t vdev_id; }; diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 3502a82efc..a6c2b87457 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -2755,6 +2755,7 @@ int wma_unified_link_iface_stats_event_handler(void *handle, wmi_iface_link_stats *link_stats, *iface_link_stats; wmi_wmm_ac_stats *ac_stats, *iface_ac_stats; wmi_iface_offload_stats *offload_stats, *iface_offload_stats; + wmi_iface_powersave_stats *powersave_stats; tSirLLStatsResults *link_stats_results; struct wifi_interface_stats *iface_stat; uint32_t count; @@ -2888,6 +2889,10 @@ int wma_unified_link_iface_stats_event_handler(void *handle, iface_offload_stats++; } + powersave_stats = param_tlvs->iface_powersave_stats; + if (powersave_stats) + iface_stat->powersave_stats = *powersave_stats; + /* Copying vdev_id info into the iface_stat for MLO*/ iface_stat->vdev_id = fixed_param->vdev_id;