public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wifi: rtlwifi: rtl8821ae: Fix media status report
@ 2024-12-17 22:53 Bitterblue Smith
  2024-12-19  3:47 ` Ping-Ke Shih
  2024-12-23  7:57 ` Ping-Ke Shih
  0 siblings, 2 replies; 4+ messages in thread
From: Bitterblue Smith @ 2024-12-17 22:53 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

RTL8821AE is stuck transmitting at the lowest rate allowed by the rate
mask. This is because the firmware doesn't know the device is connected
to a network.

Fix the macros SET_H2CCMD_MSRRPT_PARM_OPMODE and
SET_H2CCMD_MSRRPT_PARM_MACID_IND to work on the first byte of __cmd,
not the second. Now the firmware is correctly notified when the device
is connected to a network and it activates the rate control.

Before (MCS3):

[  5]   0.00-1.00   sec  12.5 MBytes   105 Mbits/sec    0    339 KBytes
[  5]   1.00-2.00   sec  10.6 MBytes  89.1 Mbits/sec    0    339 KBytes
[  5]   2.00-3.00   sec  10.6 MBytes  89.1 Mbits/sec    0    386 KBytes
[  5]   3.00-4.00   sec  10.6 MBytes  89.1 Mbits/sec    0    386 KBytes
[  5]   4.00-5.00   sec  10.2 MBytes  86.0 Mbits/sec    0    427 KBytes

After (MCS9):

[  5]   0.00-1.00   sec  33.9 MBytes   284 Mbits/sec    0    771 KBytes
[  5]   1.00-2.00   sec  31.6 MBytes   265 Mbits/sec    0    865 KBytes
[  5]   2.00-3.00   sec  29.9 MBytes   251 Mbits/sec    0    963 KBytes
[  5]   3.00-4.00   sec  28.2 MBytes   237 Mbits/sec    0    963 KBytes
[  5]   4.00-5.00   sec  26.8 MBytes   224 Mbits/sec    0    963 KBytes

Fixes: 39f40710d0b5 ("rtlwifi: rtl88821ae: Remove usage of private bit manipulation macros")
Cc: stable@vger.kernel.org
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.h b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.h
index c269942b3f4a..af8d17b9e012 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.h
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.h
@@ -197,9 +197,9 @@ enum rtl8821a_h2c_cmd {
 
 /* _MEDIA_STATUS_RPT_PARM_CMD1 */
 #define SET_H2CCMD_MSRRPT_PARM_OPMODE(__cmd, __value)	\
-	u8p_replace_bits(__cmd + 1, __value, BIT(0))
+	u8p_replace_bits(__cmd, __value, BIT(0))
 #define SET_H2CCMD_MSRRPT_PARM_MACID_IND(__cmd, __value)	\
-	u8p_replace_bits(__cmd + 1, __value, BIT(1))
+	u8p_replace_bits(__cmd, __value, BIT(1))
 
 /* AP_OFFLOAD */
 #define SET_H2CCMD_AP_OFFLOAD_ON(__cmd, __value)	\
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH] wifi: rtlwifi: rtl8821ae: Fix media status report
  2024-12-17 22:53 [PATCH] wifi: rtlwifi: rtl8821ae: Fix media status report Bitterblue Smith
@ 2024-12-19  3:47 ` Ping-Ke Shih
  2024-12-19 11:16   ` Bitterblue Smith
  2024-12-23  7:57 ` Ping-Ke Shih
  1 sibling, 1 reply; 4+ messages in thread
From: Ping-Ke Shih @ 2024-12-19  3:47 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> 
> RTL8821AE is stuck transmitting at the lowest rate allowed by the rate
> mask. This is because the firmware doesn't know the device is connected
> to a network.
> 
> Fix the macros SET_H2CCMD_MSRRPT_PARM_OPMODE and
> SET_H2CCMD_MSRRPT_PARM_MACID_IND to work on the first byte of __cmd,
> not the second. Now the firmware is correctly notified when the device
> is connected to a network and it activates the rate control.
> 
> Before (MCS3):
> 
> [  5]   0.00-1.00   sec  12.5 MBytes   105 Mbits/sec    0    339 KBytes
> [  5]   1.00-2.00   sec  10.6 MBytes  89.1 Mbits/sec    0    339 KBytes
> [  5]   2.00-3.00   sec  10.6 MBytes  89.1 Mbits/sec    0    386 KBytes
> [  5]   3.00-4.00   sec  10.6 MBytes  89.1 Mbits/sec    0    386 KBytes
> [  5]   4.00-5.00   sec  10.2 MBytes  86.0 Mbits/sec    0    427 KBytes
> 
> After (MCS9):
> 
> [  5]   0.00-1.00   sec  33.9 MBytes   284 Mbits/sec    0    771 KBytes
> [  5]   1.00-2.00   sec  31.6 MBytes   265 Mbits/sec    0    865 KBytes
> [  5]   2.00-3.00   sec  29.9 MBytes   251 Mbits/sec    0    963 KBytes
> [  5]   3.00-4.00   sec  28.2 MBytes   237 Mbits/sec    0    963 KBytes
> [  5]   4.00-5.00   sec  26.8 MBytes   224 Mbits/sec    0    963 KBytes
> 
> Fixes: 39f40710d0b5 ("rtlwifi: rtl88821ae: Remove usage of private bit manipulation macros")
> Cc: stable@vger.kernel.org
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>

Is this an urgent patch? or it's fine to go via rtw-next?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] wifi: rtlwifi: rtl8821ae: Fix media status report
  2024-12-19  3:47 ` Ping-Ke Shih
@ 2024-12-19 11:16   ` Bitterblue Smith
  0 siblings, 0 replies; 4+ messages in thread
From: Bitterblue Smith @ 2024-12-19 11:16 UTC (permalink / raw)
  To: Ping-Ke Shih, linux-wireless@vger.kernel.org

On 19/12/2024 05:47, Ping-Ke Shih wrote:
> Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
>>
>> RTL8821AE is stuck transmitting at the lowest rate allowed by the rate
>> mask. This is because the firmware doesn't know the device is connected
>> to a network.
>>
>> Fix the macros SET_H2CCMD_MSRRPT_PARM_OPMODE and
>> SET_H2CCMD_MSRRPT_PARM_MACID_IND to work on the first byte of __cmd,
>> not the second. Now the firmware is correctly notified when the device
>> is connected to a network and it activates the rate control.
>>
>> Before (MCS3):
>>
>> [  5]   0.00-1.00   sec  12.5 MBytes   105 Mbits/sec    0    339 KBytes
>> [  5]   1.00-2.00   sec  10.6 MBytes  89.1 Mbits/sec    0    339 KBytes
>> [  5]   2.00-3.00   sec  10.6 MBytes  89.1 Mbits/sec    0    386 KBytes
>> [  5]   3.00-4.00   sec  10.6 MBytes  89.1 Mbits/sec    0    386 KBytes
>> [  5]   4.00-5.00   sec  10.2 MBytes  86.0 Mbits/sec    0    427 KBytes
>>
>> After (MCS9):
>>
>> [  5]   0.00-1.00   sec  33.9 MBytes   284 Mbits/sec    0    771 KBytes
>> [  5]   1.00-2.00   sec  31.6 MBytes   265 Mbits/sec    0    865 KBytes
>> [  5]   2.00-3.00   sec  29.9 MBytes   251 Mbits/sec    0    963 KBytes
>> [  5]   3.00-4.00   sec  28.2 MBytes   237 Mbits/sec    0    963 KBytes
>> [  5]   4.00-5.00   sec  26.8 MBytes   224 Mbits/sec    0    963 KBytes
>>
>> Fixes: 39f40710d0b5 ("rtlwifi: rtl88821ae: Remove usage of private bit manipulation macros")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> 
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>
> 
> Is this an urgent patch? or it's fine to go via rtw-next?
> 
> 

It's not urgent for me, rtw-next is fine.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] wifi: rtlwifi: rtl8821ae: Fix media status report
  2024-12-17 22:53 [PATCH] wifi: rtlwifi: rtl8821ae: Fix media status report Bitterblue Smith
  2024-12-19  3:47 ` Ping-Ke Shih
@ 2024-12-23  7:57 ` Ping-Ke Shih
  1 sibling, 0 replies; 4+ messages in thread
From: Ping-Ke Shih @ 2024-12-23  7:57 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:

> RTL8821AE is stuck transmitting at the lowest rate allowed by the rate
> mask. This is because the firmware doesn't know the device is connected
> to a network.
> 
> Fix the macros SET_H2CCMD_MSRRPT_PARM_OPMODE and
> SET_H2CCMD_MSRRPT_PARM_MACID_IND to work on the first byte of __cmd,
> not the second. Now the firmware is correctly notified when the device
> is connected to a network and it activates the rate control.
> 
> Before (MCS3):
> 
> [  5]   0.00-1.00   sec  12.5 MBytes   105 Mbits/sec    0    339 KBytes
> [  5]   1.00-2.00   sec  10.6 MBytes  89.1 Mbits/sec    0    339 KBytes
> [  5]   2.00-3.00   sec  10.6 MBytes  89.1 Mbits/sec    0    386 KBytes
> [  5]   3.00-4.00   sec  10.6 MBytes  89.1 Mbits/sec    0    386 KBytes
> [  5]   4.00-5.00   sec  10.2 MBytes  86.0 Mbits/sec    0    427 KBytes
> 
> After (MCS9):
> 
> [  5]   0.00-1.00   sec  33.9 MBytes   284 Mbits/sec    0    771 KBytes
> [  5]   1.00-2.00   sec  31.6 MBytes   265 Mbits/sec    0    865 KBytes
> [  5]   2.00-3.00   sec  29.9 MBytes   251 Mbits/sec    0    963 KBytes
> [  5]   3.00-4.00   sec  28.2 MBytes   237 Mbits/sec    0    963 KBytes
> [  5]   4.00-5.00   sec  26.8 MBytes   224 Mbits/sec    0    963 KBytes
> 
> Fixes: 39f40710d0b5 ("rtlwifi: rtl88821ae: Remove usage of private bit manipulation macros")
> Cc: stable@vger.kernel.org
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

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

66ef0289ac99 wifi: rtlwifi: rtl8821ae: Fix media status report

---
https://github.com/pkshih/rtw.git


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-12-23  7:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-17 22:53 [PATCH] wifi: rtlwifi: rtl8821ae: Fix media status report Bitterblue Smith
2024-12-19  3:47 ` Ping-Ke Shih
2024-12-19 11:16   ` Bitterblue Smith
2024-12-23  7:57 ` Ping-Ke Shih

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox