Skip to content

Commit

Permalink
rtw88: show current regulatory in tx power table
Browse files Browse the repository at this point in the history
In the transmit power table, it is important to know what the regulatory
currently is. For different regulatories, there are different
transmit power limits. Show which regulatory the driver is currently
using.

Signed-off-by: Tzu-En Huang <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
Tzu-En Huang authored and Kalle Valo committed Sep 29, 2020
1 parent 714f71f commit fada093
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions drivers/net/wireless/realtek/rtw88/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,28 @@ static void rtw_print_rate(struct seq_file *m, u8 rate)
}
}

#define case_REGD(src) \
case RTW_REGD_##src: return #src

static const char *rtw_get_regd_string(u8 regd)
{
switch (regd) {
case_REGD(FCC);
case_REGD(MKK);
case_REGD(ETSI);
case_REGD(IC);
case_REGD(KCC);
case_REGD(ACMA);
case_REGD(CHILE);
case_REGD(UKRAINE);
case_REGD(MEXICO);
case_REGD(CN);
case_REGD(WW);
default:
return "Unknown";
}
}

static int rtw_debugfs_get_tx_pwr_tbl(struct seq_file *m, void *v)
{
struct rtw_debugfs_priv *debugfs_priv = m->private;
Expand All @@ -555,6 +577,7 @@ static int rtw_debugfs_get_tx_pwr_tbl(struct seq_file *m, void *v)
u8 ch = hal->current_channel;
u8 regd = rtwdev->regd.txpwr_regd;

seq_printf(m, "regulatory: %s\n", rtw_get_regd_string(regd));
seq_printf(m, "%-4s %-10s %-3s%6s %-4s %4s (%-4s %-4s) %-4s\n",
"path", "rate", "pwr", "", "base", "", "byr", "lmt", "rem");

Expand Down

0 comments on commit fada093

Please sign in to comment.