Page MenuHomeFreeBSD

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

Authored by jim.chen.1827_gmail.com on Tue, May 26, 7:18 AM.
Tags
None
Referenced Files
F160134580: D57242.diff
Sun, Jun 21, 4:25 PM
Unknown Object (File)
Fri, Jun 19, 2:52 AM
Unknown Object (File)
Fri, Jun 19, 2:52 AM
Unknown Object (File)
Wed, Jun 17, 9:16 PM
Unknown Object (File)
Tue, Jun 9, 9:17 AM
Unknown Object (File)
Tue, Jun 9, 9:14 AM
Unknown Object (File)
Sun, Jun 7, 7:11 AM
Unknown Object (File)
Sun, Jun 7, 7:08 AM
Subscribers

Details

Reviewers
emaste
siva
bz
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 Skipped
Unit
Tests Skipped

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.Mon, Jun 8, 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.Mon, Jun 8, 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.