* [PATCH] wifi: rtw88: 8821c: Add HP single-antenna quirk
@ 2026-09-11 10:56 not-eexto
0 siblings, 0 replies; 5+ messages in thread
From: not-eexto @ 2026-09-11 10:56 UTC (permalink / raw)
To: pkshih; +Cc: linux-wireless, not-eexto
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 <p17232763@gmail.com>
---
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
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;
+ 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
^ permalink raw reply related [flat|nested] 5+ messages in thread[parent not found: <20260911100904.50320-1-eexto.ref@aol.com>]
* [PATCH] wifi: rtw88: 8821c: Add HP single-antenna quirk
[not found] <20260911100904.50320-1-eexto.ref@aol.com>
@ 2026-09-11 10:09 ` not-eexto
2026-09-13 2:15 ` Ping-Ke Shih
0 siblings, 1 reply; 5+ messages in thread
From: not-eexto @ 2026-09-11 10:09 UTC (permalink / raw)
To: pkshih; +Cc: linux-wireless, not-eexto
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>
---
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
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;
+ 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
^ permalink raw reply related [flat|nested] 5+ messages in thread* RE: [PATCH] wifi: rtw88: 8821c: Add HP single-antenna quirk
2026-09-11 10:09 ` not-eexto
@ 2026-09-13 2:15 ` Ping-Ke Shih
2026-09-18 19:59 ` Paolo Lazzaroni
0 siblings, 1 reply; 5+ messages in thread
From: Ping-Ke Shih @ 2026-09-13 2:15 UTC (permalink / raw)
To: not-eexto; +Cc: linux-wireless@vger.kernel.org
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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] wifi: rtw88: 8821c: Add HP single-antenna quirk
2026-09-13 2:15 ` Ping-Ke Shih
@ 2026-09-18 19:59 ` Paolo Lazzaroni
2026-09-20 1:22 ` Ping-Ke Shih
0 siblings, 1 reply; 5+ messages in thread
From: Paolo Lazzaroni @ 2026-09-18 19:59 UTC (permalink / raw)
To: pkshih; +Cc: linux-wireless, Paolo Lazzaroni
On Sun, Sep 13, 2026 at 02:15 UTC, Ping-Ke Shih <pkshih@realtek.com> wrote:
> Should use your full real name.
>
> You sent the same patch by different mail address. I'll drop previous one.
Both patch submissions were identical, but please ignore the submission from
p17232763@gmail.com. I will use this address (eexto@aol.com) with my full
legal name (Paolo Lazzaroni) for all future submissions and v2.
> I don't see rtw88 has ' rfe_option_full' ?
Apologies, the previous patch was based on an out-of-tree backport tree.
I have checked out rtw-next where rfe_option_full does not exist, and will
only set efuse->rfe_option in v2.
> If this is the only one platform which needs this kind of quirk. Add an entry
> to rtw_pci_quirks[].
Regarding rtw_pci_quirks[]:
The reason I matched the PCI subsystem ID (10ec:c821 [103c:831a]) rather
than DMI in rtw_pci_quirks[] is that HP assigns this specific subsystem
ID across a family of laptop platforms (e.g. HP 15-da, 15-db, and related
chassis) to denote the single physical antenna connected to Aux/S1.
This is documented in the OEM Windows driver INF (netrtwlane.inf):
"PCI\VEN_10EC&DEV_C821&SUBSYS_831A103C ;;single ant(connect to right one S1)"
If we use DMI matching in rtw_pci_quirks[], it would only match this specific
laptop SKU ("HP Laptop 15-da0xxx" / "4XW76EA#ABZ"), leaving other HP models
sharing this identical 103c:831a single-antenna card with severe signal loss.
However, I understand that inspecting PCI structures inside rtw8821c_read_efuse()
violates bus abstraction for rtw8821c.c.
Would you prefer:
Option A: Keep the PCI subsystem match, but handle it cleanly in rtw_pci_probe()
(e.g., setting a flag or rfe_option override in rtwdev before chip setup)?
Option B: Add a DMI entry to rtw_pci_quirks[] matching this platform?
^ permalink raw reply [flat|nested] 5+ messages in thread* RE: [PATCH] wifi: rtw88: 8821c: Add HP single-antenna quirk
2026-09-18 19:59 ` Paolo Lazzaroni
@ 2026-09-20 1:22 ` Ping-Ke Shih
0 siblings, 0 replies; 5+ messages in thread
From: Ping-Ke Shih @ 2026-09-20 1:22 UTC (permalink / raw)
To: Paolo Lazzaroni; +Cc: linux-wireless@vger.kernel.org
Paolo Lazzaroni <eexto@aol.com> wrote:
> > If this is the only one platform which needs this kind of quirk. Add an entry
> > to rtw_pci_quirks[].
>
> Regarding rtw_pci_quirks[]:
>
> The reason I matched the PCI subsystem ID (10ec:c821 [103c:831a]) rather
> than DMI in rtw_pci_quirks[] is that HP assigns this specific subsystem
> ID across a family of laptop platforms (e.g. HP 15-da, 15-db, and related
> chassis) to denote the single physical antenna connected to Aux/S1.
> This is documented in the OEM Windows driver INF (netrtwlane.inf):
> "PCI\VEN_10EC&DEV_C821&SUBSYS_831A103C ;;single ant(connect to right one S1)"
>
> If we use DMI matching in rtw_pci_quirks[], it would only match this specific
> laptop SKU ("HP Laptop 15-da0xxx" / "4XW76EA#ABZ"), leaving other HP models
> sharing this identical 103c:831a single-antenna card with severe signal loss.
>
> However, I understand that inspecting PCI structures inside rtw8821c_read_efuse()
> violates bus abstraction for rtw8821c.c.
>
> Would you prefer:
> Option A: Keep the PCI subsystem match, but handle it cleanly in rtw_pci_probe()
> (e.g., setting a flag or rfe_option override in rtwdev before chip setup)?
> Option B: Add a DMI entry to rtw_pci_quirks[] matching this platform?
I prefer option A, but yes, please handle it cleanly in pci.c.
You can flag a quirk at pci.c, and update rfe_option in 8821c.c.
Ping-Ke
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-09-20 1:22 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-11 10:56 [PATCH] wifi: rtw88: 8821c: Add HP single-antenna quirk not-eexto
[not found] <20260911100904.50320-1-eexto.ref@aol.com>
2026-09-11 10:09 ` not-eexto
2026-09-13 2:15 ` Ping-Ke Shih
2026-09-18 19:59 ` Paolo Lazzaroni
2026-09-20 1:22 ` Ping-Ke Shih
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.