Skip to contentSkip to conversation

wifi: rtw88: 8822b: Relax ETSI EDCCA threshold on 2.4 GHz

PATCH In review Josef Schlehofer 2 participants 3 messages Oct 11 – Nov 3 Realtek wireless driver (rtw88)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: rtw88: 8822b: Relax ETSI EDCCA threshold on 2.4 GHz

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.

---
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(+)
drivers/net/wireless/realtek/rtw88/rtw8822b.c +6 -0
index a56c8befa..cd39888ae 100644
@@ -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;
drivers/net/wireless/realtek/rtw88/rtw8822b.h +2 -0
index 9fca9ba67..1083953e0 100644
@@ -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
Signature · 1 line
2.54.0 (Apple Git-157)
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 13 lines · Josef Schlehofer

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.

Quoted 8 lines

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.

[...]

drivers/net/wireless/realtek/rtw88/rtw8822b.h _rtw_write32s_mask(struct rtw_dev *rtwdev, u32 addr, u32 mask, u32 data) · line 155

Quoted 2 lines
drivers/net/wireless/realtek/rtw88/rtw8822b.h +2 -0
+/* 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.

maintainer
#2 lore raw
In reply to Josef Schlehofer
Quoted 16 lines · Josef Schlehofer

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.

Quoted 6 lines

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.

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

b0435910e47d wifi: rtw88: 8822b: Relax ETSI EDCCA threshold on 2.4 GHz

---
https://github.com/pkshih/rtw.git