USB-WiFi icon indicating copy to clipboard operation
USB-WiFi copied to clipboard

News: Add support for Mediatek Wi-Fi 7 driver for the mt7925 chipset (USB and PCIe)

Open morrownr opened this issue 2 years ago • 13 comments

I follow the Linux-Wlireless list and today I see v2 of the Add support for Mediatek Wi-Fi7 driver mt7925 patchset flowing in.

Info from v1 can be read at the following:

https://lwn.net/Articles/939966/

Patch v2 0/17 reads as follows:

This series adds mt7925, a new mac80211 driver for MediaTek Wi-Fi 7 (802.11be) device Filogic 360, which can support Station, AP, P2P, and monitor modes. Filogic 360 supports max 4096-QAM/160MHz radio operation at 6 GHz, 5 GHz, or 2.4 GHz with 2x2 antennas. This chip supports PCIe and USB bus type.

mt7925 supports Wi-Fi 6E and EHT rate with single link only at this moment, whereas Wi-Fi 7 and its specific features are working in progress. They will be introduced in further patches.

The driver is build tested by Intel's kernel test robot with both GCC and Clang with several architecture. Sparse reports no warnings.


This gives us a more clear picture of where Mediatek is headed with USB Wireless. Things we now know:

  • The mt7925 chipset will support a usb version of the chipset.
  • This is a WiFi 7 capable chipset.
  • It is capable of 160 Mhz channel width.
  • This patchset will be going mainline in the not so distant future.

This is really exciting. It looks like we are going to have an in-kernel driver for our next generation of USB WiFi adapters before the adapters are on the market. This is twice in a row. Mediatek is acting like Intel and AMD. It looks like Mediatek has had all hands on deck to get this driver out of the door so no wonder some patches to mt7921u have been going in slowly.

@morrownr

morrownr avatar Sep 13 '23 15:09 morrownr

Hi @LINGTIANJIAO

All I can do is speculate. Let's look at what history has to offer.

Mediatek bought Ralink about 10 years ago in an effort to get into the wifi business. This is a complicated business and it took some time, a few years, for a strategy to be set and it is obvious now that Linux support is on equal footing with Windows as far as Mediatek's strategy is concerned. We saw the first mac80211 (in-kernel) drivers for their usb chips in 2018. This has allowed Linux users to discover just how much better it is to have drivers based on the modern Linux wifi stack. Last year Mediatek released the WiFi 6e usb chipset but, for the first time in Linux history, the usb wifi driver was in the Linux kernel BEFORE product was available to buy. This was the mt7921 chipset. For the mt7921 chipset, the PCIe driver came into the Linux kernel with kernel 5.12 but the USB driver did not show up until kernel 5.18.

What we are seeing with the next generation, WiFi 7, is that the USB driver is shipping at the same time as the PCIe driver. I think this is mostly due to Mediatek now having devs that have learned and are more experienced. The modern WiFi 6 and later drivers are incredibly complicated and big but Mediatek is speeding up their ability to release drivers and ship product. All indications seem to point toward Mediatek being very serious about the wifi market and Linux support.

So, my guess would be that we see PCIe and USB chipsets shipping later this year with adapters and cards available at some point in the first half of 2024. I realize it can take time, many months, from a maker receiving chips until a product is ready to ship but I think it can happen faster than it did with the WiFi 6e products as both Mediatek and the adapter/card makers are now more familiar with the Mediatek chips.

Curiously, I have no idea what Realtek is up to. Historically you can get some idea of future products at Realtek by looking at some of the internals of their out-of-kernel drivers but right now, I see nothing beyond the rtl8852cu chipset. It recently shipped in new products but it is Realtek's first WiFi 6e usb product and it is basically a year behind Mediatek's offerings.

There has been code merged into the Linux kernel that prevents non standards compliant wifi 7 code from being able to run so it appears the door is shut on Realtek's out-of-kernel drivers starting with WiFi 7. I watch for hints on what Realtek is going to do but I'm not seeing anything at this point. It appears that Realtek is just going to continue to get further behind with its wifi business.

@morrownr

morrownr avatar Sep 18 '23 13:09 morrownr

Linux support is on equal footing with Windows as far as Mediatek's strategy is concerned.

I think Windows support by Mediatek is not very good. Wifi 6 routers are not even common.

bjlockie avatar Sep 18 '23 15:09 bjlockie

I think Windows support by Mediatek is not very good.

I don't use Windows but have seen some complaints. I see this as normal given that it takes time to train people and get up to speed. The company seems to be committed. The complaints seem to be lessening but there are old drivers out there that will cause problems for a while as the company just can't reach out and take everything that is out in the wild back. That is actually an advantage for Linux as there are no mt7921 drivers out in the wild so everyone basically gets the latest for the kernel they are using and it will continue to get better as new kernels are released.

Wifi 6 routers are not even common.

https://openwrt.org/toh/views/toh_available_16128_ax-wifi

morrownr avatar Sep 18 '23 15:09 morrownr

But I think the mt7921 has not good performance to Linux. Even can't apply 160Mhz!

The first Realtek usb chipset that will do 160 Mhz is the recently available rtl8832cu. I have a mt7922 based PCIe card. It will do 160 Mhz width in managed mode. Currently it shows a max of 80 Mhz for AP mode but I suspect that will be corrected in firmware at some point or it could be in code as it is supported with the same driver, mt7921u, that the mt7921 chipsets use. A lot of changes and additions continue to flow into the drivers and firmware. The complexity and size of these modern WiFi 6+ drivers and firmware is astounding.

So now I'm trying to use the mt7922 with PCIe.

As I said above. Managed mode is working fine with 160 Mhz with the mt7922.

morrownr avatar Sep 18 '23 16:09 morrownr

@LINGTIANJIAO

G'day.

I am trying to use the MT7922 in raspberry pi cm4. Do you know how to set it?

The mt7922 chipset uses the same in-kernel driver as the mt7921: mt7921u.ko

Raspberry Pi OS 05-03-23 is plug and play here with my mt7921au chipsets. I have a mt7922 based PCIe card and it works play and play with my desktop but I have not tested your specific combination but I'm sure we can get it going.

Tell me what version of the RasPiOS you are running?

The mt7922 chipset uses a different set of firmware files than the mt7921. Do you know how to check the version of the firmware files you have? You can read:

https://github.com/morrownr/USB-WiFi/blob/main/home/How_to_Install_Firmware_for_Mediatek_based_USB_WiFi_adapters.md

morrownr avatar Oct 02 '23 15:10 morrownr

01:00.0 Network controller: MEDIATEK Corp. Device 0616

The 0616 is just AMD speak for mt7922. AMD and Mediatek have a close contractual relationship. Intel does its own wifi but AMD has a contract with Mediatek and uses their own branding. 0608 = mt7921.

I'm on my main dev box right now. I has a PCIe card using the mt7922 chipset and kernel 6.1 and it works well.

If the mt7921u.ko driver is in place, which it should be with kernel 6.1 and the firmware files are the latest, it should work unless your card is using a vid/pid that is not in kernel 6.1. Can you get the vid/pid for your card and we will do some kernel diving to see if your vid/pid is there.

morrownr avatar Oct 02 '23 18:10 morrownr

$ grep PCI_ID /sys/bus/pci/devices/*/uevent

/sys/bus/pci/devices/0000:00:00.0/uevent:PCI_ID=8086:0150 /sys/bus/pci/devices/0000:00:01.0/uevent:PCI_ID=8086:0151 /sys/bus/pci/devices/0000:00:14.0/uevent:PCI_ID=8086:1E31 /sys/bus/pci/devices/0000:00:16.0/uevent:PCI_ID=8086:1E3A /sys/bus/pci/devices/0000:00:1a.0/uevent:PCI_ID=8086:1E2D /sys/bus/pci/devices/0000:00:1b.0/uevent:PCI_ID=8086:1E20 /sys/bus/pci/devices/0000:00:1c.0/uevent:PCI_ID=8086:1E10 /sys/bus/pci/devices/0000:00:1c.1/uevent:PCI_ID=8086:1E12 /sys/bus/pci/devices/0000:00:1c.3/uevent:PCI_ID=8086:1E16 /sys/bus/pci/devices/0000:00:1d.0/uevent:PCI_ID=8086:1E26 /sys/bus/pci/devices/0000:00:1f.0/uevent:PCI_ID=8086:1E4A /sys/bus/pci/devices/0000:00:1f.2/uevent:PCI_ID=8086:1E02 /sys/bus/pci/devices/0000:00:1f.3/uevent:PCI_ID=8086:1E22 /sys/bus/pci/devices/0000:01:00.0/uevent:PCI_ID=1002:675D /sys/bus/pci/devices/0000:01:00.1/uevent:PCI_ID=1002:AA90 /sys/bus/pci/devices/0000:03:00.0/uevent:PCI_ID=14C3:7922 /sys/bus/pci/devices/0000:04:00.0/uevent:PCI_ID=10EC:8168

The line for my card is:

/sys/bus/pci/devices/0000:03:00.0/uevent:PCI_ID=14C3:7922

morrownr avatar Oct 02 '23 18:10 morrownr

14C3 is the vendor ID for MediaTek and 0616 should be supported for quite a while:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f395d41f2a0343fa9d989d8f53e5640329554dd8

Is there anything mt7921e related in dmesg? E.g. like:

[    9.430862] mt7921e 0000:01:00.0: enabling device (0000 -> 0002)
[    9.472196] mt7921e 0000:01:00.0: ASIC revision: 79220010
[    9.572245] mt7921e 0000:01:00.0: HW/SW Version: 0x8a108a10, Build Time: 20231120183400a
[    9.952435] mt7921e 0000:01:00.0: WM Firmware Version: ____000000, Build Time: 20231120183441
[   11.101994] mt7921e 0000:01:00.0 wlp1s0: renamed from wlan0

BTW: 14E4 is the vendor ID for Broadcom and 2711 their BCM2711 PCIe Bridge.

ziswiler avatar Feb 11 '24 23:02 ziswiler

https://github.com/morrownr/USB-WiFi/issues/431

1b:00.0 Network controller: MEDIATEK Corp. Device 0717
	Subsystem: Foxconn International, Inc. Device e106
	Flags: bus master, fast devsel, latency 0, IRQ 236
	Memory at bfc00000 (64-bit, non-prefetchable) [size=2M]
	Memory at bfe00000 (64-bit, non-prefetchable) [size=32K]
	Capabilities: [80] Express Endpoint, IntMsgNum 0
	Capabilities: [e0] MSI: Enable+ Count=1/32 Maskable+ 64bit+
	Capabilities: [f8] Power Management version 3
	Capabilities: [100] Vendor Specific Information: ID=1556 Rev=1 Len=008 <?>
	Capabilities: [108] Latency Tolerance Reporting
	Capabilities: [110] L1 PM Substates
	Capabilities: [200] Advanced Error Reporting
	Kernel driver in use: mt7925e
	Kernel modules: mt7925e

ilikenwf avatar May 29 '24 03:05 ilikenwf

I have the PCIe version.

ilikenwf avatar May 29 '24 03:05 ilikenwf

Anyone knew if there is a plan of supporting it?

Yeeler avatar Jun 10 '25 06:06 Yeeler

@Yeeler

Anyone knew if there is a plan of supporting it?

All indications are that it will be supported. The lack of mt7927 Linux support is unusual as Mediatek over the last several years has proven to be on par with Intel and AMD as far as their Linux support is concerned. The mt7925 chip had Linux support starting with kernel 6.7, which was long before hardware was available to buy. As far as I can tell, the only difference between the mt7925 and mt7927 chips is that the mt7925 supports 160 MHz channel width and the mt7927 supports 320 MHz channel width. Both are WiFi 7. The easiest solution for now is to replace the mt7927 card with one that is based on the mt7925, if possible. The mt7925 M.2 cards can be had for 20-25 USD. What is needed would depend on your system.

The best way to speed up support is to make the requests directly to https://www.mediatek.com/ and https://www.amd.com/ . I suspect that everyone asking for mt7927 support is using a system with an AMD processor. The reason I suspect this is that Mediatek and AMD have a contract for wireless. Intel has its own wireless but AMD does not but it has an agreement with Mediatek to supply wireless chips. Often you will see Mediatek chips with AMD part numbers. So AMD needs to know Linux users want Linux drivers for the mt7927 chip... I'll try to find the AMD part number if anyone is going to send a message to AMD.

I can provide an example message if it would help.

morrownr avatar Jun 11 '25 18:06 morrownr

AMD part number for the mediatek mt7927 chip?

AMD collaborates with MediaTek on WiFi solutions, and the MediaTek MT7927 chip is often referred to with an AMD designation as well.

According to a Framework Community post, the MediaTek MT7927 is associated with the AMD RZ738 designation.

Therefore, the AMD part number for the MediaTek MT7927 chip is likely RZ738.

Note that while the MT7927 supports WiFi 7 (802.11be), the driver support for this chip, especially on platforms like Linux, is still being developed.


Any confirming information by those that own a system with the mt7927/rz738 chip is appreciated.

morrownr avatar Jun 12 '25 03:06 morrownr