Skip to content

Commit c8bc376

Browse files
Bitterblue SmithKalle Valo
authored andcommitted
wifi: rtl8xxxu: Simplify setting the initial gain
The goal of writing 0x6954341e / 0x6955341e to REG_OFDM0_XA_AGC_CORE1 appears to be setting the initial gain, which is stored in bits 0..6. Bits 7..31 are the same as what the phy init tables write. Modify only bits 0..6 so that we don't have to care about the values of the others. This way we don't have to add another "else if" for the RTL8192FU. Why we need to change the initial gain from the default 0x20 to 0x1e? Not sure. Some of the vendor drivers change it to 0x1e before scanning and then restore it to the original value after. Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/cf91ca69-70e3-4c20-c0b1-e59d452356a1@gmail.com
1 parent cd85c8b commit c8bc376

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7034,10 +7034,8 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw)
70347034
rtl8xxxu_write16(priv, REG_RXFLTMAP2, 0xffff);
70357035
rtl8xxxu_write16(priv, REG_RXFLTMAP0, 0xffff);
70367036

7037-
if (priv->rtl_chip == RTL8188E)
7038-
rtl8xxxu_write32(priv, REG_OFDM0_XA_AGC_CORE1, 0x6955341e);
7039-
else
7040-
rtl8xxxu_write32(priv, REG_OFDM0_XA_AGC_CORE1, 0x6954341e);
7037+
rtl8xxxu_write32_mask(priv, REG_OFDM0_XA_AGC_CORE1,
7038+
OFDM0_X_AGC_CORE1_IGI_MASK, 0x1e);
70417039

70427040
return ret;
70437041

0 commit comments

Comments
 (0)