Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

wifi: rtw89: add BW info for both TX and RX in phy_info

In order to debug performance issue intuitively, add bandwidth information
into debugfs entry phy_info. After applying this patch, it looks like:

TX rate [0]: HE 2SS MCS-11 GI:0.8 BW:80 (hw_rate=0x19b) ==> agg_wait=1 (3500)
RX rate [0]: HE 2SS MCS-9 GI:0.8 BW:80 (hw_rate=0x199)

Signed-off-by: Eric Huang <echuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221021091601.39884-1-pkshih@realtek.com

authored by

Eric Huang and committed by
Kalle Valo
25f49617 e69ae29e

+18
+18
drivers/net/wireless/realtek/rtw89/debug.c
··· 51 51 }; 52 52 }; 53 53 54 + static const u16 rtw89_rate_info_bw_to_mhz_map[] = { 55 + [RATE_INFO_BW_20] = 20, 56 + [RATE_INFO_BW_40] = 40, 57 + [RATE_INFO_BW_80] = 80, 58 + [RATE_INFO_BW_160] = 160, 59 + [RATE_INFO_BW_320] = 320, 60 + }; 61 + 62 + static u16 rtw89_rate_info_bw_to_mhz(enum rate_info_bw bw) 63 + { 64 + if (bw < ARRAY_SIZE(rtw89_rate_info_bw_to_mhz_map)) 65 + return rtw89_rate_info_bw_to_mhz_map[bw]; 66 + 67 + return 0; 68 + } 69 + 54 70 static int rtw89_debugfs_single_show(struct seq_file *m, void *v) 55 71 { 56 72 struct rtw89_debugfs_priv *debugfs_priv = m->private; ··· 2395 2379 else 2396 2380 seq_printf(m, "Legacy %d", rate->legacy); 2397 2381 seq_printf(m, "%s", rtwsta->ra_report.might_fallback_legacy ? " FB_G" : ""); 2382 + seq_printf(m, " BW:%u", rtw89_rate_info_bw_to_mhz(rate->bw)); 2398 2383 seq_printf(m, "\t(hw_rate=0x%x)", rtwsta->ra_report.hw_rate); 2399 2384 seq_printf(m, "\t==> agg_wait=%d (%d)\n", rtwsta->max_agg_wait, 2400 2385 sta->deflink.agg.max_rc_amsdu_len); ··· 2421 2404 he_gi_str[rate->he_gi] : "N/A"); 2422 2405 break; 2423 2406 } 2407 + seq_printf(m, " BW:%u", rtw89_rate_info_bw_to_mhz(status->bw)); 2424 2408 seq_printf(m, "\t(hw_rate=0x%x)\n", rtwsta->rx_hw_rate); 2425 2409 2426 2410 rssi = ewma_rssi_read(&rtwsta->avg_rssi);