Skip to content

Commit

Permalink
wifi: rtlwifi: rtl8821ae: Fix media status report
Browse files Browse the repository at this point in the history
mainline inclusion
from mainline-v6.14-rc1
category: bugfix

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: 39f4071 ("rtlwifi: rtl88821ae: Remove usage of private bit manipulation macros")
Cc: [email protected]
Signed-off-by: Bitterblue Smith <[email protected]>
Acked-by: Ping-Ke Shih <[email protected]>
Signed-off-by: Ping-Ke Shih <[email protected]>
Link: https://patch.msgid.link/[email protected]
(cherry picked from commit 66ef0289ac99e155d206ddaa0fdfad09ae3cd007)
Signed-off-by: Wentao Guan <[email protected]>
  • Loading branch information
Bitterblue Smith authored and opsiff committed Jan 26, 2025
1 parent a6b7605 commit a202546
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit a202546

Please sign in to comment.