Skip to content

Configure rtl8xxxu for TP Link Wifi USB Dongle

How to handle TP-Link TL-WN823N v2/v3 on Gentoo Linux when rtl8xxxu is built into the kernel, by installing the out-of-tree RTL8192EU driver and preventing driver binding conflicts


Install eselect-repository

emerge --ask app-eselect/eselect-repository

Install net-wireless/rtl8192eu from guru repository

eselect repository enable guru
emaint sync -r guru
emerge --ask net-wireless/rtl8192eu

Install and configure useflags for sys-kernel/linux-firmware package

echo "sys-kernel/linux-firmware savedconfig" > /etc/portage/package.use/linux-firmware
emerge --ask sys-kernel/linux-firmware

Create a backup of default file for linux-firmware

cp -v /etc/portage/savedconfig/sys-kernel/linux-firmware-20260110 \
    /etc/portage/savedconfig/sys-kernel/linux-firmware-20260110.bak

Replace with firmware discovered from dmesg to the active file

dmesg | awk '
/(Direct firmware load for|Loading firmware:)/ {
  f=$NF
  if (f ~ /\.(bin|db)$/) {
    d=f
    if (f ~ /\//) { sub(/\/[^\/]+$/, "/", d); print d }
    print f
  }
}' | sort -u > /etc/portage/savedconfig/sys-kernel/linux-firmware-20260110

Confirm that our linux-firmware file contains the correct firmware lines

$ cat /etc/portage/savedconfig/sys-kernel/linux-firmware-20260110
i915/
i915/skl_dmc_ver1_27.bin
regulatory.db
rtlwifi/
rtlwifi/rtl8192eu_nic.bin

Create linux-firmware file for being our default savedconfig file

cp -v /etc/portage/savedconfig/sys-kernel/linux-firmware-20260110 /etc/portage/savedconfig/sys-kernel/linux-firmware    

Recompile sys-kernel/linux-firmware to activate our new linux-firmware file

emerge --ask sys-kernel/linux-firmware

We want to store the linux-firmware-20260110 file as it is so we hit -7 to skip replacement of file

etc-update

Now reboot the PC to see everything is loading as we expect us it to do

reboot

After we have booted up the system again let´s see if everything is loaded as it should be

dmesg | awk '
/Loading firmware/ {
  sub(/^.*Loading firmware[: ]+/, "Loading firmware: ")
  print
}' | sort -u

Output from above awk command

Loading firmware: i915/skl_dmc_ver1_27.bin
Loading firmware: regulatory.db
Loading firmware: rtlwifi/rtl8192eu_nic.bin
Loading firmware: rtlwifi/rtl8192eu_nic.bin

We can also confirm everything with dmesg command and it should output same as above example

dmesg | awk '/Loading firmware/ { sub(/^.*Loading firmware[: ]+/, "Loading firmware: "); print }' | sort -u
  • Everything is now correct installed and we use savedconfig

Now re-plug the wifi dongle and you should see below message

dmesg
[ 4216.386854] usb 1-9.3: USB disconnect, device number 7
[ 4216.453041] rtl8192eu 1-9.3:1.0: Runtime PM usage count underflow!
[ 4217.619626] usb 1-9.3: new high-speed USB device number 8 using xhci_hcd
[ 4217.723573] usb 1-9.3: New USB device found, idVendor=2357, idProduct=0109, bcdDevice= 2.00
[ 4217.723576] usb 1-9.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4217.723578] usb 1-9.3: Product: 802.11n NIC 
[ 4217.723580] usb 1-9.3: Manufacturer: Realtek 
[ 4217.723582] usb 1-9.3: SerialNumber: 00e04c000001
[ 4217.783799] usb 1-9.3: RTL8192EU rev B (SMIC) romver 0, 2T2R, TX queues 3, WiFi=1, BT=0, GPS=0, HI PA=0
[ 4217.783804] usb 1-9.3: RTL8192EU MAC: 7c:c2:c6:06:09:e6
[ 4217.783806] usb 1-9.3: rtl8xxxu: Loading firmware rtlwifi/rtl8192eu_nic.bin
[ 4217.783809] Loading firmware: rtlwifi/rtl8192eu_nic.bin
[ 4217.783950] usb 1-9.3: Firmware revision 35.7 (signature 0x92e1)
[ 4218.694186] rtl8xxxu 1-9.3:1.0 wlp0s20f0u9u3: renamed from wlan0

Configure rtl8xxxu to avoid conflicts with the builtin kernel module

Prevent rtl8xxxu from binding (important since it’s builtin)

cat > /etc/modprobe.d/rtl8xxxu-block.conf <<'EOF'
# Prevent auto-binding for rtl8xxxu (builtin) so 8192eu can claim the device
install rtl8xxxu /bin/false
blacklist rtl8xxxu
EOF

Set stable options for 8192eu

cat > /etc/modprobe.d/8192eu.conf <<'EOF'
options 8192eu rtw_power_mgnt=0 rtw_enusbss=0
EOF

Reboot (needed because builtin driver is already active)

dmesg -T | egrep -i 'rtl8xxxu|8192eu|firmware|wlan' | tail -120
lsmod | egrep '8192eu|rtl8xxxu'
iw dev
ip -br link