Build RT3070 kernel module on Ubuntu 10.04 (Lucid Lynx)

The Ralink USB dongle wireless 802.11n driver install on Ubuntu 10.04 steps as below:

1. Download the driver for linux
click RT8070/RT3070USB(RT307x) and press Accept button.

2. Extract the file, open a terminal, cd into it and copy a missing file.
tar -xvf DPO_RT3070_LinuxSTA_V2.3.0.2_20100412.tar.bz2
cd DPO_RT3070_LinuxSTA_V2.3.0.2_20100412
cp RT2870STA.dat RT3070STA.dat

3. edit os/linux/usb_main_dev.c, add one line “MODULE_LICENSE(“GPL”);”. Please refers to
lsusb to check your id, add the ids into file common/rtusb_dev_id.c.

4. Compile and install the driver.
make (you’ll see one error that related “tftpboot”, ignore it.)
sudo make install

5. Add a missing symlink.
sudo mkdir /etc/Wireless/RT2870STA; sudo ln -s /etc/Wireless/RT3070STA/RT3070STA.dat /etc/Wireless/RT2870STA/RT2870STA.dat

6. Load the driver, if failed please rmmod rt2800usb related kernel modules.
sudo modprobe rt3070sta

7. edit file “/etc/modprobe.d/blacklist.conf”.
Add “blacklist rt2800usb” to the bottom line

After reboot you will use the WLAN well on Ubuntu 10.04, good luck!


About xlcwu

Self-employed (One-man Company), Developer/Chief Designer/Consultant, Embedded Linux/NAS/Storage/Platform/Devices, Xcode/Cocos2D/Cocoa/Objective-C, at Joe’s Lab – Newland ESP (TM).
This entry was posted in Ubuntu and tagged , , . Bookmark the permalink.

15 Responses to Build RT3070 kernel module on Ubuntu 10.04 (Lucid Lynx)

  1. Kevin says:

    I used Archive Manager to extract the folder from the tar. When I try to cd over to the folder, I get bash: not a file or directory. Nothing works from there on out. I’m a newbie so any help will be appreciated.

    • xlcwu says:

      try tar xvf file_name_that_you_download …

      • Matt Williams says:

        I hit this problem too. It appears that the .tar.bz2 file that you download from Ralink’s site has actually been tar-ed twice. After untarring it once with

        tar jxf DPO_RT3070_LinuxSTA_V2.3.0.4_20100604.tar.bz2

        you then need to rename the result to a tar file once more, and then unpack that

        mv DPO_RT3070_LinuxSTA_V2.3.0.4_20100604 DPO_RT3070_LinuxSTA_V2.3.0.4_20100604.tar

        tar xf DPO_RT3070_LinuxSTA_V2.3.0.4_20100604.tar

        This worked for me, apart from some compile errors, which I’ll post about separately in a moment.


      • xlcwu says:

        Thanks Matt, untar twice is the point.

  2. Matt Williams says:

    When compiling the latest code (V2.3.04_20100604) against Ubuntu 10.10, I got compiler errors about usb_buffer_alloc and usb_buffer_free not existing.

    CC [M] /home/mirw/DPO_RT3070_LinuxSTA_V2.3.0.4_20100604/os/linux/../../common/cmm_mac_usb.o
    /home/mirw/DPO_RT3070_LinuxSTA_V2.3.0.4_20100604/os/linux/../../common/cmm_mac_usb.c: In function ‘NICInitRecv’:
    /home/mirw/DPO_RT3070_LinuxSTA_V2.3.0.4_20100604/os/linux/../../common/cmm_mac_usb.c:789: error: implicit declaration of function ‘usb_buffer_alloc’
    /home/mirw/DPO_RT3070_LinuxSTA_V2.3.0.4_20100604/os/linux/../../common/cmm_mac_usb.c:789: warning: assignment makes pointer from integer without a cast
    /home/mirw/DPO_RT3070_LinuxSTA_V2.3.0.4_20100604/os/linux/../../common/cmm_mac_usb.c:818: error: implicit declaration of function ‘usb_buffer_free’
    make[2]: *** [/home/mirw/DPO_RT3070_LinuxSTA_V2.3.0.4_20100604/os/linux/../../common/cmm_mac_usb.o] Error 1
    make[1]: *** [_module_/home/mirw/DPO_RT3070_LinuxSTA_V2.3.0.4_20100604/os/linux] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.35-22-generic’
    make: *** [LINUX] Error 2

    This is the same issue as encountered in the lkml post at Specifically, these functions have been renamed. I believe the fix is to replace all instances of usb_buffer_alloc with usb_alloc_coherent and all instances of usb_buffer_free with usb_free_coherent. The instances I replaced were in include/os/rt_linux.h and os/linux/rt_usb_util.c.

    BTW, it looks like they’ve fixed the MODULE_LICENSE(“GPL”) issue in the latest version.


  3. hordak says:

    Thanks, Matt! You’re a lifesaver! I used these updated instructions to install a Trendnet TEW-644UB on Ubuntu 10.10. I just used the 2870 drivers instead. THANKS!!

  4. pesarak says:

    thanks to Matt Williams
    solution replacing function name solve my problem in compiling ralink rt2870 driver.

  5. Pingback: Help with Wireless Solution for Linux EMC box - Largest Machinist Community on the net!

  6. add1kt says:

    Thank you very much, Great succes and I now have 802.11n capability!

  7. add1kt says:

    I should bow in repsect, as I am a linux novice, but I would also suggest this instead of rebooting (noting I did this in Debian 6.0 vice Ubuntu)
    # ifconfig wlan0 down
    # rmmod rt2870sta
    # insmod rt3070sta
    # ifconfig ra0 up

    correct me if i am wrong here

  8. vlip says:

    It compiles correctly if i dont change the chipset settings in makefile from 5370 to 3070 or 2870,

    it does not compile as rt3070sta but as rt5370sta it compiles and works for me.

  9. dinesh says:

    cd DPO_RT3070_LinuxSTA_V2.3.0.2_20100412/
    bash: cd: DPO_RT3070_LinuxSTA_V2.3.0.2_20100412/: No such file or directory


    • xlcwu says:

      Could you confirm the directory name after you extract/uncompress tarball.
      If you download latest tarball file, it should be 2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO.bz2 and after extract it the directory name is 2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO.

  10. Ali says:

    Hi All, I have trouble with the /os/linux/rt_linux.c >> error: incompatible types when assigning to type ‘int’ from type ‘kuid_t’ <<

    see details
    /DPO_RT5572_LinuxSTA_2.6.1.3_20121022# make
    make -C tools
    make[1]: Entering directory `/root/wlan/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/tools'
    gcc -g bin2h.c -o bin2h
    make[1]: Leaving directory `/root/wlan/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/tools'
    cp -f os/linux/Makefile.6 /root/wlan/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux/Makefile
    make -C /lib/modules/3.12-kali1-686-pae/build SUBDIRS=/root/wlan/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux modules
    make[1]: Entering directory `/usr/src/linux-headers-3.12-kali1-686-pae'
    CC [M] /root/wlan/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux/../../os/linux/rt_linux.o
    /root/wlan/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux/../../os/linux/rt_linux.c: In function ‘__RtmpOSFSInfoChange’:
    /root/wlan/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux/../../os/linux/rt_linux.c:1141:20: error: incompatible types when assigning to type ‘int’ from type ‘kuid_t’
    /root/wlan/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux/../../os/linux/rt_linux.c:1142:20: error: incompatible types when assigning to type ‘int’ from type ‘kgid_t’
    make[4]: *** [/root/wlan/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux/../../os/linux/rt_linux.o] Fehler 1
    make[3]: *** [_module_/root/wlan/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux] Fehler 2
    make[2]: *** [sub-make] Fehler 2
    make[1]: *** [all] Fehler 2
    make[1]: Leaving directory `/usr/src/linux-headers-3.12-kali1-686-pae'
    make: *** [LINUX] Fehler 2

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s