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

Please change both vfs_read & vfs_write for recent linux kernels 4.14 >= #35

Open adamchilcott opened 6 years ago

adamchilcott commented 6 years ago

https://github.com/xtknight/mt7610u-linksys-ae6000-wifi-fixes/blob/3b7b8d97582006948b265357c1d938ad59dbb61e/os/linux/rt_linux.c#L1090

Swapping out vfs_read & vfs_write for kernel_read & kernel_write respectively solves most of my problems under Arch and the latest LTS kernel Linux 4.14.16-1-MANJARO. Hey, at least I can connect now!

Output from dmesg is positive. Blinking LED lights functional! Always a bonus of course.

I'm not sure, but this change may break compatibility with older kernels, if prior compatibility is an aim for this project.

Best,

Adam.

rasdotsu commented 6 years ago
diff --git a/os/linux/rt_linux.c b/os/linux/rt_linux.c
index 581227a..55fc66b 100644
--- a/os/linux/rt_linux.c
+++ b/os/linux/rt_linux.c
@@ -1087,7 +1087,7 @@ int RtmpOSFileRead(RTMP_OS_FD osfd, char *pDataPtr, int readLen)
                return osfd->f_op->read(osfd, pDataPtr, readLen, &osfd->f_pos);
        } else {
                DBGPRINT(RT_DEBUG_ERROR, ("no file read method, using vfs_read\n"));
-               return vfs_read(osfd, pDataPtr, readLen, &osfd->f_pos);
+               return kernel_read(osfd, pDataPtr, readLen, &osfd->f_pos);
        }
 }

@@ -1097,7 +1097,7 @@ int RtmpOSFileWrite(RTMP_OS_FD osfd, char *pDataPtr, int writeLen)
                return osfd->f_op->write(osfd, pDataPtr, (size_t) writeLen, &osfd->f_pos);
        } else {
                DBGPRINT(RT_DEBUG_ERROR, ("no file write method, using vfs_write\n"));
-               return vfs_write(osfd, pDataPtr, (size_t) writeLen, &osfd->f_pos);
+               return kernel_write(osfd, pDataPtr, (size_t) writeLen, &osfd->f_pos);
        }
 }