2020-09-25 06:20:14

by Andy Huang

[permalink] [raw]
Subject: [PATCH 5/5] rtw88: show current regulatory in tx power table

From: Tzu-En Huang <[email protected]>

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.

Change-Id: Id92aa6a833053fbf0b065c9ff946d7d4722897fd
Signed-off-by: Tzu-En Huang <[email protected]>
---
drivers/net/wireless/realtek/rtw88/debug.c | 23 ++++++++++++++++++++++
1 file changed, 23 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/debug.c b/drivers/net/wireless/realtek/rtw88/debug.c
index bff6ce19345a..3852c4f0ac0b 100644
--- a/drivers/net/wireless/realtek/rtw88/debug.c
+++ b/drivers/net/wireless/realtek/rtw88/debug.c
@@ -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;
@@ -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");

--
2.17.1


2020-09-25 16:32:14

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 5/5] rtw88: show current regulatory in tx power table

<[email protected]> writes:

> From: Tzu-En Huang <[email protected]>
>
> 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.
>
> Change-Id: Id92aa6a833053fbf0b065c9ff946d7d4722897fd

No Change-Id tags, but I can remove it during commit. No need to resend
just because of this.

--
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches