# [Solved] - Cannot get MediaTek-based wifi to work

## phil_r

Hey everyone. So I have a new Asus ROG X570-E motherboard that has a built-in MediaTek 7921e wifi module. Using kernel 5.14 or 5.15, I cannot get this card to activate in any way, shape or form.

I have dual-boot with Windows - surprise, it works fine there.  Even though the box and branding says the wifi card is an Intel AX220, the driver it loads is a MT76 so that's what I've been going with.

```
lspci -k:

06:00.0 Network controller: MEDIATEK Corp. Device 0608

Subsystem: MEDIATEK Corp. Device 0608
```

```
lsusb:

Bus 003 Device 003: ID 0e8d:0608 MediaTek Inc. Wireless_Device
```

```
lshw -c network:

*-network UNCLAIMED

description: Network controller

product: MEDIATEK Corp.

vendor: MEDIATEK Corp.

physical id: 0

bus info: pci@0000:06:00.0

version: 00

width: 64 bits

clock: 33MHz

capabilities: pciexpress msi pm cap_list

configuration: latency=0

resources: memory:e0300000-e03fffff memory:e0400000-e0403fff memory:e0404000-e0404fff
```

I can modprobe mt7921e and it loads up fine:

```
mt7921e 90112 0

mt76_connac_lib 40960 1 mt7921e

mt76 90112 2 mt7921e,mt76_connac_lib

mac80211 1150976 3 mt76,mt7921e,mt76_connac_lib

cfg80211 1007616 4 mt76,mt7921e,mac80211,mt76_connac_lib
```

MediaTek themselves say it's supported since kernel 5.12:

https://wireless.wiki.kernel.org/en/...ivers/mediatek),

Doing ip link only shows lo and onboard ethernet.

I just don't know what it is I'm missing to get this to work. I even found a post that Windows 10's fast startup can cause issues, so to go and delete the fast startup to get rid of the hibernation file, which I did (grabbing at straws) - didn't help.  Also tried shutting the system down for a few hours.

I have the 

```
mediatek/WIFI_MT7961_patch_mcu_1_2_hdr.bin mediatek/WIFI_MT7922_patch_mcu_1_1_hdr.bin mediatek/WIFI_RAM_CODE_MT7961_1.bin mediatek/WIFI_RAM_CODE_MT7922_1.bin mediatek/mt7622_n9.bin mediatek/mt7622_rom_patch.bin
```

 firmware compiled in.

Modules built:

```
undertaker /lib/modules/5.15.3-gentoo/kernel/drivers/net/wireless/mediatek # ls

mt76

undertaker /lib/modules/5.15.3-gentoo/kernel/drivers/net/wireless/mediatek # cd mt76

undertaker /lib/modules/5.15.3-gentoo/kernel/drivers/net/wireless/mediatek/mt76 # ls

mt76-connac-lib.ko  mt76.ko  mt7921

undertaker /lib/modules/5.15.3-gentoo/kernel/drivers/net/wireless/mediatek/mt76 # cd mt7921

undertaker /lib/modules/5.15.3-gentoo/kernel/drivers/net/wireless/mediatek/mt76/mt7921 # ls

mt7921e.ko
```

System is fully up to date on ~amd64. Any one have any ideas? I don't even see anything in dmesg for this.  The bluetooth component works fine.

Thanks!

----------

## Jaglover

I did search cateee.net kernel driver database for your device and now I doubt this Mediatek is your WiFi device. I think for some reason your real WiFi card is not showing in lspci. Possibly Windows is disabling it in the firmware. My 2¢.

----------

## phil_r

 *Jaglover wrote:*   

> Possibly Windows is disabling it in the firmware. My 2¢.

 

I did think this too, but I've checked several times and it's most definitely enabled.  I tried it with bluetooth disabled (also set in firmware) to see if that made a difference, it did not.

----------

## NeddySeagoon

phil_r,

Its showing on both USB and PCI. That's possible if its in a M.2 slot as some keying allow a USB2 interface too.

Are you trying to use it as a PCIe or a USB device?

The wrong answer is both at the same time.

Show us all of 

```
lspci -nnk
```

and 

```
lsusb
```

 please.

Oh, put all of dmesg onto a pastebin too, after you are sure the module is loaded.

----------

## phil_r

@Neddy...

I have two M.2 slots and they're both occupied with NVMe drives.  The wifi is "integrated" onto the motherboard, but I don't know precisely how.  I assume it's part of the main chipset.

```
undertaker /usr/src/linux # lspci -nnk

00:00.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Root Complex [1022:1480]

        Subsystem: ASUSTeK Computer Inc. Starship/Matisse Root Complex [1043:87c0]

00:00.2 IOMMU [0806]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse IOMMU [1022:1481]

        Subsystem: ASUSTeK Computer Inc. Starship/Matisse IOMMU [1043:87c0]

00:01.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge [1022:1482]

00:01.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse GPP Bridge [1022:1483]

        Kernel driver in use: pcieport

00:01.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse GPP Bridge [1022:1483]

        Kernel driver in use: pcieport

00:02.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge [1022:1482]

        DeviceName:  Onboard IGD

00:03.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge [1022:1482]

00:03.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse GPP Bridge [1022:1483]

        Kernel driver in use: pcieport

00:04.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge [1022:1482]

00:05.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge [1022:1482]

00:07.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge [1022:1482]

00:07.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Internal PCIe GPP Bridge 0 to bus[E:B] [1022:1484]

        Kernel driver in use: pcieport

00:08.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge [1022:1482]

00:08.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Internal PCIe GPP Bridge 0 to bus[E:B] [1022:1484]

        Kernel driver in use: pcieport

00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 61)

        Subsystem: ASUSTeK Computer Inc. FCH SMBus Controller [1043:87c0]

        Kernel driver in use: piix4_smbus

        Kernel modules: i2c_piix4

00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge [1022:790e] (rev 51)

        Subsystem: ASUSTeK Computer Inc. FCH LPC Bridge [1043:87c0]

00:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Matisse/Vermeer Data Fabric: Device 18h; Function 0 [1022:1440]

00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Matisse/Vermeer Data Fabric: Device 18h; Function 1 [1022:1441]

00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Matisse/Vermeer Data Fabric: Device 18h; Function 2 [1022:1442]

00:18.3 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Matisse/Vermeer Data Fabric: Device 18h; Function 3 [1022:1443]

        Kernel driver in use: k10temp

        Kernel modules: k10temp

00:18.4 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Matisse/Vermeer Data Fabric: Device 18h; Function 4 [1022:1444]

00:18.5 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Matisse/Vermeer Data Fabric: Device 18h; Function 5 [1022:1445]

00:18.6 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Matisse/Vermeer Data Fabric: Device 18h; Function 6 [1022:1446]

00:18.7 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Matisse/Vermeer Data Fabric: Device 18h; Function 7 [1022:1447]

01:00.0 Non-Volatile memory controller [0108]: Phison Electronics Corporation PS5013 E13 NVMe Controller [1987:5013] (rev 01)

        Subsystem: Phison Electronics Corporation PS5013 E13 NVMe Controller [1987:5013]

        Kernel driver in use: nvme

02:00.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Matisse Switch Upstream [1022:57ad]

        Kernel driver in use: pcieport

03:01.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Matisse PCIe GPP Bridge [1022:57a3]

        Kernel driver in use: pcieport

03:02.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Matisse PCIe GPP Bridge [1022:57a3]

        Kernel driver in use: pcieport

03:04.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Matisse PCIe GPP Bridge [1022:57a3]

        Kernel driver in use: pcieport

03:05.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Matisse PCIe GPP Bridge [1022:57a3]

        Kernel driver in use: pcieport

03:08.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Matisse PCIe GPP Bridge [1022:57a4]

        Kernel driver in use: pcieport

03:09.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Matisse PCIe GPP Bridge [1022:57a4]

        Kernel driver in use: pcieport

03:0a.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Matisse PCIe GPP Bridge [1022:57a4]

        Kernel driver in use: pcieport

04:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983 [144d:a808]

        Subsystem: Samsung Electronics Co Ltd SSD 970 EVO Plus 1TB [144d:a801]

        Kernel driver in use: nvme

05:00.0 USB controller [0c03]: NEC Corporation uPD720200 USB 3.0 Host Controller [1033:0194] (rev 03)

        Kernel driver in use: xhci_hcd

        Kernel modules: xhci_pci

06:00.0 Network controller [0280]: MEDIATEK Corp. Device [14c3:0608]

        Subsystem: MEDIATEK Corp. Device [14c3:0608]

07:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller [10ec:8125] (rev 05)

        Subsystem: ASUSTeK Computer Inc. RTL8125 2.5GbE Controller [1043:87d7]

        Kernel driver in use: r8169

        Kernel modules: r8169

08:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Reserved SPP [1022:1485]

        Subsystem: ASUSTeK Computer Inc. Starship/Matisse Reserved SPP [1043:87c0]

08:00.1 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller [1022:149c]

        Subsystem: ASUSTeK Computer Inc. Matisse USB 3.0 Host Controller [1043:87c0]

        Kernel driver in use: xhci_hcd

        Kernel modules: xhci_pci

08:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller [1022:149c]

        Subsystem: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller [1022:148c]

        Kernel driver in use: xhci_hcd

        Kernel modules: xhci_pci

09:00.0 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 51)

        Subsystem: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901]

        Kernel driver in use: ahci

0a:00.0 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 51)

        Subsystem: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901]

        Kernel driver in use: ahci

0b:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] [1002:67df] (rev e7)

        Subsystem: Micro-Star International Co., Ltd. [MSI] Radeon RX 580 Armor 4G OC [1462:3418]

        Kernel driver in use: amdgpu

        Kernel modules: amdgpu

0b:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] [1002:aaf0]

        Subsystem: Micro-Star International Co., Ltd. [MSI] Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] [1462:aaf0]

        Kernel driver in use: snd_hda_intel

        Kernel modules: snd_hda_intel

0c:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Function [1022:148a]

        Subsystem: ASUSTeK Computer Inc. Starship/Matisse PCIe Dummy Function [1043:87c0]

0d:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Reserved SPP [1022:1485]

        Subsystem: ASUSTeK Computer Inc. Starship/Matisse Reserved SPP [1043:87c0]

0d:00.1 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Cryptographic Coprocessor PSPCPP [1022:1486]

        Subsystem: ASUSTeK Computer Inc. Starship/Matisse Cryptographic Coprocessor PSPCPP [1043:87c0]

        Kernel driver in use: ccp

        Kernel modules: ccp

0d:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Matisse USB 3.0 Host Controller [1022:149c]

        Subsystem: ASUSTeK Computer Inc. Matisse USB 3.0 Host Controller [1043:87c0]

        Kernel driver in use: xhci_hcd

        Kernel modules: xhci_pci

0d:00.4 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse HD Audio Controller [1022:1487]

        Subsystem: ASUSTeK Computer Inc. Starship/Matisse HD Audio Controller [1043:87c5]

        Kernel driver in use: snd_hda_intel

        Kernel modules: snd_hda_intel
```

When I modprobe mt76 and mt7921e, this is all that shows in dmesg (I unloaded then re-loaded them for this snippet):

```
[15604.956475] cfg80211: Loading compiled-in X.509 certificates for regulatory database

[15604.956612] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'

[15604.956618] Loading firmware: regulatory.db

[15604.956987] Loading firmware: regulatory.db.p7s

undertaker /usr/src/linux # lsmod | grep mt

mt7921e                86016  0

mt76_connac_lib        32768  1 mt7921e

mt76                   69632  2 mt7921e,mt76_connac_lib

mac80211              815104  3 mt76,mt7921e,mt76_connac_lib

cfg80211              798720  4 mt76,mt7921e,mac80211,mt76_connac_lib
```

```
undertaker /usr/src/linux # lsusb

Bus 008 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 006 Device 006: ID 05e3:0749 Genesys Logic, Inc. SD Card Reader and Writer

Bus 006 Device 002: ID 05e3:0616 Genesys Logic, Inc. hub

Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 005 Device 003: ID 0b05:18f3 ASUSTek Computer, Inc. AURA LED Controller

Bus 005 Device 002: ID 05e3:0610 Genesys Logic, Inc. Hub

Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 003 Device 003: ID 0e8d:0608 MediaTek Inc. Wireless_Device

Bus 003 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver

Bus 003 Device 002: ID 05e3:0608 Genesys Logic, Inc. Hub

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 001 Device 002: ID 046d:0825 Logitech, Inc. Webcam C270

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
```

Let me know if there's anything else you'd like to see.  The more I look at this the more I start to think I simply have the wrong device, but based off what Windows loads and other research I've done I don't see what other device it could be.

----------

## NeddySeagoon

phil_r,

```
06:00.0 Network controller [0280]: MEDIATEK Corp. Device [14c3:0608]

        Subsystem: MEDIATEK Corp. Device [14c3:0608] 
```

```
Bus 003 Device 003: ID 0e8d:0608 MediaTek Inc. Wireless_Device 
```

Two different vendor IDs ... That's possible. I'm pretty sure that's two different devices now, both with the device ID 0608.

Ahhh ... you need this patch

Its dated 14-Nov-21.

Its not in the 5.15.0 kernel. That only has 

```
static const struct pci_device_id mt7921_pci_device_table[] = {

        { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7961) },

        { },

};

```

so the patch won't even apply cleanly. Nor is it in 5.15.5.

How to fix it ... edit 

```
/usr/src/linux//drivers/net/wireless/mediatek/mt76/mt7921/pci.c
```

At line 15, expect to see 

```
static const struct pci_device_id mt7921_pci_device_table[] = {
```

Make that function read 

```
static const struct pci_device_id mt7921_pci_device_table[] = {

    { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7961) },

    { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7922) },

    { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x0608) },

    { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x0616) },

    { },

 };

```

The { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x0608) } line makes the driver bind to your device.

Now rebuild and reinstall the kernel. If you feel lucky, just rebuilding and reinstalling modules will do.

----------

## phil_r

Hot frickin' diggity dawg - I think that did it.

```
dmesg:

[20571.404695] cfg80211: Loading compiled-in X.509 certificates for regulatory database

[20571.404880] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'

[20571.404892] Loading firmware: regulatory.db

[20571.404918] Loading firmware: regulatory.db.p7s

[20576.246821] mt7921e 0000:06:00.0: enabling device (0000 -> 0002)

[20576.246971] mt7921e 0000:06:00.0: ASIC revision: 79610010

[20576.319766] Loading firmware: mediatek/WIFI_MT7961_patch_mcu_1_2_hdr.bin

[20576.319768] mt7921e 0000:06:00.0: HW/SW Version: 0x8a108a10, Build Time: 20211014150838a

[20576.571196] Loading firmware: mediatek/WIFI_RAM_CODE_MT7961_1.bin

[20576.571202] mt7921e 0000:06:00.0: WM Firmware Version: ____010000, Build Time: 20211014150922

[20576.600622] mt7921e 0000:06:00.0: Firmware init done

[20578.174927] mt7921e 0000:06:00.0 wlp6s0: renamed from wlan0
```

```
ip link

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

2: enp7s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000

    link/ether 04:42:1a:e7:d6:9e brd ff:ff:ff:ff:ff:ff

3: wlp6s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000

    link/ether b4:b5:b6:92:b8:45 brd ff:ff:ff:ff:ff:ff
```

```
rfkill list all

0: hci0: Bluetooth

        Soft blocked: no

        Hard blocked: no

1: phy0: Wireless LAN

        Soft blocked: no

        Hard blocked: no
```

```
lspci -k:

<snip>

06:00.0 Network controller: MEDIATEK Corp. Device 0608

        Subsystem: MEDIATEK Corp. Device 0608

        Kernel driver in use: mt7921e

        Kernel modules: mt7921e

```

The adapter now shows up in Network Manager and can be configured, which obviously wasn't happening before.

You are THE MAN.

What a clusterf* that is... and I did get away with just rebuilding the modules then modprobe -r and modprobe them back.  So that's sweet.

Hopefully that patch makes it into the kernel sometime soon.

Thanks again for figuring that out, I really, really appreciate it.

----------

## NeddySeagoon

phil_r,

Its not in 5.16-rc3 so bookmark this topic :)

----------

## sl70

Does this actually work? My new computer has the Mediatek wifi controller in it, too. I patched (hand edited) the pci.c file, made a module. The module loads, but I still can't get the wireless interface to come up. I tried by hand with ifconfig, and with NetworkManager. Neither way does the wifi work.

Here are the lines in the log when I load the module:

```
Jan 29 22:26:01 new_ kernel: mt7921e 0000:04:00.0: ASIC revision: 79610010

Jan 29 22:26:01 new_ kernel: Loading firmware: mediatek/WIFI_MT7961_patch_mcu_1_2_hdr.bin

Jan 29 22:26:01 new_ kernel: mt7921e 0000:04:00.0: HW/SW Version: 0x8a108a10, Build Time: 20211014150838a\x0a

Jan 29 22:26:01 new_ kernel: Loading firmware: mediatek/WIFI_RAM_CODE_MT7961_1.bin

Jan 29 22:26:01 new_ kernel: mt7921e 0000:04:00.0: WM Firmware Version: ____010000, Build Time: 20211014150922

Jan 29 22:26:01 new_ kernel: mt7921e 0000:04:00.0: Firmware init done

Jan 29 22:26:03 new_ NetworkManager[2372]: <info>  [1643462763.5359] manager: (wlan0): new 802.11 Wi-Fi device (/org/freedesktop/NetworkManager/Devices/7)

Jan 29 22:26:03 new_ kernel: mt7921e 0000:04:00.0 wlp4s0: renamed from wlan0

Jan 29 22:26:03 new_ NetworkManager[2372]: <info>  [1643462763.5367] rfkill1: found Wi-Fi radio killswitch (at /sys/devices/pci0000:00/0000:00:02.1/0000:01:00.2/0000:02:09.0/0000:04:00.0/ieee80211/phy1/rfkill1) (driver mt7921e)

Jan 29 22:26:03 new_ NetworkManager[2372]: <info>  [1643462763.5453] device (wlan0): interface index 7 renamed iface from 'wlan0' to 'wlp4s0'

Jan 29 22:26:03 new_ NetworkManager[2372]: <info>  [1643462763.5467] device (wlp4s0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')

Jan 29 22:26:04 new_ NetworkManager[2372]: <info>  [1643462764.2368] device (wlp4s0): set-hw-addr: set MAC address to 9A:B4:ED:DE:84:10 (scanning)

Jan 29 22:26:04 new_ NetworkManager[2372]: <info>  [1643462764.2815] device (wlp4s0): supplicant interface state: internal-starting -> disconnected

Jan 29 22:26:04 new_ NetworkManager[2372]: <info>  [1643462764.2815] device (wlp4s0): state change: unavailable -> disconnected (reason 'supplicant-available', sys-iface-state: 'managed')

```

Here are the modules:

```
mt7921e                86016  0

mt76_connac_lib        32768  1 mt7921e

mt76                   65536  2 mt7921e,mt76_connac_lib

mac80211              811008  3 mt76,mt7921e,mt76_connac_lib

cfg80211              778240  4 mt76,mt7921e,mac80211,mt76_connac_lib

```

Can't get it up.

```
 ifconfig  wlp4s0

wlp4s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500

        ether 72:de:c5:16:e3:7a  txqueuelen 1000  (Ethernet)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

```

```
lspci -k

04:00.0 Network controller: MEDIATEK Corp. Device 0608

        Subsystem: MEDIATEK Corp. Device 0608

        Kernel driver in use: mt7921e

        Kernel modules: mt7921e

```

Any ideas?

TIA

----------

## phil_r

 *sl70 wrote:*   

> Does this actually work? My new computer has the Mediatek wifi controller in it, too. I patched (hand edited) the pci.c file, made a module. The module loads, but I still can't get the wireless interface to come up. I tried by hand with ifconfig, and with NetworkManager. Neither way does the wifi work.
> 
> Here are the lines in the log when I load the module:
> 
> ```
> ...

 

You're going through what i went through.  These two things did help for me though:

a) if you dual-boot with Windows, go into Windows and disable the fast-start nonsense (hibernataion, if you're old school).  Make sure all that crap is turned off.

b) power down your system and actually pull the power cord for a moment.

I've had to do the power cord thing a couple of times but it does work (for me, at least).  I'm putting it down to buggy firmware where some memory isn't being cleared on a soft reset so it doesn't initialize properly.  Under Windows the drivers can handle it so it works fine, but under Linux that isn't there so it needs that extra helping hand.

I doubt it will ever be properly fixed because "it works with Windows" which as we know is the target market for these things.  Us Linux folks just have to deal with it  :Smile:   This MediaTek wifi card reminds me of the old soft-modems of the early 2000's that worked fine in Windows 2000 and XP but were as dead as last year's calendar in Linux because of the drivers.

----------

## sl70

 *phil_r wrote:*   

> 
> 
> You're going through what i went through.  These two things did help for me though:
> 
> a) if you dual-boot with Windows, go into Windows and disable the fast-start nonsense (hibernataion, if you're old school).  Make sure all that crap is turned off.
> ...

 

I've never had any problems with drivers in Linux, but in the past I've never used hardware that was anywhere near "cutting edge". I don't dual-boot, so thanks for the advice but I don't think I can use it. This is a desktop computer and I have ethernet, so I'm not so inconvenienced, but I would like to get it working some day.

----------

## phil_r

 *sl70 wrote:*   

>  *phil_r wrote:*   
> 
> You're going through what i went through.  These two things did help for me though:
> 
> a) if you dual-boot with Windows, go into Windows and disable the fast-start nonsense (hibernataion, if you're old school).  Make sure all that crap is turned off.
> ...

 

I'd still try the power cord trick, if I were you.  What's the worst that can happen?

----------

## sl70

 *phil_r wrote:*   

> 
> 
> I'd still try the power cord trick, if I were you.  What's the worst that can happen?

 

Tried it. Still didn't help. Thanks, anyway.

----------

## sl70

I mentioned that I have a working ethernet connection on this computer so I don't feel the absence of wifi. However, I have recently discovered (yes, I'm a little slow) that the wifi card also handles bluetooth. I have a bluetooth speaker that I would like to use with the computer, so I do feel the absence of bluetooth. 

The weird thing about this network card is that on the wifi side, it looks fine, it just refused to connect. And bluetooth startup proceeds normally, with no error messages:

```
Feb  7 16:52:14 mu kernel: Bluetooth: Core ver 2.22

Feb  7 16:52:14 mu kernel: NET: Registered PF_BLUETOOTH protocol family

Feb  7 16:52:14 mu kernel: Bluetooth: HCI device and connection manager initialized

Feb  7 16:52:14 mu kernel: Bluetooth: HCI socket layer initialized

Feb  7 16:52:14 mu kernel: Bluetooth: L2CAP socket layer initialized

Feb  7 16:52:14 mu kernel: Bluetooth: SCO socket layer initialized

Feb  7 16:52:26 mu bluetoothd[29951]: Bluetooth daemon 5.62

Feb  7 16:52:26 mu bluetoothd[29951]: Starting SDP server

Feb  7 16:52:26 mu bluetoothd[29951]: Bluetooth management interface 1.21 initialized

Feb  7 16:52:26 mu kernel: Bluetooth: BNEP (Ethernet Emulation) ver 1.3

Feb  7 16:52:26 mu kernel: Bluetooth: BNEP filters: protocol multicast

Feb  7 16:52:26 mu kernel: Bluetooth: BNEP socket layer initialized
```

```
bluetoothctl

Agent registered

[bluetooth]# devices

No default controller available

```

Any help?

Later edit:

I tried connecting to my phone as a wireless hotspot. The computer actually connected to the phone, but couldn't go any further. I tried pinging google, but that went nowhere. I tried pinging the numeric ip address for a couple of sites but it said "destination host unreachable". Very weird.

Latest edit: Bluetooth is working. Don't know why, but after I rebooted it was OK.

----------

## sl70

Hmm. Now it works. (Still need to patch that pci.c file.) Maybe it was the new firmware that came out a couple of weeks ago.

 :Very Happy:   :Smile: 

----------

