Page MenuHomeFreeBSD

Update fwget(8) to identify packages available in wifi-firmware-kmod
ClosedPublic

Authored by jim.chen.1827_gmail.com on May 26 2026, 7:18 AM.
Tags
None
Referenced Files
F166908190: D57242.id179381.diff
Mon, Aug 17, 4:52 PM
F166881991: D57242.id178592.diff
Mon, Aug 17, 12:16 PM
Unknown Object (File)
Sat, Aug 15, 8:01 AM
Unknown Object (File)
Thu, Aug 13, 5:10 AM
Unknown Object (File)
Thu, Aug 13, 1:13 AM
Unknown Object (File)
Tue, Aug 11, 10:55 AM
Unknown Object (File)
Mon, Aug 10, 11:38 AM
Unknown Object (File)
Sun, Aug 9, 2:36 AM
Subscribers

Details

Summary
  1. Update fwget(8) to download wifi-firmware-mt76-kmod-mt7921, and wifi-firmware-mt76-kmod-mt7925 for suitable PCI devices
  2. Update fwget(8) to recognize ITTIM PCI cards
  3. Update the mt76/zzz_fw_ports_fwget.sh script to download mt7921 and mt7925 rather than non-existent mt792x firmware.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Not saying that I'll take them but where did you get the two Realtek driver files from?
The ones I am aware off are different, that's why I am asking.

In D57242#1311904, @bz wrote:

Not saying that I'll take them but where did you get the two Realtek driver files from?
The ones I am aware off are different, that's why I am asking.

I started by copying the file for rtw8821ce, which I noticed had very little device-specific code, and added the device codes based on the PCI ID repository. I later found some similar implementations on (https://github.com/lwfinger/rtw88), so I assumed it was mostly correct.

I do not have the devices, so I can't test the drivers. I added the files mainly so the fwget script could pick up on them. If they are an issue, I will remove them from the differential.

bz requested changes to this revision.Jun 8 2026, 7:04 AM

If you can remove the realtek bits for now, I'll review the mediatek bits and @emaste or I can commit them then.

This revision now requires changes to proceed.Jun 8 2026, 7:04 AM
jim.chen.1827_gmail.com edited the summary of this revision. (Show Details)

Removed realtek changes.

This isn't quite correct yet (though probably not wrong).

mt7921 has an entry for a different vendor as well these days:

{ PCI_DEVICE(PCI_VENDOR_ID_ITTIM, 0x7922),
        .driver_data = (kernel_ulong_t)MT7922_FIRMWARE_WM },

Not sure anymore if the script doesn't check or if it simply didn't barf and it goes unnoticed as it is the same device ID as for mediatek?

Another reason we need a newer fwget (I should get back and rewrite my lua take I) to avoid adding different files for vendors but rather have the logical unit be a driver or similar. *sigh*

I would suggest, for now, to manually add the extra file to fwget and not try to automate this just yet. Maybe a printf saying to check for other vendor IDs in the driver or to list them at the end?

grep -r PCI_VENDOR_ID sys/contrib/dev/mediatek/mt76/ | grep -v PCI_VENDOR_ID_MEDIATEK
sys/contrib/dev/mediatek/mt76/mt7921/pci.c:     { PCI_DEVICE(PCI_VENDOR_ID_ITTIM, 0x7922),
In D57242#1317770, @bz wrote:

This isn't quite correct yet (though probably not wrong).

mt7921 has an entry for a different vendor as well these days:

{ PCI_DEVICE(PCI_VENDOR_ID_ITTIM, 0x7922),
        .driver_data = (kernel_ulong_t)MT7922_FIRMWARE_WM },

Not sure anymore if the script doesn't check or if it simply didn't barf and it goes unnoticed as it is the same device ID as for mediatek?

Another reason we need a newer fwget (I should get back and rewrite my lua take I) to avoid adding different files for vendors but rather have the logical unit be a driver or similar. *sigh*

I would suggest, for now, to manually add the extra file to fwget and not try to automate this just yet. Maybe a printf saying to check for other vendor IDs in the driver or to list them at the end?

grep -r PCI_VENDOR_ID sys/contrib/dev/mediatek/mt76/ | grep -v PCI_VENDOR_ID_MEDIATEK
sys/contrib/dev/mediatek/mt76/mt7921/pci.c:     { PCI_DEVICE(PCI_VENDOR_ID_ITTIM, 0x7922),

I've added the ITTIM device. I'm not sure whether it's one of the exceptions for PCI class like some other cards are, so I've assumed that it has the standard 0x02 code for network cards.

I am splitting it up into fwget and the shell script so I can MFC fwget quickly more easily) and am committing this.
Sorry it fell through the cracks after your last update.

Thanks a lot!

This revision is now accepted and ready to land.Mon, Jul 27, 1:01 PM