ashaffer/rt3573sta

rt3573 fails to compile in latest kernel

Opened this issue · 48 comments

First off appreciate all your hard work. I have successfully compiled and used your package to run our RT3573 adapter (trendnet 684usb) on x64 bit kernels all the way up to 3.12 final. However it no longer compiles on 3.12,1 or any of the 3.13 rc1 to rc3 releases and was just wondering if you were aware. This is what I get following the make command not sure if this helps in anyway:

home/xxxxx/driversx/os/linux/../../os/linux/rt_linux.c:1138:20: error: incompatible types when assigning to type ‘int’ from type ‘kuid_t’
/home/xxxxx/driversx/os/linux/../../os/linux/rt_linux.c:1139:20: error: incompatible types when assigning to type ‘int’ from type ‘kgid_t’
make[2]: *** [/home/xxxx/driversx/os/linux/../../os/linux/rt_linux.o] Error 1
make[1]: *** [module/home/xxxxx/driversx/os/linux] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-031300rc3-generic'
make: *** [LINUX] Error 2

Again thanks for all your hard work

Thanks for the heads up. I will research and get back to you.

Be well...

On Sat, December 7, 2013 10:32, MRNGSTAR wrote:

First off appreciate all your hard work. I have successfully compiled and
used your package to run our RT3573 adapter (trendnet 684usb) on x64 bit
kernels all the way up to 3.12 final. However it no longer compiles on
3.12,1 or any of the 3.13 rc1 to rc3 releases and was just wondering if
you were aware. This is what I get following the make command not sure if
this helps in anyway:

home/xxxxx/driversx/os/linux/../../os/linux/rt_linux.c:1138:20: error:
incompatible types when assigning to type ‘int’ from type ‘kuid_t’
/home/xxxxx/driversx/os/linux/../../os/linux/rt_linux.c:1139:20: error:
incompatible types when assigning to type ‘int’ from type ‘kgid_t’
make[2]: *** [/home/xxxx/driversx/os/linux/../../os/linux/rt_linux.o]
Error 1
make[1]: *** [module/home/xxxxx/driversx/os/linux] Error 2
make[1]: Leaving directory
`/usr/src/linux-headers-3.13.0-031300rc3-generic'
make: *** [LINUX] Error 2

Again thanks for all your hard work


Reply to this email directly or view it on GitHub:
#8

Sal Di Sciascio

"I think; therefore I am." - Rene DesCartes
"I yam wot I yam 'n' 'at's all wot I yam." - Popeye the Sailorman

I was not aware of this. I'll try to look into it ASAP. Should be a straightforward fix.

Hi, I'm also experiencing the same issue with my Edimax wireless usb adaptor.

It kinda works with the integrated rt28xx module:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=637065267eab4817c0b06cbf3c7fc80842acab99

However.... it's not stable! The rt3573sta driver with ashaffer patch was brilliant; no disconnects or chip resets and also 5GHz frequency worked really well.... The current integrated kernel rt28xx module disconnects all the time and when analyzing via "wavemon" I don't get the output that the rt3573sta-ashaffer-patch driver had. Mainly SNR ratio, Noise level that kinda stuff....

still doesn't compile on ubuntu 14.04 with the 3.13.0-5-generic kernel.

I'm wondering if the integrated rt28xx module mentioned by JohnnySSH is actually somehow preventing the rt3573sta-ashaffer from compiling correctly. If I get the time maybe I'll try removing the rt28xx module from the new kernel and attempt to recompile the rt3573sta-ashaffer unless someone more ambitious beats me to it.

can only get the rt2800usb driver to work on 2.4 ghz on ubuntu 14.04

Okay I got ambitious I tried removing the rt2x00 module (not elegantly I should add) from the new kernel restarted then tried to compile the ashaffer rt3573sta the bottom line is it still doesn't work. So its beyond my current knowledge/skill set to get it working in the newer kernel my failed attempt was with 3.14rc2. I went back to 3.12 final and will probably stay put on that kernel until ashaffer rt3573 is patched to work with the newer kernels

I did the same in Archlinux.... I ran rmmod rt2x00 then tried installing the Ashaffer patch. It didn't work :-(

Currently I reverted back to the LTS kernel which for Arch is version: 3.10.31-1

For some reason the Ashaffer patch doesn't work on the Arch stock kernels? I did manage to install the standard rt3573sta driver which am using now. Though I can feel that it's not the same as as the "patched" version.

Using the Lqx kernel everything was fine however, now none build on it.

If the ashaffer patched version could be incorporated into the mainstream kernel that would be fantastic as the rt2x00 module doesn't even seem to be 3x3 antenna compatible either meaning my signal quality is far less using that, it's probably able to use the 1x1 or 2x2 antenna array but the extra is a no-go.

Well just call me stubborn I tried again with 3.14 rc5 messing around with lsmod, blacklist alll with no joy. Could it be as simple as just needing a change in gcc version or command line directing which version needs to be used to compile and if so anyone out there who really knows what they are doing able to help out?

ashaffer, just checking to see if you have made any progress at all in identifying a fix for this and to let you know that I would be happy to help test if needed although be advised unfortunately my skills are admittedly not particularly great.

@MRNGSTAR Sorry for not responding in so long. I actually stopped using the driver because it seemed to still have intermittent issues.

I'll see if I can get it to compile on the latest ubuntu kernel when I get home from work, but I may or may not have time to see if it actually operates correctly.

If you guys are getting it to load at all and it's not working, would you mind posting the output of dmesg if possible? There is also a way to compile the driver with elevated log levels so your dmesg output is more verbose. I'll try to re-figure that out for you again so you can get better debugging information.

On 04/07/2014 07:01 PM, ashaffer wrote:

@MRNGSTAR https://github.com/MRNGSTAR Sorry for not responding in so
long. I actually stopped using the driver because it seemed to still
have intermittent issues.

I'll see if I can get it to compile on the latest ubuntu kernel when I
get home from work, but I may or may not have time to see if it
actually operates correctly.

If you guys are getting it to load at all and it's not working, would
you mind posting the output of dmesg if possible? There is also a way
to compile the driver with elevated log levels so your dmesg output is
more verbose. I'll try to re-figure that out for you again so you can
get better debugging information.


Reply to this email directly or view it on GitHub
#8 (comment).

@ashaffer Hey no worries, your driver works the absolute best as far as
I'm concerned and I think quite a few others share my opinion if you are
having intermittent issues it might be just be your wireless router.
Your driver is the only reason I'm staying on kernel 3.12. I don't think
anyone has been able to get it to load on the new kernels as it pretty
much totally fails to compile I'm just glad your still willing to work
on it :-)

@MRNGSTAR Hello there, if you want a quick fix on the compilation and since I can see you're using a kernel > 3.0 well the fix would be to do the following:
Comment out the lines 1137,1138,1139 in rt3573sta/os/linux/rt_linux.c

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
pOSFSInfo->fsuid = current->fsuid;
pOSFSInfo->fsgid = current->fsgid;
current->fsuid = current->fsgid = 0;
//#else
// pOSFSInfo->fsuid = current_fsuid() ;
// pOSFSInfo->fsgid = current_fsgid() ;
#endif

and make install, modprobe, etc.

On 04/09/2014 03:26 PM, RD777 wrote:

Hello there, if you want a quick fix on the compilation and since I
can see you're using a kernel > 3.0 well the fix would be to do the
following:
Comment out the lines 1137,1138,1139 in rt3573sta/os/linux/rt_linux.c

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
pOSFSInfo->fsuid = current->fsuid;
pOSFSInfo->fsgid = current->fsgid;
current->fsuid = current->fsgid = 0;
//#else
// pOSFSInfo->fsuid = current_fsuid() ;
// pOSFSInfo->fsgid = current_fsgid() ;
#endif

and make install, modprobe, etc.


Reply to this email directly or view it on GitHub
#8 (comment).

YEAH !!!!!!!!!!! IT WORKS!!!!!!! ITS ALIVE!!!!!!! THANK YOU
!!!!!!!!THANK YOU!!!!!!!!!

@MRNGSTAR Haha no problem!

Yep I concur, it is working!!

Many thanks for the hack :-)

Just an FYI in case anyone reads this with the RT2x00 modules precompiled into the kernel; Depending on the names you would have to blacklist those out.

For Arch Linux the list is as follows:

rt2x00usb
rt2x00lib
rt2800usb
rt2800lib

Though the above modules may seem like they make the device work, in actuality only the 2.4GHz channel is utilized due to the hardware constraints of the rt28xx chipsets.

I was happy until I read this thread, again. Then I checked and, yes, my dongle was working but only at the lower of the two channels on the router. I followed your instructions and commented out the 3 lines as you suggested, recompiled and installed the new driver and upon ifdown and ifup, yast now showed the faster essid. Thanks for taking this to the finish line... until they move it again. OpenSuSE 13.1 BTW

excellent!! thanks for the fix. i am on 5 GHz again.

Here's a fix for Arch Linux kernel version:

3.14.4-1

[code]
case SHOW_DRVIER_VERION:
//snprintf(extra, size, "Driver version-%s, %s %s\n", STA_DRIVER_VERSION, DATE, TIME );
snprintf(extra, size, "Driver version-%s, %s %s\n", STA_DRIVER_VERSION );
[/code]

in file: sta/sta_cfg.c

@JohnnySSH Do you know why the 5 GHz band doesn't work with the kernel drivers? I feel like it should, and at one point it did, but a commit a few months ago changed the 5 GHz detection and it stopped working. I feel like I should open a kernel bug report for it....

Also, you should probably get rid of the last two %s's in that snprintf statement. If you're removing DATE and TIME they're probably printing junk.

i success compile in ubuntu 14/trusty, but the wifi is not run , i did modprobe rt2573sta

llinux kernel 3.13

any missing step?

Sorry, I'll start with the basics. Once you comment out the lines that have been pointed out in this thread, you should follow the normal steps.
#sudo make
#sudo make install
#sudo modprobe rt3573sta
Once you have done that, verify that the module is loaded
#lsmod | grep rt3573sta

I will wrap my head around forking this repo, since @ashaffer seems to be busy :(

@Glanzick I will test the kernel drivers (rt2800usb) with the 5.0 ghz band to see if the lack of 5.0Ghz is still an issue.
On the 2.4Ghz band for the rt2800usb drivers I seem to have some stability issues sadly.... :(

my lsmod

meruvian@baremerv:~/rt3573sta/sta$ lsmod | egrep 'rt28|rt55'
rt2800usb 27034 0
rt2x00usb 20742 1 rt2800usb
rt2800lib 89076 1 rt2800usb
rt2x00lib 55307 3 rt2x00usb,rt2800lib,rt2800usb
mac80211 626557 3 rt2x00lib,rt2x00usb,rt2800lib
crc_ccitt 12707 1 rt2800lib

@fthamura Sorry, but if you did enter that command you may have commited a mistake, since it states "rt55"
Also, do not forget to unload the module rt2800usb if you want to use the rt3573sta driver.
$modprobe -r rt2800usb
$modprobe rt3573sta
$lsmod | grep "rt35"

@RD777
meruvian@baremerv:~$ lsmod | grep "rt35"
rt3573sta 708979 0

@fthamura The module is now loaded, remember if you want to load a module at boot and blacklist a module on boot follow this guide: https://help.ubuntu.com/community/Loadable_Modules
Since the rt3573sta module is loaded, you can now attempt to bring up your wireless interface and connect.
https://help.ubuntu.com/community/WifiDocs/WirelessNetworking
Your interface name should be something like ra0.
Good luck.

@Glanzick Hello there, I will test the 5GHz issue with my Asus-N66 tonight and the rt2800usb in the 3.15 kernel. (Arch LInux) However, I have a feeling that the problem you're experiencing might be in relation to crda not being set correctly.....

@MRNGSTAR @jerseysal @JohnnySSH @jimerickson @Glanzick I have forked this repo, and applied the necessary fixes for it to compile on the latest kernels.
The fixes are more elegant than the ones posted on this thread (I was in a hurry :D). The fixes are easy to do by yourselves, however feel free to just clone my forked repo. I will keep updating if ever there is another problem.
I will also take a look into the 5.0Ghz issue.
Feel free to look at the diff in my fork to see the easy fixes.

On 07/18/2014 04:13 PM, RD777 wrote:

@MRNGSTAR https://github.com/MRNGSTAR @jerseysal
https://github.com/jerseysal @JohnnySSH
https://github.com/JohnnySSH @jimerickson
https://github.com/jimerickson @Glanzick
https://github.com/Glanzick I have forked this repo, and applied the
necessary fixes for it to compile on the latest kernels.
The fixes are more elegant than the ones posted on this thread (I was
in a hurry :D). The fixes are easy to do by yourselves, however feel
free to just clone my forked repo. I will keep updating if ever there
is another problem.
I will also take a look into the 5.0Ghz issue.
Feel free to look at the diff in my fork to see the easy fixes.


Reply to this email directly or view it on GitHub
#8 (comment).

Awesome :-)

On 07/18/2014 04:13 PM, RD777 wrote:

@MRNGSTAR https://github.com/MRNGSTAR @jerseysal
https://github.com/jerseysal @JohnnySSH
https://github.com/JohnnySSH @jimerickson
https://github.com/jimerickson @Glanzick
https://github.com/Glanzick I have forked this repo, and applied the
necessary fixes for it to compile on the latest kernels.
The fixes are more elegant than the ones posted on this thread (I was
in a hurry :D). The fixes are easy to do by yourselves, however feel
free to just clone my forked repo. I will keep updating if ever there
is another problem.
I will also take a look into the 5.0Ghz issue.
Feel free to look at the diff in my fork to see the easy fixes.


Reply to this email directly or view it on GitHub
#8 (comment).

The new forked version works like a dream on Linux Mint 17 although I
did have to manually install gcc++ from synaptic first. A leaps and
bounds improvement in performance over the vanilla rt2800usb. Excellent
work RD777 :-)

also works like a charm on ubuntu 14.04. great work RD777!!

which one is the right new fork that work well?

https://github.com/RD777/rt3573sta.git ?

@Glanzick Hello there, I believe that the problem you're experiencing regarding the 5.0ghz band with rt2800usb is related to crda.

If your regulatory domain is not set, some 5.0ghz frequencies will not be detected at all. Let me know if installing crda and regdom helps you.
Arch Linux Wiki - Respecting Regulatory Domain - Wireless

@RD777 I bought a new HTPC with wireless onboard so I haven't been using the rt3573 chip. However, the onboard is only 2.4 GHz so I'll try again. I also have a RT-66 and am using Arch so I'll read up on the crda and see if it can detect the 5GHz bands from my router.

@RD777 I set up the regulatory domain to US and now I can connect to my router using rt2800usb and 5 GHz bands, so yes, I guess that was the problem. Thanks!

@Glanzick You're welcome! Glad to see it worked for you.

I am still have compilation problems. My copy of os/linux/rt_linux.c line 1137 is already patched as follows:

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
pOSFSInfo->fsuid = current->fsuid;
pOSFSInfo->fsgid = current->fsgid;
current->fsuid = current->fsgid = 0;
#else
pOSFSInfo->fsuid = current_fsuid();
pOSFSInfo->fsgid = current_fsgid();
#endif
pOSFSInfo->fs = get_fs();
set_fs(KERNEL_DS);
} else {
set_fs(pOSFSInfo->fs);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
current->fsuid = pOSFSInfo->fsuid;
current->fsgid = pOSFSInfo->fsgid;
#endif
}
}

I am running linux mint 17 with the 3.13.0-24-generic kernel and the 4:4.8.2-1ubuntu6 g++ compiler.

The compilation error I am getting is

/home/jeffs/Downloads/rt3573ste/rt3573sta/os/linux/../../os/linux/rt_linux.c: In function ‘__RtmpOSFSInfoChange’:
/home/jeffs/Downloads/rt3573ste/rt3573sta/os/linux/../../os/linux/rt_linux.c:1138:20: error: incompatible types when assigning to type ‘int’ from type ‘kuid_t’
pOSFSInfo->fsuid = current_fsuid();
^
/home/jeffs/Downloads/rt3573ste/rt3573sta/os/linux/../../os/linux/rt_linux.c:1139:20: error: incompatible types when assigning to type ‘int’ from type ‘kgid_t’
pOSFSInfo->fsgid = current_fsgid();
^
make[2]: *** [/home/jeffs/Downloads/rt3573ste/rt3573sta/os/linux/../../os/linux/rt_linux.o] Error 1

It seems to me that the way out of this problem is to cast kgid_t to int - has anybody here thought of that?

Thank you

Jeff

@jeffsilverm Actually the solution is way simpler than that. Feel free to clone my fork of this repo. It should build without any hiccups on your kernel.

Thanks.

@RD777 Damn!!! It went in and worked in 3 minutes. OpenSuSE 13.1.10.21

Great job,

@jerseysal Glad to know it worked for you!

I have a curious problem - the device works on some USB ports and not
others. This is a USB problem, not a device driver issue. When the device
doesn't work, lsusb doesn't detect it. However, the compilation and
installation went without a problem, and the gizmo works!

You have saved me the expense and hassle of buying a new computer, plus you
have done your bit to save the planet by keeping the existing computer out
of the landfill.

This is on Linux Mint 17.

Jeff

On Wed, Oct 22, 2014 at 9:54 PM, RD777 notifications@github.com wrote:

@jeffsilverm https://github.com/jeffsilverm Actually the solution is
way simpler than that. Feel free to clone my fork of this repo. It should
build without any hiccups on your kernel.

Thanks.


Reply to this email directly or view it on GitHub
#8 (comment).

Jeff Silverman, linux sysadmin
nine two four twentieth avenue east
Seattle, WA, nine eight one one two -3507
(2O6) 329-1O94
jeffsilverm@gmail.c0m (note the zero!)
http://www.commercialventvac.co http://www.commercialventvac.com/~jeffs/m
Read my book, "Failure is Not an Option: How to build reliable computer
systems from unreliable parts using Open Source software"
http://www.commercialventvac.com/finao/index.html"

@jeffsilverm I am glad to see the installation went smoothly! Also if you do not want to have to compile the driver again on your next kernel update you might want to take a look at the steps I described on the README.md on the fork!!! It should work just fine and spare you from compiling it after each update! 😄

@RD777
Thanks for all the work you've done on this issue. I was wondering if you are still interested in fixing other people's problems with this device. I had Centos 6.6 to Centos 6.7 update applied and my old device stopped working. Knowing that that device was not really supported (ndis-wrapper) I decided to buy the Linksys version of the rt3573 set. I plugged this in and it worked exactly as expected. I then decided to install Centos 7.1, expecting the kernel to pick it up. It doesn't. I poked around and noticed that the aliases for RT3573 aren't even compiled into the rt2800usb mod. I downloaded the kernel 3.11 source and compiled and installed, but then got some pretty ugly messages and though the device was recognized it was not working.

So after a ton of researching, I found this thread. I compiled successfully but not cleanly - there is a warning on a memcpy() call that looked pretty ominous. I installed anyway. the device is recognized, but I see some very ugly messages in the logs.

If you - or anyone else - is still active in this work, let me know and I will post my system details. I have some feeling that it may be a Centos this as RH seems to be tightening up on some the hardware things. If not, thanks for all the work you done to help others out.

RD777 commented

@worthp

Hi there, I'll try to take a look at it.
Does the device work? Are you able to put the interface up?
Could you provide me with the logs please?

Thanks

Hi,

Thanks for the reply. After doing some further research and thinking
through, I realized that Centos 7 is running an old kernel. I saw that
you guys were looking at 3.11+. I gave up an Centos and installed Fedora
22 (kernel 4.x). I can now compile cleanly and will look to see if it
works that way.

I appreciate the response though, and the work you've contributed.

Thanks.

On 08/19/2015 01:54 PM, RD777 wrote:

@worthp https://github.com/worthp

Hi there, I'll try to take a look at it.
Does the device work? Are you able to put the interface up?
Could you provide me with the logs please?

Thanks


Reply to this email directly or view it on GitHub
#8 (comment).

RD777 commented

@worthp

No problem at all. Also, since kernel 3.12 devices with the chipset Ralink RT3573, have been supported by the driver RT2800usb. Normally, your linksys adapter should work perfectly in both bands or at least 2.4Ghz.

If you cannot seem to find any 5.0 Ghz while using your adapter, be sure to check crda

Respecting the Regulatory Domain

fnzv commented

@RD777 Thank you, i can confirm that your cloned repo works on Ubuntu 16 LTS with the Ralink chipset