=== LinuxKPI 802.11 and Native Wireless Update

Links: +
link:https://github.com/FreeBSDFoundation/proj-laptop/issues/66[Support the MediaTek Wireless cards] URL: link:https://github.com/FreeBSDFoundation/proj-laptop/issues/66[] +
link:https://github.com/FreeBSDFoundation/proj-laptop/issues/99[Support the Realtek Wireless cards] URL: link:https://github.com/FreeBSDFoundation/proj-laptop/issues/99[]

Contact: Bjoern A. Zeeb <bz@FreeBSD.org> +
Contact: The FreeBSD wireless mailing list <wireless@FreeBSD.org>

This report focuses on the efforts using permissively licensed Linux wireless drivers, mostly unmodified, on FreeBSD, as well as preparing the native net80211 stack for support of newer standards.

==== Driver updates

All LinuxKPI based wireless drivers were updated to Linux v6.19 in main and stable/15.

This includes
* the shipping drivers Intel man:iwlwifi[4] mvm/mld, Realtek man:rtw88[4] and man:rtw89[4],
* the Mediatek mt76 driver which is a work in progress,
* the three Qualcomm Atheros drivers ath10k, ath11k, and ath12k, which are TODO, as well as
* the Broadcom brcmfmac, which compiles and loads firmware but is lacking the cfg80211 compat shim and some netdev work.

==== Intel iwlwifi support

In order for the man:iwlwifi[4] driver update to be applied a few FreeBSD specific adjustments were made to allow the mld sub-driver to load properly.
Also multiple bug fixes were worked out.

==== Realtek rtw88 and rtw89 support

After the driver updates it turned out that our chandef emulation needed to be more elaborate.
In the follow-up further problems were discovered related to the fact that some rtw88 drivers can fail the hardware scan needing a fallback to software scanning.
Lastly the two rtw88 chipsets 8821c and 8822b seem to often have a 6s delay when we are preparing to authenticate.
It is unclear why the firmware fails in those cases but in the end I decided to leave this problem alone and try to get the 802.11n and 802.11ac updates in next (before 15.1-R hopefully) and only then go back to these chipsets and see what we can do.

==== Mediatek mt76 support

MT7921/7922 and MT7925 are the primary chipsets to work on currently.
After the driver update some DMA32 problems along with page_pools got sorted.
The drm-kmod changes prepared for the switch from native vm_page to Linux struct page were thankfully committed.
This we allow me to get a testing version out to people more easily.
MT7925 also revealed an insufficiency in our LinuxKPI IDR implementation, which more or less was documented there from day one.
This will need a complete rework to avoid problems with accesses to already destroyed entries which can happen in Linux.
I have also started to rack up further chipsets for testing.
802.11n and 802.11ac support will mostly come along with the Realtek work.

==== Broadcom brcmfmac

The Broadcom brcmfmac driver is compiling for PCIe and loading firmware (with a minor work around for arm64).
We are now lacking some cfg80211 and netdev LinuxKPI compat work in order to create the interface and drive wireless.

==== QCA support

While ath10k is mostly sorted for station mode, ath11k and ath12k need more work to compile again and an implementation for the MHI and other bits as needed.

==== LinuxKPI USB support

The LinuxKPI USB implementation has been sitting there for more than a decade.
I already put out a call for any users last years and again this year without any reply.
I do have an overhauled version which allows Realtek, Mediatek QCA ath10k, and Broadcom brcmfmac USB chipsets to compile.
The latter two are mostly irrelevant with old, and little actual USB dongles available.
Realtek and Mediatek attach and do pass packets but need a bit more work on stability and clean teardown.

There is one blocker on this in that the (old and new) LinuxKPI USB implementation is intermingle our native USB stack leading to conflicts.
There is work in progress to resolve this and two possible ways have been identified but there is a 15 year old change in the way that first needs to be understood and cleaned up.

==== LinuxKPI SDIO support

The LinuxKPI SDIO support has been sitting in my development tree for a good year and was done mostly for Realtek rtw88.
Broadcom will need a few more placeholders to be filled, but that should not be too hard.
Interrupts need to be finalized and speed upgrade support pulled in from someone else's work in progress.
My plan is to get it into the tree as-is as soon as USB is out of the way for people to help testing and finalizing it.

==== Native net80211

Thanks to the Ports Management Team for running an exp-run (experimental test build).
I prepared a patch in order to identify all ports using the net80211 ioctl interface.
This is needed in order to minimize breakage of upcoming ioctl interface changes upfront.

Check link:https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293016[PR 293016] for details.

==== Other

I have given an update on most of this during the March LDWG (Laptop Desktop Working Group) call.
See link:https://wiki.freebsd.org/LaptopDesktopWorkingGroup[LDWG Wiki Page] for more information.

Sponsor: The FreeBSD Foundation
