PDA

View Full Version : [ubuntu] HOWTO: Ralink rt2870 (Native) Kernel 2.6.24


pandapanda
April 25th, 2008, 12:06 PM
Hi all,

As many people have pointed out the Ralink rt2870 driver will not compile OTB Hardy Heron. I have some simple patch instructions that will allow you to compile the driver ( available from http://www.ralinktech.com.tw/data/drivers/2007_1220_RT2870_Linux_STA_v1.2.1.0.tar.bz2 ) and regain your wifi.

PRE:

- Alter the makefile(s) according to your needs, just as the README_STA states.

STEP 1:

- navigate to /include/rt2870.h and and a NULL terminator to RT2870_USB_DEVICES.

#define RT2870_USB_DEVICES \
{ \
{USB_DEVICE(0x148F,0x2770)}, /* Ralink */ \
{USB_DEVICE(0x148F,0x2870)}, /* Ralink */ \
{USB_DEVICE(0x0B05,0x1731)}, /* Asus */ \
{USB_DEVICE(0x0B05,0x1732)}, /* Asus */ \
{USB_DEVICE(0x0B05,0x1742)}, /* Asus */ \
{USB_DEVICE(0x0DF6,0x0017)}, /* Sitecom */ \
{USB_DEVICE(0x0DF6,0x002B)}, /* Sitecom */ \
{USB_DEVICE(0x0DF6,0x002C)}, /* Sitecom */ \
{USB_DEVICE(0x0DF6,0x002D)}, /* Sitecom */ \
{USB_DEVICE(0x14B2,0x3C06)}, /* Conceptronic */ \
{USB_DEVICE(0x14B2,0x3C28)}, /* Conceptronic */ \
{USB_DEVICE(0x2019,0xED06)}, /* Planex Communications, Inc. */ \
{USB_DEVICE(0x07D1,0x3C09)}, /* D-Link */ \
{USB_DEVICE(0x14B2,0x3C07)}, /* AL */ \
{USB_DEVICE(0x050D,0x8053)}, /* Belkin */ \
{USB_DEVICE(0x14B2,0x3C23)}, /* Airlink */ \
{USB_DEVICE(0x14B2,0x3C27)}, /* Airlink */ \
{USB_DEVICE(0x07AA,0x002F)}, /* Corega */ \
{USB_DEVICE(0x07AA,0x003C)}, /* Corega */ \
{USB_DEVICE(0x07AA,0x003F)}, /* Corega */ \
{USB_DEVICE(0x1044,0x800B)}, /* Gigabyte */ \
{USB_DEVICE(0x15A9,0x0006)}, /* Sparklan */ \
{USB_DEVICE(0x083A,0xB522)}, /* SMC */ \
{USB_DEVICE(0x083A,0xA618)}, /* SMC */ \
{USB_DEVICE(0x083A,0x7522)}, /* Arcadyan */ \
{USB_DEVICE(0x0CDE,0x0022)}, /* ZCOM */ \
{USB_DEVICE(0x0586,0x3416)}, /* Zyxel */ \
{USB_DEVICE(0x0CDE,0x0025)}, /* Zyxel */ \
{USB_DEVICE(0x1740,0x9701)}, /* EnGenius */ \
{USB_DEVICE(0x1740,0x9702)}, /* EnGenius */ \
{USB_DEVICE(0x0471,0x200f)}, /* Philips */ \
{USB_DEVICE(0x14B2,0x3C25)}, /* Draytek */ \
{USB_DEVICE(0x13D3,0x3247)}, /* AzureWave */ \
{USB_DEVICE(0x083A,0x6618)}, /* Accton */ \
{USB_DEVICE(0x15c5,0x0008)}, /* Amit */ \
{USB_DEVICE(0x0E66,0x0001)}, /* Hawking */ \
{USB_DEVICE(0x0E66,0x0003)}, /* Hawking */ \
{USB_DEVICE(0x129B,0x1828)}, /* Siemens */ \
{NULL} \
}

STEP 2:

- navigate to /os/linux/rt_main_dev.c and replace static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER pAd) function with

static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER pAd)
{
NDIS_STATUS Status;
INT i=0;
CHAR slot_name[IFNAMSIZ];
struct net_device *device;


//ether_setup(dev);
dev->hard_start_xmit = rt28xx_send_packets;
// dev->set_multicast_list = ieee80211_set_multicast_list;
// dev->change_mtu = ieee80211_change_mtu;
#ifdef CONFIG_STA_SUPPORT
#if WIRELESS_EXT >= 12
dev->wireless_handlers = &rt28xx_iw_handler_def;
#if WIRELESS_EXT < 21
dev->get_wireless_stats = rt28xx_get_wireless_stats;
#else
dev->get_stats = rt28xx_get_wireless_stats;
#endif
#endif //WIRELESS_EXT >= 12
#endif // CONFIG_STA_SUPPORT //
dev->open = rt28xx_open;
dev->stop = rt28xx_close;
// dev->uninit = ieee80211_if_reinit;
// dev->destructor = ieee80211_if_free;
dev->priv_flags = INT_MAIN;
dev->do_ioctl = rt28xx_ioctl;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
dev->validate_addr = NULL;
#endif


// find available device name
for (i = 0; i < 8; i++)
{
#ifdef MULTIPLE_CARD_SUPPORT
if (pAd->MC_RowID >= 0)
sprintf(slot_name, "ra%02d-%d", pAd->MC_RowID, i);
else
#endif // MULTIPLE_CARD_SUPPORT //
sprintf(slot_name, "ra%d", i);

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
device = dev_get_by_name(dev->nd_net, slot_name);
#else
device = dev_get_by_name(slot_name);
#endif
if (device != NULL) dev_put(device);
#else
for (device = dev_base; device != NULL; device = device->next)
{
if (strncmp(device->name, slot_name, 4) == 0)
break;
}
#endif
if(device == NULL)
break;
}

if(i == 8)
{
DBGPRINT(RT_DEBUG_ERROR, ("No available slot name\n"));
Status = NDIS_STATUS_FAILURE;
}
else
{
#ifdef MULTIPLE_CARD_SUPPORT
if (pAd->MC_RowID >= 0)
sprintf(dev->name, "ra%02d-%d", pAd->MC_RowID, i);
else
#endif // MULTIPLE_CARD_SUPPORT //
sprintf(dev->name, "ra%d", i);
DBGPRINT(RT_DEBUG_INFO, ("Assign the net device name as %s\n", dev->name));
Status = NDIS_STATUS_SUCCESS;
}

return Status;

}


STEP 3:

- navigate to /usr/src/linux-headers-2.6.24-16/include/linux/module.h and add #define SET_MODULE_OWNER(dev) do { } while (0) just above #endif /* _LINUX_MODULE_H */

STEP 4:

- navigate back to the drivers root
-make || make install
-cp RT2870STA.dat /etc/Wireless/RT2870STA/RT2870STA.dat

STEP 5:

- navigate to /os/linux
- $/sbin/insmod rt2870sta.ko
- $/sbin/ifconfig ra0 inet YOUR_IP up

I recommend removing/commenting the addition to module.h after installing the driver.

Enjoy. I have only tested this connecting without no encryption so I have no idea if encryption will work. If anyone feels like taking the time to create a script or patch then please do so :) Hope it works for you all.

pandapanda

negora
April 25th, 2008, 12:57 PM
You're my hero LOL. This issue has made me get desperated. I've been using ndiswrapper and the Vista 64 driver this afternoon, until Ralink answered me (I know they sent a patch to some people who asked), but the result has been a disaster: Some times wpa_supplicant worked... Others, the more, this wasn't able to get associated to my AP. I guess that ndiswrapper doesn't handle this Vista 64 driver very well.

I'm just going to try your solution, using WPA-CCMP and publish my results.

pandapanda
April 25th, 2008, 01:07 PM
You will have to restart network to get it associated with network manager. I did this via GUI by right clicking the network manager -> enable networking and once more network manager -> enable network. I believe ifconfig ra0 up will also do the trick - just copied $/sbin/ifconfig ra0 inet YOUR_IP up from the readme :p

negora
April 25th, 2008, 01:35 PM
You've done my day!!! :D I've followed your steps and it worked perfectly! At the beginning I did a stupid mistake, as I was so impatient and happy, that at the Step 3, I simply copied and pasted all the text, with your instruction "just above #endif /* _LINUX_MODULE_H */" included, ha ha ha. But checking the code carefully I realized about it. Ouch! :P

Well, I've a Dlink DWA-140 wireless adaptor and a Dlink DSL-2740B router, configured both to work using WPA2-PSK, and it works flawless, like it did on Ubuntu v. 7.10.

Many many many thanks pandapanda. I really appreciate your help, since this issue was driving me crazy and these people from Ralink, according to some opinions on the Internet, maybe took many days to answer.

Now, every time I see a piece of bamboo, I'll remind that you helped me, he he he. Nah, seriously, many thanks for this great guide ;) .

negora
April 25th, 2008, 01:38 PM
Ops, by the way, maybe I give a second opportunity to the Network Manager, because I HATE this. Maybe it's because I only have used this for WiFi connections, but it never worked properly for me :/ . Everytime I've tested Ubuntu/Kubuntu have ended using Kwlan or none, configuring "/etc/networks" by hand ;) .

matthew.kent
April 27th, 2008, 03:19 AM
Thank you for these instructions! I've moved these changes into an easy to apply patch and attached it here.

Be sure to backup any existing /etc/Wireless/RT2870STA as the make install (stupidly) rm -rf's it.

Here's the simplified instructions:

wget http://www.ralinktech.com.tw/data/drivers/2007_1220_RT2870_Linux_STA_v1.2.1.0.tar.bz2
tar jxf 2007_1220_RT2870_Linux_STA_v1.2.1.0.tar.bz2
gzip -d rt2870-v1.2.1.0_2.6.24.patch.gz
patch -p0 < rt2870-v1.2.1.0_2.6.24.patch
cd 2007_1220_RT2870_Linux_STA_v1.2.1.0
make && sudo make install


Slight addendum: attaching a modified version of the previous patch which disables the insane amount of debug being printed to the kernel ring buffer.

All working great with my Asus WL-160N.

pandapanda
April 27th, 2008, 09:17 AM
Thank you for taking the time to put the instructions into a patch. It appears that you have chosen to define the deprecated SET_MODULE_OWNER locally in the driver's source which is probably safest for inexperienced users, however, experienced users may wish to compile multiple drivers that made use of the macro and in this case it would be more efficient to add to <linux/module.h>. I believe that many other wireless drivers that are no longer compiling with 2.6.24 (due to similar cause) can be made to work using the same principle of this patch.

El-Doble-O
April 30th, 2008, 06:57 PM
I executed the last line: "make && sudo make install" and this is what I got

make -C tools
make[1]: Entering directory `/home/myloginname/2007_1220_RT2870_Linux_STA_v1.2.1.0/tools'
gcc -g bin2h.c -o bin2h
bin2h.c:28:19: error: stdio.h: No such file or directory
bin2h.c:29:20: error: string.h: No such file or directory
bin2h.c:30:20: error: stdlib.h: No such file or directory
bin2h.c: In function ‘main’:
bin2h.c:34: error: ‘FILE’ undeclared (first use in this function)
bin2h.c:34: error: (Each undeclared identifier is reported only once
bin2h.c:34: error: for each function it appears in.)
bin2h.c:34: error: ‘infile’ undeclared (first use in this function)
bin2h.c:34: error: ‘outfile’ undeclared (first use in this function)
bin2h.c:42: warning: incompatible implicit declaration of built-in function ‘memset’
bin2h.c:49: warning: incompatible implicit declaration of built-in function ‘printf’
bin2h.c:54: warning: incompatible implicit declaration of built-in function ‘printf’
bin2h.c:57: warning: incompatible implicit declaration of built-in function ‘strcat’
bin2h.c:69: error: expected expression before ‘)’ token
bin2h.c:71: warning: incompatible implicit declaration of built-in function ‘printf’
bin2h.c:76: error: expected expression before ‘)’ token
bin2h.c:78: warning: incompatible implicit declaration of built-in function ‘printf’
bin2h.c:146: warning: incompatible implicit declaration of built-in function ‘sprintf’
bin2h.c:155: warning: incompatible implicit declaration of built-in function ‘exit’
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/myloginname/2007_1220_RT2870_Linux_STA_v1.2.1.0/tools'
make: *** [build_tools] Error 2

CMasami
May 2nd, 2008, 09:03 PM
El-Doble-O,

You have to install header and library files to build any C/C++ programs.
The simplest way is:
$ sudo apt-get install build-essential

Jackie999
May 3rd, 2008, 12:26 AM
I'm extremely wet behind the ears here..only having used linux for a few days. I'll try and lay out my question so it makes sense.
I followed the above steps (learnt a lot along the way) and *think* I'm almost there....BUT...my Belkin F5D8053 wireless adapter still shows as ndiswrapper - here is my lshw -C network output:
*-network
description: Wireless interface
physical id: 1
logical name: wlan0
serial: 00:1c:df:31:66:5b
capabilities: ethernet physical wireless
configuration: broadcast=yes driver=ndiswrapper+rt2870 driverversion=1.52+Arcadyan Technology Corpora ip=192.168.0.101 multicast=yes wireless=IEEE 802.11gMy etc/network/interfaces shows

auto lo
iface lo inet loopbackSo my question..how do I know I followed instructions and it worked..and how do I make it load and the ndiswrapper not load?
Thanks very much..these forums and support staff are invaluable :)

Jackie999
May 6th, 2008, 10:11 AM
I've been trying for days to get this working..the ndiswrapper is freezing me hourly..so I have to get the native driver installed..
My usb is 1.1 and I wonder if that's my problem - anyone else got the ralink driver installed with the older usb ?

Alien.col
May 6th, 2008, 10:53 AM
I've been trying for days to get this working..the ndiswrapper is freezing me hourly..so I have to get the native driver installed..
My usb is 1.1 and I wonder if that's my problem - anyone else got the ralink driver installed with the older usb ?

Follow this guide: http://ubuntuforums.org/showthread.php?t=783366

It installs the native rt2570 driver, could work

TLZ
May 12th, 2008, 08:48 AM
@matthev.kent: Thanks for posting an easy to apply patch. I've used this with success on a computer with my Dlink DWA-140, however I now need it on another computer. I did the same thing and after I compiled and installed the drivers Ubuntu(8.04) reported that I was using restricted drivers.

However, that's where the fun stops. My network manager displays a wireless connection but it doesen't do much(not even display networks). So I ran lshw to see if it was there, and it was but it was disabled. It does not show up in Network Tools though. (Only my regular ethernet is there.)

I figured a simple "ifconfig ra0 inet up" would fix it but that returns this:
SIOCSIFFLAGS: Operation not permitted

I'm quite a newbie to Ubuntu so sorry if I'm making a stupid mistake here.

Any help would be appriciated. :)

Edit: nevermind, I just used ndiswrapper and windows-drivers instead!

XEQT
May 20th, 2008, 07:12 PM
@matthev.kent: Thanks for posting an easy to apply patch. I've used this with success on a computer with my Dlink DWA-140, however I now need it on another computer. I did the same thing and after I compiled and installed the drivers Ubuntu(8.04) reported that I was using restricted drivers.

However, that's where the fun stops. My network manager displays a wireless connection but it doesen't do much(not even display networks). So I ran lshw to see if it was there, and it was but it was disabled. It does not show up in Network Tools though. (Only my regular ethernet is there.)

I figured a simple "ifconfig ra0 inet up" would fix it but that returns this:
SIOCSIFFLAGS: Operation not permitted

I'm quite a newbie to Ubuntu so sorry if I'm making a stupid mistake here.

Any help would be appriciated. :)

Edit: nevermind, I just used ndiswrapper and windows-drivers instead!

How did you get the ndiswrapper to work ?
I have the Dlink usb DWA-142 and are looking for a solution.
If you could tell me how i would love to hear that !!

// XEQT

Absurd
May 22nd, 2008, 01:22 AM
in my experience, rt2870 works horribly with ndiswrapper

aarnink
May 23rd, 2008, 08:42 AM
Hi,

Thanks for this info, I have tried to install my Eminent EM4550 USB WirelessN stick using the 1.3.0 drivers from ralink. I run Ubuntu 8.04 X64.

After setting up network from the Ubuntu menu I notice that iwconfig shows:

ra0 RT2870 Wireless ESSID:"aarnink_N" Nickname:"RT2870STA"
Mode:Managed Frequency=2.412 GHz Access Point: 00:60:B3:A6:F9:5A
Bit Rate=270 Mb/s
RTS thr:off Fragment thr:off
Encryption key:xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx
Link Quality=92/100 Signal level:-48 dBm Noise level:-71 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

so all is well I thought, but I cannot ping, even the router doesnt respond

If I run ifconfig this is the result

ra0 Link encap:Ethernet HWaddr 00:60:b3:a6:f2:30
inet addr:192.168.0.10 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::260:b3ff:fea6:f230/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:33703 errors:107 dropped:0 overruns:0 frame:0
TX packets:1470 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6036838 (5.7 MB) TX bytes:127230 (124.2 KB)

Can anyone help me? Im totally wasted after 2 extensive days of searching for a solution

negora
May 25th, 2008, 03:36 PM
Hi again to you all:

Today I've had to set up my laptop with the last Kubuntu. I also have a RT2870 WiFi USB stick installed on it and I've decided to check the Ralink website to check if something had changed since last time. And I've realized that they have updated their drivers for Linux.

I've tryed to compile them with the last version of the Ubuntu kernel (2.6.27) and everything has been done ok. It even seems to connect to my network (or that's what the output messages say). However, wpa_cli isn't able to work with it and there's not connection. Has anyone faced the same problem?

I think I'l try to compile with the v. 2.6.24 headres and try again. Maybe that has something to do...

Salutes.

aarnink
May 27th, 2008, 04:50 PM
Hi negora,

Did you have any succes with the new rt2870 drivers (ver 1.3) on kubuntu 8.04?

I only managed to get a working connection on a completely open router (no security set). All other attempts failed, even with WEP 64 bit key.

I'd very much appreciate a helping hand...

Richard

negora
May 27th, 2008, 07:37 PM
Hi aarnink!:

Although I'm very busy these days I could try with the headers of the version 2.6.24... And I got the same result :( . The wpa_supplicant application tells that everything is ok and that the connection to the AP was successful. However, executing wpa_cli returns an error because it could not connect.

I haven't had enough time to check what's wrong but, by now, I believe that we can use the old drivers that our partner pandapanda patched for us ;) .

If anyone have news about this issue I would be pleased to listen about it :D .

PD: By the way, I'm trying to connect to a WiFi network with both WPA1 and WPA2 encryption.

aarnink
May 30th, 2008, 12:29 AM
Hi negora,

Finally it works! I received an email with updated drivers from Ralink. I have posted them on this forum, Look here: http://www.uluga.ubuntuforums.org/showthread.php?t=202834&page=143

Hopefully it works for you as well

gr, Richard

negora
May 30th, 2008, 03:47 AM
aarnink: Thanks for your help ;) . In my case Ralink never answered, ha ha ha. I'll download those and try this afternoon. I also hope that Ralink publish the updated ones on their website so other people don't suffer from the same problem. Again, thank you very much :D .

tatoniss
June 1st, 2008, 06:34 PM
HI im new to ubuntu but i installed hardy harion on a computer ans connected it to a modem to use cox high speed internet. when i type a site in and click go it brings me to a cox instll page, when i click next it says browser or os not supported but it worked on the live cd on another computer. so I am trying to use a usb wirless card, d-link dwa-140 version 2.0,to connect to my wireless but it is not regonized by ubuntu so could you give me instuctions as to why i keep getting directed to cox or how to install the drivers you recently recevied by email, I am having trouble understanding how. thankyou

mpns2mpns2
June 15th, 2008, 02:51 PM
Hi

I've got this error
Can you help me !
Thanks alot
Marc


>make && sudo make install

make -C tools
make[1]: entrant dans le répertoire « /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/tools »
gcc -g bin2h.c -o bin2h
make[1]: quittant le répertoire « /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/tools »
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/tools/bin2h
cp -f os/linux/Makefile.6 /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/Makefile
make -C /lib/modules/2.6.24-17-generic/build SUBDIRS=/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux modules
make[1]: entrant dans le répertoire « /usr/src/linux-headers-2.6.24-17-generic »
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../common/md5.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../common/mlme.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../common/rtmp_wep.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../common/action.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../common/ba_action.o
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../common/ba_action.c: Dans la fonction «convert_reordering_packet_to_preAMSDU_or_802_3_pa cket» :
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../common/ba_action.c:1376: attention : assignment makes integer from pointer without a cast
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../common/cmm_data.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../common/rtmp_init.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../common/rtmp_tkip.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../common/cmm_sync.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../common/eeprom.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../common/cmm_sanity.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../common/cmm_info.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../common/cmm_wpa.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../common/dfs.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../sta/assoc.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../sta/aironet.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../sta/auth.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../sta/auth_rsp.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../sta/sync.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../sta/sanity.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../sta/rtmp_data.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../sta/connect.o
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../sta/connect.c: Dans la fonction «MakeIbssBeacon» :
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../sta/connect.c:2468: attention : format «%d» expects type «int», but argument 2 has type «long unsigned int»
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../sta/connect.c:2468: attention : format «%d» expects type «int», but argument 6 has type «long unsigned int»
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../sta/wpa.o
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_linux.o
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_linux.c: Dans la fonction «duplicate_pkt» :
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_linux.c:545: attention : passing argument 1 of «memmove» makes pointer from integer without a cast
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_linux.c:547: attention : passing argument 1 of «memmove» makes pointer from integer without a cast
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_linux.c: Dans la fonction «ClonePacket» :
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_linux.c:631: attention : assignment makes integer from pointer without a cast
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_linux.c: Dans la fonction «update_os_packet_info» :
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_linux.c:653: attention : assignment makes integer from pointer without a cast
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_linux.c: Dans la fonction «wlan_802_11_to_802_3_packet» :
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_linux.c:673: attention : assignment makes integer from pointer without a cast
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_linux.c: Dans la fonction «send_monitor_packets» :
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_linux.c:865: attention : format «%d» expects type «int», but argument 3 has type «long unsigned int»
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_linux.c:912: attention : assignment makes integer from pointer without a cast
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_linux.c:920: attention : assignment makes integer from pointer without a cast
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_profile.o
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_profile.c:223: attention : «rtinet_aton» defined but not used
CC [M] /home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_main_dev.o
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_main_dev.c: Dans la fonction «rt_ieee80211_if_setup» :
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_main_dev.c:671: attention : assignment from incompatible pointer type
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_main_dev.c:694: attention : passing argument 1 of «dev_get_by_name» from incompatible pointer type
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_main_dev.c:694: erreur: trop peu d'arguments pour la fonction «dev_get_by_name»
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_main_dev.c: Dans la fonction «rt28xx_probe» :
/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_main_dev.c:1157: erreur: déclaration implicite de la fonction « «SET_MODULE_OWNER» »
make[2]: *** [/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux/../../os/linux/rt_main_dev.o] Erreur 1
make[1]: *** [_module_/home/marc/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0/os/linux] Erreur 2
make[1]: quittant le répertoire « /usr/src/linux-headers-2.6.24-17-generic »
make: *** [LINUX] Erreur 2
marc@ubuntu-marc:~/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0$
marc@ubuntu-marc:~/Bureau/2007_1220_RT2870_Linux_STA_v1.2.1.0$

lukemack
June 27th, 2008, 12:03 PM
Has anyone tried the 2008_0528_RT2870_Linux_STA_v1.3.0.0 version from the ralink site?

I can compile it but get this warning from iwconfig:

Warning: Driver for device ra0 has been compiled with an ancient version
of Wireless Extension, while this program support version 11 and later.
Some things may be broken...


I used the latest version of build-essential on Hardy to compile it.

thanks,

lukemack.

pmorton
July 22nd, 2008, 07:58 PM
Yes. I've got an rt2870 working with the 2008_0528_RT2870_Linux_STA_v1.3.0.0 driver, having used pandapanda's patches at the head of this thread. Only I can't get Network Manager to bring the adapter up. It puts all the right stuff into /etc/network/interfaces, but it won't list the available ESSID's and it won't connect with encryption active. It does connect with no encryption, but that's hardly a long-term option.

The RT2870 wireless utility RutilT (apt-get install rutilt) does work, though, finding the ESSID's and connecting after asking for a WEP key. So wifi works but each boot requires a manual hook-up using RutilT. My conclusion is that it's a Network Manager problem. Does anyone know any different?

lukemack
July 23rd, 2008, 03:12 AM
I have it working now too. On boot, I have to disable and enable networking via network manager and then it comes up fine. WPA-PSK encryption works fine (you need to compile the driver with the correct options in the makefile for that).

Didnt know about the rtutil thing, though the driver comes with the equivalent utility on my hackintosh partition ;-)

My guess is the problems are probably a combination of the badly written driver, poor documentation and network-manager, which though I've never had a major problem, people often bitch about.

Let me know if you want to combine on trying to get a fix for it. I didnt get any response from Ralink technology so the Ubuntu community or these people are probably the best bet:

http://rt2x00.serialmonkey.com/

GepettoBR
August 30th, 2008, 10:20 AM
I got my DWA-140 to work with WPA Personal encryption using these instructions (http://ubuntuforums.org/showpost.php?p=5400203&postcount=6) but now I have to run "sudo modprobe rt2780sta" at start-up for it to work. I added the line to /etc/rc.local as a temporary fix, but if memory serves me right there should be a way to make the module load normally with boot. Can anyone help me remember? :)

P.S.: The D-Link website claims to have a Beta Linux driver for the DWA-140, but it looks like all they did was host the 1.2.1 version of the Ralink driver on their own website.
P.S.2: ndiswrapper didn't work at all with the Vista32 driver, and allowed me to access only unencrypted networks with the XP/2k driver. Compiling the ralink driver is just as easy as installing ndisgtk and the Windows driver, and yields far better results.

Jackie999
August 30th, 2008, 04:51 PM
There is a new driver on the ralink site http://www.ralinktech.com/ralink/Home/Support/Linux.html dated 07/18/2008 which I've tried a few times.
Can anyone who's gotten it working tell me what changes, if any, are required to compile/install on Hardy 2.6.24 ?
I've tried a few times and it appears to compile okay but still I don't have a device in iwconfig. Could somebody let me know if there are changes I need to make in /etc/network/interface or /etc/modules - or should the 'make install' have made changes (mine didn't)
Thanks.

GepettoBR
August 30th, 2008, 09:54 PM
There is a new driver on the ralink site http://www.ralinktech.com/ralink/Home/Support/Linux.html dated 07/18/2008 which I've tried a few times.
Can anyone who's gotten it working tell me what changes, if any, are required to compile/install on Hardy 2.6.24 ?
I've tried a few times and it appears to compile okay but still I don't have a device in iwconfig. Could somebody let me know if there are changes I need to make in /etc/network/interface or /etc/modules - or should the 'make install' have made changes (mine didn't)
Thanks.

This is exactly what happened to me. See my previous post for how I solved it (it's actually very simple, though I suspect there should be a better way to do it):
I got my DWA-140 to work with WPA Personal encryption using these instructions (http://ubuntuforums.org/showpost.php?p=5400203&postcount=6) but now I have to run "sudo modprobe rt2780sta" at start-up for it to work. I added the line to /etc/rc.local as a temporary fix, but if memory serves me right there should be a way to make the module load normally with boot. Can anyone help me remember? :)

I followed the linked instructions, but using the latest drivers from the Ralink website (I did this today) and rebooted. ifconfig would only display eth0 and the loopback interface, but upon running modprobe rt2780sta as root, ra0 appeared. By adding the modprobe line to /etc/rc.local (before the line that says "ifconfig ra0 up", naturally) I managed to get it working on every successive boot, of which there were a total of seven so far. I get high up/down speeds on Transmission, I can connect to other machines on the LAN, and all the while using WPA/WPA2 encryption.

AFAIK the /etc/rc.local file which I wrote these lines to is something of a list of extra commands Ubuntu runs as root right after booting up, or right after logging in, so adding a command to the file would be like adding it to Preferences>Sessions, except it gets run by the root account (which is necessary to load kernel modules and activate network interfaces).

On a sidenote, the driver thus compiled works much better than the Windows driver on Windows. The same computer running XP loses the connection every ten minutes or so, and under Ubuntu my uptimes so far have been as long as the computer was on.

Jackie999
August 30th, 2008, 11:35 PM
Thanks for the pointers GepettoBR ..but still no go...I did a fresh format/reinstall and followed your instructions on the linked post with these results:
I did a few things differently, for example, the ralink driver I used was 07/18/2008 - I think you used one from May (which I've used as well with same failure)
Your post shows "make" and "make install" I did "sudo make" and "sudo make install"
I also navigated to the "2008_0718_RT2870_Linux_STA_v1.3.1.0/os/linux/" and typed
sudo /sbin/insmod rt2870sta.koWhen I typed the following I got the error
jackie@ubuntu:~$ sudo ifconfig ra0 up
ra0: ERROR while getting interface flags: No such device
jackie@ubuntu:~$ iwconfig
lo no wireless extensions.

eth0 no wireless extensions.

irda0 no wireless extensions.
I tried sudo modprobe rt2870sta then the sudo ifconfig ra0 up ...but the device isn't in the iwconfig list and I don't know how to get it there :(

GepettoBR
August 30th, 2008, 11:50 PM
I used the Ralink_2008_0718_RT2870_Linux_STA_v1.3.1.0 driver, which I downloaded this morning. From the filename, it's the same date as yours. I'm quite sleepy now, but I can think of four noteworthy points. I'll try and help more tomorrow.

You're correct to use "sudo" before those commands, the poster just happened to be in a root shell already. As for the other thing you did different, did you run that command from the folder that contains rt2870sta.ko? It seems obvious, but we do sometimes forget.

The post I linked to mentioned not having to copy a certain .dat file; yet when I followed his instructions I found that the .dat file was already where it was supposed to be. Maybe you should check on that.

I had to do a similar fix with a DWL-G122 in Gutsy (supported OOTB in Hardy) and the instructions also mentioned ra0, but mine came up as eth1. With ndiswrapper, the DWA-140 was wlan1, with the current fix it's ra0. Maybe the interface name is just messed up. What's your irda0 supposed to represent?

Finally, mine only worked after rebooting. Did you try rebooting before running iwconfig?

Jackie999
August 31st, 2008, 09:21 AM
Thanks for the help GepettoBR, you asked where I ran the rt2870sta.ko from - I was in the "2008_0718_RT2870_Linux_STA_v1.3.1.0/os/linux/" folder, which I think is correct.
As for the irda0 - I'm guessing that's the infrared on the lappy (for printer?) which has never been used.
And the .dat file you mentioned, I think I've tried installing this driver at least 6 times now and that RT2870STA.dat file is always in the /etc/Wireless/RT2870STA/ folder where it belongs - I've never done anything there.

GepettoBR
August 31st, 2008, 10:05 AM
That's very strange, it seems we've done the exact same thing and have achieved very diffeent results. Maybe it's a firmware problem. My DWA-140 is HW version B1 and Firmware version 1.11 (it's written in the back of the device). I do remember that my 802.11g adapter (also from D-Link) had different fixes for each HW version on the WifiDocs. Some worked OOTB, some required ndiswrapper or compiling drivers and one didn't work at all - at the time.

If you've tried using the ndiswrapper method before doing this, then did you uninstall the Windows driver? Conflicting drivers may be what's keeping your computer from recognizing the device.

Even though the wireless interface doesn't show up in iwconfig, does the device appear when you type lsusb in a terminal?

Jackie999
August 31st, 2008, 01:54 PM
Yes, the ndiswrapper enabled me to use the usb stick (mine is the Belkin F5D8053 v3 - 802.11n ) but the ndiswrapper caused so many freezes that it rendered the computer useless. As for conflicting drivers ..thats why I reformatted and tried again yesterday..with the same failure :(
I've just started fresh again..this time with Fedora 9 - hopefully I'll have better luck.
Thanks again for all your help it's very much appreciated.

GepettoBR
August 31st, 2008, 02:19 PM
Well, I'm just sorry I couldn't help you make it work. And there's no entry for your adapter on WifiDocs either...

With ndiswrapper, did you try with all the available Windows drivers (For Windows Vista, XP, 2000, etc)? Like I mentioned earlier, I could get some functionality with the XP/2000 drivers but none with Vista; maybe under a different Windows driver you'll be able to satisfactorily use ndiswrapper with your card.

Jackie999
August 31st, 2008, 05:24 PM
Wellllll.....I didn't try the other windows drivers, only the one that came with the device. But to be honest..the reason I moved to linux was to get away from all things windows :) so..to fight with the windows drivers in linux (i.e. ndiswrapper) didn't seem worthwhile..I figured my time was better spent trying distros.

GepettoBR
August 31st, 2008, 06:56 PM
Wellllll.....I didn't try the other windows drivers, only the one that came with the device. But to be honest..the reason I moved to linux was to get away from all things windows :) so..to fight with the windows drivers in linux (i.e. ndiswrapper) didn't seem worthwhile..I figured my time was better spent trying distros.

Yeah, I feel the same way... but after spending money on a usb stick it kind of sucks to not be able to use it. I'll keep scavenging the interwebs and if I find something I'll let you know. Until the, best of luck to you! :)

Jackie999
August 31st, 2008, 08:27 PM
Thanks ...who knows..I may be back on Hardy by tomorrow :) The driver doesn't even compile under Fedora ...so so much for that ...there is always SUSE though ...:)

GepettoBR
August 31st, 2008, 08:32 PM
Did you remember to install build-essentials before trying to compile the driver in Fedora?

Jackie999
September 1st, 2008, 09:53 PM
Yep..I did the

# yum install gcc gcc-c++ make kernel-headers kernel-devel
then got a load of errors and asked for help and was told "it appears that the driver you are attempting to compile isn't compatible with the kernel version you have"

So now I'm back to Ubuntu..this time I'm trying the 8.10 alpha 4 Intrepid Ibex version :)
which doesn't work with the wireless either..but I'm used to that.

aextance
September 30th, 2008, 04:29 PM
I am coming up against an "Invalid module error" with this, both when doing a modprobe, and also when trying to follow the instructions in the Ralink readme on loading the driver.

Watching the install process, although the build file is in /lib/modules/2.6.24-19-generic, the driver is installed to /lib/modules/2.6.24-19-386. Is this likely to be an issue?

When I look at "hardware drivers" under the system administration menu it shows the RT2870 driver as being installed, lsusb shows that the device is a RT2870 adaptor, but ifconfig ra0 up fails to show anything and sudo modprobe RT2870.sta gives a fatal, invalid module error.

Can anyone explain what's wrong?

GepettoBR
October 1st, 2008, 11:11 AM
This may sound stupid, but did just copying the files from /lib/modules/2.6.24-19-386 to /lib/modules/2.6.24-19-generic work?

Do you have both versions of the kernel or only the generic version? If you have both, does booting with the 2.6.24-19-386 kernel allow the driver to work?

There may be some parameter in the makefile where you can specify your kernel version before installing.

Jackie999
October 1st, 2008, 06:37 PM
aextance, my problem was it seemed to compile fine..but when all was done..there was no ra0 listed in iwconfig.

The answer was that my device was missing from the driver and I'll post a link of how I was advised to fix it ...also how I used the newest driver 1.4.0.0.

http://ubuntuforums.org/showthread.php?t=919044

Hope this helps ...this linux wireless battle can keep you awake nights :)

Oh..and by the way
but ifconfig ra0 up fails to show anything and sudo modprobe RT2870.sta gives a fatal, invalid module error.


There is no period in that ..should be - sudo modprobe rt2870sta

primaxx
October 2nd, 2008, 12:53 AM
I just want to inform you that Ralink has published a new driver (Version 1.4.0.0).
http://www.ralinktech.com/ralink/Home/Support/Linux.html

When following the included instructions, it worked like a charm for me.

GepettoBR
October 2nd, 2008, 01:38 PM
I just want to inform you that Ralink has published a new driver (Version 1.4.0.0).
http://www.ralinktech.com/ralink/Home/Support/Linux.html

When following the included instructions, it worked like a charm for me.

Did anyone who had already gotten the previous driver to work test this and notice any improvements? I might give it a whirl this weekend (though I'm really hoping that the Intrepid beta will have this working out of the box).

GepettoBR
October 3rd, 2008, 01:30 PM
Hello, all, posting from the Intrepid Beta!

My D-Link DWA-140 was not recognized OOTB (it didn't even appear in lsusb), but installing the ralink driver version 1.4.0.0 following these instructions (http://ubuntuforums.org/showpost.php?p=5400203&postcount=6) (except I did not have to add anything to /etc/rc.local, and roaming mode does not need to be disabled) got me working perfectly: I can manage the interface with Network Manager, connect to WPA-encrypted networks in Wireless N mode and my speed is as high as it should be.

Nutt's
October 6th, 2008, 03:55 AM
hello,
using the newest driver 1.4.0.0. I also have a problem when doing the "insmod" or "modprobe".

In fact, during the "make" I have a warning:
cnuttens@ubuntuCN:~/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0$ sudo make
sudo: unable to resolve host ubuntuCN
[sudo] password for cnuttens:
make -C tools
make[1]: entrant dans le répertoire « /home/cnuttens/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0/tools »
gcc -g bin2h.c -o bin2h
make[1]: quittant le répertoire « /home/cnuttens/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0/tools »
/home/cnuttens/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0/tools/bin2h
cp -f os/linux/Makefile.6 /home/cnuttens/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0/os/linux/Makefile
make -C /lib/modules/2.6.24-19-rt/build SUBDIRS=/home/cnuttens/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0/os/linux modules
make[1]: entrant dans le répertoire « /usr/src/linux-headers-2.6.24-19-rt »
CC [M] /home/cnuttens/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0/os/linux/../../common/rtmp_init.o
LD [M] /home/cnuttens/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0/os/linux/rt2870sta.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: "there_is_no_init_MUTEX_LOCKED_for_RT_semaphores" [/home/cnuttens/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0/os/linux/rt2870sta.ko] undefined!
LD [M] /home/cnuttens/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0/os/linux/rt2870sta.ko
make[1]: quittant le répertoire « /usr/src/linux-headers-2.6.24-19-rt »
cp -f /home/cnuttens/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0/os/linux/rt2870sta.ko /tftpboot

But after that, it seems to have no problem with the "make install":
cnuttens@ubuntuCN:~/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0$ sudo make install
sudo: unable to resolve host ubuntuCN
make -C /home/cnuttens/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0/os/linux -f Makefile.6 install
mkdir: ne peut créer le répertoire `/etc/Wireless': Le fichier existe
make[1]: entrant dans le répertoire « /home/cnuttens/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0/os/linux »
rm -rf /etc/Wireless/RT2870STA
mkdir /etc/Wireless/RT2870STA
cp /home/cnuttens/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0/RT2870STA.dat /etc/Wireless/RT2870STA/.
install -d /lib/modules/2.6.24-19-rt/kernel/drivers/net/wireless/
install -m 644 -c rt2870sta.ko /lib/modules/2.6.24-19-rt/kernel/drivers/net/wireless/
/sbin/depmod -a 2.6.24-19-rt
make[1]: quittant le répertoire « /home/cnuttens/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0/os/linux »


But after, the problems come back:
cnuttens@ubuntuCN:~/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0$ sudo insmod os/linux/rt2870sta.ko
sudo: unable to resolve host ubuntuCN
insmod: error inserting 'os/linux/rt2870sta.ko': -1 Unknown symbol in module


So I tried the modprobe:
cnuttens@ubuntuCN:~/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0$ sudo modprobe rt2870sta
sudo: unable to resolve host ubuntuCN
FATAL: Error inserting rt2870sta (/lib/modules/2.6.24-19-rt/kernel/drivers/net/wireless/rt2870sta.ko): Unknown symbol in module, or unknown parameter (see dmesg)


As it advises to see dmesg:

cnuttens@ubuntuCN:~/Desktop/rt2870/2008_0925_RT2870_Linux_STA_v1.4.0.0$ dmesg
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Linux version 2.6.24-19-rt (buildd@king) (gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)) #1 SMP PREEMPT RT Wed Aug 20 20:13:12 UTC 2008 (Ubuntu 2.6.24-4.6-generic)
....
[ 7937.030160] rt2870sta: Unknown symbol there_is_no_init_MUTEX_LOCKED_for_RT_semaphores


And we find again the "there_is_no_init_MUTEX_LOCKED_for_RT_semaphores" as in the "make" and I don't know how to solve it. I looked in the different files from "2008_0925_RT2870_Linux_STA_v1.4.0.0" for this expression "there_is_no_init_MUTEX_LOCKED_for_RT_semaphores" but I didn't find it..

Does someone could help me?
thanks

sorry for my English I'm French-speaking.

aextance
October 7th, 2008, 04:46 PM
I'm about to try the new September Ralink driver, but Nutt's problem looks similar to what I got when I tried to make without changing the make file to point at the right "build" folder.

From what I can tell, the MUTEX_LOCKED file is a kernel file like the Build files - is there definitely one in the folder that the make file's pointing at (possibly /usr/src/linux-headers-2.6.24-19-rt from your entry)?

Also, could the "sudo: unable to resolve host ubuntuCN" message be part of the problem?

Maybe try the following thread for that, and then try sudo make again?

http://ubuntuforums.org/showthread.php?t=723361

aextance
October 7th, 2008, 05:41 PM
Arrgh - the new driver gives me a new problem!

When going through the make process, I get the following output:

andy@andyslaptop:~/rt2870/2008_0925_RT2870_Linux_STA_WebUI_v1.4.0.0/RT2870$ sudo make
make -C tools
make[1]: Entering directory `/home/andy/rt2870/2008_0925_RT2870_Linux_STA_WebUI_v1.4.0.0/RT2870/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/andy/rt2870/2008_0925_RT2870_Linux_STA_WebUI_v1.4.0.0/RT2870/tools'
/andy/rt2870/2008_0925_RT2870_Linux_STA_WebUI_v1.4.0.0/RT2870/tools/bin2h
make: /andy/rt2870/2008_0925_RT2870_Linux_STA_WebUI_v1.4.0.0/RT2870/tools/bin2h: Command not found
make: *** [build_tools] Error 127
andy@andyslaptop:~/rt2870/2008_0925_RT2870_Linux_STA_WebUI_v1.4.0.0/RT2870$

I think I'm getting to grips with Ralink's info in the driver readme, but can anybody help me with what the following means please?:

3> In os/linux/config.mk
define the GCC and LD of the target machine
define the compiler flags CFLAGS

I'm not sure that has anything to do with the "Error 127", but I thought I should ask while I'm posting.

Any suggestions would be much appreciated!

GepettoBR
October 7th, 2008, 05:58 PM
Arrgh - the new driver gives me a new problem!

When going through the make process, I get the following output:

andy@andyslaptop:~/rt2870/2008_0925_RT2870_Linux_STA_WebUI_v1.4.0.0/RT2870$ sudo make
make -C tools
make[1]: Entering directory `/home/andy/rt2870/2008_0925_RT2870_Linux_STA_WebUI_v1.4.0.0/RT2870/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/andy/rt2870/2008_0925_RT2870_Linux_STA_WebUI_v1.4.0.0/RT2870/tools'
/andy/rt2870/2008_0925_RT2870_Linux_STA_WebUI_v1.4.0.0/RT2870/tools/bin2h
make: /andy/rt2870/2008_0925_RT2870_Linux_STA_WebUI_v1.4.0.0/RT2870/tools/bin2h: Command not found
make: *** [build_tools] Error 127
andy@andyslaptop:~/rt2870/2008_0925_RT2870_Linux_STA_WebUI_v1.4.0.0/RT2870$

I think I'm getting to grips with Ralink's info in the driver readme, but can anybody help me with what the following means please?:

3> In os/linux/config.mk
define the GCC and LD of the target machine
define the compiler flags CFLAGS

I'm not sure that has anything to do with the "Error 127", but I thought I should ask while I'm posting.

Any suggestions would be much appreciated!

That's not the driver, it's the WebUI. I have no idea why you'd need a WebUI for the client end of the wireless connection, though. The driver download is right beneath the WebUI download in Ralink's web page.

aextance
October 7th, 2008, 06:32 PM
Ah yes, good point. I thought just unzipping the driver out of the WebUI would work but I was wrong. :oops:

So, now I'm back to the

FATAL: Error inserting rt2870sta (/lib/modules/2.6.24-19-386/kernel/drivers/net/wireless/rt2870sta.ko): Invalid module format

error on sudo modprobe rt2870sta. Could it have something to do with the os/linux/config.mk file do you think? The readme says I should tell it about GCC and LD, but I'm not sure what to tell it?

GepettoBR
October 7th, 2008, 06:39 PM
I don't know, the only things I changed on my config.mk file were
HAS_WPA_SUPPLICANT=y
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y
Are you sure that the TARGET in the Makefile is set to LINUX?

Domas
October 9th, 2008, 04:42 PM
Hi all,

Can someone help me to get module working on boot? I did "sudo make install", added "alias ra0 rt2870sta" to /etc/modules, but still no luck to load module. Everytime after reboot I have to go to /os/linux and sudo /sbin/insmod rt2870sta.ko to load it. :(

Domas
October 9th, 2008, 06:37 PM
Ok, got it work, just had to change "alias ra0 rt2870sta" to "rt2870sta", but got another issue. After reboot Ubuntu crashes:

ct 9 22:45:31 community /usr/sbin/cron[5357]: (CRON) INFO (Running @reboot jobs)
Oct 9 22:45:32 community kernel: [ 48.096939] [drm] Initialized drm 1.1.0 20060810
Oct 9 22:45:32 community kernel: [ 48.101277] ACPI: PCI Interrupt 0000:00:02.0[A] -> GSI 16 (level, low) -> IRQ 16
Oct 9 22:45:32 community kernel: [ 48.101287] PCI: Setting latency timer of device 0000:00:02.0 to 64
Oct 9 22:45:32 community kernel: [ 48.101378] [drm] Initialized i915 1.6.0 20060119 on minor 0
Oct 9 22:45:33 community dhclient: DHCPREQUEST of 192.168.1.3 on ra0 to 255.255.255.255 port 67
Oct 9 22:45:44 community dhclient: DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 8
Oct 9 22:45:51 community kernel: [ 67.078573] NET: Registered protocol family 10
Oct 9 22:45:51 community kernel: [ 67.079054] lo: Disabled Privacy Extensions
Oct 9 22:45:52 community dhclient: DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 9
Oct 9 22:45:53 community avahi-daemon[4956]: Registering new address record for fe80::20e:3bff:fe0c:955 on ra0.*.
Oct 9 22:46:01 community dhclient: DHCPDISCOVER on ra0 to 255.255.255.255 port 67 interval 14
Oct 9 22:46:02 community kernel: [ 77.882596] ra0: no IPv6 routers present
Oct 9 22:46:04 community anacron[5824]: Anacron 2.3 started on 2008-10-09
Oct 9 22:46:04 community anacron[5824]: Normal exit (0 jobs run)
Oct 9 22:46:13 community gdm[5317]: WARNING: gdm_slave_xioerror_handler: Fatal X error - Restarting :0

So I have to login one more time and then boots ok. Is there any way to make module load after a while, just when Ubuntu is booted?

GepettoBR
October 9th, 2008, 09:03 PM
I'd say remove the line from /etc/modules first to revert this crash (since it started when you added the line, right?) and run "modprobe rt2870sta" as root. This should make the driver load on boot but maybe not (read below).

With a previous version of the driver, I had the same problem of it not loading at boot. I added the modprobe line above to /etc/rc.local and it worked.

Nutt's
October 11th, 2008, 01:39 PM
hello,
I come back with a very good new! Problem solved!! for months I've been fighting with it but now it's ok!

So, in fact with "-rt" kernels the problem seems to come regularly, and I found the post of someone with the same warning during the installation of his webcam.
The only thing I had to do is:
to edit "2008_0925_RT2870_Linux_STA_v1.4.0.0./include/rtmp.h" and
to change "struct semaphore" into "struct compat_semaphore" on the lines 2716, 2717, 2718 and 2720.

I'm so Happy! :-D

I hope it'll solve aextance's problem too!

and thx for your help!
(ps: I also solved my "sudo" problem with the link of aextance!)

aextance
October 19th, 2008, 05:27 PM
Interestingly enough, Nutt's modification was useful to me in that it enabled me to see the Ralink driver in System>Admin>Hardware Drivers, which I had been able to do with the previous drivers, but not 1.4.0.0.

Still, sudo modprobe rt2870sta is still coming up against the same invalid module format error.

And Gepetto, yes the target in the Makefile is set to Linux. Copying the driver files from /lib/modules/2.6.24-19-386 to /lib/modules/2.6.24-19-generic did not work - the references in the makefile for the build files refer to generic, but the rest refers to 386 - the build files are normally all that are in my generic folder. I only have the 2.6.24-19-386 kernel.

My next plans are:
1) To try ndiswrapper, to see if that tells me anything else
2) The invalid module format error seems to mean that there is some mismatch between my makefile and my kernel, so I will try and go through these with a fine-tooth-comb - as much as I can with my limited knowledge - to look for a reason.
3) Upgrade to Intrepid Ibex - apart from the appearance, how is that going Gepetto?

GepettoBR
October 20th, 2008, 11:23 AM
3) Upgrade to Intrepid Ibex - apart from the appearance, how is that going Gepetto?

Very well, actually. On my Hardy box, while the 1.4.0.0 driver does work, it requires setting the network interface to "manual" on Network Manager, so no roaming mode or wardriving. My Intrepid install still required me to manually compile the driver for the 2.6.27-4-generic kernel, but then it worked great with open, WEP, WPA and WPA2 networks, was manageable from Network Manager and the driver showed up in Hardware Drivers.

I have yet to test the 2.6.27-7-generic kernel, since the machine I'm testing Intrepid on has a wired connection to my router. I'll do it today if I have the time and post the results.

GepettoBR
October 20th, 2008, 12:35 PM
As promised, here are the instructions for installing the Ralink rt2870 driver version 1.4.0.0 on kernel version 2.6.27-7-generic (on the Ubuntu 8.10 Intrepid Ibex beta):

1)Download the driver from Ralink's website: [Direct link to file (http://www.ralinktech.com.tw/data/drivers/2008_0925_RT2870_Linux_STA_v1.4.0.0.tar.bz2)] or [Link to download page (http://www.ralinktech.com/ralink/Home/Support/Linux.html)]

2)Extract the archive and enter the directory.

3)gedit ./os/linux/config.mk #if running on KDE, do kate ./os/linux/config.mk instead
Change the following values from n to y:
HAS_WPA_SUPPLICANT
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT

4, 5 and 6 must be done as root

4)make #see notes below

5)make install

6)insmod ./os/linux/rt2870sta.ko

7)ifconfig ra0 up

After a few seconds, Network Manager will display the available wireless networks.

Additional notes
Before installing the driver, the device (mine is the D-Link DWA-140, revision B1) was correctly identified in lsusb, but did not show up as a network interface. After installing, the driver name was appended to the lsusb information: Bus 001 Device 004: ID 07d1:3c09 D-Link System DWA-140 802.11n Adapter [ralink rt2870]

Injecting and other similar features were not tested. I might run a WEP cracking test later.

During step 4 (make), I ran into an error message. This did not affect the installation. Here's the snippet:
Building modules, stage 2.
MODPOST 1 modules
WARNING: modpost: Found 1 section mismatch(es).

I obtained a connection speed of 270 Mb/s on a computer sitting next to the router (~50cm with the monitor and the PC itself as the only physical obstacles), I expected a full 300 Mb/s, since at the time of the test this was the only wireless client.

Hotplugging works, no need to enable/disable networking or repeating ifconfig ra0 up like with previous versions.

The interface is up on reboot and attempts to connect to a network. For some reason, the nm-applet only displayed the signal strength on the taskbar after the first reboot (before that it simply displayed the two computers "connected" icon).

This procedure worked for me, but I do not guarantee it will work for you.

newsman1970
October 22nd, 2008, 10:04 AM
hi, GepettoBR
is this guid will work with the asus WL-160N USB, that is what i have, and i still have the 2.6.24 kernel. i am still new to ubuntu and trying to learn.
please and thank you,

MichaelSM
October 23rd, 2008, 08:33 AM
Bye.

GepettoBR
October 23rd, 2008, 03:08 PM
hi, GepettoBR
is this guid will work with the asus WL-160N USB, that is what i have, and i still have the 2.6.24 kernel. i am still new to ubuntu and trying to learn.
please and thank you,

Yes, this should work on the 2.6.24 kernel and for any device that uses the rt2870 chipset, and according to Google your does. Let us know if you have any problems, and we'll try to help you.

GepettoBR
October 23rd, 2008, 03:17 PM
RALink chipset supported in Hardy.

Having updated to Hardy (Linux Mint 5 (Elyssa) well, Hmm. Looks like Hardy even with Network Manager finds a home for RALINK chipsets.

One can buy as I did a TP-Link TL-WN321G USB WIFI unit for $16 which is cheap.

Works out of the box.

Buggered if I know why.

No need for wcid.

Plug it in, configure wireless. Done.

Mike.
Hello, Mike. Either you're posting in the wrong thread or you didn't pay much attention to what's going on here. :)

Ralink is a manufacturer, they make lots of chipsets. Some are supported out of the box by the current kernels, and some aren't.

The device you mentioned uses the rt73 chipset, which is supported OOTB since Hardy (my DWL-G122 rev C1 from D-Link, for example, uses the same chipset), however the rt2870 drivers, for now, have to be compiled manually. That's what this thread is for - not for debating which adapter we should buy or discussing which one works best.

Also, this thread is about drivers, not network managers. WICD does not affect how a driver works, it simply helps manage the network interface - which will only exist if the driver is properly installed.

Paulo.

thor240z
October 23rd, 2008, 04:26 PM
I'm running on Hardy, and I'm fairly certain I have the driver installed properly as per the directions earlier in the thread. The problem I'm having is that in the Network Manager, it detects the networks in the area, but won't connect to them.

I did notice that when I run lsusb, it incorrectly detects my USB adapter as being Atheros. I'm using an Airlink AWLL6080(USB) and verified it uses the RT2870F chipset by taking apart the enclosure.

Is there a default driver I need to deactivate? Or a way to force the RT2870 driver? Any other thoughts/suggestions?

MichaelSM
October 23rd, 2008, 08:21 PM
[QUOTE=MichaelSM;6018078]RALink chipset supported in Hardy.



Post removed by author.

GepettoBR
October 24th, 2008, 03:29 PM
I'm running on Hardy, and I'm fairly certain I have the driver installed properly as per the directions earlier in the thread. The problem I'm having is that in the Network Manager, it detects the networks in the area, but won't connect to them.

I did notice that when I run lsusb, it incorrectly detects my USB adapter as being Atheros. I'm using an Airlink AWLL6080(USB) and verified it uses the RT2870F chipset by taking apart the enclosure.

Is there a default driver I need to deactivate? Or a way to force the RT2870 driver? Any other thoughts/suggestions?

I suggest looking at the output of lsmod to see if there are any Atheros drivers loaded. If so, you can blacklist them by adding a line to /etc/modprobe.d/blacklist that reads "blacklist <driver's name>". Then, you can try to insmod rt2870sta again.

thor240z
October 24th, 2008, 05:53 PM
Here's my lsusb & lsmod output. I can't find any Atheros drivers there:

xbmc@xbmc-desktop:~$ lsusb
Bus 004 Device 001: ID 0000:0000
Bus 005 Device 001: ID 0000:0000
Bus 003 Device 002: ID 413c:3012 Dell Computer Corp.
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 002: ID 1784:0008
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 004: ID 14b2:3c23 Atheros Communications Inc
Bus 001 Device 001: ID 0000:0000
xbmc@xbmc-desktop:~$ lsmod
Module Size Used by
rt2870sta 499796 1
snd_rtctimer 4640 0
rfcomm 41744 2
l2cap 25728 13 rfcomm
bluetooth 61156 4 rfcomm,l2cap
ppdev 10372 0
ipv6 267780 18
speedstep_lib 6532 0
cpufreq_userspace 5284 0
cpufreq_conservative 8712 0
cpufreq_ondemand 9740 0
cpufreq_powersave 2688 0
cpufreq_stats 7104 0
freq_table 5536 2 cpufreq_ondemand,cpufreq_stats
sbs 15112 0
sbshc 7680 1 sbs
container 5632 0
dock 11280 0
video 19856 0
output 4736 1 video
battery 14212 0
af_packet 23812 2
iptable_filter 3840 0
ip_tables 14820 1 iptable_filter
x_tables 16132 1 ip_tables
ac 6916 0
sbp2 24072 0
lp 12324 0
rfkill_input 5760 0
arc4 2944 2
ecb 4480 2
blkcipher 8324 1 ecb
b43 144548 0
rfkill 8596 3 rfkill_input,b43
mac80211 165652 1 b43
lirc_mceusb2 14980 1
cfg80211 15112 1 mac80211
lirc_dev 15732 1 lirc_mceusb2
usbhid 32128 0
led_class 6020 1 b43
hid 38784 1 usbhid
input_polldev 5896 1 b43
nvidia 7825536 24
snd_hda_intel 344856 3
snd_pcm_oss 42144 0
snd_mixer_oss 17920 1 snd_pcm_oss
snd_pcm 78596 2 snd_hda_intel,snd_pcm_oss
i2c_core 24832 1 nvidia
snd_page_alloc 11400 2 snd_hda_intel,snd_pcm
snd_hwdep 10500 1 snd_hda_intel
snd_seq_dummy 4868 0
snd_seq_oss 35584 0
snd_seq_midi 9376 0
snd_rawmidi 25760 1 snd_seq_midi
snd_seq_midi_event 8320 2 snd_seq_oss,snd_seq_midi
snd_seq 54224 6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_mid i_event
snd_timer 24836 3 snd_rtctimer,snd_pcm,snd_seq
snd_seq_device 9612 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi ,snd_seq
snd 56996 18 snd_rtctimer,snd_hda_intel,snd_pcm_oss,snd_mixer_o ss,snd_pcm,snd_hwdep,snd_seq_dummy,snd_seq_oss,snd _rawmidi,snd_seq,snd_timer,snd_seq_device
button 9232 0
intel_agp 25492 0
parport_pc 36260 1
parport 37832 3 ppdev,lp,parport_pc
shpchp 34452 0
pci_hotplug 30880 1 shpchp
agpgart 34760 2 nvidia,intel_agp
evdev 13056 4
soundcore 8800 1 snd
pcspkr 4224 0
ext3 136840 1
jbd 48404 1 ext3
mbcache 9600 1 ext3
sg 36880 0
sd_mod 30720 3
ata_generic 8324 0
ata_piix 19588 2
pata_acpi 8320 0
ohci1394 33584 0
floppy 59588 0
ssb 34308 1 b43
libata 159344 3 ata_generic,ata_piix,pata_acpi
scsi_mod 151436 4 sbp2,sg,sd_mod,libata
uhci_hcd 27024 0
ieee1394 93752 2 sbp2,ohci1394
ehci_hcd 37900 0
e1000 126016 0
usbcore 146412 6 rt2870sta,lirc_mceusb2,usbhid,uhci_hcd,ehci_hcd
thermal 16796 0
processor 37384 1 thermal
fan 5636 0
fbcon 42912 0
tileblit 3456 1 fbcon
font 9472 1 fbcon
bitblit 6784 1 fbcon
softcursor 3072 1 bitblit
fuse 50708 3

Anywhere else I can look?

GepettoBR
October 25th, 2008, 08:23 AM
thor240z, the rt2870sta driver appears to be properly installed and loaded. If the device is working properly, I don't think it's a problem that lsusb has got the wrong name for it.

Network Manager 0.7 (the Intrepid version) can manage the rt2870 devices in roaming mode, but 0.6.6 (the current Hardy version) can't. In my case, I got my connection up by manually configuring the connection settings for one specific network (my home network). Here's how you can do that:

1. Click the nm-applet in your taskbar and select "Manual configuration" to open the Network Settings window. Then, click "Unlock" at the bottom of the window and enter your password.

2. Select your wireless connection and click the "Properties" button.

3. Now, uncheck the "Enable roaming mode" box and select your access point's ESSID from the drop-down list (or enter it manually).

4. Select your password type (WEP ascii, WEP hex, WPA or WPA2) and enter your password.

5. Fill in your connection settings. If you don't know what they are, select Automatic configuration (DHCP).

6. ?????

7. PROFIT!

You may need to disable and re-enable networking by right-clicking nm-applet for this to take effect.

Hope this helps,

Paulo

GepettoBR
November 5th, 2008, 11:14 AM
There's a firmware update at the Ralink page, does anyone know how I can go about applying it?