rtw88: add debugfs to fix tx rate
authorYan-Hsuan Chuang <yhchuang@realtek.com>
Mon, 29 Nov 2021 02:05:06 +0000 (10:05 +0800)
committerKalle Valo <kvalo@kernel.org>
Wed, 8 Dec 2021 18:28:07 +0000 (20:28 +0200)
commit1379e62026ab5a89b4d0fd1aed68248ceafca5bf
tree0752674c94fe930d680ac8e06494b46b86848d00
parenteb4e52b3f38dfd08a89e1084f5980a2bb93456fb
rtw88: add debugfs to fix tx rate

It is useful to fix the bit rate of TX packets. For example, if
someone is measuring the TX power, or debugging with the issues
of the TX throughput on the field.

To set the value of fixed rate, one should input corresponding
desc rate index (ex, 0x0b for DESC_RATE54M to fix at 54 Mbps).
Set a value larger than DESC_RATE_MAX will disable fix rate, so
the rate adaptive mechanism can resume to work.

Example,
  To fix rate at MCS 1:
  echo 0x0d > /sys/kernel/debug/ieee80211/phy0/rtw88/fix_rate

  To not to fix rate:
  echo 0xff > /sys/kernel/debug/ieee80211/phy0/rtw88/fix_rate

  To know which rate was fixed at:
  cat /sys/kernel/debug/ieee80211/phy0/rtw88/fix_rate

Signed-off-by: Yan-Hsuan Chuang <yhchuang@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/20211129020506.6273-1-pkshih@realtek.com
drivers/net/wireless/realtek/rtw88/debug.c
drivers/net/wireless/realtek/rtw88/main.c
drivers/net/wireless/realtek/rtw88/main.h
drivers/net/wireless/realtek/rtw88/tx.c