Driver for Realtek 8852AE, an 802.11ax device https://github.com/lwfinger/rtw89
Find a file
Larry Finger 48680abfeb rtw89: Fix build errors on kernels as old as 5.8.
This change also adds the rtw8922ae driver for the first Wifi 7 device.

Larry
2024-03-09 18:56:59 -06:00
.gitignore Initial commit 2023-10-20 17:34:24 -05:00
70-rtw89.conf rtw89: Update README.md and add 70-rtw89.conf 2023-11-28 13:12:21 -06:00
acpi.c wifi: rtw89: acpi: process 6 GHz band policy from DSM 2023-11-22 11:17:06 -06:00
acpi.h rtw89: Fix builds on kernels as old as v5.15 2023-11-22 15:00:06 -06:00
cam.c wifi: rtw89: fw: add H2C command to update security CAM v2 2024-02-13 10:20:57 -06:00
cam.h wifi: rtw89: fw: add H2C command to reset DMAC table for WiFi 7 2024-02-13 10:20:57 -06:00
chan.c wifi: rtw89: chan: support MCC on Wi-Fi 7 chips 2024-02-15 10:43:15 -06:00
chan.h wifi: rtw89: chan: tweak weight recalc ahead before MLO 2024-02-13 10:22:06 -06:00
coex.c rtw89: Fix build errors on kernels as old as 5.8. 2024-03-09 18:56:59 -06:00
coex.h [PATCH] wifi: rtw89: coex: Add TDMA slot parameter setting version 7 2024-03-06 14:16:43 -06:00
core.c wifi: rtw89: Update EHT PHY beamforming capability 2024-03-05 13:55:16 -06:00
core.h [PATCH] wifi: rtw89: coex: Add TDMA slot parameter setting version 7 2024-03-06 14:16:43 -06:00
debug.c wifi: rtw89: coex: add BTC ctrl_info version 7 and related logic 2024-03-05 13:58:16 -06:00
debug.h wifi: rtw89: phy: dynamically adjust EDCCA threshold 2023-11-30 19:45:12 -06:00
efuse.c wifi: rtw89: mac: add to access efuse for WiFi 7 chips 2023-11-22 11:17:06 -06:00
efuse.h wifi: rtw89: fw: read firmware secure information from efuse 2024-02-13 10:22:06 -06:00
efuse_be.c wifi: rtw89: fw: read firmware secure information from efuse 2024-02-13 10:22:06 -06:00
fw.c wifi: rtw89: coex: Add WiFi role info format version 8 2024-03-06 14:00:07 -06:00
fw.h wifi: rtw89: coex: Add WiFi role info format version 8 2024-03-06 14:00:07 -06:00
LICENSE Initial commit 2023-10-20 17:34:24 -05:00
mac.c wifi: rtw89: wow: set security engine options for 802.11ax chips only 2024-03-05 13:58:16 -06:00
mac.h wifi: rtw89: wow: update config mac function with different generation 2024-03-05 13:58:16 -06:00
mac80211.c wifi: rtw89: drop TIMING_BEACON_ONLY and sync beacon TSF by self 2024-02-13 10:22:06 -06:00
mac_be.c rtw89: Fix build errors on kernels as old as 5.8. 2024-03-09 18:56:59 -06:00
Makefile [PATCH] wifi: rtw89: 8922a: add 8922ae to Makefile and Kconfig 2024-03-06 14:18:04 -06:00
pci.c wifi: rtw89: update DMA function with different generation 2024-03-05 13:58:16 -06:00
pci.h wifi: rtw89: update suspend/resume for different generation 2024-03-05 13:58:16 -06:00
pci_be.c wifi: rtw89: update suspend/resume for different generation 2024-03-05 13:58:16 -06:00
phy.c rtw89: Fix build errors on kernels as old as 5.8. 2024-03-09 18:56:59 -06:00
phy.h wifi: rtw89: 8922a: add set_channel RF part 2024-02-19 13:27:41 -06:00
phy_be.c wifi: rtw89: correct PHY register offset for PHY-1 2024-02-13 10:22:06 -06:00
ps.c wifi: rtw89: update ps_state register for chips with different generation 2024-02-13 10:22:06 -06:00
ps.h wifi: rtw89: refine remain on channel flow to improve P2P connection 2023-12-07 11:22:48 -06:00
README.md rtw89: Fix build errors on kernels as old as 5.8. 2024-03-09 18:56:59 -06:00
reg.h wifi: rtw89: update suspend/resume for different generation 2024-03-05 13:58:16 -06:00
regd.c rtw89: Fix build errors for kernel 5.15 2023-12-08 09:54:19 -06:00
rtw8851b.c wifi: rtw89: wow: update WoWLAN reason register for different chips 2024-03-05 13:58:16 -06:00
rtw8851b.h wifi: rtw89: 8851b: add to parse efuse content 2023-10-21 10:41:46 -05:00
rtw8851b_rfk.c wifi: rtw89: 8851b: rfk: update IQK to version 0x8 2023-10-21 10:41:47 -05:00
rtw8851b_rfk.h wifi: rtw89: 8851b: rfk: add LCK track 2023-10-21 10:41:47 -05:00
rtw8851b_rfk_table.c wifi: rtw89: 8851b: add tables for RFK 2023-10-21 10:41:46 -05:00
rtw8851b_rfk_table.h wifi: rtw89: 8851b: add tables for RFK 2023-10-21 10:41:46 -05:00
rtw8851b_table.c wifi: rtw89: 8851b: update TX power tables to R37 2024-01-10 09:29:19 -06:00
rtw8851b_table.h wifi: rtw89: indicate TX power by rate table inside RFE parameter 2023-10-21 10:41:48 -05:00
rtw8851be.c wifi: rtw89: pci: validate RX tag for RXQ and RPQ 2024-02-13 10:20:57 -06:00
rtw8852a.c wifi: rtw89: wow: update WoWLAN reason register for different chips 2024-03-05 13:58:16 -06:00
rtw8852a.h wifi: rtw89: phy: make generic txpwr setting functions 2023-10-21 10:41:45 -05:00
rtw8852a_rfk.c wifi: rtw89: cleanup rtw89_iqk_info and related code 2023-10-21 10:41:47 -05:00
rtw8852a_rfk.h wifi: rtw89: cleanup rtw89_iqk_info and related code 2023-10-21 10:41:47 -05:00
rtw8852a_rfk_table.c rtw89: refine naming of rfk helpers with prefix 2023-10-20 20:57:33 -05:00
rtw8852a_rfk_table.h rtw89: make rfk helpers common across chips 2023-10-20 20:57:33 -05:00
rtw8852a_table.c wifi: rtw89: indicate TX power by rate table inside RFE parameter 2023-10-21 10:41:48 -05:00
rtw8852a_table.h wifi: rtw89: indicate TX power by rate table inside RFE parameter 2023-10-21 10:41:48 -05:00
rtw8852ae.c wifi: rtw89: pci: validate RX tag for RXQ and RPQ 2024-02-13 10:20:57 -06:00
rtw8852b.c wifi: rtw89: wow: update WoWLAN reason register for different chips 2024-03-05 13:58:16 -06:00
rtw8852b.h wifi: rtw89: 8852b: add functions to control BB to assist RF calibrations 2023-10-21 10:41:45 -05:00
rtw8852b_rfk.c wifi: rtw89: 8852b: rfk: fine tune IQK parameters to improve performance on 2GHz band 2023-10-21 10:41:47 -05:00
rtw8852b_rfk.h wifi: rtw89: 8852b: rfk: add DPK 2023-10-21 10:41:45 -05:00
rtw8852b_rfk_table.c wifi: rtw89: 8852b: add tables for RFK 2023-10-21 10:41:45 -05:00
rtw8852b_rfk_table.h wifi: rtw89: 8852b: add tables for RFK 2023-10-21 10:41:45 -05:00
rtw8852b_table.c wifi: rtw89: 8852b: update TX power tables to R36 2024-01-10 09:29:04 -06:00
rtw8852b_table.h wifi: rtw89: indicate TX power by rate table inside RFE parameter 2023-10-21 10:41:48 -05:00
rtw8852be.c wifi: rtw89: pci: validate RX tag for RXQ and RPQ 2024-02-13 10:20:57 -06:00
rtw8852c.c wifi: rtw89: wow: update WoWLAN reason register for different chips 2024-03-05 13:58:16 -06:00
rtw8852c.h wifi: rtw89: 8852c: read RX gain offset from efuse for 6GHz channels 2023-11-22 11:17:06 -06:00
rtw8852c_rfk.c wifi: rtw89: 52c: rfk: disable DPK during MCC 2023-10-21 10:41:47 -05:00
rtw8852c_rfk.h wifi: rtw89: 52c: rfk: disable DPK during MCC 2023-10-21 10:41:47 -05:00
rtw8852c_rfk_table.c wifi: rtw89: 8852c: Fix TSSI causes transmit power inaccuracy 2023-10-21 10:41:47 -05:00
rtw8852c_rfk_table.h rtw89: 8852c: rfk: add RFK tables 2023-10-20 20:57:34 -05:00
rtw8852c_table.c wifi: rtw89: 8852c: update TX power tables to R67 2023-10-21 10:41:48 -05:00
rtw8852c_table.h wifi: rtw89: indicate TX power by rate table inside RFE parameter 2023-10-21 10:41:48 -05:00
rtw8852ce.c wifi: rtw89: pci: validate RX tag for RXQ and RPQ 2024-02-13 10:20:57 -06:00
rtw8922a.c wifi: rtw89: 8922a: update chip parameter for coex 2024-03-06 14:00:27 -06:00
rtw8922a.h wifi: rtw89: 8922a: read efuse content via efuse map struct from logic map 2023-11-22 11:17:06 -06:00
rtw8922a_rfk.c wifi: rtw89: 8922a: add helper of set_channel 2024-02-19 13:27:41 -06:00
rtw8922a_rfk.h wifi: rtw89: 8922a: add helper of set_channel 2024-02-19 13:27:41 -06:00
rtw8922ae.c wifi: rtw89: update suspend/resume for different generation 2024-03-05 13:58:16 -06:00
sar.c wifi: rtw89: acpi: process 6 GHz band policy from DSM 2023-11-22 11:17:06 -06:00
sar.h rtw89: Bring source up to level of wireless_next as of Oct 17, 2023 2023-11-01 21:56:07 -05:00
ser.c wifi: rtw89: 8922a: configure CRASH_TRIGGER FW feature 2023-12-07 11:22:48 -06:00
ser.h rtw89: add Realtek 802.11ax driver 2023-10-20 20:57:32 -05:00
suspend_rtw89 wifi: rtw89: debug: add debugfs entry to disable dynamic mechanism 2023-12-01 10:10:51 -06:00
txrx.h wifi: rtw89: consider RX info for WiFi 7 chips 2023-11-02 10:52:59 -05:00
util.h wifi: rtw89: add WoWLAN pattern match support 2023-10-21 10:41:45 -05:00
wow.c wifi: rtw89: wow: move release offload packet earlier for WoWLAN mode 2024-03-05 13:58:16 -06:00
wow.h wifi: rtw89: add WoWLAN function support 2023-10-21 10:41:45 -05:00

rtw89

A repo for the newest Realtek rtw89 codes.

This repo now contains the code for the Realtek RTW8922AE, which is a Wifi 7 device. It has been tested using a Wifi 6 AP as I do not have access to a Wifi 7 model. The driver works very well.

This repo is current with wireless-next up to March 6, 2024.

This branch was created from the version merged into the wireless-drivers-next repo, which is in the 5.16 kernel. IF YOU USE DRIVERS FROM THIS REPO FOR KERNELS 5.16+, YOU MUST BLACKLIST THE KERNEL VERSIONS!!!! FAILING TO DO THIS WILL RESULT IN ALL MANNER OF STRANGE ERRORS.

This code will build on any kernel 5.8 and newer as long as the distro has not modified any of the kernel APIs. IF YOU RUN UBUNTU, YOU CAN BE ASSURED THAT THE APIs HAVE CHANGED. NO, I WILL NOT MODIFY THE SOURCE FOR YOU. YOU ARE ON YOUR OWN!!!!!

Note that if you use this driver on kernels older than 5.15, the enhanced features of wifi 5 and wifi 6 are greatly crippled as the kernel does hot have the capability to support the new packet widths and speeds. If you use such a kernel, you might as well have an 802.11n (wifi 4) device.

This repository includes drivers for the following card:

Realtek 8852AE, 8852BE, 8852CE, and RTW8922AE.

If you are looking for a driver for chips such as RTL8188EE, RTL8192CE, RTL8192CU, RTL8192DE, RTL8192EE, RTL8192SE, RTL8723AE, or RTL8723BE, these should be provided by your kernel. If not, then you should go to the Backports Project (https://backports.wiki.kernel.org/index.php/Main_Page) to obtain the necessary code.

If you have an RTW8822B{E,U,S}, RTW8822C{E,U,S}, RTW8723D{E,U,S}, or RTW8821C{E,U,S}, then you should use the drivers at https://github.com/lwfinger/rtw88.git.

Installation instruction

Requirements

You will need to install "make", "gcc", "kernel headers", "kernel build essentials", and "git".

For Ubuntu: You can install them with the following command

sudo apt-get update
sudo apt-get install make gcc linux-headers-$(uname -r) build-essential git

Users of Debian, Ubuntu, and similar (Mint etc) may want to scroll down and follow the DKMS instructions at the end of this document instead.

For Fedora: You can install them with the following command

sudo dnf install kernel-headers kernel-devel
sudo dnf group install "C Development Tools and Libraries"

For openSUSE: Install necessary headers with

sudo zypper install make gcc kernel-devel kernel-default-devel git libopenssl-devel

For Arch: After installing the necessary kernel headers and base-devel,

git clone https://aur.archlinux.org/rtw89-dkms-git.git
cd rtw89-dkms-git
makepkg -sri

If any of the packages above are not found check if your distro installs them like that.

Installation

For all distros:

git clone https://github.com/lwfinger/rtw89.git
cd rtw89
make
sudo make install
Installation with module signing for SecureBoot

For all distros:

git clone https://github.com/lwfinger/rtw89.git
cd rtw89
make
sudo make sign-install

You will be promted a password, please keep it in mind and use it in next steps. Reboot to activate the new installed module. In the MOK managerment screen:

  1. Select "Enroll key" and enroll the key created by above sign-install step
  2. When promted, enter the password you entered when create sign key.
  3. If you enter wrong password, your computer won't not bebootable. In this case, use the BOOT menu from your BIOS, to boot into your OS then do below steps:
sudo mokutil --reset

Restart your computer Use BOOT menu from BIOS to boot into your OS In the MOK managerment screen, select reset MOK list Reboot then retry from the step make sign-install

How to unload/reload a Kernel module
sudo modprobe -rv rtw_8852ae
sudo modprobe -rv rtw89core	     #These two statements unload the module

Due to the behavior of the modprobe utility, it takes both to unload.

sudo modprobe -v rtw_8852ae          #This loads the module

A single modprobe call will reload the module.
Uninstall drivers

For all distros:

sudo make uninstall
Problem with recovery after sleep or hibernation

Some BIOSs have trouble changing power state from D3hot to D0. If you have this problem, then

sudo cp suspend_rtw89 /usr/lib/systemd/system-sleep/.

That script will unload the driver before sleep or hibernation, and reload it following resumption.

Option configuration

IMPORTANT: If you have an HP or Lenovo laptop, Their BIOS does not handle the PCIe interface correctly. To compensate, run the following command: sudo cp 70-rtw89.conf /etc/modprobe.d/. Then unload the drivers and reload. You should see the options appended to the end of the rtw89_pci or rtw89pci load line.

If it turns out that your system needs one of the other configuration options, then do the following:

sudo nano /etc/modprobe.d/<dev_name>.conf

There, enter the line below:

options <driver_name> <<driver_option_name>>=<value>

The available options for rtw89pci are disable_clkreq, disable_aspm_l1, and disable_aspm_l1ss. The available options for rtw89core are debug_mask, and disable_ps_mode

Normally, none of these will be needed; however, if you are getting firmware errors, one or both of the disable_aspm_* options may help. Thay are needed when a buggy BIOS fails to implement the PCI specs correctly.


When your kernel changes, then you need to do the following:

cd ~/rtw89
git pull
make clean
make
sudo make install
;or
sudo make sign-install

Remember, this MUST be done whenever you get a new kernel - no exceptions.

These drivers will not build for kernels older than 5.8. If you must use an older kernel, submit a GitHub issue with a listing of the build errors, but be aware that doing so will cripple your device. Without the errors, the issue will be ignored. I am not a mind reader.

When you have problems where the driver builds and loads correctly, but fails to work, a GitHub issue is NOT the best place to report it. I have no idea of the internal workings of any of the chips, and the Realtek engineers who do will not read these issues. To reach them, send E-mail to linux-wireless@vger.kernel.org. Include a detailed description of any messages in the kernel logs and any steps that you have taken to analyze or fix the problem. If your description is not complete, you are unlikely to get any satisfaction. One other thing - your mail MUST be plain test. HTML mail is rejected.

DKMS packaging for debian and derivatives

DKMS is commonly used on debian and derivatives, like ubuntu, to streamline building extra kernel modules.
By following the instructions below and installing the resulting package, the rtw89 driver will automatically rebuild on kernel updates. Secure boot signing will happen automatically as well, as long as the dkms signing key (usually located at /var/lib/dkms/mok.key) is enrolled. See your distro's secure boot documentation for more details.

Prerequisites:

sudo apt install dh-sequence-dkms debhelper build-essential devscripts

This workflow uses devscripts, which has quite a few perl dependencies.
You may wish to build inside a chroot to avoid unnecessary clutter on your system. The debian wiki page for chroot has simple instructions for debian, which you can adapt to other distros as needed by changing the release codename and mirror url.
If you do, make sure to install the package on your host system, as it will fail if you try to install inside the chroot.

Build and installation

# If you've already built as above clean up your workspace or check one out specially (otherwise some temp files can end up in your package)
git clean -xfd

git deborig HEAD
dpkg-buildpackage -us -uc
sudo apt install ../rtw89-dkms_1.0.2-3_all.deb 

This will install the package, and build the module for your currently active kernel. You should then be able to modprobe as above. It will also load automatically on boot.

A note regarding firmware

Firmware from userspace is required to use this driver. This package will attempt to pull the firmware in automatically as a Recommends. However, if your distro does not provide one of firmware-realtek >= 20230117-1 or linux-firmware >= 20220329.git681281e4-0ubuntu3.10, the driver will fail to load, and dmesg will show an error about a specific missing firmware file. In this case, you can download the firmware files directly from https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/rtw89.