Skip to content

Commit 9de2040

Browse files
Bitterblue Smithopsiff
authored andcommitted
wifi: rtl8xxxu: Fix HT40 channel config for RTL8192CU, RTL8723AU
[ Upstream commit 5511ba3 ] Flip the response rate subchannel. It was backwards, causing low speeds when using 40 MHz channel width. "iw dev ... station dump" showed a low RX rate, 11M or less. Also fix the channel width field of RF6052_REG_MODE_AG. Tested only with RTL8192CU, but these settings are identical for RTL8723AU. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://patch.msgid.link/1f46571d-855b-43e1-8bfc-abacceb96043@gmail.com Signed-off-by: Sasha Levin <sashal@kernel.org> (cherry picked from commit 40257a2ef1bc19805af016e8213fcfb8a085f6cf) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 800701e commit 9de2040

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

  • drivers/net/wireless/realtek/rtl8xxxu

drivers/net/wireless/realtek/rtl8xxxu/core.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ void rtl8xxxu_gen1_config_channel(struct ieee80211_hw *hw)
12521252
opmode &= ~BW_OPMODE_20MHZ;
12531253
rtl8xxxu_write8(priv, REG_BW_OPMODE, opmode);
12541254
rsr &= ~RSR_RSC_BANDWIDTH_40M;
1255-
if (sec_ch_above)
1255+
if (!sec_ch_above)
12561256
rsr |= RSR_RSC_UPPER_SUB_CHANNEL;
12571257
else
12581258
rsr |= RSR_RSC_LOWER_SUB_CHANNEL;
@@ -1321,9 +1321,8 @@ void rtl8xxxu_gen1_config_channel(struct ieee80211_hw *hw)
13211321

13221322
for (i = RF_A; i < priv->rf_paths; i++) {
13231323
val32 = rtl8xxxu_read_rfreg(priv, i, RF6052_REG_MODE_AG);
1324-
if (hw->conf.chandef.width == NL80211_CHAN_WIDTH_40)
1325-
val32 &= ~MODE_AG_CHANNEL_20MHZ;
1326-
else
1324+
val32 &= ~MODE_AG_BW_MASK;
1325+
if (hw->conf.chandef.width != NL80211_CHAN_WIDTH_40)
13271326
val32 |= MODE_AG_CHANNEL_20MHZ;
13281327
rtl8xxxu_write_rfreg(priv, i, RF6052_REG_MODE_AG, val32);
13291328
}

0 commit comments

Comments
 (0)