[RFC] ath12k: Qualcomm WCN7850 working via LinuxKPI (proof of concept)

From: Diego Casati <diego.casati_at_gmail.com>
Date: Tue, 27 Oct 2026 21:34:25 UTC
Hello,

I am a long-time FreeBSD user, not a kernel developer. With the help of
an AI coding assistant (GitHub Copilot) I got the Qualcomm WCN7850
(hw2.0, PCIe) working in station mode with the in-tree ath12k driver
through LinuxKPI on a Lenovo ThinkPad T14s Gen 6. I would like to offer
the result in case any of it is useful.

To be clear about what this is:

- The code was written by the AI assistant under my direction. I can't
  review kernel code to a committer's standard, and I am not asking
  for any of it to be committed as-is.
- I ran all the hardware tests myself and can keep doing so: test
  patches, collect logs, try ideas on real hardware.
- Reviewers who prefer not to look at AI-generated code can skip this
  thread.

Tl;DR - the code is here: https://github.com/dcasati/freebsd-ath12k-wcn7850

What works (FreeBSD 15.1-STABLE, amd64, one AP):

- WPA2-PSK on 2.4 GHz and 5 GHz (up to VHT80), DHCP, bring-up at boot.
- 20/20 reconnects per band, 30-minute ping soak with no loss, about
  340 Mb/s TCP each way on 5 GHz.
- 20/20 clean kldunload/kldload cycles, and 10/10 unloads while
  associated.

These ran on the stable/15 version of the series; the same patches
against main are build-tested only.

It may be useful as:

- a map of what ath12k needs from LinuxKPI: an MHI host, QMI/QRTR, a
  few 802.11 and regulatory changes, and a small net80211 hook. That
  is ten patches against main, about 9,500 lines, mostly MHI/QMI and
  ath12k, plus an ath12k(4) manual page;
- a bug report: the testing turned up a per-TID txq leak in LinuxKPI
  802.11 (lkpi_lsta_free()) that should affect every LinuxKPI wireless
  driver. I will file that separately in Bugzilla with measurements.

License: the ath12k changes stay BSD-3-Clause-Clear and everything else
is BSD-2-Clause.

On the repo at https://github.com/dcasati/freebsd-ath12k-wcn7850

- patches/main and patches/stable-15: the series for each branch
- results/2026-10-27: test results, charts and a boot dmesg
- docs/ath12k.4.txt: the manual page, rendered as text
- DEVELOPER-NOTES.md: the patch split, known limitations, and open
  design questions (where MHI/QMI should live, DMA teardown in dp.c,
  rc_update ordering, the net80211 hook)

Thanks for any feedback,

Diego Casati
<diego.casati@gmail.com>