Skip to content

shchuchkin-pkims/rtl8812au-linux-6.17

Repository files navigation

RTL8812AU/RTL8821AU Linux Driver (Kernel 6.17+ Support)

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.

Why This Fork?

Linux kernel 6.16/6.17 introduced breaking API changes that prevent all existing RTL8812AU drivers from compiling:

  • Timer API removalfrom_timer(), del_timer_sync(), del_timer() removed
  • cfg80211 API changeset_wiphy_params(), set_tx_power(), get_tx_power() gained a new radio_idx parameter
  • kbuild changeEXTRA_CFLAGS no 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 rtw88 driver exists for RTL8812AU. However, it may not work properly with all adapters. If rtw88 does not work for your hardware, this driver is your solution.

Supported Adapters

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.

Tested On

  • Ubuntu 24.04 LTS (Noble Numbat)
  • Linux kernel 6.14.x — working
  • Linux kernel 6.17.x — working

Quick Install

One-liner

git clone https://github.com/shchuchkin-pkims/rtl8812au-linux-6.17.git
cd rtl8812au-linux-6.17
sudo ./install.sh

Manual Install

# 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

From Release Archive

# Download and extract
tar xzf rtl8812au-patched-617.tar.gz
cd rtl8812au-patched-617
sudo ./install.sh

Uninstall

sudo ./uninstall.sh

Or manually:

sudo dkms remove rtl8812au/5.13.6-23 --all
sudo rm -rf /usr/src/rtl8812au-5.13.6-23/

DKMS Auto-rebuild

The driver is installed via DKMS, which means it will automatically rebuild when you install a new kernel — no manual intervention needed.

Patches Applied

All patches use #if LINUX_VERSION_CODE guards for backward compatibility.

1. kbuild: EXTRA_CFLAGSccflags-y

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

2. Timer API (kernel 6.16+)

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

3. cfg80211 API (kernel 6.17+)

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

4. Compiler warnings

Added -Wno-error to prevent kernel 6.17's stricter -Werror policy from failing the build on non-critical warnings.

Troubleshooting

Driver loads but no WiFi:

sudo modprobe 8812au
dmesg | grep 8812

Build fails on a new kernel:

# Check the build log
cat /var/lib/dkms/rtl8812au/5.13.6-23/build/make.log

Secure Boot blocks the module:

The module is unsigned. Either disable Secure Boot in BIOS or sign the module manually.

Contributing

If the driver breaks on a future kernel version, feel free to open an issue with:

  1. Your kernel version (uname -r)
  2. The DKMS build log (/var/lib/dkms/rtl8812au/5.13.6-23/build/make.log)

Pull requests with patches for newer kernels are welcome.

License

This driver is licensed under the GNU General Public License v2.0. See LICENSE for details.

Credits

About

RTL8812AU/RTL8821AU USB WiFi driver patched for Linux kernel 6.17+ (DKMS). Fixes timer API, cfg80211 radio_idx, and kbuild compatibility.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages