Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH rtw-next] wifi: rtw88: 8822b: Relax ETSI EDCCA threshold on 2.4 GHz
@ 2026-10-11 20:45 Josef Schlehofer
  2026-10-19  3:49 ` Ping-Ke Shih
  0 siblings, 1 reply; 2+ messages in thread
From: Josef Schlehofer @ 2026-10-11 20:45 UTC (permalink / raw)
  To: Ping-Ke Shih; +Cc: linux-wireless

The RTL8822B has no firmware-managed adaptivity, so rtw88 sets
the EDCCA thresholds in the driver. Under ETSI, the current rule
uses L2H = min(IGI, 36), at most about -74 dBm.

On a TP-Link Archer T4U v3 (RTL8812BU) operating as a 2.4 GHz AP,
in-band energy, mostly from the adapter's own USB 3 link, kept IGI
at 0x2a and L2H at 36. The AP was not seen in any of 5 scans, and
the driver reported "failed to get tx report from firmware".

With min(max(IGI + 8, 48), 50), the AP was seen in 4/5 scans on the
same port and boot (16/19 across repeated runs), with no TX report
failures and no change in the false alarm rate.

EN 300 328 V2.2.2 tests detection at -70 dBm/MHz for a 20 dBm EIRP
transmitter, about -57 dBm over 20 MHz.

Use the normal threshold, max(IGI + 8, 48), on 2.4 GHz under ETSI,
capped at 50 (nominally -60 dBm). Keep the existing rule on 5 GHz
and in JP.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
---
How other drivers handle ETSI energy detect: rtw89 has no regional
EDCCA mode (it does not block without a station and never goes below
-62 dBm once linked); mt76x02 and mt7603 keep their ETSI ED/CCA
blocking off by default since 2019 ("stability issues"); ath9k caps
its CCA noise floor at -60 dBm for non-FCC boards; Realtek's 88x2bu
vendor driver ships adaptivity disabled and its 802.11ax driver uses
-60 dBm for CE.

 drivers/net/wireless/realtek/rtw88/rtw8822b.c | 6 ++++++
 drivers/net/wireless/realtek/rtw88/rtw8822b.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822b.c b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
index a56c8befa..cd39888ae 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
@@ -1565,6 +1565,12 @@ static void rtw8822b_adaptivity(struct rtw_dev *rtwdev)
 	if (dm_info->edcca_mode == RTW_EDCCA_NORMAL) {
 		l2h = max_t(s8, igi + EDCCA_IGI_L2H_DIFF, EDCCA_TH_L2H_LB);
 		h2l = l2h - EDCCA_L2H_H2L_DIFF_NORMAL;
+	} else if (rtwdev->regd.dfs_region == NL80211_DFS_ETSI &&
+		   rtwdev->hal.current_band_type == RTW_BAND_2G) {
+		/* follow the normal threshold, capped for EN 300 328 */
+		l2h = max_t(s8, igi + EDCCA_IGI_L2H_DIFF, EDCCA_TH_L2H_LB);
+		l2h = min_t(s8, l2h, RTW8822B_EDCCA_ETSI_2G);
+		h2l = l2h - EDCCA_L2H_H2L_DIFF;
 	} else {
 		l2h = min_t(s8, igi, dm_info->l2h_th_ini);
 		h2l = l2h - EDCCA_L2H_H2L_DIFF;
diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822b.h b/drivers/net/wireless/realtek/rtw88/rtw8822b.h
index 9fca9ba67..1083953e0 100644
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.h
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.h
@@ -151,6 +151,8 @@ _rtw_write32s_mask(struct rtw_dev *rtwdev, u32 addr, u32 mask, u32 data)
 
 #define RTW8822B_EDCCA_MAX	0x7f
 #define RTW8822B_EDCCA_SRC_DEF	1
+/* nominally -60 dBm: 3 dB below the EN 300 328 level at 20 dBm e.i.r.p. */
+#define RTW8822B_EDCCA_ETSI_2G	50
 #define REG_HTSTFWT	0x800
 #define REG_RXCCAMSK	0x814
 #define REG_L1WT	0x83c
-- 
2.54.0 (Apple Git-157)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH rtw-next] wifi: rtw88: 8822b: Relax ETSI EDCCA threshold on 2.4 GHz
  2026-10-11 20:45 [PATCH rtw-next] wifi: rtw88: 8822b: Relax ETSI EDCCA threshold on 2.4 GHz Josef Schlehofer
@ 2026-10-19  3:49 ` Ping-Ke Shih
  0 siblings, 0 replies; 2+ messages in thread
From: Ping-Ke Shih @ 2026-10-19  3:49 UTC (permalink / raw)
  To: Josef Schlehofer; +Cc: linux-wireless@vger.kernel.org

Josef Schlehofer <pepe.schlehofer@gmail.com> wrote:
> The RTL8822B has no firmware-managed adaptivity, so rtw88 sets
> the EDCCA thresholds in the driver. Under ETSI, the current rule
> uses L2H = min(IGI, 36), at most about -74 dBm.
> 
> On a TP-Link Archer T4U v3 (RTL8812BU) operating as a 2.4 GHz AP,
> in-band energy, mostly from the adapter's own USB 3 link, kept IGI
> at 0x2a and L2H at 36. The AP was not seen in any of 5 scans, and
> the driver reported "failed to get tx report from firmware".
> 
> With min(max(IGI + 8, 48), 50), the AP was seen in 4/5 scans on the
> same port and boot (16/19 across repeated runs), with no TX report
> failures and no change in the false alarm rate.
> 
> EN 300 328 V2.2.2 tests detection at -70 dBm/MHz for a 20 dBm EIRP
> transmitter, about -57 dBm over 20 MHz.
> 
> Use the normal threshold, max(IGI + 8, 48), on 2.4 GHz under ETSI,
> capped at 50 (nominally -60 dBm). Keep the existing rule on 5 GHz
> and in JP.
> 
> Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>

[...]

> +/* nominally -60 dBm: 3 dB below the EN 300 328 level at 20 dBm e.i.r.p. */
> +#define RTW8822B_EDCCA_ETSI_2G 50

For the record, I consulted internally that the hardware isn't very accurate,
but with 3 dB reduction, it should be fine. 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-19  3:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-11 20:45 [PATCH rtw-next] wifi: rtw88: 8822b: Relax ETSI EDCCA threshold on 2.4 GHz Josef Schlehofer
2026-10-19  3:49 ` Ping-Ke Shih

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox