# RTL8821CE driver?



## miasmaeternal (Jun 18, 2020)

Hello,

As sure as some of you know, getting WiFi to work on this OS can be a hassle - especially when the network card you have is not supported. Just curious - will there be the prospect of an RTL8821CE driver in FreeBSD?


----------



## aponomarenko (Jun 23, 2020)

Added a bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247495

It's 11th most popular wireless card on Linux laptops this year after QCA9377, AR9285, AR9485, QCA9565, Intel 8265, Intel 7260, Intel 7265, BCM4313, Intel 9560 and Cannon Point-LP CNVi according to https://linux-hardware.org/?view=net_model&search=wireless&period=-2

So support for this device is critical to conquering the desktop market.


----------



## tingo (Jun 23, 2020)

As the FreeBSD project doesn't have "conquer the desktop market" as one of its goals, the criticality of this request fails. 
If somebody wants to do something about getting this supported, here are a few suggestions:
1) learn how to be a FreeBSD developer, then learn how to write device drivers, then write a device driver for it
2) find a FreeBSD developer who is interested in writing a driver for it, and have some free time, then pay this developer to write the driver
3) gather a few hundred friends who are also very interested in this subject, and have them petition the FreeBSD Foundation to sponsor the project

Whatever you choose; good luck!


----------



## aponomarenko (Jun 23, 2020)

12th to be exact:

QCA9377 802.11ac Wireless Network Adapter
AR9285 Wireless Network Adapter (PCI-Express)
AR9485 Wireless Network Adapter
QCA9565 / AR9565 Wireless Network Adapter
Wireless 8265 / 8275
Wireless 7260
Wireless 7265
BCM4313 802.11bgn Wireless Network Adapter
Wireless-AC 9560 [Jefferson Peak]
Centrino Advanced-N 6205 [Taylor Peak]
Cannon Point-LP CNVi [Wireless-AC]
RTL8821CE 802.11ac PCIe Wireless Network Adapter
RTL8723BE PCIe Wireless Network Adapter


----------



## aponomarenko (Jun 23, 2020)

tingo said:


> As the FreeBSD project doesn't have "conquer the desktop market" as one of its goals, the criticality of this request fails.



Why then is it defined as a system for desktops, laptops and servers? Personally, I really like desktop derivatives like NomadBSD, GhostBSD and FuryBSD.



			
				https://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/book.html said:
			
		

> [TD valign="top"]
> *1.1.*​
> [/TD]
> [TD valign="top"]
> ...



Also interest in desktops is far enough from zero:


----------



## codermen (Jun 26, 2020)

tingo said:


> As the FreeBSD project doesn't have "conquer the desktop market" as one of its goals, the criticality of this request fails.
> If somebody wants to do something about getting this supported, here are a few suggestions:
> 1) learn how to be a FreeBSD developer, then learn how to write device drivers, then write a device driver for it
> 2) find a FreeBSD developer who is interested in writing a driver for it, and have some free time, then pay this developer to write the driver
> ...



This is why FreeBSD uses both the server and the workstation every day, because It is unified, unlike many Linux distributions. It is a pity that FreeBSD is losing its competitive advantage over Fedora and Debian.

FreeBSD is the best solution for servers, just think about why most VPS (KVM) offers CentOS, Ubuntu, Debian but not FreeBSD, for me it is a loss of competitiveness. Very sorry.

Even Debian and Fedora have solutions for 8821CE ( https://github.com/tomaspinho/rtl8821ce ) only FreeBSD does not have a step-by-step solution to the problem.

This is why the FreeBSD project is significantly inferior to Debian, RHEL, and other Linux distributions, with fewer and fewer hosting providers providing FreeBSD. With such a drinker, you will ensure that FreeBSD simply disappears. Note the AMD drivers it offers for RHEL and Ubuntu only not FreeBSD! This is a strategic loss!

I want to cry "Give me back FreeBSD 5-6"...


----------



## George (Jun 26, 2020)

Stop whining.


----------



## codermen (Jun 26, 2020)

Elazar said:


> Stop whining.



Stopped 
Have an idea, can you help with the idea of how to run rtl8821ce on FreeBSD?


----------



## Jose (Jun 26, 2020)

Elazar said:


> Stop whining.


Why? It's easy, and it's fun! I've been following the saga of Mcjames looking for a USB wireless adapter that works with Freebsd, and it's made me sad. Openbsd has better wireless support than Freebsd.

Expecting people to work on Freebsd by dragging long cables attached to their laptops doesn't pass the laugh test.


----------



## codermen (Jun 26, 2020)

Jose said:


> Why? It's easy, and it's fun! I've been following the saga of Mcjames looking for a USB wireless adapter that works with Freebsd, and it's made me sad. Openbsd has better wireless support than Freebsd.
> 
> Expecting people to work on Freebsd by dragging long cables attached to their laptops doesn't pass the laugh test.



 Agree! 
FreeBSD was supposed to remain a model in hardware support!


----------



## shkhln (Jun 26, 2020)

I'm getting quite annoyed each time somebody misrepresents laptops as desktops.


----------



## codermen (Jun 26, 2020)

[QUOTE = "шхлн, должность: 467361, участник: 54069"]
Я становлюсь довольно раздраженным каждый раз, когда кто-то неверно представляет ноутбуки как настольные.
[/ QUOTE]

Laptop is a full-fledged workstation, I agree completely! It is a pity that FreeBSD is inferior to Linux in this matter (


----------



## aponomarenko (Jun 26, 2020)

Jose said:


> Expecting people to work on Freebsd by dragging long cables attached to their laptops doesn't pass the laugh test.



Try EDUP EP-2911 or similar device inserted into one of the usb ports as described in the linked thread to have a short cable.


----------



## Jose (Jun 26, 2020)

shkhln said:


> I'm getting quite annoyed each time somebody misrepresents laptops as desktops.


I'm not sure what you mean. The linked thread clearly discusses wired workarounds for non-working laptop wireless hardware. Even short cables as Aponomarenko suggests are obnoxious given all* modern laptops ship with built-in wireless hardware.

There are at least two meanings of "desktop" in computer lexicon. One is the beige box we all know and love. The other is the set of graphical user interface abstractions we've become used to since the Mac classic popularized Xerox PARC's work.

Sometimes when people say something about "desktops" they mean desktop PCs. Sometimes when they speak of how something will work "on the desktop" they mean on the GUI common to laptops and desktops, as opposed to smart phones.

In any case, the desktop user experience in all its forms is becoming less and less popular, like it or not. (I don't like it.) The desktop computer is losing popularity even more rapidly. I had the realization that even most people that work on open source software don't have and don't want a desktop PC. Most work on laptops.

* I'd be curious if someone can come up with an example of one that doesn't.


----------



## shkhln (Jun 26, 2020)

codermen said:


> Laptop is a full-fledged workstation, I agree completely!


----------



## 20-100-2fe (Jun 26, 2020)

shkhln said:


> I'm getting quite annoyed each time somebody misrepresents laptops as desktops.



Laptop is the new Desktop: with 19" "laptops" - and the weight that comes with the size, the last place you want to see one is in your lap, so it ends up sitting on your desk, plugged in to the mains with a mouse attached. Laptops have become TRANSportable computers, slimmer than this one, of course, but still...


----------



## shkhln (Jun 26, 2020)

Jose said:


> I'm not sure what you mean. The linked thread clearly discusses wired workarounds for non-working laptop wireless hardware.



You know this thread has posts before your link, right?


----------



## Jose (Jun 26, 2020)

20-100-2fe said:


> Laptops have become TRANSportable computers, slimmer than this one, of course, but still...


The not-so lovable luggables of yesteryear.


----------



## Jose (Jun 26, 2020)

You mean this?


aponomarenko said:


> ...So support for this device is critical to conquering the desktop market.


To me that meant desktop as in the desktop user experience, and not specifically desktop computers. Maybe I'm alone on this.


----------



## aponomarenko (Jul 2, 2020)

tingo said:


> As the FreeBSD project doesn't have "conquer the desktop market" as one of its goals, the criticality of this request fails.
> ...



Just found this info about desktop support: https://www.phoronix.com/scan.php?page=news_item&px=FreeBSD-Laptops-2020-Challenge:



> ... Among the recent initiatives helping this have been more FreeBSD contributions from Intel and the FreeBSD Foundation buying newer laptops for developers in an effort to improve hardware support. ...


----------



## beastuxie (Jul 17, 2020)

To make long things short.
No FreeBSD does not support RTL 8821CE and it is not very probable it will in the near future.
I think is no need being arrogant or snippy.
My main notebook also uses a RTL 8821CE wifi card, it cannot be exchanged (thanks HP!) and so i cannot use FreeBSD on my main notebook right now.
And as my main notebook featur4es a Ryzen CPU und AMD GPU, i also cannot use my graphics chip and therefor i get a lower resolution than my display is made for.
Sigh. I will try on an older (wintel based) notebook, maybe there i can use FreeBSD.
Wish me luck.


----------



## aponomarenko (Jul 17, 2020)

beastuxie said:


> my main notebook featur4es a Ryzen CPU und AMD GPU, i also cannot use my graphics chip



Did you try latest https://www.freshports.org/graphics/drm-kmod and what is your card ID?


----------



## beastuxie (Jul 20, 2020)

_Quote from *aponomarenko*:   Did you try latest https://www.freshports.org/graphics/drm-kmod and what is your card ID?_

No, i did not, because without wifi/internet FreeBSD is kinda useless for me, no matter if grafics do work fine or not.

Btw. installing ports without wifi/internet might be a little difficult for me.


----------



## aponomarenko (Jul 21, 2020)

beastuxie said:


> _Quote from *aponomarenko*:   Did you try latest https://www.freshports.org/graphics/drm-kmod and what is your card ID?_
> 
> No, i did not, because without wifi/internet FreeBSD is kinda useless for me, no matter if grafics do work fine or not.
> 
> Btw. installing ports without wifi/internet might be a little difficult for me.



Does your laptop have an Ethernet port?


----------



## aponomarenko (Jul 21, 2020)

beastuxie said:


> _Quote from *aponomarenko*:   Did you try latest https://www.freshports.org/graphics/drm-kmod and what is your card ID?_
> 
> No, i did not, because without wifi/internet FreeBSD is kinda useless for me, no matter if grafics do work fine or not.
> 
> Btw. installing ports without wifi/internet might be a little difficult for me.



And what is the model of your laptop?


----------



## aponomarenko (Aug 15, 2020)

Good news! Support for RTL8821CE is coming: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247495#c2


----------



## nunotex (Nov 7, 2020)

Have you try ndis()?

I did try to used it with 

```
none1@pci0:4:0:0:       class=0x028000 card=0x817210ec chip=0x817210ec rev=0x10 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8191SEvB Wireless LAN Controller'
    class      = network
```
but it crashes when loading kernel module.


----------



## siarak230 (Jun 20, 2021)

hello, has the problem with the rtl8821ce card already been solved?


----------



## fbsd_ (Jun 20, 2021)

Oh I have been watitng that hardware support for a long time neighter. I created sıme threads on forum for that.
One of them: https://forums.freebsd.org/threads/can-i-compile-linux-hardware-code-with-freebsd.80600/#post-513913
I hope someones can create support for it


----------



## fbsd_ (Jun 20, 2021)

siarak230 said:


> hello, has the problem with the rtl8821ce card already been solved?


nope. Not yet unfortunately. Hope to get as soon as possible. Are you tried to setup FreeBSD to your daily computer? That sounds crazy


----------



## siarak230 (Jun 20, 2021)

fbsd_ said:


> nope. Not yet unfortunately. Hope to get as soon as possible. Are you tried to setup FreeBSD to your daily computer? That sounds crazy


I like testing new systems and freebsd showed up by accident and I wanted to install it and play on my laptop head.


----------



## fbsd_ (Jun 21, 2021)

siarak230 said:


> I like testing new systems and freebsd showed up by accident and I wanted to install it and play on my laptop head.


You can try it on a virtual machine too. It just works fine with virtualbox and that kinda things.


----------



## astyle (Nov 3, 2022)

Trying to convert my own Lenovo Ideapad 720S (Ryzen 5 2500, Vega 8 graphics). Everything works swimmingly - except for the wi-fi card (rtl8821ce).  

(on another machine that already has 13-RELEASE) I tried NDIS as per the Handbook, downloaded the Realtek drivers - and ndisgen didn't like the .sys and .inf files I fed it. I tried 64-bit drivers from all 3 available versions (win7/8.1/10) - no go.

Next, I tried to boot my Ideapad into the 13.1-RELEASE installer, and go into 'Live CD' mode. 
Running `ls -l /boot/kernel | grep rtwn` yielded a list of .ko modules that look like the correct driver (there's only one .ko file with `8821` in the name)
Running `pciconf -lv | grep -B3 network` yielded the same results as in post #27... but correct for my card. And yes, I also get the same `none1@pci0:nnn:nnn` device name.

So, I `kldload` the modules I find, no complaints/crashes there... `kldstat` shows the modules as loaded. BUT:

Running `sysctl net.wlan.devices` returns empty.
Running `dmesg | grep none1` to look for the `none1` device turned up by `pciconf` earlier - returns empty.
`ifconfig` shows `lo0` (loopback) and `ue0` (USB-attached ethernet cable), but not the wifi card...

No wifi is kind of a dealbreaker here... I don't want to be chained to my desk. If push comes to shove, I am aware of other options/workarounds. Decided to be stubborn in my pursuit of this one.


----------



## wb7odyfred (Nov 4, 2022)

astyle said:


> Trying to convert my own Lenovo Ideapad 720S (Ryzen 5 2500, Vega 8 graphics). Everything works swimmingly - except for the wi-fi card (rtl8821ce).
> 
> (on another machine that already has 13-RELEASE) I tried NDIS as per the Handbook, downloaded the Realtek drivers - and ndisgen didn't like the .sys and .inf files I fed it. I tried 64-bit drivers from all 3 available versions (win7/8.1/10) - no go.
> 
> ...


Glad to have you be stubborn and scratch your own itch.  The 8821au driver appears to be working with rtwn FreeBSD device driver.  rtw88 is the Linux device driver for rtl8821ce.

Found this approach using alpine Linux wifi driver for rtw88 for the rtl8821ce driver.
https://www.freshports.org/net/wifibox-alpine/    If you are able to build and test, tell us what you see from this vantage point.

https://wiki.freebsd.org/WiFi/Rtw88    Read more about rtl8821ce device driver modules


----------



## Jose (Nov 4, 2022)

astyle said:


> (on another machine that already has 13-RELEASE) I tried NDIS as per the Handbook, downloaded the Realtek drivers - and ndisgen didn't like the .sys and .inf files I fed it. I tried 64-bit drivers from all 3 available versions (win7/8.1/10) - no go.


NDIS was a Windows XP thing. You might have luck with XP / Vista 64-bit drivers, but I wouldn't bet on it working.





						XP x64 Remote NDIS based Internet Sharing Device driver?
					

Hello, May I know if any one have a working Remote NDIS based Internet Sharing Device driver for XP x64? I only have a working one for x86 (32 bit), but it obviously does not work for 64 bit.



					msfn.org


----------



## astyle (Nov 4, 2022)

wb7odyfred said:


> Glad to have you be stubborn and scratch your own itch.  The 8821au driver appears to be working with rtwn FreeBSD device driver.  rtw88 is the Linux device driver for rtl8821ce.
> 
> Found this approach using alpine Linux wifi driver for rtw88 for the rtl8821ce driver.
> https://www.freshports.org/net/wifibox-alpine/    If you are able to build and test, tell us what you see from this vantage point.
> ...


Thanks! I have to say, this looks useful! Will probably report my findings over the weekend.  

My other options included swapping in a compatible Intel-branded aftermarket card. The manual that I found for my laptop said that there are just two Intel-based options... and my Ideapad 720S has 8 GB of RAM...  Got the thing back in 2018, it will be 5 years old soon.


----------



## astyle (Nov 5, 2022)

Update: net/wifibox-alpine compiled perfectly on a 13.1-RELEASE machine that I have. Got a 93-MB package.  But downloading it to a Live CD environment for testing seems a bit of a challenge. Live CD is a Read-Only environment.

I tried to do some research on how to work through that, but it only pointed me in the direction of rolling my own Live CD... I want to be able to test that driver before I commit to installing FreeBSD on the laptop's SSD...

I'm hoping that this amounts to some `mount` command with useful parameters, rather than rolling my own Live CD from scratch. So if someone could point me in the right direction, that would be appreciated!


----------



## tingo (Nov 5, 2022)

And you don't have a usb memory stick you could install to?


----------



## astyle (Nov 15, 2022)

Installed 13.1-RELEASE to a USB stick, but my Ideapad 720S with 8 GB of RAM is VERY finicky trying to boot that stick.
After that, I proceeded to install net/wifibox-alpine in a couple separate ways:

To start, I compiled net/wifibox-alpine on another 13.1-RELEASE box, and then used `scp` to slurp up the prepared package onto the USB stick (hostname `beastie_test`). `kldload` - ed the following modules: `if_rtwn_pci.ko`, `if_urtw.ko`, `rtwn.ko`, and `rtwn-rtl8821aufw.ko` ... no complaints, but nothing registering in dmesg, either.  ifconfig not turning up the new hardware, either.

Then, I compiled the port on the `beastie_test` host itself... 

```
# pkg info wifibox-alpine
wifibox-alpine-20220712
Name           : wifibox-alpine
Version        : 20220712
Installed on   : Sun Nov 13 16:13:35 2022 PST
Origin         : net/wifibox-alpine
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : net
Licenses       : BSD2CLAUSE
Maintainer     : pali.gabor@gmail.com
WWW            : https://github.com/pgj/freebsd-wifibox-alpine
Comment        : Wifibox guest based on Alpine Linux
Options        :
        APP_HOSTAPD    : off
        APP_WPA_SUPPLICANT: on
        COMP_GZIP      : off
        COMP_LZ4       : off
        COMP_LZO       : off
        COMP_XZ        : on
        COMP_ZSTD      : off
        FW_ATH10K      : on
        FW_ATH11K      : on
        FW_ATMEL       : off
        FW_B43         : off
        FW_B43LEGACY   : off
        FW_BRCM        : on
        FW_IPW2100     : off
        FW_IPW2200     : off
        FW_IWL3945     : off
        FW_IWL4965     : off
        FW_IWLWIFI     : on
        FW_MARVELL     : on
        FW_MEDIATEK    : on
        FW_RT61        : on
        FW_RTLWIFI     : on
        FW_RTW88       : on
        FW_TI          : off
        UDS_PASSTHRU   : on
        XX_DRIVER_RTW89: on
        XX_DRIVER_WL   : on
Annotations    :
        FreeBSD_version: 1301000
        flavor         : default
Flat size      : 121MiB
Description    :
The implementation of the Wifibox embedded wireless router is based on
the use of a Linux-based guest operating system which can communicate
with the host's wireless network card on behalf of the host.  In order
to meet the requirements, this has to be a system with a low resource
footprint and easy to manage.  This is derived from Alpine Linux,
which is an actively maintained, security-oriented, lightweight
distribution, based on musl libc and BusyBox.

WWW: https://github.com/pgj/freebsd-wifibox-alpine
```

I turned on the `FW_RTW88` option, but that the .ko somehow never got installed anywhere properly - still lives in the port's work-default/ subdirectory.  In fact:

```
# updatedb
>>> WARNING
>>> Executing updatedb as root.  This WILL reveal all filenames
>>> on your machine to all login users, which is a security risk.
# locate rtw88 | grep ko
/usr/ports/net/wifibox-alpine/work-default/freebsd-wifibox-alpine-f8fd8cdb1a0e545272917fe1dc1f9544cf74e383/work/image-contents/lib/modules/5.15.53-0-lts/kernel/drivers/net/wireless/realtek/rtw88/rtw88_8723d.ko.xz
/usr/ports/net/wifibox-alpine/work-default/freebsd-wifibox-alpine-f8fd8cdb1a0e545272917fe1dc1f9544cf74e383/work/image-contents/lib/modules/5.15.53-0-lts/kernel/drivers/net/wireless/realtek/rtw88/rtw88_8723de.ko.xz
/usr/ports/net/wifibox-alpine/work-default/freebsd-wifibox-alpine-f8fd8cdb1a0e545272917fe1dc1f9544cf74e383/work/image-contents/lib/modules/5.15.53-0-lts/kernel/drivers/net/wireless/realtek/rtw88/rtw88_8822b.ko.xz
/usr/ports/net/wifibox-alpine/work-default/freebsd-wifibox-alpine-f8fd8cdb1a0e545272917fe1dc1f9544cf74e383/work/image-contents/lib/modules/5.15.53-0-lts/kernel/drivers/net/wireless/realtek/rtw88/rtw88_8822be.ko.xz
/usr/ports/net/wifibox-alpine/work-default/freebsd-wifibox-alpine-f8fd8cdb1a0e545272917fe1dc1f9544cf74e383/work/image-contents/lib/modules/5.15.53-0-lts/kernel/drivers/net/wireless/realtek/rtw88/rtw88_8822c.ko.xz
/usr/ports/net/wifibox-alpine/work-default/freebsd-wifibox-alpine-f8fd8cdb1a0e545272917fe1dc1f9544cf74e383/work/image-contents/lib/modules/5.15.53-0-lts/kernel/drivers/net/wireless/realtek/rtw88/rtw88_8822ce.ko.xz
/usr/ports/net/wifibox-alpine/work-default/freebsd-wifibox-alpine-f8fd8cdb1a0e545272917fe1dc1f9544cf74e383/work/image-contents/lib/modules/5.15.53-0-lts/kernel/drivers/net/wireless/realtek/rtw88/rtw88_core.ko.xz
/usr/ports/net/wifibox-alpine/work-default/freebsd-wifibox-alpine-f8fd8cdb1a0e545272917fe1dc1f9544cf74e383/work/image-contents/lib/modules/5.15.53-0-lts/kernel/drivers/net/wireless/realtek/rtw88/rtw88_pci.ko.xz
```

Resolving this last code snippet (finding and installing the `rtw88` modules properly) and the `compat.linuxkpi.skb.mem_limit=1` suggested in the wiki are the next thing to try. Although, if those last two don't work... a compatible Intel card (which is about $15-20 USD) is in the works for me. :/


----------



## astyle (Nov 16, 2022)

One more thing: the hack that puts `compat.linuxkpi.skb.mem_limit=1`into /boot/loader.conf doesnt seem to work... Yeah, this is GENERIC kernel on a 13.1-RELEASE.

```
# cat /boot/loader.conf
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
cryptodev_load="YES"
zfs_load="YES"
compat.linuxkpi.skb.mem_limit=1
# sysctl compat.linuxkpi.skb.mem_limit
sysctl: unknown oid 'compat.linuxkpi.skb.mem_limit'
# sysctl compat.linuxkpi
compat.linuxkpi.task_struct_reserve: 2304
compat.linuxkpi.net_ratelimit: 99
compat.linuxkpi.warn_dump_stack: 0
compat.linuxkpi.debug: 0
```


----------

