On 11/5/2024 8:45 PM, Roopni Devanathan wrote: > From: Dinesh Karthikeyan <quic_dinek@xxxxxxxxxxx> > > Add support to request downlink pager stats from firmware through HTT > stats type 36. These stats give paging information like number of pages, > their timestamp, number of locked and free pages, synchronous and > asynchronous locked pages. > > Note: MCC firmware version - > WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 responds to > the event requesting stats, but it does not give any data. > > Sample output: > ------------- > echo 36 > /sys/kernel/debug/ath12k/pci-0000\:06\:00.0/mac0/htt_stats_type > cat /sys/kernel/debug/ath12k/pci-0000\:06\:00.0/mac0/htt_stats > HTT_DLPAGER_STATS_TLV: > ASYNC locked pages = 2 > SYNC locked pages = 0 > Total locked pages = 2 > Total free pages = 127 > > LOCKED PAGES HISTORY > last_locked_page_idx = 0 > Index - 0 ; Page Number - 8495 ; Num of pages - 1 ; Timestamp - 4031009360us > Index - 1 ; Page Number - 7219 ; Num of pages - 2 ; Timestamp - 885379515us > Index - 2 ; Page Number - 0 ; Num of pages - 0 ; Timestamp - 0us > Index - 3 ; Page Number - 0 ; Num of pages - 0 ; Timestamp - 0us > ..... > UNLOCKED PAGES HISTORY > last_unlocked_page_idx = 0 > Index - 0 ; Page Number - 7144 ; Num of pages - 2 ; Timestamp - 4032070008us > Index - 1 ; Page Number - 7214 ; Num of pages - 2 ; Timestamp - 885379512us > Index - 2 ; Page Number - 0 ; Num of pages - 0 ; Timestamp - 0us > Index - 3 ; Page Number - 0 ; Num of pages - 0 ; Timestamp - 0us > ..... > > Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 > > Signed-off-by: Dinesh Karthikeyan <quic_dinek@xxxxxxxxxxx> > Signed-off-by: Roopni Devanathan <quic_rdevanat@xxxxxxxxxxx> > --- > .../wireless/ath/ath12k/debugfs_htt_stats.c | 86 +++++++++++++++++++ > .../wireless/ath/ath12k/debugfs_htt_stats.h | 31 +++++++ > 2 files changed, 117 insertions(+) > > diff --git a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c > index c9980c0193d1..8a4fe3cbb8dd 100644 > --- a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c > +++ b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c > @@ -2542,6 +2542,89 @@ ath12k_htt_print_pdev_obss_pd_stats_tlv(const void *tag_buf, u16 tag_len, > stats_req->buf_len = len; > } > > +static void ath12k_htt_print_dlpager_entry(const struct ath12k_htt_pgs_info *pg_info, > + int idx, char *str_buf) > +{ > + u32 ts_lo; > + u32 ts_hi; > + u64 page_timestamp; > + u16 index = 0; > + > + ts_lo = le32_to_cpu(pg_info->ts_lsb); > + ts_hi = le32_to_cpu(pg_info->ts_msb); when I build with W=1 drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c: In function 'ath12k_htt_print_dlpager_entry': drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c:2582:13: warning: variable 'ts_hi' set but not used [-Wunused-but-set-variable] drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c:2581:13: warning: variable 'ts_lo' set but not used [-Wunused-but-set-variable] > + page_timestamp = ath12k_le32hilo_to_u64(pg_info->ts_msb, pg_info->ts_lsb); > + > + index += snprintf(&str_buf[index], ATH12K_HTT_MAX_STRING_LEN - index, > + "Index - %u ; Page Number - %u ; ", > + idx, le32_to_cpu(pg_info->page_num)); > + index += snprintf(&str_buf[index], ATH12K_HTT_MAX_STRING_LEN - index, > + "Num of pages - %u ; Timestamp - %lluus\n", > + le32_to_cpu(pg_info->num_pgs), page_timestamp); > +}