diff mbox series

[v7,1/6] wifi: rtlwifi: rtl8192de: Fix 5 GHz TX power

Message ID c7653517-cf88-4f57-b79a-8edb0a8b32f0@gmail.com (mailing list archive)
State Accepted
Delegated to: Ping-Ke Shih
Headers show
Series wifi: rtlwifi: Move common code from rtl8192de to rtl8192d-common | expand

Commit Message

Bitterblue Smith April 25, 2024, 6:09 p.m. UTC
Different channels have different TX power settings. rtl8192de is using
the TX power setting from the wrong channel in the 5 GHz band because
_rtl92c_phy_get_rightchnlplace expects an array which includes all the
channel numbers, but it's using an array which includes only the 5 GHz
channel numbers.

Use the array channel_all (defined in rtl8192de/phy.c) instead of
the incorrect channel5g (defined in core.c).

Tested only with rtl8192du, which will use the same TX power code.

Cc: stable@vger.kernel.org
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
v7:
 - No change.

v6:
 - No change.

v5:
 - No change.

v4:
 - CC stable.

v3:
 - No change.

v2:
 - No change from v1, which was originally sent separately:
https://lore.kernel.org/linux-wireless/9995b805-ef8b-47c9-b176-ff540066039a@gmail.com/
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Ping-Ke Shih May 2, 2024, 2:55 a.m. UTC | #1
Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:

> Different channels have different TX power settings. rtl8192de is using
> the TX power setting from the wrong channel in the 5 GHz band because
> _rtl92c_phy_get_rightchnlplace expects an array which includes all the
> channel numbers, but it's using an array which includes only the 5 GHz
> channel numbers.
> 
> Use the array channel_all (defined in rtl8192de/phy.c) instead of
> the incorrect channel5g (defined in core.c).
> 
> Tested only with rtl8192du, which will use the same TX power code.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>

6 patch(es) applied to rtw-next branch of rtw.git, thanks.

de4d4be4fa64 wifi: rtlwifi: rtl8192de: Fix 5 GHz TX power
a7c0f48410f5 wifi: rtlwifi: rtl8192de: Fix low speed with WPA3-SAE
2f228d364da9 wifi: rtlwifi: rtl8192de: Fix endianness issue in RX path
db5ae2e1826b wifi: rtlwifi: Move code from rtl8192de to rtl8192d-common
d75589a0133d wifi: rtlwifi: Clean up rtl8192d-common a bit
014bba73b525 wifi: rtlwifi: Adjust rtl8192d-common for USB

---
https://github.com/pkshih/rtw.git
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
index d835a27429f0..56b5cd032a9a 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
@@ -892,8 +892,8 @@  static u8 _rtl92c_phy_get_rightchnlplace(u8 chnl)
 	u8 place = chnl;
 
 	if (chnl > 14) {
-		for (place = 14; place < ARRAY_SIZE(channel5g); place++) {
-			if (channel5g[place] == chnl) {
+		for (place = 14; place < ARRAY_SIZE(channel_all); place++) {
+			if (channel_all[place] == chnl) {
 				place++;
 				break;
 			}