# rt2500 cvs with WPA

## bicatali

I finally got to work the rt2500 wireless based card and WPA/Pre Shared Key, on my amd64.

Hardware setup: amd64 desktop, EDIMAX EW-7128G PCI wireless card. Wifi Router is a Linksys WRK54G.

Hopefully the same should work for similar hardware configurations.

The gentoo-wiki did not help so much,  but a 6 pages forum did.

```

1 - mkdir -p $PORTDIR_OVERLAY/net-wireless/rt2500; cd $PORTDIR_OVERLAY/net-wireless/rt2500

2 - cp /usr/portage/net-wireless/rt2500/rt2500-1.1.0_beta3.ebuild rt2500-1.1.0_beta3-r1.ebuild

3 - edit rt2500-1.1.0_beta3-r1.ebuild and change:

      SRC_URI="http://rt2x00.serialmonkey.com/rt2500-cvs-daily.tar.gz"

      S=${WORKDIR}/rt2500-cvs-2005101415 (change with the correct date)

4 - ebuild rt2500-1.1.0_beta3-r1.ebuild digest

5 - emerge rt2500-1.1.0_beta3-r1.ebuild

6 - echo rt2500 >> /etc/modules.autoload.d/kernel-2.6

7 - edit /etc/Wireless/RT2500STA/RT2500STA.dat with the help of iwpriv_usage.txt or the page 4 of the forum  above

8 - add your network config in /etc/conf.d/local.start. Mine is simply dhcpcd ra0

9 - /etc/init.d/local restart

```

This should work on a reboot. 

I tried many config options in /etc/conf.d/net and /etc/conf.d/wireless, to have a more standard config. 

It never worked, both with the daily cvs driver and the last beta one.

Does anyone has a cleaner solution, or it is a real baselayout bug?

----------

## bicatali

Well I have to say this config is not very stable. The DHCP daemon is quite lunatic. 

It sometimes picks up an IP very fast and sometimes never does. A better bet will 

certainly be to wait for a stabilization of the new rt2x00-2.0 driver, which according 

to this page will do the job.

I will try to post a new ebuild in the next few days if nobody beats me before.

----------

## UberLord

I already have an ebuild which looks like it should work. However, I don't have the hardware (it's arriving early next week) so I can't test it.

http://dev.gentoo.org/~uberlord/overlay/net-wireless/rt2x00/rt2x00-2.0.0_beta2.ebuild

Let me know if it works and you can at least get it to recognise your hardware  :Smile: 

The only issue with the ebuild is that it doesn't detect the minimum kernel version required (2.6.13) which I should fix later

EDIT: It does now, the ebuild itself should be good to go, the driver on the other hand .... someone tell me if it works or not!

----------

## UberLord

OK, the driver seems to work with a few cavets

1 - wpa_supplicant don't work with it - WPA via iwpriv calls may work, but I've not tested this

2 - connectivity isn't as good as the madwifi driver (when madwifi works)

3 - cannot use 4KSTACKS, SMP, PREEMPT (low latency) in kernel

And the ebuild is in portage  :Smile: 

emerge net-wireless/rt2x00  :Smile: 

----------

## bicatali

Thanks for this immediate support! I am now home and can try the ebuild.

I first tried the ebuild from your previous post on my config, after emerging net-wireless/ieee80211 unstable.

I encountered some problems:

```

mango ~ # modprobe rt2500pci

WARNING: Error inserting ieee80211_crypt (/lib/modules/2.6.13-gentoo-r3/net/ieee80211/ieee80211_crypt.ko): Invalid module format

WARNING: Error inserting ieee80211 (/lib/modules/2.6.13-gentoo-r3/net/ieee80211/ieee80211.ko): Invalid module format

WARNING: Error inserting rt2x00core (/lib/modules/2.6.13-gentoo-r3/net/wireless/rt2x00core.ko): Invalid module format

FATAL: Error inserting rt2500pci (/lib/modules/2.6.13-gentoo-r3/net/wireless/rt2500pci.ko): Invalid module format

mango ~ # 

```

I will emerge sync and updating the kernel. More later.

----------

## UberLord

That looks like you complied the module with a different toolchain.

I recomend a full make clean, make && make modules_install in your kernel source and then re-emerge ieee80211 and rt2x00

----------

## bicatali

OK, I got rt2500pci to load, by recompiling a clean kernel, selecting appropriate crypting options, 

deselecting all preemptive kernel options, and running the shell command  mentioned in the ieeee80211 ebuild. 

It loads properly on the stack rt2500pci, rt2x00core, ieee80211, and ieee80211_crypt.

They change the interface quite a bit. It is now eth? instead of ra0, and the iwpriv commands changed.

I have not yet got successfull in configuring my dhcp with iwpriv/iwconfig on a WPA/PSK with TKIP network.

```

mango ~ # iwconfig eth2

eth2      IEEE 802.11bg  ESSID:off/any  Nickname:"xxxxxx"

          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:00:00:00:00:00   

          Bit Rate:54 Mb/s   Tx-Power:off   Sensitivity:10/0  

          RTS thr:off   Fragment thr:off

          Encryption key:off

          Link Quality:0  Signal level:0  Noise level:0

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

mango ~ # iwconfig eth2 key s:xxxxxx

Error for wireless request "Set Encode" (8B2A) :

    SET failed on device eth2 ; Operation not supported.

```

How to pass the network key, since iwconfig key is disabled and iwpriv does not have this option?

----------

## bicatali

I rebooted and got a nasty problem with the drivers. I have the coldplug enabled, and it loaded the module automatically.

An abridged version of the messages are:

 *Quote:*   

> 
> 
> Unable to handle kernel paging request at 00000000006f03fc RIP: 
> 
> <ffffffff88599bef>{:rt2500pci:rt2x00_dev_radio_on+79}
> ...

 

and it goes on with hex symbols. Then it becomes unusable. 

I tried the new cvs ebuild. I still get these errors during compilation:

 *Quote:*   

> 
> 
>   MODPOST
> 
> *** Warning: "free_ieee80211" [/var/tmp/portage/rt2x00-9999/work/rt2x00-9999/rt2x00core.ko] undefined!
> ...

 

The modules loads properly, but I still get a similar Oops kernel message.

Als is there a trick to pick up the proper ethx extension? If I do it during boot, it picks up eth2, if I do it afterwards, it picks up eth4.

----------

## chunderbunny

I'm using the regular rt2500 driver and I noticed that I would get intermittent connection problems unless I used the following option in my /etc/conf.d/wireless 

```
sleep_scan_ra0="1"
```

Perhaps this will help?

----------

## F-0_ICE

hi it seems you have trouble with your rt2500 based card. i am glad my thread was of help to you i revived it a bit ago for my own needs on wpa. but anyway i was told that wpa doesn't work with rt2500 but it would work with the new rt2x00 driver i my self have not had much luck at all with this new driver. but i will keep working to see what i can do. if i make any progress i will gladly inform you of it. later. btw where do you turn off the kernel preempt?

----------

## UberLord

 *F-0_ICE wrote:*   

> btw where do you turn off the kernel preempt?

 

In your kernel options Processor Type & Features -> Preemption Model ()

----------

## F-0_ICE

it won't give me an option to turn it off  :Confused: 

----------

## UberLord

Sure it does - you can pick from

No Forced Preemption

Voluntary Kernel Preemption

Preemptible Kernel

AFAIK only the last one causes serious breakage, I run with Voluntary myself.

----------

## F-0_ICE

ok i thought having any of those ops on was enabling CONFIG_PREEMPT. thanks that might be why the driver wasn't working properly but i will see.

----------

## bicatali

Another try. Got rid of coldplugging. Apparently the new rt2x00 driver uses wpa_supplicant, so I emerged it and tried  

configuring it. I also tried their Qt GUI without success. With the command line, I get this message:

 *Quote:*   

> 
> 
> mango ~ # wpa_supplicant  -i eth2 -c /etc/wpa_supplicant.conf
> 
> Failed to initialize EAPOL state machines.
> ...

 

Which driver am I supposed to specify?

----------

## UberLord

 *bicatali wrote:*   

> Which driver am I supposed to specify?

 

wext

----------

## F-0_ICE

```

net.eth0 start

 * Starting eth0

 *   Loading networking modules for eth0

 *     modules: wpa_supplicant essidnet iptunnel ifconfig dhcpcd apipa

 *       wpa_supplicant provides wireless

 *       ifconfig provides interface

 *       dhcpcd provides dhcp

 *   Starting wpa_supplicant on eth0 ...

ioctl[SIOCSIWAUTH]: Unknown error 524

 *     Waiting for association                                            [ ok ]

 *     timed out

```

thats what i get when using wpa_supplicant with rt2x00-2.0.0_beta2-r1 after 5 tries it relays the same message.

i do get perfect results from ndiswrapper if you would like to give it a try. also heres the config i used

/etc/conf.d/net

```
#Access Point(s) Configuration

preferred_aps=( "ESSID" )

config_ESSID=( "dhcp" )

dhcpcd_ESSID="-t 60"

#Standard Network Configuration

config_eth0="dhcp"

dhcpcd_eth0="-t 60"

dhcp_eth0="release nodns nontp nonis"

#Wireless Network Configuration

modules=( "wpa_supplicant" )

wpa_supplicant_eth0="-Dwext"

mode_eth0="managed"

channel_eth0="11"

#Misc Config Options

RC_VERBOSE=yes

```

between the three drivers i am working with:

rt2x00 interface is eth0,wext 

rt2500 interface is ra0,N/A

ndiswrapper interface is wlan0,ndiswrapper or wlan0,wext

NOTE: syntax is <interface>,<wpa_supplicant driver>

heres my wpa_supplicant.conf

```

ctrl_interface=/var/run/wpa_supplicant

network={

  ssid="ESSID"

  psk="PASSKEY"

  priority=5

}

```

 when i switch between drivers the only changes i make are to the interface and the wpa_supplicant driver

----------

## bicatali

After configuring for WPA-PSK the /etc/wpa_supplicant.conf:

 *Quote:*   

> 
> 
> ctrl_interface=/var/run/wpa_supplicant
> 
> network={
> ...

 

I get the same error:

```

mango ~ # /etc/init.d/net.eth2 start

 * Caching service dependencies ...                                       [ ok ]

 * Starting eth2

 *   Loading networking modules for eth2

 *     modules: wpa_supplicant essidnet iptunnel ifconfig dhcpcd apipa

 *       wpa_supplicant provides wireless

 *       ifconfig provides interface

 *       dhcpcd provides dhcp

 *   Starting wpa_supplicant on eth2 ...

ioctl[SIOCSIWAUTH]: Unknown error 524

WEXT auth param 4 value 0x0 -  *     Waiting for association              [ ok ]

```

----------

## UberLord

Have you guys reported this to the rtx200 beta testing forum?

http://rt2x00.serialmonkey.com/phpBB2/viewforum.php?f=5

----------

