Message ID | 20250113071144.3397293-5-quic_rdevanat@quicinc.com (mailing list archive) |
---|---|
State | New |
Delegated to: | Kalle Valo |
Headers | show |
Series | wifi: ath12k: Support Sounding, Latency, Trigger, FSE stats | expand |
On 1/13/25 12:41, Roopni Devanathan wrote: > Currently, print_array_to_buf() is used to print arrays to HTT > stats buffer. This function supports printing only arrays with > 32-bit unsigned integers. Add print_array_to_buf_s8(), which > implements print_array_to_buf()'s functionality to all the > arrays with 8-bit signed integers. > > Sample output: > rx_ul_mumimo_target_rssi: user_0 = 0:-128, 1:-128, 2:-128, 3:-128 > rx_ul_mumimo_target_rssi: user_1 = 0:-128, 1:-128, 2:-128, 3:-128 > rx_ul_mumimo_target_rssi: user_2 = 0:-128, 1:-128, 2:-128, 3:-128 > > Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 > Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 > > Signed-off-by: Roopni Devanathan <quic_rdevanat@quicinc.com> > --- > .../wireless/ath/ath12k/debugfs_htt_stats.c | 28 +++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c > index 77c51269669f..92935134735a 100644 > --- a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c > +++ b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c > @@ -48,6 +48,34 @@ print_array_to_buf(u8 *buf, u32 offset, const char *header, > footer); > } > > +static u32 > +print_array_to_buf_s8(u8 *buf, u32 offset, const char *header, u32 stats_index, > + const s8 *array, u32 array_len, const char *footer) Who is the user of this new function? I don't see it called from anywhere. At least have 1 caller to it in this patch? Or else this patch fails to compile with W=1 drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c:52:1: error: 'print_array_to_buf_s8' defined but not used [-Werror=unused-function] 52 | print_array_to_buf_s8(u8 *buf, u32 offset, const char *header, u32 stats_index, | ^~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors
On 1/13/2025 1:50 PM, Aditya Kumar Singh wrote: > On 1/13/25 12:41, Roopni Devanathan wrote: >> Currently, print_array_to_buf() is used to print arrays to HTT >> stats buffer. This function supports printing only arrays with >> 32-bit unsigned integers. Add print_array_to_buf_s8(), which >> implements print_array_to_buf()'s functionality to all the >> arrays with 8-bit signed integers. >> >> Sample output: >> rx_ul_mumimo_target_rssi: user_0 = 0:-128, 1:-128, 2:-128, 3:-128 >> rx_ul_mumimo_target_rssi: user_1 = 0:-128, 1:-128, 2:-128, 3:-128 >> rx_ul_mumimo_target_rssi: user_2 = 0:-128, 1:-128, 2:-128, 3:-128 >> >> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 >> Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 >> >> Signed-off-by: Roopni Devanathan <quic_rdevanat@quicinc.com> >> --- >> .../wireless/ath/ath12k/debugfs_htt_stats.c | 28 +++++++++++++++++++ >> 1 file changed, 28 insertions(+) >> >> diff --git a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c >> index 77c51269669f..92935134735a 100644 >> --- a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c >> +++ b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c >> @@ -48,6 +48,34 @@ print_array_to_buf(u8 *buf, u32 offset, const char *header, >> footer); >> } >> +static u32 >> +print_array_to_buf_s8(u8 *buf, u32 offset, const char *header, u32 stats_index, >> + const s8 *array, u32 array_len, const char *footer) > > > Who is the user of this new function? I don't see it called from > anywhere. At least have 1 caller to it in this patch? > > Or else this patch fails to compile with W=1 > > drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c:52:1: error: 'print_array_to_buf_s8' defined but not used [-Werror=unused-function] > 52 | print_array_to_buf_s8(u8 *buf, u32 offset, const char *header, u32 stats_index, > | ^~~~~~~~~~~~~~~~~~~~~ > cc1: all warnings being treated as errors > This new function is called in patch "[PATCH v3 5/6] wifi: ath12k: Support Uplink MUMIMO Trigger Stats". If we are facing this warning, we'd have to merge this patch with patch 5/6. Jeff, Aditya, can you please confirm if doing that is okay?
diff --git a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c index 77c51269669f..92935134735a 100644 --- a/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c +++ b/drivers/net/wireless/ath/ath12k/debugfs_htt_stats.c @@ -48,6 +48,34 @@ print_array_to_buf(u8 *buf, u32 offset, const char *header, footer); } +static u32 +print_array_to_buf_s8(u8 *buf, u32 offset, const char *header, u32 stats_index, + const s8 *array, u32 array_len, const char *footer) +{ + u32 buf_len = ATH12K_HTT_STATS_BUF_SIZE; + int index = 0; + u8 i; + + if (header) + index += scnprintf(buf + offset, buf_len - offset, "%s = ", header); + + for (i = 0; i < array_len; i++) { + index += scnprintf(buf + offset + index, (buf_len - offset) - index, + " %u:%d,", stats_index++, array[i]); + } + + index--; + if ((offset + index) < buf_len) + buf[offset + index] = '\0'; + + if (footer) { + index += scnprintf(buf + offset + index, (buf_len - offset) - index, + "%s", footer); + } + + return index; +} + static const char *ath12k_htt_ax_tx_rx_ru_size_to_str(u8 ru_size) { switch (ru_size) {
Currently, print_array_to_buf() is used to print arrays to HTT stats buffer. This function supports printing only arrays with 32-bit unsigned integers. Add print_array_to_buf_s8(), which implements print_array_to_buf()'s functionality to all the arrays with 8-bit signed integers. Sample output: rx_ul_mumimo_target_rssi: user_0 = 0:-128, 1:-128, 2:-128, 3:-128 rx_ul_mumimo_target_rssi: user_1 = 0:-128, 1:-128, 2:-128, 3:-128 rx_ul_mumimo_target_rssi: user_2 = 0:-128, 1:-128, 2:-128, 3:-128 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 Signed-off-by: Roopni Devanathan <quic_rdevanat@quicinc.com> --- .../wireless/ath/ath12k/debugfs_htt_stats.c | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+)