Intel Wireless

Thanks

Upfront I would love to thank the FreeBSD Foundation for sponsoring most of this project. I would also love to thank everyone who has reviewed changes, did initial testing, helped with drm-kmod, helped in various other ways, answered questions, encouraged, or patiently waited for any results or running code.

Background

In March 2020 Phoronix reported that the FreeBSD Foundation would sponsor 802.11ac work (I think based on a Tweet). I started working working on the Intel driver and wireless in April 2020 (with some gaps). At that point in time FreeBSD had (and still has) iwn(4) and iwm(4) support for various (older) Intel chipsets. There were various requests on the mailing lists and the bug tracking system for support for newer chipsets. There were also requests for drivers from other vendors. I did not feel that FreeBSD would have the man power at that point to write (or port and keep up-to-date from another BSD) native drivers for all the wireless cards (often exceeding the size of a wired driver by a magnitude in size these days). We also had no-one working on both sides of drivers anymore (having vendor resources or firmware access) and hence are dependent on public information to write drivers. This lead to multiple points:

Availability

What is there now, you wonder?

What is outstanding?

What is not there yet?

What will be added next?

  1. Full state machine.
  2. Check what is going on with TCP/UDP/IPv4 again.
  3. Fixes and enhancements for chipsets as needed.
  4. Reload support.
  5. Defered NAPI processing (this seems to bring some timing issues in and is a lot harder to debug just now).
  6. Auto-probing.
  7. Manual page. -- at this point I would consider iwlwifi a usable replacement for iwm(4) as well.

  8. Then we'll work on getting 802.11n support over the finish line in net80211 and LinuxKPI and re-enable it in the driver.
  9. Rinse and repeat for 802.11ac...
  10. What comes next comes next.

FAQ

Testing

Getting code

Please fetch the latest "apply-iwlwifi" script from https://people.freebsd.org/~bz/wireless/. The script will then download a number of patches and tarballs and apply them to a local tree. You are expected to run the script from the top of the src/ tree. If you are having other changes in that tree please make sure to have a backup. The tarballs may overwrite files (LinuxKPI netdevice.h being one).

Tunables

Please add the following lines to /boot/loader.conf or /boot/loader.conf.local.

boot_verbose="YES"
kern.msgbufsize=1146880

This will help any possible debugging which needs to be done by making the kernel and drivers more verbose and massively increasing the kernel message buffer.

Wireless configuration

You want to setup wireless configuration in /etc/rc.conf and probably /etc/wpa_supplicant.conf if you have not done so already. There is some information in the FreeBSD Handbook to help you getting started.

Here is a short sample I copied from a test setup. For rc.conf I assume a wlan99 (while most people will likely use wlan0 or wlan1). You will have to replace the XX bits with something suitable to your location. This will also enable wlan debugging so we can try to see what happened in case something goes wrong. If you have your own configuration already please add the wlandebug line.

wlans_iwlwifi0="wlan99"
create_args_wlan99="wlanmode sta regdomain XXXX country XX"
wlandebug_wlan99="+state +crypto +node +auth +assoc +dot1xsm +wpa"
ifconfig_wlan99="WPA SYNCDHCP"
ifconfig_wlan99_ipv6="inet6 accept_rtadv"

Rebuilding kernel

At this point it is only neccessary to rebuild the kernel but no userland. If in doubt please check the FreeBSD Handbook for more information on how to do that. Reboot your system to the newly installed kernel. You may see a lot more messages on the screen due to "boot_verbose" being on, which you may not be used to.

Loading the driver

(Optional) Before loading the driver clear the kernel message buffer in order to minimize logs running sysctl kern.msgbuf_clear=1.

kldload /boot/kernel/if_iwlwifi.ko should load the driver and you should see some information scrolling on the console.

(If you are using iwm(4) please see below at this point.)

A sysctl net.wlan.devices should now list iwlwifi0 as a possible wireless device.

If it does and you have not yet automatically gotten a wlan<n> device (see ifconfig -l) you can now run sh /etc/rc.d/netif start wlan99 (or wlan0 or wlan1 depending on your setup). Depending on your configuration WPA and then DCHPv4 may run, IPv6 will autoconfigure and you should see the output from ifocnfig about the wireless device.

Test

You can test and see what is working. At this point please do not expect a fully-functional device. Should anything go wrong, simply toggling the interface or unloading and reloading the driver will likely not be enough and you will have to reboot.

If you get to this point, please email me a sample of your log and the pciconf -lv lines for the iwlwifi0 entry so we can add the information to the table below. (Contact details at the bottom of this page)

I have an iwm(4) supported device

If you have an iwm(4) supported device, you will need to detach the iwm(4) and attach iwlwifi. Please check pciconf -l for your wireless device and remember (or copy and paste later) the first bit.

% pciconf -l | grep iwm
iwm0@pci0:3:0:0:        class=0x028000 rev=0x78 hdr=0x00 vendor=0x8086 device=0x24fd subvendor=0x8086 subdevice=0x0010

After loading the iwlwifi kernel module run the following commands (replacing the device selector with what you found for your computer):

devctl detach pci0:3:0:0
devctl set driver pci0:3:0:0 iwlwifi

That should do the trick.

What if things go wrong

I am sorry.

(Contact details at the bottom of this page)

Currently known issues

Support-Matrix

Which chipset was tested?

Card

PCI IDs

Current state

8000/AC 8265

0x8086/0x24fd/0x8086/0x0010

9000/AC 9260

0x8086/0x2526/0x8086/0x0014

22000/AX200

0x8086/0x2723/0x1a56/0x1653

Main development chipset.

22000/AX201

0x8086/0x06f0/0x8086/0x4070

quz_hr, Comet Lake PCH CNVi WiFi, works as much as the compat framework works.

22000/AX210

0x8086/0x2725/0x8086/0x0024

Wifi 6E (6Ghz) support, needs more work in compat code, FW assert on scan.

Contact

You can reach me at (bz at FreeBSD.ORG) or via the freebsd-wireless mailing list. If possible add "[iwlwifi]" to the subject. If possible add the "date" prefix of the files you downloaded and the hash of your git tree to the email body. 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.

History


CategoryWiFi

WiFi/Iwlwifi (last edited 2021-07-30T08:30:35+0000 by BjoernZeeb)