linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: not-eexto <eexto@aol.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: RE: [PATCH] wifi: rtw88: 8821c: Add HP single-antenna quirk
Date: Sun, 13 Sep 2026 02:15:50 +0000	[thread overview]
Message-ID: <3b3788a7c4f240899e630938a6c7b472@realtek.com> (raw)
In-Reply-To: <20260911100904.50320-1-eexto@aol.com>

not-eexto <eexto@aol.com> wrote:
> Certain HP laptop platforms with RTL8821CE (PCI ID 10ec:c821, subsystem
> 103c:831a) are manufactured with only a single physical antenna wire
> connected to the Aux/S1 port (Port 2). As documented in the OEM Windows
> INF file (netrtwlane.inf):
>   "single ant(connect to right one S1)"
> 
> However, the eFuse on these chipsets reports RFE Type 2 (Main antenna,
> Port 1), causing the hardware SPDT RF switch to route to an unconnected
> port under Linux. This leads to severe signal attenuation (~ -86 dBm)
> and frequent beacon-loss disconnections.
> 
> Add an automatic quirk in rtw8821c_read_efuse() for HP subsystem
> 10ec:c821 [103c:831a] that overrides efuse->rfe_option and
> efuse->rfe_option_full to 4 (Aux), routing the RF path to the physically
> connected antenna.
> 
> Signed-off-by: not-eexto <eexto@aol.com>

Should use your full real name.

You sent the same patch by different mail address. I'll drop previous one.

> ---
>  rtw8821c.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
> b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
> index 9f0964d..32c7de5 100644
> --- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c
> +++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c
> @@ -15,6 +15,9 @@
>  #include "debug.h"
>  #include "bf.h"
>  #include "regd.h"
> +#if IS_ENABLED(CONFIG_PCI)
> +#include <linux/pci.h>
> +#endif

If this is the only one platform which needs this kind of quirk. Add an entry
to rtw_pci_quirks[].

> 
>  static const s8 lna_gain_table_0[8] = {22, 8, -6, -22, -31, -40, -46, -52};
>  static const s8 lna_gain_table_1[16] = {10, 6, 2, -2, -6, -10, -14, -17,
> @@ -56,6 +59,21 @@ static int rtw8821c_read_efuse(struct rtw_dev *rtwdev, u8 *log_map)
> 
>         efuse->rfe_option = map->rfe_option & 0x1f;
>         efuse->rfe_option_full = map->rfe_option;
> +
> +#if IS_ENABLED(CONFIG_PCI)
> +       if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE && dev_is_pci(rtwdev->dev)) {
> +               struct pci_dev *pdev = to_pci_dev(rtwdev->dev);
> +
> +               if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
> +                   pdev->device == 0xc821 &&
> +                   pdev->subsystem_vendor == 0x103c &&
> +                   pdev->subsystem_device == 0x831a) {
> +                       efuse->rfe_option = 4;
> +                       efuse->rfe_option_full = 4;

I don't see rtw88 has ' rfe_option_full' ?

> +                       rtw_info(rtwdev, "HP quirk auto-detected (10ec:c821 [103c:831a]): forced RFE
> option 4 (Aux antenna S1)\n");
> +               }
> +       }
> +#endif
>         efuse->rf_board_option = map->rf_board_option;
>         efuse->crystal_cap = map->xtal_k;
>         efuse->pa_type_2g = map->pa_type;
> --
> 2.43.0


  reply	other threads:[~2026-09-13  2:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260911100904.50320-1-eexto.ref@aol.com>
2026-09-11 10:09 ` [PATCH] wifi: rtw88: 8821c: Add HP single-antenna quirk not-eexto
2026-09-13  2:15   ` Ping-Ke Shih [this message]
2026-09-11 10:56 not-eexto

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=3b3788a7c4f240899e630938a6c7b472@realtek.com \
    --to=pkshih@realtek.com \
    --cc=eexto@aol.com \
    --cc=linux-wireless@vger.kernel.org \
    /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).