Thread (4 messages) flat view 4 messages, 2 authors, 2021-10-29

RE: [PATCH 1/2] rtw89: update tx power limit/limit_ru tables to R54

From: Pkshih <pkshih@realtek.com>
Date: 2021-10-29 01:30:45

-----Original Message-----
From: Brian Norris <briannorris@chromium.org>
Sent: Friday, October 29, 2021 5:32 AM
To: Pkshih <pkshih@realtek.com>
Cc: kvalo@codeaurora.org; linux-wireless@vger.kernel.org; Kevin Yang <redacted>
Subject: Re: [PATCH 1/2] rtw89: update tx power limit/limit_ru tables to R54

Hi,

On Thu, Oct 28, 2021 at 04:40:53PM +0800, Ping-Ke Shih wrote:
quoted
From: Zong-Zhe Yang <redacted>

Support QATAR in rtw89_regulation_type and reorder the enum.
Update tx power limit table and tx power limit_ru table to configure QATAR
and adjust indexes to align rtw89_regulation_type enum.

Besides, if an unassigned entry of limit/limit_ru tables is read,
return the corresponding WW value for the unconfigured case.

Signed-off-by: Zong-Zhe Yang <redacted>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/core.h     |    9 +-
 drivers/net/wireless/realtek/rtw89/phy.c      |   12 +
 .../wireless/realtek/rtw89/rtw8852a_table.c   | 5199 +++++++++++------
 3 files changed, 3488 insertions(+), 1732 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/core.h b/drivers/net/wireless/realtek/rtw89/core.h
index c2885e4dd882..3729abda04f9 100644
--- a/drivers/net/wireless/realtek/rtw89/core.h
+++ b/drivers/net/wireless/realtek/rtw89/core.h
@@ -411,12 +411,13 @@ enum rtw89_regulation_type {
 	RTW89_NA	= 4,
 	RTW89_IC	= 5,
 	RTW89_KCC	= 6,
-	RTW89_NCC	= 7,
-	RTW89_CHILE	= 8,
-	RTW89_ACMA	= 9,
-	RTW89_MEXICO	= 10,
+	RTW89_ACMA	= 7,
+	RTW89_NCC	= 8,
+	RTW89_MEXICO	= 9,
+	RTW89_CHILE	= 10,
 	RTW89_UKRAINE	= 11,
 	RTW89_CN	= 12,
+	RTW89_QATAR	= 13,
 	RTW89_REGD_NUM,
 };
diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c
index ab134856baac..0620ef02e275 100644
--- a/drivers/net/wireless/realtek/rtw89/phy.c
+++ b/drivers/net/wireless/realtek/rtw89/phy.c
quoted
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852a_table.c
b/drivers/net/wireless/realtek/rtw89/rtw8852a_table.c
quoted
index 3a4fe7207420..6a61549ffac7 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852a_table.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852a_table.c
@@ -43556,1346 +43556,1850 @@ const s8 rtw89_8852a_txpwr_lmt_2g[RTW89_2G_BW_NUM][RTW89_NTX_NUM]
 	[0][0][0][0][1][0] = 56,
 	[0][0][0][0][3][0] = 68,
 	[0][0][0][0][5][0] = 76,
-	[0][0][0][0][6][0] = 56,
-	[0][0][0][0][9][0] = 56,
-	[0][0][0][0][8][0] = 60,
+	[0][0][0][0][6][0] = 76,
+	[0][0][0][0][7][0] = 56,
+	[0][0][0][0][10][0] = 60,
...

If one of these colums is based on an enum, you should probably *use*
the enum in the table. Then this patch would probably much much smaller,
and it would be clear what parts are changes and what parts are just
renumbering...

I'd suggest splitting this into at least one more patch, where the first
patch should replace all the magic numbers (0..12) with the appropriate
rtw89_regulation_type values.
Got it. 
Thanks for the suggestion. We'll do it.

--
Ping-Ke
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help