xtknight / mt7610u-linksys-ae6000-wifi-fixes

Trying to fix the MT7610U chipset driver by MediaTek so it's usable on modern Linux kernels and with nl80211/NetworkManager (and not completely breaking on old ones, maybe...)
187 stars 71 forks source link

Fixed compil for Linux >= 4.15 #37

Closed Viish closed 5 years ago

Viish commented 6 years ago

Hi,

This PR fixes the compilation on Linux version 4.15 and newer. Fix is mostly the same as the one in https://github.com/evgeni/tp_smapi/issues/31

Thanks a lot for your work, I wouldn't have WiFi on my computer if it wasn't for you !

Best regards.

Dumonu commented 6 years ago

Have you gotten this fix to work? I'm working on a fix myself and when I looked into it, it looked like there was a fundamental change to the way the kernel handles timers, such that it looked like it would take a rework of BUILD_TIMER_FUNCTION.

Dumonu commented 6 years ago

I just compiled and installed this version. I cannot see my wifi card in the output of ip link. This is the same issue I'm running into with my current version of the fix.

Viish commented 6 years ago

This fix works fine for my TP-Link T2UH on my desktop running KaOS (an OS based on Arch) with kernel 4.15.

Dumonu commented 6 years ago

Interesting. That's the same card I have and I'm running Arch, so from what I can tell, it should work. lsusb has Bus 001 Device 002: ID 148f:761a Ralink Technology, Corp. MT7610U ("Archer T2U" 2.4G+5G WLAN Adapter in its output.

Dumonu commented 6 years ago

Ah. I've poked around and it looks like something in this driver is looking for the symbols vfs_write and vfs_read and they don't exist.

Dumonu commented 6 years ago

OK. So my issue was in the vfs_write and vfs_read calls. I have no idea why it's an issue. I commented out those lines, replacing them with dummy lines and now it runs perfectly fine. I'll look into why they might be having an issue tomorrow. I guess I was overthinking the fix.

Dumonu commented 6 years ago

OK. Never mind. I just looked into it. I get nerdsniped easily. vfs_read and vfs_write are deprecated and have been unexported. The new version is kernel_read and kernel_write. I'll look into setting up preprocessor directives for this change and set up a pull request.

jneumaier commented 6 years ago

Please merge those commits. Came up with the same solution which was quite some effort for me :-) Just wanted to create a pull request and found the same fix here. Thanks to all contributors!

Jibtchay commented 6 years ago

Hi, I've been trying to make my TP-Link T2UH work on my virtual machine kali linux (kernel 4.15.0) but I can't manage to install the drivers. I finally ended up here after looking for solutions. I was wondering how to apply you fixes about compilations on kernel 4.15. Do I have to copy the files to the correspondant location ? If yes, I tried it but it didn't work. Can you help me please ? @Viish

jneumaier commented 6 years ago

@Jibtchay You can clone the master of Viish's fork from his repository: https://github.com/Viish/mt7610u-linksys-ae6000-wifi-fixes 4.15 compile fixes are already merged there.

Jibtchay commented 6 years ago

@jneumaier It worked, thanks ! But whenever I try to connect to my network, the VM freezes after a few sec, do you have an idea why it's happening ?

EDIT: I also noticed that when my T2UH is plugged in, the "service network-manager restart" or "ifconfig ra0 up" commands load for ever. journalctl -xe log RTUSB_VendorRequest failed(-110),TxFlags=0x0, ReqType=IN, Req=0x7, Idx=0x1000,pAd->Flags=0x0

jneumaier commented 6 years ago

@Jibtchay No idea, sorry. I also had freezes with other drivers but with different error logs. I am also using a Raspberry Pi, so this might be difficult to compare.

Dumonu commented 6 years ago

Does the output from lsusb contain the card with a proper vendor name and description?

Jibtchay commented 6 years ago

@jneumaier no problem thank you for trying ! I've been looking for something to help but can't find anything :/

@Dumonu this is what I get from lsusb : Bus 001 Device 002: ID 148f:761a Ralink Technology, Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

My usb controller is activated and set on 2.0. The adapter is pluged into a 2.0 port aswell. I read that the issue could be because of the power supply delivered by the usb port that is too low, what do you think ?

Dumonu commented 6 years ago

Hmm. That's the proper output of lsusb, so that's not the issue. I tried finding the definition of RTUSB_VendorRequest(), but I could only find its declaration in a header. It doesn't get the definition from the kernel, which I checked. If anyone knows where to find that function, that'd probably shed some light on this.

Jibtchay commented 6 years ago

I also found this from "systemctl status NetWorkManager.service" :

● NetworkManager.service - Network Manager
   Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
   Active: activating (start) since Tue 2018-05-29 17:30:41 CEST; 21s ago
     Docs: man:NetworkManager(8)
 Main PID: 2202 (NetworkManager)
    Tasks: 4 (limit: 2353)
   Memory: 17.3M
   CGroup: /system.slice/NetworkManager.service
           ├─ 482 /sbin/dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-eth0.pid -lf /var/lib/NetworkManager/dhclient-4b5f1537-518
           ├─2189 /usr/sbin/NetworkManager --no-daemon
           └─2202 /usr/sbin/NetworkManager --no-daemon

mai 29 17:30:41 me systemd[1]: NetworkManager.service: Service hold-off time over, scheduling restart.
mai 29 17:30:41 me systemd[1]: NetworkManager.service: Scheduled restart job, restart counter is at 1.
mai 29 17:30:41 me systemd[1]: Stopped Network Manager.
mai 29 17:30:41 me systemd[1]: NetworkManager.service: Found left-over process 482 (dhclient) in control group while starting unit. Ignoring.
mai 29 17:30:41 me systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
mai 29 17:30:41 me systemd[1]: NetworkManager.service: Found left-over process 2189 (NetworkManager) in control group while starting unit. Ignoring.
mai 29 17:30:41 me systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
mai 29 17:30:41 me systemd[1]: Starting Network Manager...
mai 29 17:30:41 me NetworkManager[2202]: <info>  [1527607841.8629] NetworkManager (version 1.10.8) is starting... (after a restart)
mai 29 17:30:41 me NetworkManager[2202]: <info>  [1527607841.8630] Read config: /etc/NetworkManager/NetworkManager.conf (lib: no-mac-addr-change.conf)

Don't really know what it means

tinhtrilac commented 6 years ago

Thanks I was able to build and install, but I cannot see any network. Do i have anything else?

PS. It fixed by restart the service service network-manager restart

edit2: computer does not recognize device after restart (have to reinstall driver?) edit2: add module to boot from startup cat >> /etc/modules mt7610u_sta