MT7922 in PVE use PCI invalid wifi

I'm sorry, I used mechanical translation software. So it may not be expressed clearly.
I am running openwrt 23.05.03 using PVE VM on the X86 platform of GMK N6
At first, my OpenWrt couldn't even recognize the network card. Unable to identify network devices through virtualization.
I have installed two drivers for MT7922 during this process, but still cannot recognize them. The configuration file output through the wifi config command is also empty.
Later, I learned from other people on this site that mac80211 can output valid configuration files through the wifi config command. At the same time, relevant settings and activations can be set. You can see the WiFi logo in the LAN bridge.
But the actual signal is 0dB, and it cannot scan other wifi and other devices cannot recognize hotspot wifi.
I have been spending many days without resolving this issue.

I have tried to modify the region and channel, but multiple combinations have not yet taken effect. And after startup, WiFi [not a device] will display interface disabled, wireless not associated, etc. Both GHZ and mbit/S in the device options are question marks. I have also tried the driver for MT7921.

you should probably try the snapshots, and get it up and running on bare metal 1st.
if it doesn't work there, there's no point in trying to get it to work in a VM.

You can boot OpenWrt from a USB stick on the bare iron, without touching anything of the installed system - this will tell you if there is a fundamental issue with the WLAN card support (and if there is, the next step would be booting a main snapshot build) or if your issues are 'just' with (and caused by) proxmox.

Because I lack an external display screen now, I am unable to access the BIOS of the physical machine. So I want to first investigate as many problems as possible that can be found now. And based on the information I have searched, I believe OpenWrt can run on RZ616 [MT7922].

I deleted the software for mac80211 halfway through. After reinstalling mac80211, the operating frequency now only has two modes: N and Legacy. The AC and AX modes have disappeared.

root@OpenWrt:~# wifi config>/etc/config/wireless
root@OpenWrt:~# lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: Device 1234:1111 (rev 02)
00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon
00:05.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge
00:10.0 Network controller: MEDIATEK Corp. MT7922 802.11ax PCI Express Wireless Network Adapter
00:12.0 Ethernet controller: Red Hat, Inc. Virtio network device
00:13.0 Ethernet controller: Red Hat, Inc. Virtio network device
00:1e.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge
00:1f.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge
01:01.0 SCSI storage controller: Red Hat, Inc. Virtio SCSI
01:02.0 SCSI storage controller: Red Hat, Inc. Virtio SCSI
02:1b.0 USB controller: Red Hat, Inc. QEMU XHCI Host Controller (rev 01)
root@OpenWrt:~# wifi config>/etc/config/wireless
root@OpenWrt:~# lspci -v -s 00:10.0
00:10.0 Network controller: MEDIATEK Corp. MT7922 802.11ax PCI Express Wireless Network Adapter
        Subsystem: MEDIATEK Corp. Device c616
        Physical Slot: 16
        Flags: fast devsel, IRQ 11
        Memory at fd600000 (64-bit, prefetchable) [size=1M]
        Memory at fea90000 (64-bit, non-prefetchable) [size=32K]
        Capabilities: [80] Express Endpoint, MSI 00
        Capabilities: [e0] MSI: Enable- Count=1/32 Maskable+ 64bit+
        Capabilities: [f8] Power Management version 3
lspci: Unable to load libkmod resources: error -2


root@OpenWrt:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr BC:24:11:85:08:DA
          inet addr:192.168.100.1  Bcast:192.168.100.255  Mask:255.255.255.0
          inet6 addr: fe80::be24:11ff:fe85:8da/64 Scope:Link
          inet6 addr: fd74:e569:791f::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20611 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25826 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2567578 (2.4 MiB)  TX bytes:77429274 (73.8 MiB)

eth0      Link encap:Ethernet  HWaddr BC:24:11:85:08:DA
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:47785 errors:0 dropped:0 overruns:0 frame:0
          TX packets:57379 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:8137612 (7.7 MiB)  TX bytes:114519587 (109.2 MiB)

eth1      Link encap:Ethernet  HWaddr BC:24:11:32:3B:E2
          inet6 addr: fe80::be24:11ff:fe32:3be2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:140 (140.0 B)  TX bytes:11844 (11.5 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:40797 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40797 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:20639802 (19.6 MiB)  TX bytes:20639802 (19.6 MiB)

usb0      Link encap:Ethernet  HWaddr A2:97:15:D7:5B:97
          inet addr:192.168.59.23  Bcast:192.168.59.255  Mask:255.255.255.0
          inet6 addr: fe80::a097:15ff:fed7:5b97/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:96890 errors:0 dropped:0 overruns:0 frame:0
          TX packets:73244 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:91447639 (87.2 MiB)  TX bytes:15167212 (14.4 MiB)

utun      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:198.18.0.1  P-t-P:198.18.0.1  Mask:255.255.255.252
          inet6 addr: fe80::98d2:a21c:320f:a5f/64 Scope:Link
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:9000  Metric:1
          RX packets:509 errors:0 dropped:0 overruns:0 frame:0
          TX packets:635 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:273449 (267.0 KiB)  TX bytes:124535 (121.6 KiB)

root@OpenWrt:~# ifconfig -a
br-lan    Link encap:Ethernet  HWaddr BC:24:11:85:08:DA
          inet addr:192.168.100.1  Bcast:192.168.100.255  Mask:255.255.255.0
          inet6 addr: fe80::be24:11ff:fe85:8da/64 Scope:Link
          inet6 addr: fd74:e569:791f::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20746 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25963 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2580096 (2.4 MiB)  TX bytes:77461266 (73.8 MiB)

eth0      Link encap:Ethernet  HWaddr BC:24:11:85:08:DA
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:47920 errors:0 dropped:0 overruns:0 frame:0
          TX packets:57516 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:8152020 (7.7 MiB)  TX bytes:114551579 (109.2 MiB)

eth1      Link encap:Ethernet  HWaddr BC:24:11:32:3B:E2
          inet6 addr: fe80::be24:11ff:fe32:3be2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:140 (140.0 B)  TX bytes:11844 (11.5 KiB)

hwsim0    Link encap:UNSPEC  HWaddr 12-00-00-00-00-00-60-75-00-00-00-00-00-00-00-00
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:40914 errors:0 dropped:0 overruns:0 frame:0
          TX packets:40914 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:20689301 (19.7 MiB)  TX bytes:20689301 (19.7 MiB)

usb0      Link encap:Ethernet  HWaddr A2:97:15:D7:5B:97
          inet addr:192.168.59.23  Bcast:192.168.59.255  Mask:255.255.255.0
          inet6 addr: fe80::a097:15ff:fed7:5b97/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:97054 errors:0 dropped:0 overruns:0 frame:0
          TX packets:73387 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:91483041 (87.2 MiB)  TX bytes:15212159 (14.5 MiB)

utun      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:198.18.0.1  P-t-P:198.18.0.1  Mask:255.255.255.252
          inet6 addr: fe80::98d2:a21c:320f:a5f/64 Scope:Link
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:9000  Metric:1
          RX packets:517 errors:0 dropped:0 overruns:0 frame:0
          TX packets:645 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:275161 (268.7 KiB)  TX bytes:125879 (122.9 KiB)

root@OpenWrt:~#vi /etc/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option path 'virtual/mac80211_hwsim/hwsim0'
	option channel '36'
	option band '5g'
	option htmode 'HE80'
	option disabled '0'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'none'

config wifi-device 'radio1'
	option type 'mac80211'
	option path 'virtual/mac80211_hwsim/hwsim1'
	option channel '36'
	option band '5g'
	option htmode 'HE80'
	option disabled '0'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'none'

As long as your system has at least two network cards, it will default to a 'normal' router setup, eth0 as lan and eth1 as wan (yes, this might involve having to test all ports, to find lan); if you have only a single ethernet port it's going to be lan - so in either case, you should be able to access the system via ssh/ https/ http.

I really makes no sense to discuss about potential driver bugs, before you have gotten the virtualization aspect out of the way and tested running on the bare iron.

1 Like

I have tried many methods, but none of them can be installed on bare metal. The current problem has become how to install it。

After my efforts, I have successfully run OpenWrt on bare metal. But Openwrt still cannot recognize wireless. Hardware can be seen in PCI, but there are no wireless devices in ifconfig.

Even though I reinstalled the software according to the previous steps, the wificonfig output is still empty.

Log:
Sun May 12 02:31:28 2024 kern.info kernel: [    0.809355] pci 0000:04:00.0: [14                                                                   c3:0616] type 00 class 0x028000
Sun May 12 02:31:28 2024 kern.info kernel: [    0.810563] pci 0000:04:00.0: reg                                                                    0x10: [mem 0x7c10000000-0x7c100fffff 64bit pref]
Sun May 12 02:31:28 2024 kern.info kernel: [    0.812066] pci 0000:04:00.0: reg                                                                    0x18: [mem 0xdc900000-0xdc907fff 64bit]
Sun May 12 02:31:28 2024 kern.info kernel: [    0.813511] pci 0000:04:00.0: PME                                                                   # supported from D0 D3hot D3cold

Lspci:
04:00.0 Network controller: MEDIATEK Corp. MT7922 802.11ax PCI
Express Wireless

Lsusb:
Bus 001 Device 002: ID 0e8d:c616 MediaTek Inc. Wireless_Device

Ifconfig -a:
br-lan    Link encap:Ethernet  HWaddr 84:47:09:32:C7:79
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fd93:c6c5:5e86::1/60 Scope:Global
          inet6 addr: fe80::8647:9ff:fe32:c779/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:25535 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37048 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6990560 (6.6 MiB)  TX bytes:32828441 (31.3 MiB)

eth0      Link encap:Ethernet  HWaddr 84:47:09:32:C7:79
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:27184 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37048 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7437096 (7.0 MiB)  TX bytes:32878064 (31.3 MiB)

eth1      Link encap:Ethernet  HWaddr 84:47:09:32:C7:7A
          inet addr:139.1.4.75  Bcast:139.1.5.255  Mask:255.255.254.0
          inet6 addr: fe80::8647:9ff:fe32:c77a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:54246 errors:0 dropped:4710 overruns:0 frame:0
          TX packets:22439 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:21730360 (20.7 MiB)  TX bytes:7057043 (6.7 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:212 errors:0 dropped:0 overruns:0 frame:0
          TX packets:212 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:23562 (23.0 KiB)  TX bytes:23562 (23.0 KiB)

Wifi config:
null

The card is now at least detected on a PCIe & USB level, now make sure that you have the necessary kmods and firmwares installed. Corresponding dmesg errors and warnings should guide you there, as well as testing with iwinfo radio0 scan.

I execute ‘https://github.com/kjames2001/OpenWRT-PVE-AP-MT7922opkg’ The result of the 'opkg install kmod mt7921e wpad openss kmod iwlwwifi' command in allows wireless to output. Compared to last time, although there is one less configuration point, it is now possible to scan the surrounding wireless network. Last time I couldn't scan, but although I could scan, I couldn't join someone else's hotspot. At the same time, I am unable to create a hotspot myself and it shows as unassociated. Just being able to scan the wireless network. This operation is performed on a physical machine.
RedSunHYNG/openwrt (github.com)

In other words, the card is working now.

If luci needs a little hand holding,

rm /etc/config/wireless
wifi config
reboot

Although the wireless network card is already working and can scan the surrounding network, I am unable to join and create an access point. And at this point, 'ifconfig - a' still has no information about it。

root@OpenWrt:~# ifconfig -a
br-lan    Link encap:Ethernet  HWaddr 84:47:09:32:C7:79
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fd93:c6c5:5e86::1/60 Scope:Global
          inet6 addr: fe80::8647:9ff:fe32:c779/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9308 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11658 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3943128 (3.7 MiB)  TX bytes:5993440 (5.7 MiB)

eth0      Link encap:Ethernet  HWaddr 84:47:09:32:C7:79
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10354 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11658 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4129924 (3.9 MiB)  TX bytes:6020280 (5.7 MiB)

eth1      Link encap:Ethernet  HWaddr 84:47:09:32:C7:7A
          inet addr:139.1.4.75  Bcast:139.1.5.255  Mask:255.255.254.0
          inet6 addr: fe80::8647:9ff:fe32:c77a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16437 errors:0 dropped:1566 overruns:0 frame:0
          TX packets:7087 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2642130 (2.5 MiB)  TX bytes:3576587 (3.4 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:346 errors:0 dropped:0 overruns:0 frame:0
          TX packets:346 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:31098 (30.3 KiB)  TX bytes:31098 (30.3 KiB)

I have placed documents that may display information in the

Thank you, I succeeded inexplicably on my own. It can now operate as a network hotspot in a single frequency manner.