Skip to content

Releases

cywfm 0.22.11 (pre-release)

Pre-release

Choose a tag to compare

@spagu spagu released this 02 Dec 18:47

cywfm is a FreeBSD kernel module for the on-board Wi-Fi of Raspberry Pi boards. It loads into the stock GENERIC kernel and gives you a normal wlan0, so a board with no Ethernet cable can join your network at boot.

This is a pre-release for people who want to try it and report back. It is built as a file, so you do not need to build the module on the board.

What is in the archives

Files, all for arm64:

  • cywfm-0.22.11-t88-freebsd-15.1-arm64.tar.gz, module built on 15.1-RELEASE-p7
  • cywfm-0.22.11-t88-freebsd-15.0-arm64.tar.gz, module built on 15.0-RELEASE
  • SHA256SUMS, the checksums of the archives

Each archive holds the module, the firmware files for the Pi 4 and the Zero 2 W with their licence texts, an install script and the manual page.

A kernel module belongs to one FreeBSD release, so take the file that matches yours. On any other version, build the module on the board as the README describes.

Boards

Board State
Pi 4 Model B tested on 15.1 with 0.22.11; the module of the 15.1 archive is loaded there
Pi Zero 2 W tested on 15.1 up to 0.22.10; the module of the 15.1 archive is loaded there
Pi 5 Model B tested on 15.0 with 0.22.11; the module of the 15.0 archive is loaded there

Other boards with the same chips are untested. The README has a section on how to run the two report scripts on yours.

Install

Follow docs/install-card.md for a fresh SD card, or the Install section of the README for a running board. On a Pi 4, try it first on a machine you can reach physically.

What works

Station mode with WPA2-PSK and open networks at 2.4 GHz, and at 5 GHz on the Pi 4 and Pi 5. Access point mode with hostapd(8). A monitor interface behind a loader tunable. What ran on which board is in the test matrix, and the known limits are in docs/limits.md.

What changed since 0.22.6

  • Error recovery. The module sorts a failure into six classes (bus, frames, trap, silent, stall, stuck). After a fatal fault it takes the interface down with one log line and stays loaded. hw.cywfm.recover (default 0) allows 1 to 10 automatic restarts per load. hw.cywfm.fault holds the last fault, with the firmware's trap record when there is one, and devctl notifications DOWN, RESTARTED and HOLD carry the class. Measured with injected faults on all three boards (25 of 25 down with recover 0, 25 of 25 handled with recover 1 on each) and with a real firmware trap on the Pi 4 (5 of 5 down, 5 of 5 restarted). Not run: real bus, frames and stall faults. docs/error-recovery.md
  • Board defaults. hw.cywfm.card_intr, f2_block and bus_hs default to -1, "what the board profile says". The only default turned on is the card interrupt on the Pi 4. Compatibility: an explicit -1 in loader.conf used to mean on; set 1 instead. docs/board-defaults.md
  • Hardening. Every length and index that the chip or the air controls was audited; no out-of-bounds access was found. The module now refuses to start when a core it needs is missing from the chip's core table, and refuses malformed chanspecs.
  • Debug loads are fast. With hw.cywfm.debug 1 the per-command lines are off during the firmware download: kldload went from 75 s to 4.2 s on the Zero 2 W and from 103 s to 4.3 s on the Pi 5.
  • Aggregated receive (glom_rx 1). The receive order tracker holds 16 early control-frame numbers and has a new counter, hw.cywfm.rx_seq_overflow. On the Pi 4 the lost and back counts are 0 in 12 of 12 TCP transfers (before: nonzero in 9 of 12). Accounting only; frames were always passed on in arrival order.
  • Test scripts. tools/reload-test.sh and tools/irqfix-test.sh put back every hw.cywfm.* kenv value they change. reload-test.sh no longer restarts the board when no address arrives, unless CYWFM_NET_REBOOT=1.

State of this build

The 15.1 module is the same file from two builds (Pi 4 and Zero 2 W, equal SHA-256) and sits in /boot/modules of both boards. On the Pi 4 it was loaded in place, joined a WPA2 network and answered 20 of 20 pings; a boot of the Pi 4 from this file was not run. The 15.0 module is the one the Pi 5 has in /boot/modules, and it is the file in release/ of the tree. make test on the host is green.

Things to know before you start. On the Pi 4 and the Pi 5 the first join after loading the module often times out and the retry joins (first attempt: 12 of 20 loads on the Pi 4 on channel 11, 3 of 20 on channel 36). Against a hostapd without WMM the first WPA2 join takes about 16 seconds unless you set hw.cywfm.join_ie_rejoin to 1 or wmm_enabled=1 in hostapd. Open: in 3 of 3 long pings from the Pi 5 to an access point on the Zero 2 W, the Pi 5 stopped transmitting 70 to 90 s after the association; which board causes it is not known.