Ralink rt2870 wifi support?

tim-m89

Active Member


Messages: 123

#1
Original question:

Does FreeBSD support RaLink rt2870. My exact wifi is this if that makes any difference?

Update:

Summary of this thread:
egorenar has been developing an rt2860 and a rt2870 driver for both FreeBSD 7.2 and 8.0.
He is hosting them here.
Download the latest tarball that is correct for both your chipset and your FreeBSD version. Then:
Code:
tar xvzf driver.tar.gz
cd driver
make
As root or prepending with sudo the usual commands for driver loading kldstat, kldload, kldunload can be used or, if you prefer, you may want them to load automatically at boot time:
Code:
cp rt2870.ko /boot/modules/
chmod 555 /boot/modules/rt2870.ko
And add a line to /boot/loader.conf:
Code:
rt2870_load="YES"
Loading rt2860.ko/rt2870.ko will create the hardware interface rt28600/rt28700 respectively but since version 8 of FreeBSD, these are not controlled directly for the usual settings but with a virtual interface that must created either manually like:
Code:
ifconfig wlan0 create wlandev rt28700
Or automatically via /etc/rc.conf. Snippet of my rc.conf for a wpa network (must have a wpa_supplicant.conf file in /etc/):
Code:
wlans_rt28700="wlan0"
ifconfig_wlan0="WPA inet 192.168.2.110 netmask 255.255.255.0 country NZ"
defaultrouter="192.168.2.1"
During the development a slight bug in FreeBSD wifi was found. If your Access point sends ADDBA requests you may need this to get 802.11n working. You will need kernel source to patch it. Follow the usual guide for rebuilding the kernel.

If you use FreeBSD 7.2 with 802.11N then you may also want this patch. This patch is not required for FreeBSD 8.0 though unlike the above patch.

I have been successfully using this rt2870 driver for a 802.11n connection with WPA2-AES security for a while now and others have reported great success with both rt2860 and rt2870 in 802.11N mode.

If you can correctly use FreeBSD's wifi then any feedback specific to this driver is a great help for it's ongoing development. Posts to this thread may become very helpful to other users (if they are experiencing the same problems for example).

A big thank you to egorenar for all his efforts. :beer.

Update:

If anyone is interested in why he dropped development of this. He has been very busy. It turn's out that he is also the legendary graf_chokolo. He has made some important developments in getting ps3's to run homebrew. Homebrew doesn't necessarily mean piracy but sony have their lawyers all over his ass anyway. He has been struggling with legal bills and could really do with some help.

Meanwhile development for the run driver will likely be supported long term. It is from another developer but supports as similar set of hardware and is include within the latest freebsd source tree.
 

egorenar

Active Member

Thanks: 20
Messages: 199

#2
I'm currently developing a driver for this chip for FreeBSD 7.2.
Monitor mode is already working with wireshark :)
I will implement transmitting later.
 
OP
OP
tim-m89

tim-m89

Active Member


Messages: 123

#7
This one wireless networking device is the reason freebsd is not a suitable option for my desktop so I am very interested in this. What is he status of 802.11N and WPA2-AES?
 
OP
OP
tim-m89

tim-m89

Active Member


Messages: 123

#11
Could you please provide instructions on how I can go about testing this out? Thanks a lot for all you time + effort developing this.
 

egorenar

Active Member

Thanks: 20
Messages: 199

#12
tim-m89 said:
Could you please provide instructions on how I can go about testing this out? Thanks a lot for all you time + effort developing this.
I developed and tested my driver only on FreeBSD 7.2 and only with Linksys WUSB600N. What NIC do you have ?
 

egorenar

Active Member

Thanks: 20
Messages: 199

#14
OK, i extended my driver so it supports now also D-Link DWA-140 which also has rt2870 chip.

I attached my driver for rt2870. The driver is a kernel loadable module (KLM). Extract it and you will see the directory rt2870_fbsd72. Change into it and enter the command "make"
(Have you installed FreeBSD kernel source ? If not then you should do it).
Now you should see the KLD rt2870.ko if everything went right.
Load it with "kldload ./rt2870.ko" (run it as root !!!). Now insert your USB NIC into your system.

If you enter "ifconfig" now then you should see the interface "rt28700".

To associate with your wireless network:
Code:
1. ifconfig rt28700 channel <your channel> ssid <your ssid> up
2. wpa_supplicant -dd -i rt28700 -c <path to your wpa_supplicant.conf>
The above shell commands should be run as root !!!

After you was associated with your WLAN you have to run dhclient
in order to obtain an IP from DHCP server or assign a static IP.
The routing table must be adjusted also. Or you can edit /etc/rc.conf and restart your network script with "/etc/rc.d/netif restart".

I think you know what wpa_supplicant is or should I provide an example also ?

WEP, TKIP and AES worked with Linksys WUSB600N and this driver.
And i could surf and download. 802.11n is not implemented yet.

Please post your feedback here because i tested my driver only with Linksys WUSB600N and i have no possibility to test it with other NICs.
 

Attachments

NAC

Member

Thanks: 3
Messages: 34

#16
egorenar said:
OK, i extended my driver so it supports now also D-Link DWA-140 which also has rt2870 chip.

I attached my driver for rt2870. The driver is a kernel loadable module (KLM). Extract it and you will see the directory rt2870_fbsd72. Change into it and enter the command "make"
(Have you installed FreeBSD kernel source ? If not then you should do it).
Now you should see the KLD rt2870.ko if everything went right.
Load it with "kldload ./rt2870.ko" (run it as root !!!). Now insert your USB NIC into your system.

If you enter "ifconfig" now then you should see the interface "rt28700".

To associate with your wireless network:
Code:
1. ifconfig rt28700 channel <your channel> ssid <your ssid> up
2. wpa_supplicant -dd -i rt28700 -c <path to your wpa_supplicant.conf>
The above shell commands should be run as root !!!

After you was associated with your WLAN you have to run dhclient
in order to obtain an IP from DHCP server or assign a static IP.
The routing table must be adjusted also. Or you can edit /etc/rc.conf and restart your network script with "/etc/rc.d/netif restart".

I think you know what wpa_supplicant is or should I provide an example also ?

WEP, TKIP and AES worked with Linksys WUSB600N and this driver.
And i could surf and download. 802.11n is not implemented yet.

Please post your feedback here because i tested my driver only with Linksys WUSB600N and i have no possibility to test it with other NICs.
WOW! you r the man! :e

thanks a lot for your efficient! i have just tried ,it worked once..i am using wpa. the problem is that after it was associated, once i run /etc/rc.d/netif restart. the driver stops!
 

egorenar

Active Member

Thanks: 20
Messages: 199

#17
NAC said:
WOW! you r the man! :e

thanks a lot for your efficient! i have just tried ,it worked once..i am using wpa. the problem is that after it was associated, once i run /etc/rc.d/netif restart. the driver stops!
Ye, i know. I just reload the driver after i started netif script in that case and then it works.
I guess, the KLM should be loaded automatically at boot time
to avoid this problem.
 

egorenar

Active Member

Thanks: 20
Messages: 199

#18
NAC said:
WOW! you r the man! :e

thanks a lot for your efficient! i have just tried ,it worked once..i am using wpa. the problem is that after it was associated, once i run /etc/rc.d/netif restart. the driver stops!
What NIC do you have ?
 

NAC

Member

Thanks: 3
Messages: 34

#21
egorenar said:
Could you make the driver work ?
Or do you still have problems with netif ?
NO, once i try to give it an IP, the driver alway stops, and somehow i can ping to my router, but cannot get internet.
 

egorenar

Active Member

Thanks: 20
Messages: 199

#22
NAC said:
NO, once i try to give it an IP, the driver alway stops, and somehow i can ping to my router, but cannot get internet.
Did you add this to your rc.conf:

Code:
ifconfig_rt28700="DHCP WPA"
 

NAC

Member

Thanks: 3
Messages: 34

#23
egorenar said:
Did you add this to your rc.conf:

Code:
ifconfig_rt28700="DHCP WPA"
Hm.. no, i use this ifconfig_rt28700="inet 10.1.1.90 netmask 255.255.255.0"

i gonna try "DHCP WPA" later. thanks :)
 

egorenar

Active Member

Thanks: 20
Messages: 199

#24
NAC said:
Hm.. no, i use this ifconfig_rt28700="inet 10.1.1.90 netmask 255.255.255.0"

i gonna try "DHCP WPA" later. thanks :)
How to configure rt2870 driver:

1. Load KLM rt2870.ko

Code:
# kldload ./rt2870.ko
2a. Dynamic IP

Edit rc.conf (Don't forget to remove all other ifconfigs from rc.conf)

Code:
ifconfig_rt28700="WPA DHCP"
2b. Static IP

Edit rc.conf

Code:
ifconfig_rt28700="WPA inet 10.1.1.90 netmask 255.255.255.0"
defaultrouter="<ip address of your router>"
Add default route:

Code:
# route add default <ip address of your router>
Add DNS nameserver to /etc/resolv.conf:

Code:
nameserver <ip address of your router>
3. Restart netif

Code:
# /etc/rc.d/netif restart
4. Wait some time till your NIC associates and gets an IP.


It worked for me if i followed the steps above
(I'm writing this text and surfing with rt2870 driver :e).

Have fun.
 

NAC

Member

Thanks: 3
Messages: 34

#25
thanks for your steps.everything works well, but once i run
Code:
# /etc/rc.d/netif restart
i would get
Code:
Stopping network:wpa_supplicant not running? (check /var/run/wpa_supplicant/rt28700.pid).

rt28700: no link ...... got link
DHCPREQUEST on rt28700 to 255.255.255.255 port 67
DHCPREQUEST on rt28700 to 255.255.255.255 port 67
DHCPACK from 10.1.1.1
bound to 10.1.1.4 -- renewal in 1800 seconds.
it seems something wrong at here I am trying to sort it out, it is a bit different with my Gentoo wpa_supplicant, i have checked my folder, there is no file called: /var/run/wpa_supplicant/rt28700.pid
 
Top