# No wlan interface found



## jkk (May 15, 2021)

Hi,

i just tried to install FreeBSD on a new Lenovo laptop (see details below).
But it seems I'm unable to get the wifi interface to work.
It simply doesn't appear at "ifconfig", there is only "lo0"

As this laptop doesn't have a ethernet input, it's impossible to go on with installing by cable.

I've tried to add the following lines to /boot/loader.conf, but nothing worked:
(I know  some of them probably make no sense, but i only tried because i didn't know what else to try...)


```
if_rtwn_pci_load="YES"
if_rtwn_usb_load="YES"
if_ath_load="YES"
if_re_load="YES"
if_wi_load="YES"
if_iwi_load="YES"
wlan_load="YES"
firmware_load="YES"
```

pciconf -lvc showed:


```
none1@pci0:2:0:0    class=0x28000 rev=0x00 hdr=0x00 vendor=0x10ec device=0xc822 subvendor=0x17aa subdevice=0xc123
        vendor    = 'Realtek Semiconductor Co., Ltd.'
        device    = 'RTL8822CE 802.11ac PCIe Wireless Network Adapter'
        class    = network
```

After booting a live Mint linux I could extract the following system information:

```
System:
  Kernel: 5.4.0-58-generic x86_64 bits: 64 compiler: gcc v: 9.3.0
  Desktop: Xfce 4.14.2 Distro: Linux Mint 20.1 Ulyssa
  base: Ubuntu 20.04 focal
Machine:
  Type: Laptop System: LENOVO product: 82C7 v: Lenovo V15-ADA
  serial: <filter>
  Mobo: LENOVO model: LNVNB161216 v: SDK0J40700WIN serial: <filter>
  UEFI [Legacy]: LENOVO v: E8CN25WW date: 10/13/2020
Battery:
  ID-1: BAT0 charge: 35.9 Wh condition: 35.9/35.0 Wh (103%)
  model: SMP L16M2PB2 status: Full
CPU:
  Topology: Dual Core model: AMD Athlon Gold 3150U with Radeon Graphics
  bits: 64 type: MT MCP arch: Zen+ rev: 1 L2 cache: 1024 KiB
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  bogomips: 19164
  Speed: 1692 MHz min/max: 1400/2400 MHz Core speeds (MHz): 1: 2274 2: 1852
  3: 1521 4: 1589
Graphics:
  Device-1: AMD Picasso vendor: Lenovo driver: amdgpu v: kernel
  bus ID: 03:00.0
  Display: x11 server: X.Org 1.20.8 driver: amdgpu,ati
  unloaded: fbdev,modesetting,vesa resolution: 1920x1080~60Hz
  OpenGL: renderer: AMD RAVEN2 (DRM 3.35.0 5.4.0-58-generic LLVM 10.0.0)
  v: 4.6 Mesa 20.0.8 direct render: Yes
Audio:
  Device-1: AMD Raven/Raven2/Fenghuang HDMI/DP Audio vendor: Lenovo
  driver: snd_hda_intel v: kernel bus ID: 03:00.1
  Device-2: AMD Raven/Raven2/FireFlight/Renoir Audio Processor
  vendor: Lenovo driver: N/A bus ID: 03:00.5
  Device-3: AMD Family 17h HD Audio vendor: Lenovo driver: snd_hda_intel
  v: kernel bus ID: 03:00.6
  Sound Server: ALSA v: k5.4.0-58-generic
Network:
  Device-1: Realtek RTL8822CE 802.11ac PCIe Wireless Network Adapter
  vendor: Lenovo driver: rtw_pci v: N/A port: 2000 bus ID: 02:00.0
  IF: wlp2s0 state: up mac: <filter>
Drives:
  Local Storage: total: 267.39 GiB used: 7.91 GiB (3.0%)
  ID-1: /dev/nvme0n1 vendor: SK Hynix model: HFM256GDHTNI-87A0B
  size: 238.47 GiB
  ID-2: /dev/sda type: USB vendor: HP model: v212w size: 28.91 GiB
Partition:
  ID-1: / size: 2.79 GiB used: 110.0 MiB (3.9%) fs: overlay source: ERR-102
  ID-2: /var/log size: 26.54 GiB used: 44.6 MiB (0.2%) fs: ext4
  dev: /dev/sda3
Sensors:
  System Temperatures: cpu: 42.1 C mobo: N/A gpu: amdgpu temp: 42 C
  Fan Speeds (RPM): N/A
Info:
  Processes: 236 Uptime: 11m Memory: 5.58 GiB used: 1.46 GiB (26.2%)
  Init: systemd runlevel: 5 Compilers: gcc: 9.3.0 Shell: bash v: 5.0.17
  inxi: 3.0.38
```

After searching I only found that it probably might not work, as FreeBSD doesn't offer good support for most wifi card.
So, is it generally possible to get the onboard wlan to run (I don't want to buy a usb wlan adapter) ?

As a general question: Is this laptop suitable for a FreeBSD desktop system, or should i look for other hardware?

Please help me, I'm stuck.

Greetings


----------



## SirDice (May 15, 2021)

jkk said:


> It simply doesn't appear at "ifconfig", there is only "lo0"





> On FreeBSD 11 or higher, use this command instead:
> 
> `%  sysctl net.wlan.devices`
> 
> If a wireless adapter is not listed, an additional kernel module might be required, or it might be a model not supported by FreeBSD.











						Chapter 33. Advanced Networking
					

Advanced networking in FreeBSD:  basics of gateways and routes, CARP, how to configure multiple VLANs on FreeBSD, etc




					docs.freebsd.org


----------



## bakul (May 15, 2021)

`man rtwn` says there is no support for 8822CE. Your best bet is to just replace the wifi card with one of the supported ones. Many are in $20-$30 range and replacement is easy -- you will likely find a short youtube video on how to replace for your exact model!


----------



## jkk (May 15, 2021)

SirDice said:


> Chapter 33. Advanced Networking
> 
> 
> Advanced networking in FreeBSD:  basics of gateways and routes, CARP, how to configure multiple VLANs on FreeBSD, etc
> ...



Sry, forgot to mention that i already tried this:  (during i was reading the docs)

```
sysctl net.wlan.devices
```

but it showed no output.



bakul said:


> `man rtwn` says there is no support for 8822CE. Your best bet is to just replace the wifi card with one of the supported ones. Many are in $20-$30 range and replacement is easy -- you will likely find a short youtube video on how to replace for your exact model!



Ok thanks, but this is not what i was looking for. How is the chance that there will be published a suitable driver in the near future?

I also don't understand why there is a working driver for linux (rtw_pci), and not for BSD. Is there such a big difference?

How complex is it to write such a driver, is it realistic to do this as a one-man-project? (i have programming skills in C and C++) I think i don't have the time for this, but I'm intersted to get some deeper insights, where is a good starting point to learn more about this?


----------



## scottro (May 16, 2021)

Last time I checked, there was only one or maybe two people working on FreeBSD wireless. Not being a programmer, or knowing that much about hardware, I can't answer your questions about why Linux is so much better at wireless, save to say they have more resources to give the problem and my personal opinion is that many distributions are really aimed towards the single user laptop.  

If you don't want to be bothered with changing the wireless card there are many usb to wireless adapters, and many of those work with FreeBSD. You're not going to get high wireless speed with FreeBSD, even with supported wireless cards (though I think someone did manage to get an Atheros card working at Linux speeds), so you can even get a cheap one that has 802.11n, as you won't get speed much faster than that.

I have no idea when, if ever, support for your card will be added. I think the best thing you could do for that is to file a request for enhancement at FreeBSD's bugzilla. 






						FreeBSD Bugzilla Main Page
					






					bugs.freebsd.org
				




I know this isn't the answer you wanted, but it's how things are at this time. FreeBSD, and even OpenBSD lag behind in wireless. OpenBSD supposedly has better laptop support but even with them, their Intel driver doesn't reach Linux speeds.


----------



## bakul (May 16, 2021)

jkk said:


> How complex is it to write such a driver, is it realistic to do this as a one-man-project? (i have programming skills in C and C++) I think i don't have the time for this, but I'm intersted to get some deeper insights, where is a good starting point to learn more about this?



The relevant code is in /usr/src/sys/dev/rtwn/ directory. But note that this is some of the more complex code....

Believe me, replacing the mini pci card is the best option. You can also just add a usb wifi dongle. But in general FreeBSD wifi support is not on par with Linux. The problem is multifold - far fewer developers, worse support, if any, from vendors (compared to linux), etc. etc.


----------



## jkk (May 16, 2021)

Thanks a lot all of you, unfortunately at the moment I don't have the skills and time to rewrite the linux driver for BSD, it looks too complex.

As I'm a fan of the cheapest and simplest solution, I went back in the linux world, hopefully waiting another skilled person will do it.


----------



## Minbari (May 16, 2021)

jkk said:


> ...
> hopefully waiting another skilled person will do it.


You are going to wait a very long time for a person like that to show on FreeBSD world. For example I have a Realtek RTL8821AE (PCIe) wireless/bluetooth card, I think is from 2012/2013, and it doesn't has support on FreeBSD. A bug was opened in 2019 for it and I hoped with the release of FreeBSD 13 maybe the card will be supported (wifi only), but no luck. The only valid option was to replace it with a supported one, in my case a Intel Centrino Advanced-N 6205.


----------



## Emrion (May 16, 2021)

I think there is a solution that costs no money, but takes time: install a bhyve VM with a Linux distro (debian for example). Do a passthru of your wifi card into this VM. Intall the suited driver in this VM and use it as a network source for FreeBSD.

Well, it's simplier to stick to Linux, I admit. However, it's a good opportunity to learn many things of the FreeBSD world.


----------

