HomeFreeBSD

LinuxKPI based WiFi drivers: scripts to extract fwget(8) and port details

Description

LinuxKPI based WiFi drivers: scripts to extract fwget(8) and port details

Add a "zzz_fw_ports_fwget.sh" script to each LinuxKPI based wireless
driver which in essential are all the same and in detail all different.
The scripts have been referenced in fwget(8) sources since d33f5a0afa54b
but were never committed.

The scripts do the full job compared to single-line-scripts I tried to
use before to ease maintainance life. Some use hacks like calling cpp
and extracting bits from the output to piece them together over multiple
files. It will be left as an exercise for the future to see if what was
done (a longer while ago) for iwlwifi(4) would be a good idea for some
other drivers too, to have a FreeBSD-specific sysctl to export some of
the accumulated data in an easily processable way.
The scripts are written in the "perl spirit" -- "to get the job done" --
and not to be nice or neat or efficient. For that we do not need them
often enough or in any critical path. People are welcome to improve
them if they feel like.
I've used them for two version updates now and even if ports enforce
some other (manual) editing to keep support for multiple branches for
now they worked extremly well.

For the most the scripts extract 2 parts: PCI IDs and firmware name;
then they add "flavor"s to both and put the information together.

That output is then separated into:

  • fwget(8) lines of PCI ID to port/package wifi-firmware-${name}-kmod-${flavor} mappings and
  • distfiles per flavor for the ports.
  • For iwlwififw(4) we also generate the tables for the man page (and the wiki) and hopefully the .Sh HARDWARE section for iwlwifi.4 soon too.

Depending on driver various other checks are done, e.g.,

  • does the PCI ID have one or more firmware files/flavors associated,
  • does the referenced firmware exist in the linux-firmware.git repo,
  • are there duplicates,
  • find the latest version of the firmware API.

Sponsored by: The FreeBSD Foundation
Suggested by: imp (to have automation in D44918)
MFC after: 3 days

Details

Provenance
bzAuthored on Apr 28 2024, 8:50 PM
Parents
rGb4c8f251d65f: iwlwifi: FreeBSD specific sysctl export update
Branches
Unknown
Tags
Unknown