Search Linux Wireless

RE: [PATCH 3/3] wifi: rtl8xxxu: Simplify setting the initial gain

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Bitterblue Smith <rtl8821cerfe2@xxxxxxxxx>
> Sent: Tuesday, April 18, 2023 1:08 AM
> To: linux-wireless@xxxxxxxxxxxxxxx
> Cc: Jes Sorensen <Jes.Sorensen@xxxxxxxxx>; Ping-Ke Shih <pkshih@xxxxxxxxxxx>
> Subject: [PATCH 3/3] 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.

When WiFi gets connected, it will try to adjust initial gain for target AP.
If we scan in this situation, change it to 0x1e to have better coverage to
find APs.

> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@xxxxxxxxx>

Reviewed-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx>

> ---
>  drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> index 03c0aaa9141c..fd8c8c6d53d6 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> @@ -7034,10 +7034,8 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw)
>         rtl8xxxu_write16(priv, REG_RXFLTMAP2, 0xffff);
>         rtl8xxxu_write16(priv, REG_RXFLTMAP0, 0xffff);
> 
> -       if (priv->rtl_chip == RTL8188E)
> -               rtl8xxxu_write32(priv, REG_OFDM0_XA_AGC_CORE1, 0x6955341e);
> -       else
> -               rtl8xxxu_write32(priv, REG_OFDM0_XA_AGC_CORE1, 0x6954341e);
> +       rtl8xxxu_write32_mask(priv, REG_OFDM0_XA_AGC_CORE1,
> +                             OFDM0_X_AGC_CORE1_IGI_MASK, 0x1e);
> 
>         return ret;
> 
> --
> 2.39.2
> 
> ------Please consider the environment before printing this e-mail.




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux