# rt2500 does not compile with 2.6.20-gentoo

## col

Here is the error:

```

  CC [M]  /var/tmp/portage/net-wireless/rt2500-1.1.0_beta4/work/rt2500-1.1.0-b4/Module/auth_rsp.o

  CC [M]  /var/tmp/portage/net-wireless/rt2500-1.1.0_beta4/work/rt2500-1.1.0-b4/Module/rtmp_data.o

  CC [M]  /var/tmp/portage/net-wireless/rt2500-1.1.0_beta4/work/rt2500-1.1.0-b4/Module/rtmp_init.o

/var/tmp/portage/net-wireless/rt2500-1.1.0_beta4/work/rt2500-1.1.0-b4/Module/rtmp_init.c:978:62: macro "INIT_WORK" passed 3 arguments, but takes just 2

/var/tmp/portage/net-wireless/rt2500-1.1.0_beta4/work/rt2500-1.1.0-b4/Module/rtmp_init.c: In function `NICInitializeAdapter':

/var/tmp/portage/net-wireless/rt2500-1.1.0_beta4/work/rt2500-1.1.0-b4/Module/rtmp_init.c:978: error: `INIT_WORK' undeclared (first use in this function)

/var/tmp/portage/net-wireless/rt2500-1.1.0_beta4/work/rt2500-1.1.0-b4/Module/rtmp_init.c:978: error: (Each undeclared identifier is reported only once

/var/tmp/portage/net-wireless/rt2500-1.1.0_beta4/work/rt2500-1.1.0-b4/Module/rtmp_init.c:978: error: for each function it appears in.)

make[1]: *** [/var/tmp/portage/net-wireless/rt2500-1.1.0_beta4/work/rt2500-1.1.0-b4/Module/rtmp_init.o] Error 1

make: *** [_module_/var/tmp/portage/net-wireless/rt2500-1.1.0_beta4/work/rt2500-1.1.0-b4/Module] Error 2

make: Leaving directory `/usr/src/linux-2.6.20-gentoo'

!!! ERROR: net-wireless/rt2500-1.1.0_beta4 failed.

Call stack:

  ebuild.sh, line 1613:   Called dyn_compile

  ebuild.sh, line 970:   Called qa_call 'src_compile'

  environment, line 4445:   Called src_compile

  rt2500-1.1.0_beta4.ebuild, line 45:   Called linux-mod_src_compile

  linux-mod.eclass, line 510:   Called die

!!! Unable to make  -C /usr/src/linux M=/var/tmp/portage/net-wireless/rt2500-1.1.0_beta4/work/rt2500-1.1.0-b4/Module modules.

!!! If you need support, post the topmost build error, and the call stack if relevant.

!!! A complete build log is located at '/var/tmp/portage/net-wireless/rt2500-1.1.0_beta4/temp/build.log'.

```

----------

## sugar

The rt2500 module, as far as I know, has been depreciated in favour of rt2x00. You should be using that these days.

----------

## col

no the rt2x00 module is the cvs/experimental version & not marked as stable yet.

the rt2500 driver is not yet working on 2.6.20 .... I am going back to 2.6.19

----------

## sugar

 *col wrote:*   

> no the rt2x00 module is the cvs/experimental version & not marked as stable yet.
> 
> the rt2500 driver is not yet working on 2.6.20 .... I am going back to 2.6.19

 

the rt2500pci legacy drivers are the original drivers released by realtek. Serial monkey decided to rewrite the drivers from scratch (as rt2x00) and include all the relevant modules together. The legacy drivers are no longer being developed. The rt2x00 drivers have reached beta stage, and should be stable very soon.

----------

## didumos

 *sugar wrote:*   

> Serial monkey decided to rewrite the drivers from scratch (as rt2x00) and include all the relevant modules together.

 

It's my understanding that the main purpose of the rewrite is to get the drivers into a state where they can be accepted into the kernel.

 *sugar wrote:*   

> The legacy drivers are no longer being developed.

 

Are you certain about that? The cvs snapshots include patches for the 2.6.20 kernel so they seem to me to be maintained. Indeed, a cvs snapshot has just been added to portage by uberlord. I'm about to try it out.

----------

## sugar

 *didumos wrote:*   

>  *sugar wrote:*   Serial monkey decided to rewrite the drivers from scratch (as rt2x00) and include all the relevant modules together. 
> 
> It's my understanding that the main purpose of the rewrite is to get the drivers into a state where they can be accepted into the kernel.
> 
>  *sugar wrote:*   The legacy drivers are no longer being developed. 
> ...

 

I'll double check.

----------

## didumos

Well the new snapshot (net-wireless/rt2500-1.1.0_pre2007020911) works fine with the 2.6.20 kernel. I'm using the /etc/Wireless/RT2500STA/RT2500STA.dat file to set it up so I will try and see how this version works with configuring it through baselayout (/etc/conf.d/net).

----------

## sugar

 *didumos wrote:*   

> Well the new snapshot (net-wireless/rt2500-1.1.0_pre2007020911) works fine with the 2.6.20 kernel. I'm using the /etc/Wireless/RT2500STA/RT2500STA.dat file to set it up so I will try and see how this version works with configuring it through baselayout (/etc/conf.d/net).

 

yeah, you're right. It is still under development. I wonder why I thought it wasn't. Good to hear its working with the new kernel.

----------

## col

I tried the CVS from about 1 week ago....they did not work very well. My wireless started dropping out when I installed them. I will stick with b4 until the next stable release.

----------

## Naib

 *sugar wrote:*   

>  *col wrote:*   no the rt2x00 module is the cvs/experimental version & not marked as stable yet.
> 
> the rt2500 driver is not yet working on 2.6.20 .... I am going back to 2.6.19 
> 
> the rt2500pci legacy drivers are the original drivers released by realtek. Serial monkey decided to rewrite the drivers from scratch (as rt2x00) and include all the relevant modules together. The legacy drivers are no longer being developed. The rt2x00 drivers have reached beta stage, and should be stable very soon.

 

you mean RaLink

But anywho the rt2500 compiles but I get a sandbox violation before it can be merged into my system

----------

## Psycho Dad

The new snapshot (net-wireless/rt2500-1.1.0_pre2007020911) compiles and works for me with 2.6.20-gentoo.

But I have to activate the connection with RaConfig2500 on every boot by clicking "Connect" and entering the WEP-key.

1.1.0-beta4 + 2.6.20 compiles now but finds no AP (no ping) and gives error messages like described in the bug-report.

With 1.1.0-beta4 and 2.6.18-r6 in connects automatically (configuration is the same).

Unfortunately WPA does not work in any case.

----------

## Naib

I used FEATURES="-sandbox" and all compiled fine and I can auto-connect to my WPA-encripted router now

----------

## titoucha

 *Psycho Dad wrote:*   

> The new snapshot (net-wireless/rt2500-1.1.0_pre2007020911) compiles and works for me with 2.6.20-gentoo.
> 
> But I have to activate the connection with RaConfig2500 on every boot by clicking "Connect" and entering the WEP-key.
> 
> 1.1.0-beta4 + 2.6.20 compiles now but finds no AP (no ping) and gives error messages like described in the bug-report.
> ...

 

I have exactly the same problem   :Sad: 

----------

## col

yeah same problem with me....also it drops out randomly

----------

## Psycho Dad

It starts now automatically with the latest nightly snapshot from

http://rt2x00.serialmonkey.com/wiki/...itle=Downloads

But I had to enter

```

iwconfig ra0 AP Mac-address of router

```

in /etc/conf.d/local.start

At least with kernel 2.6.18-gentoo-r6 (did not test newer kernel yet).

Dont know if it works with the original ebuild too, but in contrast to beta4 specifying the routers MAC-adress seems to be important.

Emerged rt2500 with USE="-qt3"

----------

## Psycho Dad

Even if it automatic connect works with the 

```
iwconfig ra0 AP Mac-address of router
```

command, the connection is unstable then (can be restored with the above command).

Here is a patched beta4 that should compile and! work with 2.6.19 and 2.6.20.

ftp://mum.dyns.cx/rt2500

----------

## syouth

I modified the rt2500 ebuild a little and made it compile form cvs daily snapshot.

Here it is: http://www.physic.ut.ee/~ilvez/files/rt2500-9999.ebuild

----------

## syouth

Maybe I should make a new topic, but since some last update or something, my wireless doesn't connect anymore. I have to do it by hand:

```
$ sux - 

#RaConfig2500

```

And use connect there.

```
kosmos ~ # cat /etc/conf.d/net

#config_eth0=( "192.168.0.2/24" )

#config_ra0=( "dhcp" )

config_eth0=( "dhcp" )

config_ra0=( "192.168.0.40/24" )

routes_ra0=( "default via 192.168.0.1" )

kosmos ~ # cat /etc/conf.d/wireless

essid_ra0="55 637 827"

#channel_ra0="11":
```

And when machine is booting up, it says something about this essid_ra0 and shows only first 55 there. Maybe I'm using deprecated configuration or something....

----------

## Psycho Dad

This problem with the cvs-drivers is known.

I already made a bugreport, lets see if it helps:

http://rt2x00.serialmonkey.com/phpBB2/viewtopic.php?t=3552

For now its better to use the original 1.1.0-beta4, or if you have a kernel >2.6.18 use the patched source from

ftp://mum.dyns.cx/rt2500

----------

## syouth

Thank you for your quick reply. I will try those other sources then...

----------

## syouth

Those patches don't seem to work with 2.6.20. It dies to this message: 

```
/var/tmp/portage/net-wireless/rt2500-9999/work/rt2500-1.1.0-b4-rob/Module/rtmp_init.c:978:62: error: macro "INIT_WORK" passed 3 arguments, but takes just 2
```

This error is corrected in CVS drivers though... 

EDIT: I think I must make a new topic, because I think the problem I have is unrelated... My problems started after one update where baselayout got upgraded I think. It occurs with gentoo-sources-2.6.20-r4 and -r5. rt2500 are from daily snapshot.

On bootup it prints out:

```
 *   Configuring wireless network for ra0

iwconfig: unknown command "637"

 *   ra0 does not support setting ESSID to "55 637 827"

 *     ra0 connected to ESSID ""

 *     in managed mode on channel 1 (WEP disabled)

 *   Bringing up ra0

 *     192.168.0.40/24                                                                         [ ok ] 

 *   Adding routes

 *     default via 192.168.0.1 ...                                                             [ ok ]
```

----------

## Psycho Dad

The patch file "rt2500-b4-patch.gz" at 

ftp://mum.dyns.cx/rt2500

is against the original 1.1.0-b4 not against cvs!

The file rt2500-b4-rob.tar.gz is the ready-patched 1.1.0-b4, the only difference to 1.1.0-b4 is that it works with 2.6.19.x/2.6.20.x.

I have it successfully working with the latest stable baselayout (1.12.9) and kernel 2.6.18-gentoo-r7 on my laptop and 2.6.20-gentoo-r4 on a desktop computer.

The cvs drivers work with 2.6.20 as they are, but have the described problems with autostart and unstable connection (with older kernels too).

----------

## bendy

Hi - just discovered this thread after running into some rt2500 problems.  I updated my girlfriend's laptop at the week end for the first time in around 6 months.  This updated the kernel to gentoo-sources-2.6.19-r5 and the rt2500 driver to rt2500-1.1.0_pre2007020911.

However when I boot into the new kernel the pcmcia wireless card does not get activated - the lights don't even come on.  During the boot process I can see that udev had loaded the rt2500 module (and it also appears in lsmod) and the pcmcia card is visible in lspci.

I still have the older 2.6.17 kernel with an older rt2500 module (I forget which one), and when I boot using the old kernel and rt2500 module it works fine.  I assume this means that it's not a pcmciautils, udev or wireless-tools issue.

I notice that gentoo-sources-2.6.20-r6 has been marked as stable on x86 today.  Can anyone confirm which combinations of kernel and rt2500 module work well together?

Thanks.

----------

## Psycho Dad

rt2500-beta4 from portage works with kernel 2.6.18 and older ones (dont know about 2.6.19 but I heard it also makes problems there).

It does not work with 2.6.20.

The patched rt2500-beta4 from the link above

ftp://mum.dyns.cx/rt2500

works with 2.6.20, 2.6.19, 2.6.18 and some older ones.

The current cvs from 

http://rt2x00.serialmonkey.com/

does work with 2.6.20, 2.6.19, 2.6.18 and some older ones, but when you use WEP the connection has to be activated with

```
iwconfig ra0 AP Mac of your router
```

But maybe this problem is solved soon.

http://rt2x00.serialmonkey.com/phpBB2/viewtopic.php?t=3552

At least this is the current situation for me.

Short hint for now:

use the patched rt2500-beta4 from ftp://mum.dyns.cx/rt2500 with the current stable gentoo-sources.

----------

## bendy

Thanks for the summary Psycho Dad - a very clear explanation!

----------

## bendy

Well, I'm still having problems here.  It seems that since upgrading from a 2.6.17 kernel to a .19 or .20 kernel, my rt2500 pcmcia card is not getting activated.  The rt2500 module gets loaded by udev, and the card shows up in lspci.  Also, the ra0 interface is visible in the output of both iwconfig and ifconfig.

However, the normal lights don't come appear on the card, and it doesn't seem to be doing anything.  I may have a more fundamental pcmcia problem - anyone have any suggestions?

----------

## darkangel92

hi,

what's up with the thread? i'm still having Timed out message too . i have a fresh gentoo with the the kernel 2.6.20-gentoo-r5 . using emerge RT2500, configuring /etc/conf.d/net and wireless and nothing else. I did everything like the post 1 og the thread.

Is there still a problem wit the rt2500 drivers and a suck kernel? i did not have any error while emerging the rt2500 package.

How to troubleshoot the interface ra0 ?

Thanks a lot for your help.

----------

## Psycho Dad

Should work.

What encryption method do you use?

How does your /etc/conf.d/net look like (etc/conf.d/wireless is deprecated)?

Do you have /etc/init.d/net.ra0 as a link to /etc/init.d/net.eth0?

Do other PCMCIA-devices work?

I still have pcmcia-cs (the old way).

Did you emerge it with qt3-support?

Is there a /etc/Wireless/RT2500STA/RT2500STA.dat?

If you configure all with /etc/conf.d/net? Then this file should not exist.

You can also try latest cvs, but with WEP you have to replace or delete this section in sanity.c as described in the rt2x00-forum. 

http://rt2x00.serialmonkey.com/phpBB2/viewtopic.php?t=3552

----------

## darkangel92

hi,

i'm using WEP encription.

i did use="-qt3" emerge rt2500 and it compiles rt2500-1.1.0_pre2007020911

i don't have any /etc/wireless directory (so i don't have RT2500STA.DAT file )

i have a link net.ra0->/etc/init.d/net.lo

----------

## darkangel92

cat /etc/conf.d/net

config_ra0=('dhcp")

dhcp_ra0="nodns nontp nonis"

modules_ra0=("iwconfig")

cat /etc/conf.d/wireless

mode_ra0="Managed"

essid_ra0="test"

channel_ra0="11"

key_test="XXXXXXXXX enc restricted"

my kernel 2.6.20-gentoo-r8

----------

## darkangel92

i don't understand why when i type (or when the PC boot) i still have

starting ra0

configuring wireless network for ra0

ra0 connected to ESSID ""   ========> it should be "test"

in managed mode on channel 1 (WEP enabled - restricted)   =====>  it should be 11

bringing up ra0

dhcp

running dhcp ...

Error, Ra0 : Timed out

thanks for your help

----------

## didumos

 *darkangel92 wrote:*   

> i don't understand why when i type (or when the PC boot) i still have
> 
> starting ra0
> 
> configuring wireless network for ra0
> ...

 

I seem to remember seeing this behaviour when trying to configure the driver for my wireless network. The only way I could get the driver to work was to use the "/etc/Wireless/RT2500STA/RT2500STA.dat" file that Psycho Dad described, which I believe is loaded by the driver itself and nothing to do with portage. I'll post the setup i'm using below in case it helps:

/etc/conf.d/net

```
modules_ra0=( "!iwconfig" )

config_ra0=( "dhcp" )
```

/etc/Wireless/RT2500STA/RT2500STA.dat

```
[Default]

AdhocOfdm=0

CountryRegion=0

WirelessMode=0

TXBurst=0

TurboRate=0

BGProtection=0

ShortSlot=0

#TxBurst=0

#TxPreamble=2

TxRate=0

PSMode=CAM

SSID=my_ssid

#NetworkType=Infra

Channel=11

AuthMode=WPAPSK

EncrypType=TKIP

#DefaultKeyID=1

#Key1=

#Key2=

#Key3=

#Key4=

#WPANONE=abcdefghijklmnopqrstuvwxyz

WPAPSK=my_key

#RTSThreshold=2312

#FragThreshold=2312

PSMode=CAM

#RFMON=0

#StaWithEtherBridge=0
```

The default RT2500STA.dat file is (I think) included in the rt2500 tarball but no longer installed by portage.

----------

## darkangel92

i have fixed the problem. I don't understand how but it is fixed via Psycho Dad's command

what i did :

deleted the /etc/conf.d/wireless file  (i had a message wireless is not use anymore something like that and ask to put everyhting into the net file)

into the /etc/conf.d/net file i have

modules_ra0=( "iwconfig" )         =====> Not ("!iwconfig")

config_ra0=( "dhcp" )

AP_essid="iwconfig ra0 AP MAC addresse"

it works. if somebody can explain why   :Wink: 

I have noticed when typing at the console iwconfig ra0 i can see the AP mac address field (i don't remeber in the past a such field)

thanks

----------

## Psycho Dad

And do you have a stable connection? More than 10 minutes?

----------

## darkangel92

Hi

The world is small   :Wink:  i was loggin in the forum to say.. SaCRE BLEU, it is NOT stable at all. I have to reboot the PC.

Why on the others linux distro there is no problem. The MANDRIVA LIVE DVD rocks. iwas able to install the gentoo from it.

The problem is how i can emerge kde-meta..i guess i have to use emerge kde-meta --fetchonly to download all packages... then after i will be able to emerge kde with or without the WIFI. 5but for the moment it is not possible i have an error circulary but it is not the topic).

C U

----------

## darkangel92

i worried a lot because you use a long time ago the same RT2500 version i have and mentioned it is buggy. I espect to have a new patch but it looks like a turtle to have it. Do you know when they will move a little bit faster?

----------

## Psycho Dad

Did you try latest cvs with deleting this lines in sanity.c?

```

// New for WPA

            case IE_WPA:

            if (vielim >= (UCHAR *)ptVIE + eid_ptr->Len + 2)

            {

                    // ptVIE will report to microsoft bssid list.

                      ptVIE->ElementID = eid_ptr->Eid;

                      ptVIE->Length = eid_ptr->Len;

                      memcpy(ptVIE->data, eid_ptr->Octet, eid_ptr->Len);

               ptVIE = (PNDIS_802_11_VARIABLE_IEs)((UCHAR *)ptVIE +

                     ptVIE->Length + 2);

               DBGPRINT(RT_DEBUG_INFO, " -  OUI (%02x:%02x:%02x:%02x)\n",

                     eid_ptr->Octet[0], eid_ptr->Octet[1],

                     eid_ptr->Octet[2], eid_ptr->Octet[3]);

                }

            else

            {

               DBGPRINT(RT_DEBUG_ERROR,

                     " -  IE_WPA rcv area needs %d bytes: has %d left\n",

                     eid_ptr->Len + 2, vielim - (UCHAR *)ptVIE);

            }

                break; 

```

Runs stable for me.

No "iwconfig ra0 AP MAC addresse"  neccessary than.

Or use WPA, this works also with unchanged cvs and without this command.

This is my /etc/conf.d/net for WEP (I do not use the other configuration method, it is not supported anyway in latest cvs):

```

config_eth0=( "192.168.1.47/24" )

config_eth0=( "192.168.1.47 netmask 255.255.255.0" )

config_ra0=( "192.168.1.57/24" )

config_ra0=( "192.168.1.57 netmask 255.255.255.0" )

config_eth0=( "192.168.1.47/24 brd 192.168.1.255" )

config_eth0=( "192.168.1.47 netmask 255.255.255.0 broadcast 192.168.1.255" )

config_ra0=( "192.168.1.57/24 brd 192.168.1.255" )

config_ra0=( "192.168.1.57 netmask 255.255.255.0 broadcast 192.168.1.255" )

routes_eth0=( "default gw 192.168.1.1" )

routes_ra0=( "default gw 192.168.1.1" )

iwconfig ra0 essid my_essid

key_my_essid="s:secret enc open"

preferred_aps=( "my_essid" )

associate_order_ra0="forcepreferred"

```

Dont know it the channel must be specified for you, I simply use channel 1

eth0 is disabled with ifplugd if there is no cable connection.

Maybe its good to flash the firmware of your AP to the latest version.

----------

## darkangel92

arf   :Sad:   i give up the rt2500... do you know when they will fixe the pb? soon or they logged nothing on it?

what WIFI card do you recommend wich is 100% for sure detected and rocks with the  LIVECD 2006 or 2007??Last edited by darkangel92 on Wed Jun 13, 2007 2:58 pm; edited 1 time in total

----------

## Cyker

I've managed to get the RT2500 to work in my lappy, but not using /etc/net.ra0

It just doesn't work at all using that - The really smegged up thing is that if I run iwconfig and enter the commands manually, it does work!

I managed to get it to work on boot using the .dat file mentioned above - Filled everything in and it set all the bits correctly as soon as the module loaded.

Only weird thing is that DHCP doesn't work, and also I'll get disconnected from the WAP after a few minutes of idle time...

The only way to get it back up is to forcibly associate the card with the MAC address of the WAP, otherwise it won't reconnect at all...

I wonder if this is because the WAP's SSID is hidden? Even so, it is pretty annoying...

----------

## kenyon

 *Cyker wrote:*   

> I've managed to get the RT2500 to work in my lappy, but not using /etc/net.ra0
> 
> It just doesn't work at all using that - The really smegged up thing is that if I run iwconfig and enter the commands manually, it does work!
> 
> I managed to get it to work on boot using the .dat file mentioned above - Filled everything in and it set all the bits correctly as soon as the module loaded.

 

See if my post here might help: https://forums.gentoo.org/viewtopic-p-4113435.html#4113435

----------

