Realtek RTW88
Contents
Prolog
Support for Realtek's rtw88 driver. The driver should auto-load, if not try to load kldload if_rtw88.
FAQ
- Q: Does this driver also support RTL8821AE?
A: No. This is part of a different generation of driver support in Linux (rtlwifi) which is GPL-only and a totally different can of worms. It would more fit rtwn in FreeBSD I think but no one was working on that from what I know.
- Q: I am running 13.1-RELEASE but I cannot find the driver?
A: That is because at the time the release was published the driver has only been in main (14-CURRENT) and not even in stable/13.
A: The driver was merged to stable/13 and that'll be your best chance to try it out.
A: It is unclear at this point if it'll be feasible to provide an out-of-tree version for 13.1-RELEASE -- likely not.
- Q: I want to try this on stable/13
- A: It is now in stable/13 and changes are usually merged from main within a few (3+) days.
A: You need to cherry-pick the following (XXX FIXME it is more now) commits:
2774f206809b8fd3a4904fe945f029a414fbc642, 73d4ebea3567f18db549638c3d897b6d6758faa4, 20eeed6844e2ab82b909e02c720101297e78d916, 3443476ca9e751cebbb1c467091551bf3d518814 (for 8822CE), e140d551b78670fbf99c83a59438cb13de50420f. You do also want the other "floating" changes related to wireless most likely. While they may be in main, they may not yet be merged to stable/13. Check the wireless mailing list for cherry-pick suggestions.
A: At the point of writing 2022-05-xx it is very likely that the driver will be merged within the next weeks.
- A: It is now in stable/13 and changes are usually merged from main within a few (3+) days.
Q: The devices have awkward names like rtw880 for the first one.
A: While that is not a question I was pondering rtw88ac0 or rtw88_pci0 but be latter is problematic with rc.conf and the former would break the module name vs. driver name sameness. Still open to other suggestions but for simplicity it is numbers for now.
- Q: This fails and prints out errors.
A: Do you have more than 4GB of RAM? See currently known issues below for a solution.
A: Otherwise let me know.
Q: I see failed to get tx report from firmware. What to do?
A: can you try setting the following sysctls after loading the driver (see this thread):
sysctl compat.linuxkpi.rtw88_pci_disable_aspm=1 sysctl compat.linuxkpi.rtw88_disable_lps_deep=1
A: See next item.
Q: I see failed to write TX skb to HCI or failed to get tx report from firmware. What to do?
A: Can you apply the patch from this email and see if it happens again? https://lists.freebsd.org/archives/freebsd-wireless/2022-April/000399.html
A: Can you apply this patch 20220418-01-rtw88-debug.diff and report the results?
A: Please update the newer sources; the errors were made debug logging only and should no longer be seen.
A: At the time of writing (20220613): 17 files changed, 224 insertions(+), 1 deletion(-), with an ~ +90 lines change to use bus_dma functions on FreeBSD.
Currently known issue
Does not work on machines with more than 4GB of physical memory. Likely busdma+LinuxKPI problem to be investigated. D34715 has a change to gather data (which is in freebsd/main by now).
You need to boot with compat.linuxkpi.skb.mem_limit=1 in loader.conf to limit DMA to 32bit (announcement on freebsd-wireless for more info). As Anton Shepelev let me know on 2024-07-19 even on a computer with up-to 4GB the tunable may be needed; I believe this is due to wrong handling of certain allocations in LinuxKPI which we are in the progress of fixing (revisit once done).
Older solutions were: try hw.physmem="4G" in loader.conf and see if rtw88 starts working. If it does, please let me know along with PCI IDs (and if you want dmesg). Alternatively and possibly a better approach as it does not limit your memory is to apply this patch, rebuild, and re-install your kernel and see if that works (please also let us know).
Older problems (likely) fixed
Problem similar to https://bugzilla.redhat.com/show_bug.cgi?id=1975807 after bringing the interface up and going to scan.
- No packets are received.
- I have one report of leaking skbuffs with RTL8822CE which will eventually lead to failed allocations; to be debugged.
Support Matrix
Which chipset was tested?
Card |
PCI IDs |
Current state |
RTL8821CE |
0x10ec/0xc821/0x1a3b/0x3040 |
Fails to load firmware (email: 21-09-08) -- likely fixed |
RTL8821CE |
0x10ec/0xc821/0x1a3b/0x3040 |
4G limit + packets https://lists.freebsd.org/archives/freebsd-wireless/2022-April/000395.html |
RTL8822BE |
?/?/?/? |
Fails to load firmware (email: 21-09-07) |
RTL8822BE |
0x10ec/0xb822/0x103c/0x831b |
Works with less than 4G of RAM. |
RTL8822CE |
0x10ec/0xc822/0x1a3b/0x3750 |
Works with less than 4G of RAM??? |
RTL8822CE |
0x10ec/0xc822/0x103c/0x85f7 |
4G limit + packets https://lists.freebsd.org/archives/freebsd-wireless/2022-April/000379.html |
RTL8822CE |
|
Problems with 9.9.11 firmware supporting hw_scan (see PR mentioned below); with 9.9.10 starts to work if memory limited to 4G |
Other possibly supported chipsets?
Card |
PCI IDs |
Current state |
RTL8723DE |
0x10ec/0xd723/????/???? |
https://lists.freebsd.org/archives/freebsd-wireless/2024-February/001747.html |
PRs
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273621 meta-bug for rtw88/rtw89. Please check there first before reporting issues.
USB Support
rtw88-usb was posted https://lore.kernel.org/lkml/20220518082318.3898514-1-s.hauer@pengutronix.de/ and will share the driver with the PCI version so there will be some friction and re-shuffling coming.
Apparently this is a RTW8822CU I was told: LM842
I got an RTW8822BU here: DLink DWA-182 on Amazon.de (and got a HW Ver D1 F/W Fer 4.01 in May 2022: 0x2001 / 0x331c) (Product may have changed?)
I also got a RTW8821CU? here Tenda U10 USB WLAN Stick, AC 650 Mbps (shows up as cd0 for Windows first; camcontrol eject cd0 and Wifi appears, needs a quirk)
- I have most of the changes compiling but LinuxKPI USB support needs some refactoring which will take a bit more time. Expect USB support to come to this driver later this year.
Contact
You can reach me at (bz at FreeBSD.ORG) or via the freebsd-wireless mailing list. If possible add "[rtw88]" to the subject. Let me kindly ask you to give me some time to reply and help; I am not doing this full-time but I will try to acknowledge your email as soon as I can.
Random Links
To keep track and references to some problems or other significant changes during development / testing:
PATCH v3 1/2 rtw88: pci: Rearrange the memory usage for skb in RX ISR, lead to LinuxKPI: implement dma_sync_single_for_*, apply to (un)map single/sg
Stalls and firmware issue reported failed to get tx report from firmware, firmware failed to report density after scan, ... .
History
- 2023-10-06 Reconnected to build in main.
- 2023-09-06 Disabled driver in main.
- 2022-06-13 Updated rtw88 in main to wireless-testing (wt-2022-06-10).
- 2022-06-03 Driver was merged to stable/13 still requiring a tunable to be set for machines with more than 4GB of physical memory.
2022-05-05 LinuxKPI: skbuff: add memlimit tunable for 64bit systems committed so driver can be used in-tree without patching
- 2022-04-01 (date not a joke) commit of rtw88 driver to main