Repository navigation
Conversation
The MT7922 reports the internal chip id 0x7922, but the same chip as a PCIe endpoint enumerates as 14c3:0616 (AMD RZ616). Only the AirportMtkWlan wrapper listed 0x061614c3, so the HAL never probed the card: SimpleMtkWlan's IOPCIPrimaryMatch and mwx_devices[] both stopped at 14c3:7922, and mwx_attach() classified anything else as MWX_HW_MT7921, which loads the MT7961 ROM patch and firmware instead of the MT7922 pair. - Info.plist: add 0x061614c3 to IOPCIPrimaryMatch - MtkMwx: add PCI_PRODUCT_MEDIATEK_MT7922_PCIE, match it in mwx_devices[] and map it to MWX_HW_MT7922 in mwx_attach() Existing 14c3:7922 behaviour is unchanged. Verified on a 14c3:0616 card on macOS 15.6: these two spots were binary patched in 1.5.0 to make the card attach as MT7922; this commit puts the same two changes in the source, plus the missing PCI match string.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
症状
MT7922 以 PCIe 形式(AMD RZ616,
14c3:0616)出现时,驱动不认卡:只有
AirportMtkWlan/WCL/Info.plist的IOPCIPrimaryMatch列了0x061614c3,而 HAL 这一侧停在了
14c3:7922。原因
仓库里两处设备表都没有
0x0616:SimpleMtkWlan/Info.plist→IOPCIPrimaryMatch=0x796114c3 0x060814c3 0x792214c3SimpleMtkWlan/hal_mwx/MtkMwx.cpp:339→mwx_devices[]只有0x7961 / 0x0608 / 0x7922于是
mwx_match()(MtkMwx.cpp:7228,pci_matchbyid(vendor, product, mwx_devices, …))返回 false,卡根本进不了 attach。即使绕过这层,
MtkMwx.cpp:2273也只判PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_MEDIATEK_MT7922,其他一律落到
MWX_HW_MT7921→ 加载 MT7961 的 ROM patch / firmware,不是 MT7922 的那套。0x7922是芯片内部的 dev id,0x0616是同一个 MT7922 在 PCIe 端点上报的 device id,两者都应当映射到MWX_HW_MT7922。改动
SimpleMtkWlan/Info.plist:IOPCIPrimaryMatch增加0x061614c3SimpleMtkWlan/hal_mwx/MtkMwx.cpp:#define PCI_PRODUCT_MEDIATEK_MT7922_PCIE 0x0616mwx_devices[]增加对应条目mwx_attach()的硬件类型判断同时接受0x0616和0x7922原来的
14c3:7922行为不变。验证
网卡
14c3:0616:1.5.0 的二进制在这两处(HAL 设备表、hwtype 比较常量)手工改成0x0616后,驱动正常 attach(
attach hardware type=MT7922),加载mwx-mt7922_*固件,连上 5 GHz 80 MHz 的 AP,速率 867 Mbps,睡眠/唤醒正常。
Info.plist的 PCI 匹配串。plutil -lint通过;手边没有 Xcode(只有 Command Line Tools),所以没有在这里跑build-macos.sh。