0

I'm trying to compile the driver provided with a Ralink 5370 usb wifi adapter I bought, for Lubuntu 14.4.1 (32bit version). I'm running 3.16.0-24-generic kernel.

The header file is giving a type conversion error when I try to compile using sudo make as per the general procedure here:

/home/username/wifidriver/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO/os/linux/../../os/linux/sta_ioctl.c: In function ‘rt_ioctl_giwscan’:
./arch/x86/include/asm/string_32.h:182:25: warning: array subscript is below array bounds [-Warray-bounds]
 #define memcpy(t, f, n) __builtin_memcpy(t, f, n)
                         ^
include/net/iw_handler.h:542:3: note: in expansion of macro ‘memcpy’
   memcpy(stream + point_len, extra, iwe->u.data.length);
   ^
  CC [M]  /home/username/wifidriver/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO/os/linux/../../os/linux/rt_linux.o
/home/username/wifidriver/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO/os/linux/../../os/linux/rt_linux.c: In function ‘__RtmpOSFSInfoChange’:
/home/username/wifidriver/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO/os/linux/../../os/linux/rt_linux.c:1126:20: error: incompatible types when assigning to type ‘int’ from type ‘kuid_t’
   pOSFSInfo->fsuid = current_fsuid();
                    ^
/home/username/wifidriver/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO/os/linux/../../os/linux/rt_linux.c:1127:20: error: incompatible types when assigning to type ‘int’ from type ‘kgid_t’
   pOSFSInfo->fsgid = current_fsgid();
                    ^
scripts/Makefile.build:257: recipe for target '/home/username/wifidriver/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO/os/linux/../../os/linux/rt_linux.o' failed
make[2]: *** [/home/username/wifidriver/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO/os/linux/../../os/linux/rt_linux.o] Error 1
Makefile:1345: recipe for target '_module_/home/username/wifidriver/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO/os/linux' failed
make[1]: *** [_module_/home/username/wifidriver/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO/os/linux] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-3.16.0-24-generic'
Makefile:356: recipe for target 'LINUX' failed
make: *** [LINUX] Error 2

Relevant output from lsusb

Bus 001 Device 002: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter

How should I be approaching this? This compiler error looks odd enough for me to question whether I should be delving into it; i.e. if my time would be better spent some other way.

3
  • Issues specific to programming and software development are off topic, see What topics can I ask about here?. Try StackOverflow, but please first read How do I ask a good question?.
    – DavidPostill
    Nov 24, 2014 at 22:00
  • 2
    @DavidPostill I wouldn't say this is a programming question. Yes, there's references to code, and there is a build error. However, it seems to be related to the compilation of a vendor's supplied device driver, which is more a question about installing already available software.
    – user
    Nov 25, 2014 at 14:22
  • @Escher You may get better answers to this on Unix & Linux or even Ask Ubuntu. Should you want your question migrated, "flag" it for moderator attention and request migration; do not simply repost the question on another site in the Stack Exchange network.
    – user
    Nov 25, 2014 at 14:23

1 Answer 1

0

For the reference of anyone trying to solve the same problem, the correct answer was to ignore the vendor's supplied device driver and use the precompiled Debian rt2800usb driver instead - just apt-get install firmware-ralink; sudo modprobe rt2800usb;. Apparently Ralink's driver has needed patching to get it to compile since Ubuntu 12-ish.

@ Michael Kjörling thanks for clarifying. I did intend the error output code to merely to highlight the improbability that the simplest and best solution was to start hacking with the driver code. There's no way I have enough time or skill in C to delve into hardware drivers anyway. It wasn't easy to know computing SE to use - recognising a device driver error by its compiler error when built under linux could be any of the three.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .