Ubuntu Linux: Install RT2870 Chipset Based USB Wireless Adapter

by on September 3, 2010 · 74 comments· LAST UPDATED October 19, 2010

in

This blog post listed Linux Compatible USB wireless adapters. It seems that many new Linux users frequently have problems learning how to install RT2870 driver under Linux. I also received email requesting installation instructions for the same device. This quick tutorial will explains how to install RT2870 based chipset device with WPA2 authentication and TKIP wireless encryption.

Our Sample Setup

The following instructions are tested on:

  • Ubuntu Linux 10.04.1 LTS
  • Kernel - Linux 2.6.32-24-generic-pae i686 (32 bit)
  • WPA2 with Linksys 160N router

RT2870 Chipset Based Devices Are Not Working Out Of Box

The main problem is conflicting driver which are shipped with default kernel. WPA2 is a method of security wireless networking with optional PSK for home users. The default driver only recognizes driver but always failed to join WPA2 based network. The solution is to install RT2870 driver from the vendor site.

Step #1: Disable Default Drivers

Type the following command to black list default drivers:
$ sudo vi /etc/modprobe.d/blacklist.conf
Append the following driver names:

blacklist rt2800usb
blacklist rt2x00lib
blacklist rt2x00usb

Save and close the file. Use the rmmod command to remove current drivers or just reboot the system:
$ sudo modprobe -r driverName
# you need to remove all of the above drivers one by one:
$ sudo modprobe -r rt2800usb

OR simply reboot the systems:
$ sudo reboot

Step 2: Install Compilers

Type the following command to install required packages so that you can compile source code:
$ sudo apt-get install build-essential fakeroot dpkg-dev
Finally, install Linux kernel headers so that you can compile kernel device drivers:
$ sudo apt-get install linux-headers-$(uname -r)

Step #3: Download Driver

Visit this page and download USB drivers [RT2870USB(RT2870/RT2770)].

Untar Tarball

Type the following command:
$ tar -jxvf 2010_0709_RT2870_Linux_STA_v2.4.0.1.tar.bz2
$ cd 2010_0709_RT2870_Linux_STA_v2.4.0.1

Compile RT2870 Wireless Lan Linux Driver

First, edit config.mk file as follows so that Network Manager can be used to set WPA2 auth info:
$ vi os/linux/config.mk
Set it as follows:

# Support Wpa_Supplicant
HAS_WPA_SUPPLICANT=y
# Support Native WpaSupplicant for Network Manger
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y

Save and close the file. To compile the driver, enter:
$ make
Sample outputs:

make -C tools
make[1]: Entering directory `/tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools'
/tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools/bin2h
cp -f os/linux/Makefile.6 /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/Makefile
make -C /lib/modules/2.6.32-24-generic-pae/build SUBDIRS=/tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.32-24-generic-pae'
  CC [M]  /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_md5.o
  CC [M]  /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_sha2.o
  CC [M]  /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_hmac.o
  CC [M]  /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_aes.o
...
....
..
  CC [M]  /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/rtusb_io.o
  CC [M]  /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/rtusb_bulk.o
  CC [M]  /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/rtusb_data.o
  CC [M]  /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_data_usb.o
  CC [M]  /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/ee_prom.o
  CC [M]  /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/rtmp_mcu.o
  CC [M]  /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/rtusb_dev_id.o
  CC [M]  /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/rt_usb.o
  CC [M]  /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/rt_usb_util.o
  CC [M]  /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/usb_main_dev.o
  LD [M]  /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/rt2870sta.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/rt2870sta.mod.o
  LD [M]  /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/rt2870sta.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-24-generic-pae'

Note: You may see a LOTs of warnings during the compilation, and this is *normal* so don't panic.

Install Driver

Type the following command:
$ sudo make install
Sample outputs:

make -C /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux -f Makefile.6 install
make[1]: Entering directory `/tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux'
rm -rf /etc/Wireless/RT2870STA
mkdir /etc/Wireless/RT2870STA
cp /tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/RT2870STA.dat /etc/Wireless/RT2870STA/.
install -d /lib/modules/2.6.32-24-generic-pae/kernel/drivers/net/wireless/
install -m 644 -c rt2870sta.ko /lib/modules/2.6.32-24-generic-pae/kernel/drivers/net/wireless/
/sbin/depmod -a 2.6.32-24-generic-pae
make[1]: Leaving directory `/tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux'

Install Latest Firmware

Again visit this page and download "Firmware RT28XX/RT30XX USB series (RT2870/RT2770/RT3572/RT3070)". Unzip and install the firemware:
$ unzip RT2870_Firmware_V22.zip
$ cd RT2870_Firmware_V22/
#### Make a backup of existing old firmware ####
$ mkdir -p $HOME/backup/lib/firmware
$ cp /lib/firmware/rt2870.bin $HOME/backup/lib/firmware
#### Install the firmware (for 64 bit Linux systems, you may have to use /lib64/firmware) #####
$ sudo cp rt2870.bin /lib/firmware/
##### **** backup and move existing driver, do NOT SKIP this STEP ****######
$ sudo mv /lib/modules/$(uname -r)/kernel/drivers/net/wireless/rt2870sta.ko $HOME/backup/

Update usb.ids

Type the following commands:
$ mkdir -p $HOME/backup/var/lib/usbutils
$ cp /var/lib/usbutils/usb.ids $HOME/backup/var/lib/usbutils
$ sudo wget -O /var/lib/usbutils/usb.ids http://www.linux-usb.org/usb.ids

Step #4: Configure Driver

Connect your USB device and type the following command to verify that Wireless USB LAN adapter is detected:
$ lsusb
Sample outputs:

Bus 002 Device 007: ID 0411:00e8 MelCo., Inc. Buffalo WLI-UC-G300N Wireless LAN Adapter
Bus 002 Device 006: ID 05ac:0220 Apple, Inc. Aluminum Keyboard (ANSI)
Bus 002 Device 005: ID 05ac:1006 Apple, Inc. Hub in Aluminum Keyboard
Bus 002 Device 004: ID 413c:2513 Dell Computer Corp.
Bus 002 Device 003: ID 413c:2513 Dell Computer Corp.
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 007: ID 413c:8160 Dell Computer Corp.
Bus 001 Device 006: ID 413c:8162 Dell Computer Corp.
Bus 001 Device 005: ID 413c:8161 Dell Computer Corp.
Bus 001 Device 004: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth)
Bus 001 Device 003: ID 0a5c:5800 Broadcom Corp. BCM5880 Secure Applications Processor
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

/etc/Wireless/RT2870STA/RT2870STA.dat Configuration

You need to edit /etc/Wireless/RT2870STA/RT2870STA.dat file, enter:
$ sudo vi /etc/Wireless/RT2870STA/RT2870STA.dat
Set SSID (nixcraft is my SSID):

SSID=nixcraft

Set country (IN = INDIA, US = USA, etc):

CountryCode=IN

Set authentication information (do not skip this if you want WPA2 based authentication):

AuthMode=WPA2
EncrypType=TKIP
WPAPSK=YOUR-PASSWORD-HERE

See README_STA for other detailed information about each field. Save and close the file.

Step #5: Connect To the Internet

Type the ifconfig command and you should see ra0:
$ ifconfig ra0

ra0       Link encap:Ethernet  HWaddr 00:1d:73:bc:e4:6e
          inet6 addr: fe80::21d:73ff:febc:e46e/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:5157 errors:0 dropped:0 overruns:0 frame:0
          TX packets:206 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1093810 (1.0 MB)  TX bytes:16772 (16.7 KB)

You can now connect to the Internet by clicking on Network manager ( The network-manager is the one which is found in the systray. The icon of two computers, one below to the other on the left-side). Clicking on NM-applet will give you the types of connection/hardware you have available > Select Wireless Device > Select nixcraft SSID (or scan of SSID) > Make sure you set "WPA2" as wireless security. Once connected you can browse the Internet or verify IP info:
$ ifconfig ra0
Sample outputs:

ra0       Link encap:Ethernet  HWaddr 00:1d:73:bc:e4:6e
          inet addr:192.168.1.103  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21d:73ff:febc:e46e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6711 errors:0 dropped:0 overruns:0 frame:0
          TX packets:271 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1420879 (1.4 MB)  TX bytes:22312 (22.3 KB)

Verify gateway or just ping to public ip:
$ route -n
$ ping google.com
$ ping cyberciti.biz

A Note About Kernel Upgrades

You need to reinstall the driver using the above steps.

Further readings:

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 74 comments… read them below or add one }

1 Rich September 4, 2010 at 10:38 pm

V,
I did a clean install of ubuntu 10.04, updated kernel, etc. and had no errors with this until: lsusb where it appears the buffalo is there, but i have unknown line in line 1-16. ifconfig ra0 shows device not found. Are they any packages required for this to work that I may be missing? Any thoughts on the unknown lines 1-16?
thanks,
R

Reply

2 nixCraft September 5, 2010 at 3:35 pm

Did you installed the drivers and removed the old one as described here?

Reply

3 Rich September 6, 2010 at 9:23 am

yes. after clean install of 10.04 and kernel & other updates, i ran your tutorial line by line with no errors until lsusb.

Reply

4 nixCraft September 7, 2010 at 6:28 am

It appears that the site ( http://www.linux-usb.org/usb.ids ) in question was down. It should work now.

Reply

5 anderson September 6, 2010 at 10:03 pm

Hey, Thanks a lot for easy instructions.
Everything worked out well at the first time until right before STEP4 where I have to update my usb.ids, because I do not have a internet connection on my computer.

Strangely at that point, my mini internet icon on the top right corner of the screen showed a list of available wireless connections that I connect to. Previously, it was not showing any of them. So I think everything worked out well without further going through steps. Also, ‘lsusb’ did NOT show my usb adapter on the list, but the internet was working.

I tried to get through step 4 after internet connection is established, however my wget connection to the site was somehow refused. But I still could do web searching and so on.

Also, my ifconfig name for adapter was not ra0 but it was wlan0 or something. (i couldn’t remember

I had to do some updates, so I rebooted my computer. Now, my computer does not have available list of wireless connections on the right internet connection icons. It is only showing “Wired Network.” Also, my computer does not have an internet connection. I tried unpluging and repluging the usb adapter but it does not work. The command lsusb still does not show my usb adapter. Also, I followed through steps from the beginning until the end (except the ones that I might overwrite original backup files) but it does not work.

So I am writing this on my laptop.

Do you think if there is any way to resolve this problem?
Thanks.

Reply

6 nixCraft September 7, 2010 at 6:25 am

When you updated your system and Linux kernel, your old driver and firmware got overwritten by system installer. The solution is to reinstall the driver again.

Reply

7 anderson September 7, 2010 at 6:50 pm

Thanks for the reply.
All of my problems are fixed.
The problem was about usb.ids I think.

I fully reinstalled linux 10.04, copied the usb.ids file from my laptop in to the desktop linux, and the did the installation again, and it worked fine.
Thanks!

Reply

8 Rich September 7, 2010 at 4:06 pm

re-ran the install sequence completely, again, with no errors until lsusb. on the backup and move existing driver step, what does the “$(uname -r)” portion of the directory refer to? is my username supposed to go in here or that entire line is typed out exactly as shown?

Reply

9 Ryan October 19, 2010 at 1:21 pm

The command ‘uname -r’ will return the current version of the Linux kernel you are running. For example, the output on my server ‘Hubble’ is:

ryan@Hubble:~$ uname -r
2.6.32-25-generic

Feel free to try it on yours (it won’t hurt anything). The way it’s used in Vivek’s steps makes the computer determine the kernel version it’s running and uses that value in the directory value.

So yes, use it exactly as it’s written there :-)

Reply

10 Rich September 7, 2010 at 4:28 pm

OK, I double-checked linux-usb.org and seems it hadn’t installed correctly. Reinstalled that, install went OK and now lsusb shows Melco., Inc, but not “Buffalo WLI..” and the rest. But ifconfig ra0 still shows “device not found”.

Reply

11 George September 8, 2010 at 4:44 pm

Same here with “ifconfig ra0″. Having to use ethernet cable with laptop right now :(

Reply

12 errr September 11, 2010 at 7:09 pm

Ok i followed the step; however, when ‘ifconfig ra0′ error reads: “ra0: error fetching interface information: Device not found”
The device connects to internet now and maintains connection (before it would drop). However connection is 5Mps or less…further in ‘Network Connection’
Interface: 802.11 WiFi (wlan0) <thats should say ra0???
H…
Driver: rt2800usb <is that right driver or did i not 'move' all previous???
Speed: Unknown
if you could please show me where i went wrong and provide detailed list of instructions, I would be very appreciate. Ubuntu 10.04
I must say i have learned a great deal 'missing' around on my own, yet after three days…errr

now im guessing this is telling me I didnt erase the 'rt2800usb'!?!?!?

Reply

13 Bob September 14, 2010 at 8:01 pm

Im at the same issue Rich & George are…
lsusb command returns this:
laptop:~$ lsusb
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 006: ID 07d1:3c09 D-Link System DWA-140 RangeBooster N Adapter(rev.B1) [Ralink RT2870]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

laptop:~$ ifconfig ra0
ra0: error fetching interface information: Device not found

I can establish connection yet not able to use…in network configurations “Device: usb” not RT2870

Reply

14 Bob September 15, 2010 at 1:57 am

ok confident firmware correct…its the driver thats miss-ed up
lsusb output list device and properly..
Bus 001 Device 006: ID 07d1:3c09 D-Link System DWA-140 RangeBooster N Adapter(rev.B1) [Ralink RT2870]
(from that Im assuming usb.ids is update properly and the firmware is install properly)
now…
network manager listed device and makes connection at 12Mb/s …im cracking a smile cuz im a hole 10Mbs faster then 3 days ago..
connection information says Driver: usb, also says interface: …wlan0 (supposed ot be ra0) …so i…
iwconfig output =
wlan0 RTxx70 Wireless ESSID:”XXXXXXX” Nickname:”RT3070STA”
OK…note wrong ‘wlan0′, wrong ‘Nickname:”RT3070STA”
why is it using RT3070STA instead of RT2870STA? Now before you say ‘chipset’…I OPENED MY DEVICE AND ON THE CHIP rt2870F…
I dont think reinstall driver works cuz i got NO errors during that process…
where am i missing? why is it seeing RT3070STA? With for hundred some threads on this issue…I may have reason to make first video on youtube for it…If I get it fixed…and other than sifting thro ‘trial and error’ threads Ive gotten no assistance…
first time ever touched Linux and Im ‘ ‘ <that close, i can feel it.

Reply

15 Ryan October 19, 2010 at 1:04 pm

Hi Vivek,

Thanks for the detailed instructions :-) Just one question I have… in your sample output for the ‘Compile RT2870 Wireless Lan Linux Driver’ section, I noticed you left out quite a few lines for the sake of tidiness I suspect, and replaced them with:

“…
….
..”

The only problem is, in this area, I got a LOT of warnings during the compilation, and I have no idea whether this is normal or not. I suspect it is, however you might want to put something in the output to say that this is normal behaviour so people don’t panic when/if it happens.

Otherwise, thanks again!

Ryan

Reply

16 nixCraft October 19, 2010 at 4:30 pm

Hey Ryan,

Those are quite normal (as long as you don’t see actual compile error followed by termination).

HTH.

Reply

17 Alexis December 20, 2010 at 1:57 am

I tried compiling this, and along with a ton of warnings, I get a two compile errors (see below). Any ideas about what is going on?

Using the driver built into Ubuntu 10.10, the internet works, however I am unable to connect at higher speeds than 54Mb/s whereas this device is supposed to connect at 300Mbs.

/tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:34: note: expected ‘VOID **’ but argument is of type ‘UCHAR **’
make[2]: *** [/tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.o] Error 1
make[1]: *** [_module_/tmp/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.35-23-generic’
make: *** [LINUX] Error 2

Reply

18 Leonard21117 November 11, 2012 at 3:56 pm

I have the same Errors on 11.04 Linux 2.6 PC Dell Inspirion 530, ZyXEL n220 usb adapter.
Did you fixed it?

Reply

19 Germain October 21, 2010 at 3:57 pm

Hi Vivek,

Thanks for this great tutorial.
Do you know if the RT2870 driver support MAC address change?

Regards,
Germain

Reply

20 Rudy November 6, 2010 at 12:55 am

Hi.
I got this error.

root@rudy-A:/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1# make
make -C tools
make[1]: Entering directory `/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools'
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools/bin2h
cp -f os/linux/Makefile.6 /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/Makefile
make -C /lib/modules/2.6.35-22-generic/build SUBDIRS=/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.35-22-generic'
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_md5.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_sha2.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_hmac.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_aes.o
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_aes.c: In function ‘AES_GTK_KEY_WRAP’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_aes.c:2265: warning: the frame size of 1100 bytes is larger than 1024 bytes
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_aes.c: In function ‘WscDecryptData’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_aes.c:1592: warning: the frame size of 1356 bytes is larger than 1024 bytes
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_aes.c: In function ‘WscEncryptData’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_aes.c:1522: warning: the frame size of 1356 bytes is larger than 1024 bytes
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_arc4.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/mlme.o
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/mlme.c: In function ‘BssTableSortByRssi’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/mlme.c:6100: warning: the frame size of 1720 bytes is larger than 1024 bytes
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_wep.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/action.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_data.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/rtmp_init.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_tkip.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_aes.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_sync.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/eeprom.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_sanity.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_info.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_cfg.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_wpa.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/dfs.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/spectrum.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/rtmp_timer.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/rt_channel.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_profile.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_asic.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_cmd.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/assoc.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/auth.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/auth_rsp.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/sync.o
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/sync.c: In function ‘PeerBeacon’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/sync.c:1764: warning: the frame size of 1308 bytes is larger than 1024 bytes
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/sync.c: In function ‘PeerBeaconAtJoinAction’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/sync.c:1094: warning: the frame size of 1296 bytes is larger than 1024 bytes
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/sync.c: In function ‘PeerBeaconAtScanAction’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/sync.c:764: warning: the frame size of 1264 bytes is larger than 1024 bytes
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/sync.c: In function ‘MlmeStartReqAction’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/sync.c:581: warning: the frame size of 1064 bytes is larger than 1024 bytes
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/sanity.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/rtmp_data.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/connect.o
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/connect.c: In function ‘CntlOidScanProc’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/connect.c:355: warning: the frame size of 1748 bytes is larger than 1024 bytes
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/wpa.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/ags.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../sta/sta_cfg.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/rtmp_init_inf.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/rt_profile.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.o
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c: In function ‘rt_ioctl_siwencode’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:1479: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c: In function ‘rt_ioctl_iwaplist’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:599: warning: the frame size of 1284 bytes is larger than 1024 bytes
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c: In function ‘rt_ioctl_siwmlme’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:1979: warning: the frame size of 1652 bytes is larger than 1024 bytes
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c: In function ‘RTMPIoctlE2PROM’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:6035: warning: the frame size of 1348 bytes is larger than 1024 bytes
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c: In function ‘RTMPIoctlMAC’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/sta_ioctl.c:5836: warning: the frame size of 1344 bytes is larger than 1024 bytes
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/rt_linux.o
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/rt_linux.c: In function ‘RtmpOSNetDevDetach’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/rt_linux.c:1694: warning: initialization discards qualifiers from pointer target type
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/rt_linux.c: In function ‘RtmpOSNetDevAttach’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/rt_linux.c:1731: warning: initialization discards qualifiers from pointer target type
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/rt_main_dev.o
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/rt_main_dev.c: In function ‘MainVirtualIF_close’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../os/linux/rt_main_dev.c:117: warning: unused variable ‘Cancelled’
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/ba_action.o
  CC [M]  /home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.o
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c: In function ‘RTMPAllocUsbBulkBufStruct’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:52: error: implicit declaration of function ‘usb_buffer_alloc’
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:52: warning: assignment makes pointer from integer without a cast
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c: In function ‘RTMPFreeUsbBulkBufStruct’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:78: error: implicit declaration of function ‘usb_buffer_free’
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c: In function ‘RTMPFreeTxRxRingMemory’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:234: warning: passing argument 3 of ‘RTMPFreeUsbBulkBufStruct’ from incompatible pointer type
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:62: note: expected ‘UCHAR **’ but argument is of type ‘struct __TX_BUFFER **’
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:241: warning: passing argument 3 of ‘RTMPFreeUsbBulkBufStruct’ from incompatible pointer type
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:62: note: expected ‘UCHAR **’ but argument is of type ‘struct __TX_BUFFER **’
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:278: warning: passing argument 3 of ‘RTMPFreeUsbBulkBufStruct’ from incompatible pointer type
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:62: note: expected ‘UCHAR **’ but argument is of type ‘struct __HTTX_BUFFER **’
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c: In function ‘NICInitTransmit’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:507: warning: passing argument 3 of ‘RTMPFreeUsbBulkBufStruct’ from incompatible pointer type
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:62: note: expected ‘UCHAR **’ but argument is of type ‘struct __TX_BUFFER **’
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c: In function ‘RTMPAllocTxRxRingMemory’:
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:566: warning: passing argument 3 of ‘RTMPAllocUsbBulkBufStruct’ from incompatible pointer type
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:34: note: expected ‘VOID **’ but argument is of type ‘struct __HTTX_BUFFER **’
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:596: warning: passing argument 3 of ‘RTMPAllocUsbBulkBufStruct’ from incompatible pointer type
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:34: note: expected ‘VOID **’ but argument is of type ‘struct __TX_BUFFER **’
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:610: warning: passing argument 3 of ‘RTMPAllocUsbBulkBufStruct’ from incompatible pointer type
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:34: note: expected ‘VOID **’ but argument is of type ‘struct __TX_BUFFER **’
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:628: warning: passing argument 3 of ‘RTMPAllocUsbBulkBufStruct’ from incompatible pointer type
/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:34: note: expected ‘VOID **’ but argument is of type ‘UCHAR **’
make[2]: *** [/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.o] Error 1
make[1]: *** [_module_/home/rudy/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.35-22-generic'
make: *** [LINUX] Error 2

What can I do?
Thanks.

Reply

21 Rudy November 6, 2010 at 3:08 am

I found the solution!
http://ubuntuforums.org/showpost.php?p=8591348&postcount=6
But be careful if someone is going to do this. You will have to change the usb ID.

Reply

22 pesarak November 28, 2010 at 11:57 pm

SOLUTION for
“error: implicit declaration of function ‘usb_buffer_alloc’”
in compiling rt2870 driver in Ubuntu 10.10

i found this solution here and work for me:
http://xlcwu.wordpress.com/2010/07/09/build-rt3070-kernel-module-on-ubuntu-10-04-lucid-lynx/

Matt Williams says:
October 10, 2010 at 4:13 pm

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 http://lkml.org/lkml/2010/4/30/111. 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.

Matt

Reply

23 Spinner912 December 14, 2010 at 1:54 am

Before starting on this installation, perhaps you could advise if is it possible, using NM, to configure the encryption for a wireless connection using this device and this method, to SHARED with WEP encryption, or MUST the encryption be WPA?

I have a number of components in this wireless network and to have to reconfigure the encryption for each from WEP which they are currently configured for, while certainly not impossible, would be a real pain.

Reply

24 Spinner912 December 14, 2010 at 6:43 am

I am replying to myself here. I now understand what is involved in changing encryption from WEP to WPA, and it seems to be a non-event. So please disregard this post. It is answered.

Reply

25 Spinner912 December 14, 2010 at 2:01 am

Has anyone tried this installation procedure for an ASUS USB-N13 Wireless device?

Is there any good reason which anyone could think of why such a device would not work with this installation procedure?

Reply

26 Johnson Chen December 18, 2010 at 1:44 pm

Hi my system is Ubuntu 10.10 USB driver is SMC MUSBS-N3 use the chipset RT2870.
I was follow the step to compile RT2870 wireless linux driver but fail the reason as below could you help How can I do Thanks.

make -C tools
make[1]: Entering directory `/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools'
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools/bin2h
cp -f os/linux/Makefile.6 /home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/Makefile
make -C /lib/modules/2.6.35-22-generic/build SUBDIRS=/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.35-22-generic'
  CC [M]  /home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.o
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c: In function ‘RTMPAllocUsbBulkBufStruct’:
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:52: error: implicit declaration of function ‘usb_buffer_alloc’
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:52: warning: assignment makes pointer from integer without a cast
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c: In function ‘RTMPFreeUsbBulkBufStruct’:
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:78: error: implicit declaration of function ‘usb_buffer_free’
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c: In function ‘RTMPFreeTxRxRingMemory’:
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:234: warning: passing argument 3 of ‘RTMPFreeUsbBulkBufStruct’ from incompatible pointer type
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:62: note: expected ‘UCHAR **’ but argument is of type ‘struct __TX_BUFFER **’
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:241: warning: passing argument 3 of ‘RTMPFreeUsbBulkBufStruct’ from incompatible pointer type
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:62: note: expected ‘UCHAR **’ but argument is of type ‘struct __TX_BUFFER **’
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:278: warning: passing argument 3 of ‘RTMPFreeUsbBulkBufStruct’ from incompatible pointer type
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:62: note: expected ‘UCHAR **’ but argument is of type ‘struct __HTTX_BUFFER **’
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c: In function ‘NICInitTransmit’:
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:507: warning: passing argument 3 of ‘RTMPFreeUsbBulkBufStruct’ from incompatible pointer type
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:62: note: expected ‘UCHAR **’ but argument is of type ‘struct __TX_BUFFER **’
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c: In function ‘RTMPAllocTxRxRingMemory’:
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:566: warning: passing argument 3 of ‘RTMPAllocUsbBulkBufStruct’ from incompatible pointer type
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:34: note: expected ‘VOID **’ but argument is of type ‘struct __HTTX_BUFFER **’
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:596: warning: passing argument 3 of ‘RTMPAllocUsbBulkBufStruct’ from incompatible pointer type
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:34: note: expected ‘VOID **’ but argument is of type ‘struct __TX_BUFFER **’
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:610: warning: passing argument 3 of ‘RTMPAllocUsbBulkBufStruct’ from incompatible pointer type
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:34: note: expected ‘VOID **’ but argument is of type ‘struct __TX_BUFFER **’
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:628: warning: passing argument 3 of ‘RTMPAllocUsbBulkBufStruct’ from incompatible pointer type
/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:34: note: expected ‘VOID **’ but argument is of type ‘UCHAR **’
make[2]: *** [/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.o] Error 1
make[1]: *** [_module_/home/johnson/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.35-22-generic'
make: *** [LINUX] Error 2

Reply

27 Leonard21117 November 11, 2012 at 4:09 pm

I am having the same problem on 11.04
PC DEL Insp 530.Linux 2.6

Did you fix it?

Reply

28 Spinner912 December 21, 2010 at 9:00 am

I have had all the troubles in the world installing drivers for the ASUS USB-N13 Wireless USB. I have tried almost every driver, and every combination of installations. But after much heart break and gnashing of teeth, I have finally got the thing working perfectly.

At the end of all my attempts to get the thing working (including useless information from ASUSTek Support), I decided out of desperation, to remove everything I had done systematically from the machine. But as one final twist, having removed everything, and “cleaned” the system of everything associated with any attempted installation, I came across a small post in a Linux forum (http://pclinuxos.com/forum/index.php?PHPSESSID=kqaacu8v2cpleogltbkq2j6173&topic=76312.0), and because it was so simple, I decided to have one last try -exactly as detailed.

In essence, it said that the RT2870 drivers are standard in-kernel drivers for the “latest” distributions of Ubuntu. Now; why didn’t someone tell me that before?

I did a “find files” on rt2870, and sure enough, on each kernel update since I installed 10.04 LTS, there was an rt2870 driver.

So I followed the steps suggested in the post.

There are two points which my previous efforts seemed to have identified as important.

1.

Reply

29 Spinner912 December 21, 2010 at 9:08 am

I have had all the troubles in the world installing drivers for the ASUS USB-N13 Wireless USB. I have tried almost every driver, and every combination of installations. But after much heart break and gnashing of teeth, I have finally got the thing working perfectly.

At the end of all my attempts to get the thing working (including useless information from ASUSTek Support), I decided out of desperation, to remove everything I had done systematically from the machine. But as one final twist, having removed everything, and “cleaned” the system of everything associated with any attempted installation, I came across a small post in a Linux forum (http://pclinuxos.com/forum/index.php?PHPSESSID=kqaacu8v2cpleogltbkq2j6173&topic=76312.0), and because it was so simple, I decided to have one last try – exactly as detailed.

In essence, it said that the RT2870 drivers are standard in-kernel drivers for the “latest” distributions of Ubuntu. Now; why didn’t someone tell me that before?

I did a “find files” on rt2870, and sure enough, on each kernel update since I installed 10.04 LTS, there was an rt2870 driver.

So I followed the steps suggested in the post.

There is one point which my previous efforts seemed to have identified as important, and that is that WEP encryption did not seem to work. So I went for WPA2, and, heh presto; after a reboot and configuring Network Manager, off we went. A high speed Wireless Connection to my router.

Another discovery is that wicd is not as effective as Network Manager (updated) for managing the network configuration.

Hope this helps.

Reply

30 Jeremiah January 12, 2011 at 2:44 pm

I just have one question about your steps vs other instructions on the web. Why do you remove the rt2870sta.ko file?

Reply

31 Spinner912 January 13, 2011 at 2:09 am

I am not sure why you have concluded that I removed the rt2870sta.ko file. I didn’t.

What I did say was that each kernel installation on my machine contained an rt2870sta.ko file. I left them in place.

But before I started the steps I have outlined above, I removed all rt2870sta and other files as a result of any earlier attempts by me to install the device. In other words, I tried to get back to a clean situation so that the in-kernel drivers could do what they were supposed to do.

They did. Everything worked immediately.

Reply

32 Jeremiah January 13, 2011 at 4:11 pm

##### **** backup and move existing driver, do NOT SKIP this STEP ****######
$ sudo mv /lib/modules/$(uname -r)/kernel/drivers/net/wireless/rt2870sta.ko $HOME/backup/

This is why I asked about removing the rt2870sta.ko…

This step came after the ‘make && make install’ which copies rt2870sta.ko from the src directory to the correct modules location.

Just looking for clarification.

Reply

33 Spinner912 January 15, 2011 at 1:03 am

Hi Jeremiah. Yes; as I understand it also, that line simply backups up what is already installed on your machine. A prudent step before you do any modifications.

I did that, but I had no need to do a restore. I think therefore that this step is merely for security purposes should something go wrong.

All this assumes (as is mentioned very early in this thread by the author) that there is a bug in the Ubuntu in-kernel drivers. The author suggests therefore, that certain updates should be downloaded and installed.

I did that originally but subsequently removed those downloads, and so that is probably why I found no need to restore anything. The in-kernel drivers worked perfectly for me when I finally gave them a chance. I suspect that had I simply plugged in the device before installing downloaded drivers, there would never have been a problem.

Anyway; I found no bug in the in-kernel drivers. When I cleaned up my machine and got rid of all the “updates” I had downloaded and installed, I found that everything worked perfectly without my having had to do anything, apart from a bit of configuring.

I hope this helps, because when you do finally get the device working, it flies.

Reply

34 Ryan Turk January 12, 2011 at 11:21 pm

Hi All,

I recently upgraded to Ubuntu 10.10 (Maverick) and while the above tutorial helped me through my last installation, I found the instruction on the following page to be a bit simpler, and made the wireless client behave the way that you would expect:

http://www.smachado.com/2010/11/how-to-make-ralink-rt2870-driver-work-on-ubuntu-10-10/

For the most part it’s identical to Vivek’s method.

Thanks again Vivek :-)

Reply

35 Pär Larsson January 29, 2011 at 11:24 am

For compilation problems of the latest driver:

http://www.linuxcrew.de/2010/10/11/rt2870-compile-error-under-kubuntu-maverick-10-10/?lang=en

Here is the patch code:

— ./include/os/rt_linux.h 2010-07-09 04:13:47.000000000 +0200
+++ ./include/os/rt_linux.h 2010-10-11 18:15:17.395418003 +0200
@@ -1074,8 +1074,8 @@
#define RT28XX_PUT_DEVICE usb_put_dev
#define RTUSB_ALLOC_URB(iso) usb_alloc_urb(iso, GFP_ATOMIC)
#define RTUSB_SUBMIT_URB(pUrb) usb_submit_urb(pUrb, GFP_ATOMIC)
-#define RTUSB_URB_ALLOC_BUFFER(pUsb_Dev, BufSize, pDma_addr) usb_buffer_alloc(pUsb_Dev, BufSize, GFP_ATOMIC, pDma_addr)
-#define RTUSB_URB_FREE_BUFFER(pUsb_Dev, BufSize, pTransferBuf, Dma_addr) usb_buffer_free(pUsb_Dev, BufSize, pTransferBuf, Dma_addr)
+#define RTUSB_URB_ALLOC_BUFFER(pUsb_Dev, BufSize, pDma_addr) usb_alloc_coherent(pUsb_Dev, BufSize, GFP_ATOMIC, pDma_addr)
+#define RTUSB_URB_FREE_BUFFER(pUsb_Dev, BufSize, pTransferBuf, Dma_addr) usb_free_coherent(pUsb_Dev, BufSize, pTransferBuf, Dma_addr)
#else

#define RT28XX_PUT_DEVICE rausb_put_dev

Reply

36 Rob February 1, 2011 at 5:36 am

An alternative to Pär that may be more robust to changes in the driver code by Ralink:

find . -name \*.[ch] -exec grep usb_buffer_alloc "{}" ";" -exec sed -i 's/usb_buffer_alloc/usb_alloc_coherent/g' "{}" ";"
find . -name \*.[ch] -exec grep usb_buffer_free "{}" ";" -exec sed -i 's/usb_buffer_free/usb_free_coherent/g' "{}" ";"

This substitutes the new calls for the old.

Reply

37 Karl February 3, 2011 at 9:09 pm

I just get
make: *** No targets specified and no makefile found. Stop.

Reply

38 michael February 10, 2011 at 7:12 pm

hi,

I have followed each step here on my ubuntu 10.4 system with ralink 2870 chipset (kernel 2.6.32-28-generic). driver version 2.4.0.0

What happens is that after I plug in the usb-stick the led-is turned on permanently. No device is recognized (ifconfig), nothing is shown in the network-manager, nothing. It’s exactly as if there was no rt2870 module loaded. lsmod and modinfo confirm that the new driver is loaded and the other older ones not.

With the staging-drivers (in the version 2.1.0.0) in my kernel the device is recognized and everything is ok, but I can only connect to open networks – not to wpa.

Can someone help?

All this stuff reminds me of the early days I was using debian and to waste hours and hours for some idiotic work, that should have been simplified over a Gui. I have now wasted (until now) more than 2 days of my life for this stupid driver issue. …

Reply

39 Yuehua Zhang February 20, 2011 at 10:47 pm

Really helpful, thanks a lot!

Reply

40 leming February 22, 2011 at 3:41 pm

There is on ppa built package, but it is really unstable. Keep on disconnect 10 20 times in hours. People on bug tracker says that it is common issue for amd64 architecture

Reply

41 Pandora March 13, 2011 at 10:07 pm

Need replace code (bug)

1077 and 1078 in /include/os/rt_linux.h

line 1077:

#define RTUSB_URB_ALLOC_BUFFER(pUsb_Dev, BufSize, pDma_addr) usb_alloc_coherent(pUsb_Dev, BufSize, GFP_ATOMIC, pDma_addr)

line 1078:

#define RTUSB_URB_FREE_BUFFER(pUsb_Dev, BufSize, pTransferBuf, Dma_addr) usb_free_coherent(pUsb_Dev, BufSize, pTransferBuf, Dma_addr)

Edited config.mk in the root of the ralinks driver folder as follows::

HAS_WPA_SUPPLICANT=n to HAS_WPA_SUPPLICANT=y
and
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n to HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y

Reply

42 Arnie S March 15, 2011 at 6:38 pm

I’m new to Linux, and I get stuck on step 2. “Append the file”–I can’t figure out what this means to do. After typing in the first command, I see lots of other “blacklist” items, but I’m assuming I’m supposed to add lines here and then save; i can’t figure out how to do either. Sorry for the basic lack of knowledge here….. Thanks,

Reply

43 Vilmos June 6, 2011 at 8:45 am

Hi,
Thanks for this delightful and helpful installation guide!

I couldn´t use my wireless device properly (only with the “rt2800usb” driver which is really bad). Then I went through this guide step by step successfully, and my wlan connection worked! I could happily ping my access point again and again, and my other computer which is connected to the access point (pure joy!).

Then the next day (after new booting) it didn´t work. I tried to do the steps again, but it didn´t help. (By the way, I am using debian with 2.6.32-5-686 kernel)

lsusb has still found the device:

root@rechner0:/# lsusb
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 148f:2870 Ralink Technology, Corp. RT2870 Wireless Adapter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

With ifconfig my device was visible previously as “wlan0″ even when it didn´t work and wasn´t enabled, but now ifconfig only has my two ethernet cards:

root@rechner0:/# ifconfig
eth0      Link encap:Ethernet  Hardware Adresse 00:0a:5e:65:73:11
          inet Adresse:192.168.0.92  Bcast:192.168.1.255  Maske:255.255.254.0
          inet6-Adresse: 2001:858:5:400:20a:5eff:fe65:7311/64 Gültigkeitsbereich:Global
          inet6-Adresse: fe80::20a:5eff:fe65:7311/64 Gültigkeitsbereich:Verbindung
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metrik:1
          RX packets:36937 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11732 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:1000
          RX bytes:12653489 (12.0 MiB)  TX bytes:2271436 (2.1 MiB)
          Interrupt:21
eth1      Link encap:Ethernet  Hardware Adresse 00:08:02:51:df:b4
          UP BROADCAST MULTICAST  MTU:1500  Metrik:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
lo        Link encap:Lokale Schleife
          inet Adresse:127.0.0.1  Maske:255.0.0.0
          inet6-Adresse: ::1/128 Gültigkeitsbereich:Maschine
          UP LOOPBACK RUNNING  MTU:16436  Metrik:1
          RX packets:176 errors:0 dropped:0 overruns:0 frame:0
          TX packets:176 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:0
          RX bytes:11344 (11.0 KiB)  TX bytes:11344 (11.0 KiB)

Now the “wlan0″ interface is never visible, only when I undo the blacklisting in “/etc/modprobe.d/blacklist.conf”. But then I again have the evil “rt2800usb” driver which is of no good.

So it worked once, but never again, how sad is this?

Could you guys help me out? I thank your help in advance!!!

Vilmos

Reply

44 Jelly June 11, 2011 at 9:05 am

I had the exactly the same problem. I made it work once, but when I restart it it doesnot work any more, and even if I tried to reinstall everything again. I also could see the device from isusb, but no wlan0 which previous showed.

Reply

45 Vilmos June 11, 2011 at 9:28 pm

Hi Jelly, hi everyone!

Wlan is working for me now! I accidentally happened to delete every piece of data on my computer, so I installed debian 6.0.1 again. Then I went through this brilliant guide on every step that is before the “Update usb.ids” part. Then I clicked on knetworkmanager to connect and:
Voila, It works!
I managed to restrain myself to only a few pinging orgys and rebooted the system. I prepared myself to the horror of connection refusal, but no! It still works after numerous boots.
So I think that the first time i already messed up something before I found this helpful guide (although I do not kow what). If you have similar symptoms as Jelly (or me the first time) then:
1.: Try to remove and undo everything from previous attempts related to this problem, then follow this outstanding guide.
2.: If this does not work, then try to accidentally loose every single bit of information from your system, do a clean install and then follow the steps above and hope.

Thaks again for this gide!
Vilmos

Reply

46 Saberpeep April 18, 2012 at 2:45 am

AAARGG! Doesn’t anyone have any way around the complete re-install of ubuntu? This is the most aggravating problem I have ever come across! I’m not even sure I know how to “accidentally” re-install an entire os anyway. There must be another way.

Reply

47 nixCraft April 18, 2012 at 8:08 am

Backups?

Reply

48 jlsoto July 8, 2011 at 4:49 pm

would these instructions work for an rt5370?
thanx

Reply

49 Otacons August 23, 2011 at 2:39 pm

Works 100% right!!!

I follow all the steps, excluding the WPA steps, but everything worked fine!

Thanks u veryyyyyyyyyyyyy much!!!
:-D

Reply

50 Anonymous August 25, 2011 at 8:49 pm

Hi everyone

I would like to mention something important regarding my experience with this driver.
Before I have a very slow connection to internet, I am using knetworkmanager, so when I click on my wireless connection name I get “driver:usb2800″ on the wireless info. So I just disabled this sheet driver and black list it. Without installing RT2800 and the connection now is fast because now I see “driver:usb” instead of “driver:usb2800″. So this is a tip that maybe it help you if you get slow connection speed.

Reply

51 jj August 26, 2011 at 9:27 pm

So I did everything up until Step 4 (Step 4 excluded, I don’t understand why I need to specify SSID, I don’t want a particular SSID, I just want to use it through network manager for any network).
Anyways, when I do ifconfig, all I see is eth0, lo, and wlan0.
ifconfig ra0
gives: ra0: error fetching interface information: Device not found
What’s the deal?

Reply

52 jj August 27, 2011 at 4:21 pm

Here’s the thing:
Its enough to just blacklist rt2800usb and the driver works!
So If you compiled a downloaded rt2870 driver and followed all these steps but didn’t get it to work, just do this:
-uninstall the driver you compiled:
cd
sudo make uninstall
-make sure that rt2800usb is blacklisted:
sudo gedit /etc/modprobe.d/blacklist.conf
(And check in the bottom of the file that “blacklist rt2800usb” exists -I don’t know if “blacklist rt2x00lib” “blacklist rt2x00usb” are necessary, you can experiment with those)
-reboot.

Reply

53 Peter September 2, 2011 at 8:30 am

Hi, I ‘ve got strange problem not recognizing wifi interface.

My device works correctly with system staging driver, but I decided to install the latest from Ralink due to HW Mac address. Staging driver does not allow to change it.
I successfuly compiled and installed 2.4.0.1 driver, updated firmware rebooted and I can correctly see my device under lsusb and driver under lsmod and modinfo. The problem is that my second wireless interface ra0 ( first is internal, which works fine) or similarar corresponding to my new ralink driver is not visible, recognized. Manuall installation of the driver or rebooting provides the same results, device is visible under lsusb and led light on it is on all the time, meanwhile it blinks when connected through staging driver and interface is not visible through network applet.
I am on Ubuntu lucid (10.4.).
Any help, advice would be appreciated

Reply

54 Peter September 2, 2011 at 8:42 am

I forgot to mentioned that I also blacklisted the usb drivers and I temporarilly disfunctioned staging driver…

Reply

55 Michael Hu September 9, 2011 at 10:12 am

I am using RT5370 on Ubuntu 11.04 and the kernel version is 2.6.38-11-generic. I have followed all these instructions and My computer does recognize RT5370 USB wireless adapter. The adapter could connect to WiFI network and I can also ping google.com, but I can’t explore the web. Web page won’t load.

I used ifconfig ra0 command and here results:

michael@inspiron:~/Downloads/RT5370/os/linux$ ifconfig ra0
ra0 Link encap:Ethernet HWaddr 40:16:9f:91:7a:e2
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::4216:9fff:fe91:7ae2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:48 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2850183 (2.8 MB) TX bytes:392676 (392.6 KB)

It seems lots of error happen, but I don’t know why, could anyone help. Thank you guys very much.

Reply

56 carlivar September 15, 2011 at 4:16 am

Thank you for the information in this post.

I think I improved your process by using DKMS, Dynamic Kernel Management System. This allows the module to be auto-recompiled with every new kernel.

Also, I didn’t do many of your steps and things worked fine for me. I didn’t touch the file in /etc/Wireless/RT2870STA for example.

I posted my steps here. Feedback is welcome.

Reply

57 Josh November 20, 2011 at 6:10 am

Excuse me while I rant. I’m sooooo angry. All these “Linux supported” cards and companies suck. From ASUS to system76. Yes! dare I say it. I haven’t purchased one device in the past year with “Linux support” that has actually worked. It wouldn’t bother me so much if the hardware was supportable by the free software community. At least then if it didn’t work it would be a matter of bug fixes. The problem is they make it so damm difficult for the community to support. Everybody is shipping stuff that depends on proprietary drivers and firmware so nothing ever works right. I’m sick of having to “make it work” and then having it break a week later.

I just got a card with this rt2870 chipset working and then it breaks. Less than a week later. I hope others here will take a stand with me. I am not buying one more damm piece of hardware from any company which doesn’t explicitly support Linux and use a chipset(s) with free software support. I’ve had it. I found only one company (www.thinkpenguin.com) in my hunt that appears to be making decisions around free software. Maybe we can convince others to start supporting free software and not just “Linux”. At least the Linux companies like system76 and linuxcertified.

Reply

58 george January 10, 2012 at 5:31 pm

Please I want help to Install in Backtrack 5 the AWUS036NH . I have put the rt2800 in blacklist but when I try to do “Make” i will take the below result.

Please Help me and thanks in Advanced

root@bt:~# cd /root/Desktop/root/2010_0709_RT2870_Linux_STA_v2.4.0.1/
root@bt:~/Desktop/root/2010_0709_RT2870_Linux_STA_v2.4.0.1# make
make -C tools
make[1]: Entering directory `/root/Desktop/root/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools’
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/root/Desktop/root/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools’
/root/Desktop/root/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools/bin2h
cp -f os/linux/Makefile.6 /root/Desktop/root/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/Makefile
make -C /lib/modules/2.6.39.4/build SUBDIRS=/root/Desktop/root/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux modules
make: *** /lib/modules/2.6.39.4/build: No such file or directory. Stop.
make: *** [LINUX] Error 2

Reply

59 mv288 March 2, 2012 at 4:50 am
60 eric March 9, 2012 at 1:39 pm

Thank you very much for this….lifesaver! Was about to abandon Linux.

Reply

61 Insun March 14, 2012 at 3:48 am

Hi
I follows the steps, just want to build a rt5370sta.ko using my PC to runing on my ARM mid, but I got this error:

I Edited the Makefile ,set CROSS_COMPILE & LINUX_SRC to my local path

insun@dell-amd64:~/Work/Ralink/2011_0225_RT5370_RT5372_Linux_STA_V2.5.0.1_DPO$ make PLATFORM=TCC8902
make -C tools
make[1]: Entering directory `/home/insun/Work/Ralink/2011_0225_RT5370_RT5372_Linux_STA_V2.5.0.1_DPO/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/insun/Work/Ralink/2011_0225_RT5370_RT5372_Linux_STA_V2.5.0.1_DPO/tools'
/home/insun/Work/Ralink/2011_0225_RT5370_RT5372_Linux_STA_V2.5.0.1_DPO/tools/bin2h
cp -f os/linux/Makefile.6 /home/insun/Work/Ralink/2011_0225_RT5370_RT5372_Linux_STA_V2.5.0.1_DPO/os/linux/Makefile
make -C /home/insun/Work/telchips/telchipsdroid/kernel SUBDIRS=/home/insun/Work/Ralink/2011_0225_RT5370_RT5372_Linux_STA_V2.5.0.1_DPO/os/linux modules
make[1]: Entering directory `/home/insun/Work/telchips/telchipsdroid/kernel'
  CC [M]  /home/insun/Work/Ralink/2011_0225_RT5370_RT5372_Linux_STA_V2.5.0.1_DPO/os/linux/../../common/crypt_md5.o
/home/insun/Work/Ralink/2011_0225_RT5370_RT5372_Linux_STA_V2.5.0.1_DPO/os/linux/../../common/crypt_md5.c:28: fatal error: rt_config.h: No such file or directory
compilation terminated.
make[2]: *** [/home/insun/Work/Ralink/2011_0225_RT5370_RT5372_Linux_STA_V2.5.0.1_DPO/os/linux/../../common/crypt_md5.o] Error 1
make[1]: *** [_module_/home/insun/Work/Ralink/2011_0225_RT5370_RT5372_Linux_STA_V2.5.0.1_DPO/os/linux] Error 2
make[1]: Leaving directory `/home/insun/Work/telchips/telchipsdroid/kernel'
make: *** [LINUX] Error 2

Then ,I use -I instruction ,the same error!

Reply

62 Perry April 14, 2012 at 2:25 am

Just so you know…

I started on your solution and got as far as this step:

blacklist rt2800usb
blacklist rt2x00lib
blacklist rt2x00usb

and rebooted

and everything started to work !!!

I’m running Ubuntu 10.04.4 (32-bit) from Ubuntu.com with 2.6.32-40-generic Kernal and I honestly thought that this was going to be an issue. However as soon as I rebooted the words “wireless-g connected” came up and I was flabergasted, it worked.

So….

T Hanks

Reply

63 Perry April 14, 2012 at 2:26 am

It was a fresh install of Ubuntu 10.04.4 (32-bit) btw. I think I didnt even have all the updates down before I started working on this issue.

Thanks again,

Perry

Reply

64 PedoBear May 23, 2012 at 2:56 pm

This step is broken (it could be ‘cp’ instead of ‘mv’, or just ignore it):
sudo mv /lib/modules/$(uname -r)/kernel/drivers/net/wireless/rt2870sta.ko $HOME/backup/

Also, unless your a fan of meaningless console diarrhea, disable the debug messages:
in config.mk, remove the ‘-DDBG’ compile option.

Reply

65 ano June 6, 2012 at 11:19 am

SOLUTION to [LINUX] Error 2: or [LINUX] Fehler 2:
in file include/os/rt_linux.h

usb_buffer_alloc() has to be renamed to usb_alloc_coherent()
usb_buffer_free() has to be renamed to usb_free_coherent()

Then you can compile without errors. It worked for me (Backtrack 5 R2).

Source here.

Reply

66 juli August 9, 2012 at 6:48 pm

After reboot, nothing I plug into the USB ports is activated or seen by the system. An ifconfig shows me a “br0″ for the ethernet/usb bridge, I presume. But my “ra0″ is no longer there. A lsusb results in a frozen terminal that I can’t ^C out of.

Reply

67 data November 9, 2012 at 11:17 pm

Have all installed in root/Desktop is that a problem, have not tested what happend…how can i fix, if necessary?

Reply

68 data November 10, 2012 at 12:00 am

Me again,

i follow ur Tutorial for Setup GE-RT3070 (AWUS036NH) in VirtualBox 4.2.2 running Backtrack5R3 (Ubuntu 10.04 Basis) on a MacBookPro 10.6.8. It is essential to activate the connected USB Device in Virtualbox Settings-Devices>USB-Devices. Then “lsusb” list it. Thats all.

Reply

69 Leonard21117 November 11, 2012 at 3:50 pm

hi,
1. I do not have any rt2* modules when id do lsmod, but I did it blacklisted it anyway.

2. I do not have internet on Ubuntu, so I booted to Windows and copied files from http://www.ralinktech.com (your link does not work, but I found files in support tab, lunix) to USB flash drive).

Went back to Ubuntu, copied files from USB flash to $HOME ( I have wine)
tar
unzip
was ok.
updated os/linux/config.mk

Failed on make

lenny@lenny-Inspiron-530:~/2010_0709_RT2870_Linux_STA_v2.4.0.1$ 1$ make
make -C tools
make[1]: Entering directory `/home/lenny/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/lenny/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools'
/home/lenny/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools/bin2h
cp -f os/linux/Makefile.6 /home/lenny/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/Makefile
make -C /lib/modules/2.6.38-16-generic/build SUBDIRS=/home/lenny/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.38-16-generic'
  CC [M]  /home/lenny/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_md5.o
  CC [M]  /home/lenny/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_sha2.o
  CC [M]  /home/lenny/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_hmac.o
  CC [M]  /home/lenny/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_aes.o
/home/lenny/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_aes.c: In function ‘WscEncryptData’:
-----
-----
/home/lenny/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:34:20: note: expected ‘VOID **’ but argument is of type ‘struct __TX_BUFFER **’
/home/lenny/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:628:13: warning: passing argument 3 of ‘RTMPAllocUsbBulkBufStruct’ from incompatible pointer type
/home/lenny/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.c:34:20: note: expected ‘VOID **’ but argument is of type ‘UCHAR **’
make[2]: *** [/home/lenny/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/cmm_mac_usb.o] Error 1
make[1]: *** [_module_/home/lenny/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.38-16-generic'
make: *** [LINUX] Error 2

I tried

$ make install
install -m 644 -c rt2870sta.ko /lib/modules/2.6.38-16-generic/kernel/drivers/net/wireless/
install: cannot stat `rt2870sta.ko': No such file or directory
make[1]: *** [install] Error 1

How can I fix Errors on make?

Thanks.

Reply

70 Leonard21117 November 12, 2012 at 5:18 pm

Update:
i compiled-make after renaming functions in header file as suggested on the site
-installed it.

getting errors:
iwconfig ra0
ra0: error fetching interface information: Device not found

sudo iwconfig ra0 essid ZZ453K
Error for wireless request “Set ESSID” (8B1A) :
SET failed on device ra0 ; No such device.
How can I fix it?

Reply

71 l0pan August 5, 2013 at 7:19 pm

I finally got my D-Link DWA-140 working in Ubuntu under vmware. The trick was to make RT8070 /RT3070 driver from mediatek instead of RT2870. It is necessary also to set ‘HAS_WPA_SUPPLICANT=y’ and ‘HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y’ in config.mk and add these to /etc/modprobe.d/blacklist.conf:
blacklist rt2870usb
blacklist rt2x00usb
blacklist rt2x00lib
blacklist rt2800usb
blacklist rt2870sta

Reply

72 Justus September 24, 2013 at 11:22 am

Im faced to the

[LINUX] Error 2

after “make” command as well. Tried the advice to replace all instances of usb_buffer_alloc with usb_alloc_coherent and all instances of usb_buffer_free with usb_free_coherent.

No success! Basicly I changed the RAusb_buffer_alloc and the RAusb_buffer_free as well. Was that right? Could that be the reason for my problems?

Reply

73 Justus September 24, 2013 at 8:09 pm

Well, now I know, that I shall not change RA…

Tried the Linuxcrew patch, but didnt work either. I forgot to tell, that Im compiling Drivers for DWA-140, so RT8070… Does this change anything?? can I use the patch as well??

Reply

74 Miljan November 9, 2013 at 7:42 pm

What should i do? I am installing this on a Ubuntu 10.10.
rade@rade221955:~/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1$ make
make -C tools
make[1]: Entering directory `/home/rade/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools’
gcc -g bin2h.c -o bin2h
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/rade/Desktop/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools’
make: *** [build_tools] Error 2

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , , , , , , , , ,

Previous post:

Next post: