USB WiFi driver for Realtek RTL8812AU and RTL8821AU chipsets, patched to support Linux kernel 6.17+ while maintaining backward compatibility with kernels 4.14+.
Based on morrownr/8812au-20210820 (v5.13.6-23) with additional patches for modern kernel compatibility.
Linux kernel 6.16/6.17 introduced breaking API changes that prevent all existing RTL8812AU drivers from compiling:
- Timer API removal —
from_timer(),del_timer_sync(),del_timer()removed - cfg80211 API change —
set_wiphy_params(),set_tx_power(),get_tx_power()gained a newradio_idxparameter - kbuild change —
EXTRA_CFLAGSno longer propagated to subdirectories
This fork patches all of these issues. The driver compiles and works on both older (6.14) and newer (6.17+) kernels.
Note: Starting with kernel 6.14, an in-kernel
rtw88driver exists for RTL8812AU. However, it may not work properly with all adapters. Ifrtw88does not work for your hardware, this driver is your solution.
| Chipset | USB ID | Example Adapters |
|---|---|---|
| RTL8812AU | 0bda:8812 | Alfa AWUS036ACH, TP-Link Archer T4U v1 |
| RTL8812AU | 2357:0101 | TP-Link Archer T4U v1 |
| RTL8812AU | 2604:0012 | Tenda U12 |
| RTL8821AU | 0bda:0811 | Default |
| RTL8821AU | 2357:011e | TP-Link Archer T2U v3 |
| RTL8812AU | 0bda:881a | Default |
For a full list of supported devices, see os_dep/linux/usb_intf.c.
- Ubuntu 24.04 LTS (Noble Numbat)
- Linux kernel 6.14.x — working
- Linux kernel 6.17.x — working
git clone https://github.com/shchuchkin-pkims/rtl8812au-linux-6.17.git
cd rtl8812au-linux-6.17
sudo ./install.sh# Install dependencies
sudo apt install dkms linux-headers-$(uname -r) build-essential
# Copy source to DKMS directory
sudo cp -r . /usr/src/rtl8812au-5.13.6-23/
# Build and install
sudo dkms add rtl8812au/5.13.6-23
sudo dkms build rtl8812au/5.13.6-23
sudo dkms install rtl8812au/5.13.6-23
# Load the module
sudo modprobe 8812au# Download and extract
tar xzf rtl8812au-patched-617.tar.gz
cd rtl8812au-patched-617
sudo ./install.shsudo ./uninstall.shOr manually:
sudo dkms remove rtl8812au/5.13.6-23 --all
sudo rm -rf /usr/src/rtl8812au-5.13.6-23/The driver is installed via DKMS, which means it will automatically rebuild when you install a new kernel — no manual intervention needed.
All patches use #if LINUX_VERSION_CODE guards for backward compatibility.
Kernel 6.17 no longer propagates EXTRA_CFLAGS to subdirectory builds. Replaced with ccflags-y which is the modern kbuild equivalent.
Files: Makefile, hal/phydm/phydm.mk, hal/phydm/sd4_phydm_2_kernel.mk
| Old (removed in 6.16) | New |
|---|---|
from_timer(ptr, timer, field) |
container_of(timer, type, field) |
del_timer_sync(&timer) |
timer_delete_sync(&timer) |
del_timer(&timer) |
timer_delete(&timer) |
File: include/osdep_service_linux.h
Three cfg80211_ops callbacks gained a new int radio_idx parameter:
set_wiphy_params(wiphy, radio_idx, changed)set_tx_power(wiphy, wdev, radio_idx, type, mbm)get_tx_power(wiphy, wdev, radio_idx, link_id, dbm)
File: os_dep/linux/ioctl_cfg80211.c
Added -Wno-error to prevent kernel 6.17's stricter -Werror policy from failing the build on non-critical warnings.
Driver loads but no WiFi:
sudo modprobe 8812au
dmesg | grep 8812Build fails on a new kernel:
# Check the build log
cat /var/lib/dkms/rtl8812au/5.13.6-23/build/make.logSecure Boot blocks the module:
The module is unsigned. Either disable Secure Boot in BIOS or sign the module manually.
If the driver breaks on a future kernel version, feel free to open an issue with:
- Your kernel version (
uname -r) - The DKMS build log (
/var/lib/dkms/rtl8812au/5.13.6-23/build/make.log)
Pull requests with patches for newer kernels are welcome.
This driver is licensed under the GNU General Public License v2.0. See LICENSE for details.
- Realtek — original driver
- morrownr/8812au-20210820 — maintained driver fork
- aircrack-ng/rtl8812au — community driver fork
- Kernel 6.17 compatibility patches by @shchuchkin-pkims