From e1c50c04f9c57445caee6e4390d6411e8ab4826d Mon Sep 17 00:00:00 2001 From: Douglas Teles Date: Wed, 24 Jun 2026 12:11:20 -0300 Subject: [PATCH] RTL8188EUS: out-of-tree driver para resolver auth fail (#19) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue archr-linux/Arch-R#19: dongles USB com chipset RTL8188EUS (TP- Link TL-WN722N v3, Edimax EW-7811Un, vários no-name) escaneiam SSIDs mas falham na autenticação WPA2 — handshake 4-way não completa, ESS fica em "Connecting..." até timeout. Histórico: tentamos antes o ajuste de IWD (UseDefaultInterface, AddressRandomization), bump IWD 3.9 → 3.10, e o patch upstream rtl8xxxu de firmware upload block size 128 → 196 (`projects/ArchR/ packages/linux/patches/6.12-LTS/0050-wifi-rtl8xxxu-Fix-RTL8188EU- firmware-upload-block-size.patch`). Nenhum desses resolveu para os usuários que reportaram — o rtl8xxxu in-tree continuamente trava no handshake nesse chip específico. A solução conhecida em outras distros (Arch, Debian, Manjaro, Kali, TWRP, Postmarket) é usar o fork `aircrack-ng/rtl8188eus` mantido especificamente para esse chip. Ele tem o handshake testado com iwd e wpa_supplicant. Pacote adicionado: projects/ArchR/packages/linux-drivers/RTL8188EUS/ ├── package.mk (build out-of-tree 8188eu.ko) ├── modprobe.d/ │ └── 00-rtl8188eus.conf (tunables: LED on, no double MAC random) └── udev.d/ └── 99-rtl8188eus.rules (unbind rtl8xxxu da interface USB específica nos USB IDs do 8188EUS e force-load 8188eu) A udev rule cobre os IDs comuns: 0bda:0179 / 0bda:8179 / 0bda:8189 — Realtek de fábrica 7392:7811 — Edimax EW-7811Un 056e:4008 — Elecom WDC-150SU2M Não fazemos blacklist global do rtl8xxxu — ele continua sendo o driver de RTL8192EU, RTL8723BU, RTL8188CU etc. (que funcionam bem com ele). Só desbinda do device USB específico quando um 8188EUS aparece e load o 8188eu in its place. RTL8188EUS adicionado a ADDITIONAL_DRIVERS em projects/ArchR/devices/ RK3326/options para que a build inclua o módulo no rootfs. Co-Authored-By: Claude Opus 4.7 --- projects/ArchR/devices/RK3326/options | 2 +- .../RTL8188EUS/modprobe.d/00-rtl8188eus.conf | 10 ++++++ .../linux-drivers/RTL8188EUS/package.mk | 35 ++++++++++++++++++ .../RTL8188EUS/udev.d/99-rtl8188eus.rules | 36 +++++++++++++++++++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 projects/ArchR/packages/linux-drivers/RTL8188EUS/modprobe.d/00-rtl8188eus.conf create mode 100644 projects/ArchR/packages/linux-drivers/RTL8188EUS/package.mk create mode 100644 projects/ArchR/packages/linux-drivers/RTL8188EUS/udev.d/99-rtl8188eus.rules diff --git a/projects/ArchR/devices/RK3326/options b/projects/ArchR/devices/RK3326/options index 4831265998..f87b57ce9b 100644 --- a/projects/ArchR/devices/RK3326/options +++ b/projects/ArchR/devices/RK3326/options @@ -61,7 +61,7 @@ # for a list of additional drivers see packages/linux-drivers # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" - ADDITIONAL_DRIVERS="RTL8812AU RTL8814AU RTL8821AU RTL8821CU RTL88x2BU RTL8831 AIC8800 mali-bifrost" + ADDITIONAL_DRIVERS="RTL8188EUS RTL8812AU RTL8814AU RTL8821AU RTL8821CU RTL88x2BU RTL8831 AIC8800 mali-bifrost" # Additional Firmware to use ( ) # Space separated list is supported, diff --git a/projects/ArchR/packages/linux-drivers/RTL8188EUS/modprobe.d/00-rtl8188eus.conf b/projects/ArchR/packages/linux-drivers/RTL8188EUS/modprobe.d/00-rtl8188eus.conf new file mode 100644 index 0000000000..745253cc54 --- /dev/null +++ b/projects/ArchR/packages/linux-drivers/RTL8188EUS/modprobe.d/00-rtl8188eus.conf @@ -0,0 +1,10 @@ +# Prefer the out-of-tree r8188eu driver for RTL8188EUS chipset over +# the in-tree rtl8xxxu (which scans but can't complete WPA2 handshake +# reliably — see archr-linux/Arch-R#19). rtl8xxxu still binds to other +# Realtek USB chips (RTL8192EU, RTL8723BU, etc.), so a blanket +# blacklist of rtl8xxxu would break unrelated dongles. +# +# Default tunables for the out-of-tree driver — IWD does its own MAC +# randomization, power management belongs to mac80211, and we want LED +# blink on activity so users can see the dongle is alive. +options 8188eu rtw_drv_log_level=0 rtw_led_ctrl=1 rtw_power_mgnt=1 diff --git a/projects/ArchR/packages/linux-drivers/RTL8188EUS/package.mk b/projects/ArchR/packages/linux-drivers/RTL8188EUS/package.mk new file mode 100644 index 0000000000..7eb076cc1c --- /dev/null +++ b/projects/ArchR/packages/linux-drivers/RTL8188EUS/package.mk @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (C) 2026-present ArchR (https://github.com/archr-linux/Arch-R) + +PKG_NAME="RTL8188EUS" +PKG_VERSION="ec90af2b3f2f7d2956c7c25d0bbeb536e9ed5f9d" +PKG_LICENSE="GPL" +PKG_SITE="https://github.com/aircrack-ng/rtl8188eus" +PKG_URL="${PKG_SITE}.git" +PKG_LONGDESC="Realtek RTL8188EUS USB WiFi driver (out-of-tree). The +in-tree rtl8xxxu claims this chip but fails the WPA2 4-way handshake +on RTL8188EUS dongles (scan ok, auth times out — issue #19). The +aircrack-ng fork is the maintained driver that completes the +handshake with iwd/wpa_supplicant; the shipped udev rule unbinds +rtl8xxxu from the specific USB IDs at hotplug and lets 8188eu take +over." +PKG_TOOLCHAIN="make" +PKG_IS_KERNEL_PKG="yes" +GET_HANDLER_SUPPORT="git" + +pre_make_target() { + unset LDFLAGS +} + +make_target() { + make V=1 \ + ARCH=${TARGET_KERNEL_ARCH} \ + KSRC=$(kernel_path) \ + CROSS_COMPILE=${TARGET_KERNEL_PREFIX} \ + CONFIG_POWER_SAVING=y +} + +makeinstall_target() { + mkdir -p ${INSTALL}/$(get_full_module_dir)/kernel/drivers/net/wireless/realtek/r8188eu + cp 8188eu.ko ${INSTALL}/$(get_full_module_dir)/kernel/drivers/net/wireless/realtek/r8188eu/ +} diff --git a/projects/ArchR/packages/linux-drivers/RTL8188EUS/udev.d/99-rtl8188eus.rules b/projects/ArchR/packages/linux-drivers/RTL8188EUS/udev.d/99-rtl8188eus.rules new file mode 100644 index 0000000000..b1ffa5715d --- /dev/null +++ b/projects/ArchR/packages/linux-drivers/RTL8188EUS/udev.d/99-rtl8188eus.rules @@ -0,0 +1,36 @@ +# Force the out-of-tree r8188eu driver for RTL8188EUS dongles, instead +# of the in-tree rtl8xxxu (which scans but can't complete WPA2 4-way +# handshake on this chip — see archr-linux/Arch-R#19). +# +# rtl8xxxu is loaded for many other RTL chips and we don't want to +# blacklist it globally. Instead, this rule catches the 8188EUS USB +# IDs at hotplug time, unbinds rtl8xxxu from the interface, and +# (re)loads 8188eu. +# +# Known RTL8188EUS USB IDs (vendor:product): +# 0bda:0179 Realtek RTL8188EUS Wireless Adapter +# 0bda:8179 Realtek RTL8188EUS Wireless Adapter (most common) +# 0bda:8189 Realtek RTL8188EUS / "TP-Link TL-WN722N v3" +# 7392:7811 Edimax EW-7811Un (RTL8188EUS rebadge) +# 056e:4008 Elecom WDC-150SU2M (RTL8188EUS rebadge) + +ACTION!="add", GOTO="rtl8188eus_end" +SUBSYSTEM!="usb", GOTO="rtl8188eus_end" +ENV{DEVTYPE}!="usb_device", GOTO="rtl8188eus_end" + +ATTR{idVendor}=="0bda", ATTR{idProduct}=="0179", GOTO="rtl8188eus_swap" +ATTR{idVendor}=="0bda", ATTR{idProduct}=="8179", GOTO="rtl8188eus_swap" +ATTR{idVendor}=="0bda", ATTR{idProduct}=="8189", GOTO="rtl8188eus_swap" +ATTR{idVendor}=="7392", ATTR{idProduct}=="7811", GOTO="rtl8188eus_swap" +ATTR{idVendor}=="056e", ATTR{idProduct}=="4008", GOTO="rtl8188eus_swap" +GOTO="rtl8188eus_end" + +LABEL="rtl8188eus_swap" +# Unbind apenas a interface USB específica do rtl8xxxu (não tira o +# módulo do kernel — outros dongles RTL podem estar conectados ao +# mesmo tempo); depois carrega 8188eu, que vai bindar pela alias +# table. ${BUSNUM} e ${DEVNUM} são fornecidos por udev e identificam +# o device USB sem ambiguidade. +RUN+="/usr/bin/sh -c 'busid=$(basename %p); for drv in /sys/bus/usb/drivers/rtl8xxxu; do [ -e \"$drv/$busid\" ] && echo \"$busid\" > \"$drv/unbind\" 2>/dev/null; done; modprobe 8188eu 2>/dev/null'" + +LABEL="rtl8188eus_end"