From: Ping-Ke Shih <pkshih@realtek.com>
To: Bitterblue Smith <rtl8821cerfe2@gmail.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: Jes Sorensen <Jes.Sorensen@gmail.com>
Subject: RE: [PATCH 3/3] wifi: rtl8xxxu: Simplify setting the initial gain
Date: Tue, 18 Apr 2023 01:13:22 +0000 [thread overview]
Message-ID: <5d839cb6cea043de9f79f6490f9ccfb2@realtek.com> (raw)
In-Reply-To: <cf91ca69-70e3-4c20-c0b1-e59d452356a1@gmail.com>
> -----Original Message-----
> From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> Sent: Tuesday, April 18, 2023 1:08 AM
> To: linux-wireless@vger.kernel.org
> Cc: Jes Sorensen <Jes.Sorensen@gmail.com>; Ping-Ke Shih <pkshih@realtek.com>
> 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@gmail.com>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
> ---
> 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.
next prev parent reply other threads:[~2023-04-18 1:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-17 17:05 [PATCH 1/3] wifi: rtl8xxxu: Don't print the vendor/product/serial Bitterblue Smith
2023-04-17 17:07 ` [PATCH 2/3] wifi: rtl8xxxu: Add rtl8xxxu_write{8,16,32}_{set,clear} Bitterblue Smith
2023-04-18 1:14 ` Ping-Ke Shih
2023-04-17 17:08 ` [PATCH 3/3] wifi: rtl8xxxu: Simplify setting the initial gain Bitterblue Smith
2023-04-18 1:13 ` Ping-Ke Shih [this message]
2023-04-18 11:28 ` Bitterblue Smith
2023-04-18 1:16 ` [PATCH 1/3] wifi: rtl8xxxu: Don't print the vendor/product/serial Ping-Ke Shih
2023-04-20 12:35 ` Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5d839cb6cea043de9f79f6490f9ccfb2@realtek.com \
--to=pkshih@realtek.com \
--cc=Jes.Sorensen@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=rtl8821cerfe2@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).