driver rtw88 wifi RTL8821CE

Hello friends,
I have a pci wireless card RTL8821CE and my freebsd 14.0 not detect it.

pciconf -lv
none3@pci0:2:0:0: class=0x028000 rev=0x00 hdr=0x00 vendor=0x10ec device=0xc821 subvendor=0x10ec subdevice=0xc821
vendor = 'Realtek Semiconductor Co., Ltd.'
device = 'RTL8821CE 802.11ac PCIe Wireless Network Adapter'
class = network

I have been looking for a solution and I have found rtw88 driver, but I cannot install or compile it, I am quite new to freebsd.
I have been able to install pkg (https://pkgs.org/download/wifi-firmware-rtw88-kmod) and a series of files have been created that I show you

/boot/modules
1713659013622.png


/usr/local/share/licenses/wifi-firmware-rtw88-kmod-20230310
1713658932856.png


Now I can't move forward, what is the next step?

thanks
 
I have a pci wireless card RTL8821CE and my freebsd 14.0 not detect it.

From Realtek RTW88 FreeBSD wiki "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).

and rtw88(4) manual:
Code:
LOADER TUNABLES
     compat.linuxkpi.skb.mem_limit
             If you are running a 64bit system with more than 4GB of main
             memory you need to set this tunable to 1 in loader.conf(5) and
             reboot once to make it effective.  This tunable will work around
             a problem with DMA and limit allocations for network buffer
             memory to the lower 32bit of physical memory and make the driver
             work.

If there are still issues with the driver see "Contact" in the wiki.
 
Driver doesn't need to be installed, it's included but not loaded. So all you need to do is enable it. You do need to install the firmware for the card though, as it cannot be included with the OS due to license issues.

It is possible you have some variant of the chipset that's not recognized by the rtw88(4) driver though.
 
FOXNbsd, please note that the rtw88 is functional, but still in development.

As SirDice said
Driver doesn't need to be installed, it's included ...

Though, the driver (/boot/kernel/if_rtw88.ko) should auto-load.

rtw88(4)
Code:
SYNOPSIS
     The driver will auto-load without any user interaction using devmatch(8)
     if enabled in rc.conf(5).

devmatch(8) is enabled by default:
/etc/defaults/rc.conf
Code:
devmatch_enable="YES"   # Demand load kernel modules based on device ids.

and the device ids match
none3@pci0:2:0:0: class=0x028000 rev=0x00 hdr=0x00 vendor=0x10ec device=0xc821 subvendor=0x10ec subdevice=0xc821
vendor = 'Realtek Semiconductor Co., Ltd.'

Support Matrix
Rich (BB code):
Which chipset was tested? 
Card        PCI IDs
RTL8821CE   0x10ec/0xc821/0x1a3b/0x3040

FOXNbsd, set in

/boot/loader.conf
Code:
compat.linuxkpi.skb.mem_limit=1
reboot system, see if the driver has attached to the device (check pciconf(8)), if not, try kldload if_rtw88.

Also, the firmware is included in the base system, no need to install a firmware package.
Rich (BB code):
/boot/kernel/rtw8822c_fw.bin.ko
/boot/kernel/rtw8822b_fw.bin.ko
/boot/kernel/if_rtw88.ko
/boot/kernel/rtw8821c_fw.bin.ko
/boot/kernel/rtw8822c_wow_fw.bin.ko

If the driver still doesn't attach to the device, contact the developer of the driver Björ A. Zeeb at bz@freebsd.org, or on freebsd-wireless@freebsd.org mailing list.
 
Thanks friends
But the driver (/boot/kernel/if_rtw88.ko) i havent driver "if_rtw88.ko", only i have files in images, where can i get "if_rtw88.ko"?

Reading some posts and Björ A. Zeeb mails,
My loader.conf
if_rtw88_load="YES"
sysctl compat.linuxkpi.skb.mem_limit=1
sysctl compat.linuxkpi.rtw88_pci_disable_aspm=1
sysctl compat.linuxkpi.rtw88_disable_lps_deep=1

My rc.conf
devmatch_enable="YES" # Demand load kernel modules based on device ids.
kld_list="${kld_list} if_rtw88"
wlans_rtw880="YES"
ifconfig_wlan0="WPA SYNCDHCP"

sry im noob :(
 
But the driver (/boot/kernel/if_rtw88.ko) i havent driver "if_rtw88.ko"
You installed FreeBSD 14.0-RELEASE, right? Then that file is already on disk:
Code:
dice@maelcum:~ % ls -al /boot/kernel/if_rtw88.ko
-r-xr-xr-x  2 root wheel 1185800 Nov 26 23:15 /boot/kernel/if_rtw88.ko
This is the driver. Are you saying you don't have that file?
only i have files in images
I'm really not sure what you mean?

sry im noob
We were all noobs at first, no need to apologize for it. You're here to learn.

My loader.conf
Code:
if_rtw88_load="YES"
sysctl compat.linuxkpi.skb.mem_limit=1
sysctl compat.linuxkpi.rtw88_pci_disable_aspm=1
sysctl compat.linuxkpi.rtw88_disable_lps_deep=1
Remove that if_rtw88_load line, it's not needed.
Remove the sysctl(8) command from the other lines. It's always a variable = value pair in loader.conf(5). Never put commands in here. Commands are entered on the Command Line Interface, or CLI. Usually in our case that CLI interface is a shell. Commands can also be put into scripts but that's an entire subject in and of itself.

My rc.conf
Code:
devmatch_enable="YES" # Demand load kernel modules based on device ids.
kld_list="${kld_list} if_rtw88"
wlans_rtw880="YES"
ifconfig_wlan0="WPA SYNCDHCP"
Remove the kld_list and devmatch_enable lines. They're not needed.
 
FOXNbsd, Wish you well in getting RTL8821CE WiFi device working on your computer running FreeBSD. SirDice gives the best help and support for FreeBSD. Did you confirm that you have the file
/boot/kernel/if_rtw88.ko? Did you edit the files as SirDice instructed you?
try the following 4 commands:

service netif restart
service routing restart
ifconfig rtw88
ifconfig rtw88 up scan list


First try all the suggestions above first. If your Realtek RTL8821CE wifi device is working stay with that setup you have running.



Another method to use with newer wifi cards is the
wifibox
project to use a working Linux Wifi driver in Alpine Linux inside BHyve on a running FreeBSD. Does support RTL8821CE Realtek hardware.
https://github.com/pgj/freebsd-wifibox-alpine
https://eldapper.wordpress.com/2023/01/15/wifibox-on-my-ghostbsd-laptop/ Article to read about setting up Wifibox.
https://www.freebsd.org/status/report-2022-01-2022-03/wifibox/
 
Thanks friends.

New Tests:

kldload if_rtw88.ko
KLD if_rtw88.ko: depends on kernel - not avaliable or version mismatch
linker_load_file: /boot/kernel/if_rtw88.ko - unsupported file type
kldload: an error ocurred while loading module if_rtw88.ko. Please check dmesg(8) for more details.


dmesg
ue0: promiscuous mode enabled
KLD if_rtw88.ko: depends on kernel - not avaliable or version mismatch
linker_load_file: /boot/kernel/if_rtw88.ko - unsupported file type


ls -al /boot/kernel/if_rtw88.ko
-rw-r--r-- 1 root wheel 1185800 Apr 25 23:12 /boot/kernel/if_rtw88.ko

Maybe root permissions?

thanks
 
Hi judd, i have seen this mail from Bjoern A. Zeeb

Hi FOXBbsd, very interesting what the developer of the driver describes, however, the failure is not only in the connection drop but I had problems with involuntary reboots and freezes when the connection dropped.

Conclusion, I removed everything I installed and modified to make the driver work (at least for a couple of minutes), otherwise it was impossible to operate my laptop.

So I have gone back to my USB card and am connected again without any hiccups.
 
Code:
KLD if_rtw88.ko: depends on kernel - not avaliable or version mismatch
linker_load_file: /boot/kernel/if_rtw88.ko - unsupported file type
The version of /boot/kernel/if_rtw88.ko is not correct for your version of the kernel. You probably messed it up when you tried to install a driver you downloaded from somewhere. If possible I would just do a reinstall, there's no way of telling what else may have been messed up.
 
Back
Top