# Ralink rt2870 wifi support?



## tim-m89 (Sep 14, 2009)

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:

```
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:

```
cp rt2870.ko /boot/modules/
chmod 555 /boot/modules/rt2870.ko
```
And add a line to /boot/loader.conf:

```
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:

```
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/):

```
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 (Oct 15, 2009)

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.


----------



## aragon (Oct 15, 2009)

It seems [thread=7562]more than one person[/thread] is working on getting this into FreeBSD.


----------



## NAC (Oct 16, 2009)

I am looking for it as well. I can't wait to get it worked.


----------



## egorenar (Oct 16, 2009)

i also plan to implement rt2860 driver later.


----------



## egorenar (Oct 24, 2009)

WEP is working now !!!


----------



## tim-m89 (Oct 25, 2009)

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?


----------



## egorenar (Oct 25, 2009)

802.11n does not work yet, but i'm working on it, stay tuned.
Currently i'm working on WPA and WPA2-AES.


----------



## egorenar (Oct 29, 2009)

WPA2 is working !!!
TKIP is still not working. :-(
Stay tuned, guys.


----------



## egorenar (Nov 2, 2009)

TKIP is working now also !!!


----------



## tim-m89 (Nov 3, 2009)

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 (Nov 3, 2009)

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 ?


----------



## tim-m89 (Nov 3, 2009)

egorenar said:
			
		

> What NIC do you have ?



this


----------



## egorenar (Nov 3, 2009)

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:

```
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.


----------



## tim-m89 (Nov 4, 2009)

OK thanks. I will try this from a live freebsd disc when I get the time.


----------



## NAC (Nov 4, 2009)

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).
> ...



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 (Nov 4, 2009)

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 (Nov 4, 2009)

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 (Nov 4, 2009)

DWA-140 http://www.dlink.com/products/?pid=652
cheers.


----------



## egorenar (Nov 4, 2009)

NAC said:
			
		

> DWA-140 http://www.dlink.com/products/?pid=652
> cheers.



Could you make the driver work ?
Or do you still have problems with netif ?


----------



## NAC (Nov 4, 2009)

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 (Nov 4, 2009)

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:


```
ifconfig_rt28700="DHCP WPA"
```


----------



## NAC (Nov 4, 2009)

egorenar said:
			
		

> Did you add this to your rc.conf:
> 
> 
> ```
> ...



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 (Nov 4, 2009)

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


```
# kldload ./rt2870.ko
```

2a. Dynamic IP

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


```
ifconfig_rt28700="WPA DHCP"
```

2b. Static IP

   Edit rc.conf


```
ifconfig_rt28700="WPA inet 10.1.1.90 netmask 255.255.255.0"
defaultrouter="<ip address of your router>"
```

   Add default route:


```
# route add default <ip address of your router>
```

   Add DNS nameserver to /etc/resolv.conf:


```
nameserver <ip address of your router>
```

3. Restart netif


```
# /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 (Nov 4, 2009)

thanks for your steps.everything works well, but once i run 

```
# /etc/rc.d/netif restart
```
i would get 

```
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


----------



## egorenar (Nov 4, 2009)

NAC said:
			
		

> thanks for your steps.everything works well, but once i run
> 
> ```
> # /etc/rc.d/netif restart
> ...



The first time you run wpa_supplicant, there is no /var/run/wpa_supplicant/rt28700.pid because wpa_supplicant is running first time. After "netif restart"
you should see /var/run/wpa_supplicant/rt28700.pid.

Everything is OK, i get the same message. Your NIC was assigned the IP address 10.1.1.4 and you should now be able to use your NIC. What says ifconfig ?


----------



## NAC (Nov 4, 2009)

no, i cannot ping to router, '
PING 10.1.1.1 (10.1.1.1): 56 data bytes
the netmask should be  netmask 255.0.0.0
ifconfig_rt28700="inet 10.1.1.90  netmask 255.0.0.0"


----------



## egorenar (Nov 4, 2009)

NAC said:
			
		

> no, i cannot ping to router, '
> PING 10.1.1.1 (10.1.1.1): 56 data bytes
> the netmask should be  netmask 255.0.0.0
> ifconfig_rt28700="inet 10.1.1.90  netmask 255.0.0.0"



Did you see my previous post on first page. I extended it
with static IP configuration and i tested it myself, it works. You can use DHCP or static IP but not both.

You have not only to configure static IP for your NIC but you also
need in that case to manually define default router, nameserver and so on. See my post on previous page.


----------



## egorenar (Nov 4, 2009)

NAC said:
			
		

> here is my *rc.conf*
> 
> ```
> ifconfig_rt28700="WPA DHCP"
> ...



You are associated and you have an IP.
Can you please post your routing table with "netstat -nr"


----------



## NAC (Nov 4, 2009)

egorenar said:
			
		

> Did you see my previous post on first page. I extended it
> with static IP configuration and i tested it myself, it works. You can use DHCP or static IP but not both.
> 
> You have not only to configure static IP for your NIC but you also
> need in that case to manually define default router, nameserver and so on. See my post on previous page.



whenever i try to restart wireless, i always mark off one line, i am not using both. i am going to try now, i think it should be working soon.  thanks for your prompt replies


----------



## NAC (Nov 4, 2009)

egorenar said:
			
		

> You are associated and you have an IP.
> Can you please post your routing table with "netstat -nr"



while i am editing i made a mistake and that message been deleted. 



```
netstat -nr

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            10.1.1.1           UGS         0      672   ale0
10.0.0.0/8         link#1             UC          0        0   ale0
10.1.1.1           00:12:3c:12:22:ff  UHLW        2      182   ale0   1156
127.0.0.1          127.0.0.1          UH          0        0    lo0

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::1                               ::1                           UHL         lo0
fe80::%lo0/64                     fe80::1%lo0                   U           lo0
fe80::1%lo0                       link#2                        UHL         lo0
ff01:2::/32                       fe80::1%lo0                   UC          lo0
ff02::%lo0/32                     fe80::1%lo0                   UC          lo0
```

there is no rt28700


----------



## egorenar (Nov 4, 2009)

NAC said:
			
		

> while i am editing i made a mistake and that message been deleted.
> 
> 
> 
> ...



What is ale0 ? Have you disabled other ifconfigs in rc.conf ?
You can't use 2 NICs simultaneously connected to the same router.
You should temporarily disable ifconfig_ale0 and unplug the cable.
You should see in your routing table rt28700 instead of ale0.

That is my routing table:


```
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            192.168.178.1      UGS         0     6815 rt2870
127.0.0.1          127.0.0.1          UH          0        0    lo0
192.168.178.0/24   link#6             UC          0        0 rt2870
192.168.178.1      00:1a:4f:82:b1:82  UHLW        2      437 rt2870   1177
```


----------



## NAC (Nov 4, 2009)

egorenar said:
			
		

> What is ale0 ? Have you disabled other ifconfigs in rc.conf ?
> You can't use 2 NICs simultaneously connected to the same router.
> You should temporarily disable ifconfig_ale0 and unplug the cable.
> You should see in your routing table rt28700 instead of ale0.
> ...



thank you so much.. haha I have got it worked.
i have no idea why it worked, it just worked itself, after twice kernel panic, that is wired...
now i am writing msg surfing on this NIC..it's pretty cool. 

I am wondering did you have kernel panic problem during you using the wireless? and how i can load this module (rt2870.ko) when the sys boot-up? or i must do it manually every time?

thanks for your work, the driver works like a charm


----------



## egorenar (Nov 4, 2009)

NAC said:
			
		

> thank you so much.. haha I have got it worked.
> i have no idea why it worked, it just worked itself, after twice kernel panic, that is wired...
> now i am writing msg surfing on this NIC..it's pretty cool.
> 
> ...



The driver is not yet finished but it is OK and usable now.
It lacks locking and some error checking. I'm new to FreeBSD kernel programming. Actually i'm Linux kernel programmer 
But there is already a driver for this chip on Linux but on FreeBSD there was no driver and i wanted to learn how
WLAN NICs and 802.11 stack work.

I'm still working on driver for rt2870 and also rt2860 (PCI)
and will improve it later. I intend to implement 802.11n
and WME and of course fix bugs  The more people will test this driver the faster i can fix bugs, i think 

Have fun and please report any problems to me.

I'm going to sleep now, it's midnight and i have to work tomorrow.


----------



## NAC (Nov 4, 2009)

egorenar said:
			
		

> The driver is not yet finished but it is OK and usable now.
> It lacks locking and some error checking. I'm new to FreeBSD kernel programming. Actually i'm Linux kernel programmer
> But there is already a driver for this chip on Linux but on FreeBSD there was no driver and i wanted to learn how
> WLAN NICs and 802.11 stack work.
> ...




thanks a lot buddy for your work. i will follow up for updating.
have a good nite


----------



## egorenar (Nov 4, 2009)

NAC said:
			
		

> and how i can load this module (rt2870.ko) when the sys boot-up? or i must do it manually every time?



Copy rt2870.ko to /boot/kernel/
and edit /boot/loader.conf


```
rt2870_load="YES"
```

I have not tested it !!!

:e


----------



## NAC (Nov 4, 2009)

egorenar said:
			
		

> Copy rt2870.ko to /boot/kernel/
> and edit /boot/loader.conf
> 
> 
> ...



i do try it! but seems need to unplug NIC 1st and re-plug it! ha:e


----------



## eMxyzptlk (Nov 5, 2009)

Hello,

I'm new to FreeBSD and this laptop (HP DV7-1199EF) has an intel 5100 which is currently unsupported by FreeBSD.

I bought a Linksys WUSB54GV Ver. 3, it has a rt2870 chipset, and I'm trying to install it on 8.0-BETA, but I can't compile it, does this driver works for 8-BETA?

Thanks


----------



## egorenar (Nov 5, 2009)

eMxyzptlk said:
			
		

> Hello,
> 
> I'm new to FreeBSD and this laptop (HP DV7-1199EF) has an intel 5100 which is currently unsupported by FreeBSD.
> 
> ...



Sorry, no freebsd 8 support yet.
FreeBSD 8 has a bit different 802.11 stack (net80211).
But i do intend to port it to FreeBSD 8 later.
Currently only FreeBSD 7.2 is supported.


----------



## egorenar (Nov 5, 2009)

eMxyzptlk said:
			
		

> Hello,
> 
> I'm new to FreeBSD and this laptop (HP DV7-1199EF) has an intel 5100 which is currently unsupported by FreeBSD.
> 
> ...



Are you sure this NIC has rt2870 chip ? I think it has rt3070.


----------



## eMxyzptlk (Nov 6, 2009)

I think it has rt2870 at least that what I get on linux ( not tested, but when I plug it in, in dmesg I see it looking for rt2870.bin firmware file.

How can we confirm what ship it has ?


----------



## egorenar (Nov 6, 2009)

eMxyzptlk said:
			
		

> I think it has rt2870 at least that what I get on linux ( not tested, but when I plug it in, in dmesg I see it looking for rt2870.bin firmware file.
> 
> How can we confirm what ship it has ?



You can try my driver with FreeBSD 7.2 (if it works then it has rt2870) or
you can determine which driver is loaded on linux.

rt3070 is very similar to rt2870. I could implement it but i have no device to test it.


----------



## eMxyzptlk (Nov 6, 2009)

You might be right, it's a rt3070 device

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

Problem is I can't test on FreeBSD 7.2, because This computer does not boot any FreeBSD OS without disabling Firewire in the kernel first so I can't boot from CD, I had to install FreeBSD on an external Hard Disk on one of my friend's computer, disable firewire, rebuild the kernel and boot from it... Currently I don't have FreeBSd installed on my computer because I work 6/7 days on the same PC and I can't switch to FreeBSD (currently on ArchLinux) without being sure a 100% some sort of wireless network is accessible, so I bought this device yesterday in hope it will be the pickup untill iwl5100 works..

http://lists.freebsd.org/pipermail/freebsd-acpi/2009-July/005924.html

Your drivers do not compile on FreeBSD 8, so what next? should I re-install 7.2 just to test?


----------



## eMxyzptlk (Nov 6, 2009)

Following that ubuntu forums link allowed me to make this USB stick work under linux, I will try to get FreeBSD 7.2 on the HDD and test it.


----------



## egorenar (Nov 7, 2009)

eMxyzptlk said:
			
		

> Following that ubuntu forums link allowed me to make this USB stick work under linux, I will try to get FreeBSD 7.2 on the HDD and test it.



Which driver does work on Linux with your NIC ?


----------



## eMxyzptlk (Nov 7, 2009)

egorenar said:
			
		

> Which driver does work on Linux with your NIC ?


The RT3070USB(RT307x) driver.


----------



## egorenar (Nov 7, 2009)

eMxyzptlk said:
			
		

> The RT3070USB(RT307x) driver.



My driver will not work with your NIC.
Did you try if_run driver here: 

http://forums.freebsd.org/showthread.php?t=7562

Try it, i think it supports rt3070 chip.

I could develop a driver for rt3070 but i have no device to test.
Or i could develop a driver and you could test it if you want ? Step after step.
At first monitor mode, then sending and so on.
It is really very similar to rt2870 (rt2860 is also very similar to rt2870 and i already have a driver for rt2860 with monitor mode). If you have time we could work together.


----------



## eMxyzptlk (Nov 7, 2009)

I will try the if_run tonight and report back..

Thanks


----------



## eMxyzptlk (Nov 9, 2009)

The if_run compiled fine on 8-RC2 but doesn't run http://forums.freebsd.org/showpost.php?p=48184&postcount=32

I'd be happy to help, just PM me with links to download and I'll try them


----------



## egorenar (Nov 11, 2009)

Good news, guys.
QoS(WME) is finally working with rt2870 chip.
It was an important step towards 802.11n because
QoS is mandatory in 802.11n !!!

I'm currently working on 802.11n mode for rt2870 chip.

Tx fragmentation is also not working yet. It's the next step.

:e :e :e


----------



## Lothlorien (Nov 21, 2009)

egorenar said:
			
		

> It is really very similar to rt2870 (rt2860 is also very similar to rt2870 and i already have a driver for rt2860 with monitor mode). If you have time we could work together.



Waiting for rt2860 driver for testing  Tired to use ndis and i386 FreeBSD.


----------



## egorenar (Nov 22, 2009)

Lothlorien said:
			
		

> Waiting for rt2860 driver for testing  Tired to use ndis and i386 FreeBSD.



Here you can download it, only monitor mode works for now.

http://forums.freebsd.org/showthread.php?t=7562&page=2


----------



## Lothlorien (Nov 23, 2009)

*it works fine *



			
				egorenar said:
			
		

> Here you can download it, only monitor mode works for now.
> 
> http://forums.freebsd.org/showthread.php?t=7562&page=2



Thanks for your work, it works fine receiving packets in wireshark :beer

Here is my system info:


```
[root@abbeyroad ~]# uname -a

FreeBSD abbeyroad.home 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May  1 07:18:07 UTC 2009     root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

[root@abbeyroad ~]# kldload rt2860
[root@abbeyroad ~]# pciconf -lvcb
...
rt28600@pci0:5:2:0:	class=0x028000 card=0x28601814 chip=0x06011814 rev=0x00 hdr=0x00
    vendor     = 'Ralink Technology, Corp'
    class      = network
    bar   [10] = type Memory, range 32, base 0xfebf0000, size 65536, enabled
    cap 01[40] = powerspec 3  supports D0 D3  current D0
...
[root@abbeyroad ~]# ifconfig rt28600 up
[root@abbeyroad ~]# dmesg|tail -60
...
rt28600: <Linksys WMP600N RT2860> mem 0xfebf0000-0xfebfffff irq 18 at device 2.0 on pci5
rt28600: EEPROM rev=0x0101
rt28600: EEPROM mac address=00:14:d1:c3:96:65
rt28600: EEPROM RF rev=0x0001, paths=2T3R
rt28600: EEPROM NIC config: Tx AGC control=0
rt28600: EEPROM country code=1/2
rt28600: EEPROM freq offset=0x0d
rt28600: EEPROM led cntl=0x01, LEDs=0x5555/0xaad9/0xffbb
rt28600: EEPROM LNA gains=0x0a/0xff
rt28600: invalid EEPROM LNA gain: 2
rt28600: invalid EEPROM LNA gain: 3
rt28600: EEPROM Tx power compensation deltas=-2(2MHz), -2(5MHz)
rt28600: EEPROM Tx power compensation #0=0xaacc6666(20MHz), 0x88aa4444(40MHz/2GHz), 0x88aa4444(40MHz/5GHz)
rt28600: EEPROM Tx power compensation #1=0xaacc6688(20MHz), 0x88aa4466(40MHz/2GHz), 0x88aa4466(40MHz/5GHz)
rt28600: EEPROM Tx power compensation #2=0xaacc6688(20MHz), 0x88aa4466(40MHz/2GHz), 0x88aa4466(40MHz/5GHz)
rt28600: EEPROM Tx power compensation #3=0xaacc6688(20MHz), 0x88aa4466(40MHz/2GHz), 0x88aa4466(40MHz/5GHz)
rt28600: EEPROM Tx power compensation #4=0xffff6688(20MHz), 0xdddd4466(40MHz/2GHz), 0xdddd4466(40MHz/5GHz)
rt28600: EEPROM TSSI 2GHz: 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, step=255
rt28600: EEPROM TSSI 5GHz: 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, step=255
rt28600: MAC/BBP RT2860 (rev 0x28600101), RF RT2820
rt28600: skip channel 10, could not find extension channel
rt28600: skip channel 11, could not find extension channel
rt28600: skip channel 12, could not find extension channel
rt28600: skip channel 13, could not find extension channel
rt28600: skip channel 14, could not find extension channel
rt28600: Ethernet address: 00:14:d1:c3:96:65
rt28600: [ITHREAD]
rt28600: loading 8051 microcode
rt28600: 8051 microcode was successfully loaded
```

P.S. Expecting working driver  and 8.0 support.


----------



## egorenar (Nov 24, 2009)

Lothlorien said:
			
		

> Thanks for your work, it works fine receiving packets in wireshark :beer
> 
> Here is my system info:
> 
> ...



Thanks for your feedback. I'm working currently on packet transmission for rt2860. Maybe i will finish it till this weekend.


----------



## GeorgeMitchell (Nov 28, 2009)

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).
> ...



Thanks for the good work.  I tried modifying it for Zonet ZEW2500P (04) which contains Ralink RT2870 (USB manufacturer 148f, device 3070) and got these log messages (I added a printout of the offending value in the DPRINTF statements):


```
rt28700: <Ralink 802.11 n WLAN, class 0/0, rev 2.00/1.01, addr 2> on uhub4
 rt28700: EEPROM rev=0x0101
 rt28700: EEPROM mac address=00:a1:b0:c0:25:e8
 rt28700: EEPROM RF rev=0x0005, paths=1T1R
 rt28700: EEPROM NIC config: Tx AGC control=0, ext LNA gains=0/0
 rt28700: EEPROM country code=255/255
 rt28700: EEPROM freq offset=0x2f
 rt28700: EEPROM led cntl=0x01, LEDs=0x1111/0xffff/0xffff
 rt28700: EEPROM LNA gains=0x00/0x00
 rt28700: invalid EEPROM LNA gain 0: 2
 rt28700: invalid EEPROM LNA gain 0: 3
 rt28700: invalid EEPROM Tx power2 -1: 0 (2GHz)
 rt28700: invalid EEPROM Tx power2 -1: 1 (2GHz)
 rt28700: invalid EEPROM Tx power2 -1: 2 (2GHz)
 rt28700: invalid EEPROM Tx power2 -1: 3 (2GHz)
 rt28700: invalid EEPROM Tx power2 -1: 4 (2GHz)
 rt28700: invalid EEPROM Tx power2 -1: 5 (2GHz)
 rt28700: invalid EEPROM Tx power2 -1: 6 (2GHz)
 rt28700: invalid EEPROM Tx power2 -1: 7 (2GHz)
 rt28700: invalid EEPROM Tx power2 -1: 8 (2GHz)
 rt28700: invalid EEPROM Tx power2 -1: 9 (2GHz)
 rt28700: invalid EEPROM Tx power2 -1: 10 (2GHz)
 rt28700: invalid EEPROM Tx power2 -1: 11 (2GHz)
 rt28700: invalid EEPROM Tx power2 -1: 12 (2GHz)
 rt28700: invalid EEPROM Tx power2 -1: 13 (2GHz)
 rt28700: EEPROM Tx power compensation deltas=0(2MHz), 0(5MHz)
 rt28700: EEPROM Tx power compensation #0=0xaaaa6666(20MHz), 0xaaaa6666(40MHz/2GHz), 0xaaaa6666(40MHz/5GHz)
 rt28700: EEPROM Tx power compensation #1=0xaaaa6688(20MHz), 0xaaaa6688(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
 rt28700: EEPROM Tx power compensation #2=0xaaaa6688(20MHz), 0xaaaa6688(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
 rt28700: EEPROM Tx power compensation #3=0xaaaa6688(20MHz), 0xaaaa6688(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
 rt28700: EEPROM Tx power compensation #4=0xffff6688(20MHz), 0xffff6688(40MHz/2GHz), 0xffff6688(40MHz/5GHz)
 rt28700: EEPROM TSSI 2GHz: 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, step=255
 rt28700: EEPROM TSSI 5GHz: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, step=0
 rt28700: MAC/BBP RT2870 (rev 0x30700201), RF RT3020
 rt28700: WARNING: using obsoleted IFF_NEEDSGIANT flag
 rt28700: Ethernet address: 00:a1:b0:c0:25:e8
```

Any ideas what I should do about the invalid LNA gain and invalid Tx power2?  Judging from what ifconfig says, everything is working fine -- but no packets get sent, and scan detects nothing.


----------



## egorenar (Nov 28, 2009)

GeorgeMitchell said:
			
		

> Thanks for the good work.  I tried modifying it for Zonet ZEW2500P (04) which contains Ralink RT2870 (USB manufacturer 148f, device 3070) and got these log messages (I added a printout of the offending value in the DPRINTF statements):
> 
> 
> ```
> ...



Thanks for feedback, i shall investigate this problem.
Unfortunately, i have no access to this device and coudn't test it by myself.
Did you add USB vendor and product IDs to driver ?


----------



## egorenar (Nov 28, 2009)

GeorgeMitchell said:
			
		

> Thanks for the good work.  I tried modifying it for Zonet ZEW2500P (04) which contains Ralink RT2870 (USB manufacturer 148f, device 3070) and got these log messages (I added a printout of the offending value in the DPRINTF statements):
> 
> 
> ```
> ...



I have an anwser to question. My device driver doesn't support
RT30xx devices yet. Try if_run driver, i think it supports your device. Sorry.


----------



## egorenar (Nov 30, 2009)

Lothlorien said:
			
		

> Thanks for your work, it works fine receiving packets in wireshark :beer
> 
> Here is my system info:
> 
> ...



Hi, i have finally implemented frame transmission for rt2860 chip.
Please test it and provide feedback. Thanks.

Download link: http://forums.freebsd.org/showthread.php?t=7562&page=3


----------



## mathuin (Dec 13, 2009)

egorenar said:
			
		

> i also plan to implement rt2860 driver later.



Any idea when this might happen?  My Asus Eee PC 1000 is effectively a paperweight until the wireless works, as the places I need to use it don't have wired ethernet. :-(


----------



## egorenar (Dec 13, 2009)

mathuin said:
			
		

> Any idea when this might happen?  My Asus Eee PC 1000 is effectively a paperweight until the wireless works, as the places I need to use it don't have wired ethernet. :-(



Hi, 

here are the drivers for rt2860 and rt2870 with HOSTAP mode !!!

30.12.2009
Improved interrupt handling.
Added more statistic counters (use "sysctl -a | grep dev.rt2860 ").

06.01.2010
Fixed a bug in rt2860_io_mac_write_multi (rt2860_fbsd72)

09.01.2010
Fixed bug, LOCKING problem in HOSTAP mode
(the problem appears after several "/etc/rc.d/hostapd restart")

09.01.2010
Added support for RT2760 chip.

17.01.2010
AMRR improvements.
Several bug fixes for HOSTAP mode in rt2870
(thanks a lot to Dein for his help  )

20.01.2010
Tx power configurable now

24.01.2010
Added support for Trendnet TEW-644UB to rt2870 (FreeBSD 8 only)
802.11n support (HT20, HT40, Short GI Rx, A-MSDU Rx) for rt2870 and rt2860 (only FreeBSD 8 for now)
802.11n support is highly experimental

25.01.2010
802.11n - Short GI Tx support (FreeBSD 8 only for now)

26.01.2010
802.11n (FreeBSD 8) - A-MPDU Rx and Block ACKs
But i could not test it, don't know how to make my AP send A-MPDUs :e 

27.01.2010
802.11n support and AMRR bug fix in rt2860 and rt2870 for FreeBSD 7.2

28.01.2010
AMRR bug fix in rt2870 for FreeBSD 8 (caused low Tx rates in 802.11n mode)
Improved debugging in rt2870 and rt2860

30.01.2010
rt2870 and rt2860 for FreeBSD 8 - Fixed bug with extended channel below central channel in HT40 mode
rt2860 for FreeBSD 8 - Fixed problem with DMA on amd64 architecture (Thanks a lot to sng84 for his help)

31.01.2010
Created GIT repository for all drivers.
Link: http://repo.or.cz/w/ralink_drivers.git
I will not post new driver versions here anymore !!! Use my GIT repository please.

11.02.2010
Deleted old drivers from forum, use my GIT repository please

Please report back bugs and problems, that's all i ask from you :e
Wireshark captures, log messages and problem descriptions would be nice to have :e

:e :e :e


----------



## mathuin (Dec 13, 2009)

You are my hero, dude.  I was this close to installing Xandros back on this thing, and now I can use the laptop the way it was designed to be used.  Wooo!


----------



## egorenar (Dec 13, 2009)

mathuin said:
			
		

> You are my hero, dude.  I was this close to installing Xandros back on this thing, and now I can use the laptop the way it was designed to be used.  Wooo!



Does it work on your PC ?


----------



## sim (Dec 14, 2009)

egorenar said:
			
		

> Hi,
> 
> the driver for rt2860 is already working
> 
> :e :e :e



Just found this thread, This is EPIC news!! :h At last I can continue my quest to run FreeBSD 8 on my EeePC 901 (RT2860).

Many thanks for your hard work, I (and many others I'm sure) appreciate it. As soon as I get a chance I'll give it a go and report back.

:beergrin

sim


----------



## ccc (Dec 30, 2009)

Howto install rt2860 on freeBSD 7.2?


----------



## egorenar (Dec 30, 2009)

ccc said:
			
		

> Howto install rt2860 on freeBSD 7.2?



Hi,

1. Extract the archive

```
$ tar xvjf rt2860_fbsd72.tar.bz2
```

2. Build the KLM

```
$ cd rt2860_fbsd72
$ make
```

3. Load the KLM

```
# kldload ./rt2860.ko
```


----------



## tim-m89 (Jan 2, 2010)

Hi I am getting ready to replace win-xp on my computer with freebsd 8.0 and I am hoping that I will be able to access the net fine with this driver. Has this been tested on an amd64 install of 8.0?


----------



## egorenar (Jan 2, 2010)

tim-m89 said:
			
		

> Hi I am getting ready to replace win-xp on my computer with freebsd 8.0 and I am hoping that I will be able to access the net fine with this driver. Has this been tested on an amd64 install of 8.0?



I tested my rt2860 (PCI) drivers only on Pentium 4 (fbsd 7.2 and 8) and rt2870 (USB) also on amd64 (fbsd 8, HOSTAP mode).

:e :e :e


----------



## greyulv (Jan 2, 2010)

Hello, Egorenar.  Downloaded the RT2860 driver and installed on my machine:
Asus EEEPC 1000H
PC-BSD 7.1.1 (FreeBSD 7.2 Stable)
AsureWave AW-NE766
Model: RT2700E

I am able to configure the card in the KDE network manager and my wireless hub can sense me.  The only problem is when I try to save the settings in the profile the machine freezes and the /etc/rc.conf is left blank thus forcing me to overwrite with a backup of the original.

The card is now autodetected.

Any help would be appreciated.

G


----------



## greyulv (Jan 2, 2010)

FYI: my pciconf ouput is similar to kvchung that you helped out on Dec 6 in this thread [thread=53681]postcount=75[/thread]


----------



## greyulv (Jan 2, 2010)

Sorry, http://forums.freebsd.org/showpost.php?p=53681&postcount=75


----------



## egorenar (Jan 2, 2010)

greyulv said:
			
		

> Sorry, http://forums.freebsd.org/showpost.php?p=53681&postcount=75



Did your system save the crash dump ?
Hm, i tested my driver only on FreeBSD 7.2 but not on PC BSD 7.1.1.
Is PC BSD 7.1.1 similar to FreeBSD 7.2 ?
Sorry, i don't use KDE , i configured my NIC in /etc/rc.conf and /etc/wpa_supplicant.conf with a text editor  Try to configure your card
without KDE, i can support you in that if you want


----------



## greyulv (Jan 2, 2010)

PC-BSD is a pre-configured installer that uses FreeBSD 7.2 stable.
Here is my ifconfig output

```
rt28600: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:22:43:5e:38:d8
        inet 192.168.254.110 netmask 0xffffff00 broadcast 192.168.254.255
        media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/36Mbps)
        status: associated
        ssid WIRELESSNET channel 11 (2462 Mhz 11g) bssid 00:e0:98:55:00:ae
        authmode WPA privacy ON deftxkey UNDEF TKIP 2:128-bit txpower 50
        bmiss 7 scanvalid 60 protmode CTS wme burst roaming MANUAL
```


----------



## egorenar (Jan 2, 2010)

greyulv said:
			
		

> PC-BSD is a pre-configured installer that uses FreeBSD 7.2 stable.
> Here is my ifconfig output
> 
> ```
> ...



I see that your NIC is associated and has an IP. I do not understand, what is the problem then ?
Did you try ping ?


----------



## greyulv (Jan 2, 2010)

I can use your driver but when I do I need to turn-off the wired card because I cannot use the default gateway setup in rc.conf. I have to manually add it then it works.


----------



## egorenar (Jan 2, 2010)

greyulv said:
			
		

> I can use your driver but when I do I need to turn-off the wired card because I cannot use the default gateway setup in rc.conf. I have to manually add it then it works.



Of course, you can't have 2 default gateways  Either you must disable the Ethernet NIC or you need to modify the routing table manually.

But you said in one of your previous posts that your system crashed. Did you figure out what was wrong ?

:e :e :e


----------



## greyulv (Jan 2, 2010)

No, must be when disabling the wired link and trying to bring up the wireless one.  Only happens in Desktop.  I have posted a link back to this thread from the PC-BSD forums.

G


----------



## egorenar (Jan 2, 2010)

greyulv said:
			
		

> No, must be when disabling the wired link and trying to bring up the wireless one.  Only happens in Desktop.  I have posted a link back to this thread from the PC-BSD forums.
> 
> G



And do not forget to send me bug reports, please. Thanks in advance.
And i wanted to stop development and support of rt2860 for
FreeBSD 7.2  It seems that it will not be the case now :e

:e :e :e


----------



## greyulv (Jan 2, 2010)

Will do.  The newest release of PC-BSD was released yesterday 8 (Beta) and is based on FreeBSD 8.

G


----------



## tim-m89 (Jan 3, 2010)

I tried "ifconfig rt28700 up" and that caused a kernel panick. Ifconfig shows the rt28700's status as "no carrier" and trying "ifconfig rt28700 192.168.2.102" says invalid argument.

Edit Solved:

The solution was to do "ifconfig wlan create wlandev rt28700" and then use the newly created wlan0 device instead.


----------



## greyulv (Jan 3, 2010)

Egorenar, here is my dmesg output:


```
Copyright (c) 1992-2009 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 7.2-STABLE #11: Wed Jun 24 18:36:21 EDT 2009
    root@build7x32.pcbsd.org:/usr/obj/pcbsd-build72/cvs/7.2-src/sys/PCBSD
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Atom(TM) CPU N270   @ 1.60GHz (1596.02-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x106c2  Stepping = 2
 Features=0xbfe9fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> 
  Features2=0x40c39d<SSE3,DTES64,MON,DS_CPL,EST,TM2,SSSE3,xTPR,PDCM,<b22>>
  AMD Features=0x100000<NX> 
  AMD Features2=0x1<LAHF>
  Logical CPUs per core: 2
[....]
rt28600: <Ralink RT2790 PCIe> mem 0xfbef0000-0xfbefffff irq 19 at device 0.0 on pci1
rt28600: attaching
rt28600: EEPROM rev=0x0102
rt28600: EEPROM mac address=00:22:43:5e:38:d8
rt28600: EEPROM RF rev=0x0003, paths=1T2R
rt28600: EEPROM NIC config: Tx AGC control=0, ext LNA gains=0/0
rt28600: EEPROM country code=1/7
rt28600: EEPROM freq offset=0x23
rt28600: EEPROM led cntl=0x01, LEDs=0xffff/0x9ad9/0xc8cc
rt28600: EEPROM LNA gains=0x00/0xff
rt28600: invalid EEPROM LNA gain: 2
rt28600: invalid EEPROM LNA gain: 3
rt28600: EEPROM Tx power compensation deltas=0(2MHz), 0(5MHz)
rt28600: EEPROM Tx power compensation #0=0x66663333(20MHz), 0x66663333(40MHz/2GHz), 0x66663333(40MHz/5GHz)
rt28600: EEPROM Tx power compensation #1=0x66666666(20MHz), 0x66666666(40MHz/2GHz), 0x66666666(40MHz/5GHz)
rt28600: EEPROM Tx power compensation #2=0x33333333(20MHz), 0x33333333(40MHz/2GHz), 0x33333333(40MHz/5GHz)
rt28600: EEPROM Tx power compensation #3=0x66663333(20MHz), 0x66663333(40MHz/2GHz), 0x66663333(40MHz/5GHz)
rt28600: EEPROM Tx power compensation #4=0xffff6666(20MHz), 0xffff6666(40MHz/2GHz), 0xffff6666(40MHz/5GHz)
rt28600: EEPROM TSSI 2GHz: 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, step=255
rt28600: EEPROM TSSI 5GHz: 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, step=255
rt28600: invalid EEPROM powersave level
rt28600: EEPROM powersave level=0x00ff
rt28600: MAC/BBP RT2860 (rev 0x28720200), RF RT2720
rt28600: Ethernet address: 00:22:43:5e:38:d8
rt28600: [ITHREAD]
[...]
rt28600: initializing
rt28600: loading 8051 microcode
rt28600: 8051 microcode was successfully loaded
rt28600: stopping
rt28600: initializing
rt28600: stopping
rt28600: initializing
rt28600: stopping
[...]
rt28600: initializing
rt28600: link state changed to UP
```

The card works but I am curious why it initializes multiple times?

G


----------



## egorenar (Jan 3, 2010)

greyulv said:
			
		

> Egorenar, here is my dmesg output:
> 
> 
> ```
> ...



Every time you or wpa_supplicant do "ifconfig up" or "ifconfig down" the NIC is initialized or stopped. It is OK.


----------



## tim-m89 (Jan 7, 2010)

My computer has been crashing at random times during the night. I have no idea what the cause is yet as I only installed freebsd on it because of this driver being available rather than crashing since I installed this driver. It could also be the latest nvidia driver (the first to support amd-64) or something completely different. Anyway here is a snippet of the dmesg on one of the crashes. The cipher error actually repeats a lot:


```
rt28700: rxinfo: cipher error=0x01
rt28700: rxinfo: cipher error=0x01
rt28700: rxinfo: cipher error=0x01
rt28700: rxinfo: cipher error=0x01
rt28700: rxinfo: cipher error=0x01
rt28700: rxinfo: cipher error=0x01
rt28700: rxinfo: cipher error=0x01
rt28700: rxinfo: cipher error=0x01
wlan0: link state changed to UP
rt28700: rxinfo: cipher error=0x01
wlan0: link state changed to DOWN
Sleeping thread (tid 100104, pid 514) owns a non-sleepable lock
panic: sleeping thread
cpuid = 0
Uptime: 12h22m55s
Cannot dump. Device not defined or unavailable.
Automatic reboot in 15 seconds - press a key on the console to abort
Rebooting...
cpu_reset: Stopping other CPUs
```

How is this driver going for everybody else? I am trying to figure out if this was a coincidence.


----------



## egorenar (Jan 7, 2010)

tim-m89 said:
			
		

> My computer has been crashing at random times during the night. I have no idea what the cause is yet as I only installed freebsd on it because of this driver being available rather than crashing since I installed this driver. It could also be the latest nvidia driver (the first to support amd-64) or something completely different. Anyway here is a snippet of the dmesg on one of the crashes. The cipher error actually repeats a lot:
> 
> 
> ```
> ...



It is a rt28700 problem.
Which mode do you use with rt2870 ?
Crash dump would be very useful to help me fix this bug.

"rt28700: rxinfo: cipher error=0x01" means that there were errors during frame decryption. Maybe wrong key.


----------



## tim-m89 (Jan 8, 2010)

egorenar said:
			
		

> It is a rt28700 problem.
> Which mode do you use with rt2870 ?



I am not how you mean exactly but this is what I have in rc.conf:


```
wlans_rt28700="wlan0"
ifconfig_wlan0="WPA inet 192.168.2.110 netmask 255.255.255.0 country NZ"
defaultrouter="192.168.2.1"
```



			
				egorenar said:
			
		

> Crash dump would be very useful to help me fix this bug.



Read that It says "Cannot dump. Device not defined or unavailable"



			
				egorenar said:
			
		

> "rt28700: rxinfo: cipher error=0x01" means that there were errors during frame decryption. Maybe wrong key.



The key is correct and not changing and I am using the net a lot with it.

Also this is not something that is easy to reproduce. I didn't think that the user app 'transmission' could cause this by itself but when it's going it is making hundreds of connections so I guess it could be stress testing the wifi driver?


----------



## egorenar (Jan 8, 2010)

tim-m89 said:
			
		

> I am not how you mean exactly but this is what I have in rc.conf:
> 
> 
> ```
> ...



Thanks for feedback. I appreciate it.

You are using STA mode.

Do you have swap device, you could define it as crash dump device


----------



## Halt (Jan 9, 2010)

*Rt2760*

Hi, I have wifi chipset RT2760, for this chipset uses ralink driver rt2860. But your driver does not find this chipset.


```
[gw] /home/wtf# kldstat
Id Refs Address            Size     Name
 1   11 0xffffffff80100000 8f4ad8   kernel
 2    1 0xffffffff809f5000 1aa18    rt2860.ko
 3    1 0xffffffff80c22000 1c3a7    linux.ko
[gw] /home/wtf# uname -a
FreeBSD gw.loc 8.0-RELEASE-p1 FreeBSD 8.0-RELEASE-p1 #0: Wed Dec 30 21:49:11 MSK 2009     root@gw.loc:/usr/obj/usr/src/sys/ROUTER  amd64
[gw] /home/wtf# pciconf -lvcb
...
none2@pci0:4:0:0:       class=0x028000 card=0x27601814 chip=0x07011814 rev=0x00 hdr=0x00
    vendor     = 'Ralink Technology, Corp'
    class      = network
    bar   [10] = type Memory, range 32, base 0xd0400000, size 65536, enabled
    cap 01[40] = powerspec 3  supports D0 D3  current D0
...
```

Thank you!


----------



## egorenar (Jan 9, 2010)

Halt said:
			
		

> Hi, I have wifi chipset RT2760, for this chipset uses ralink driver rt2860. But your driver does not find this chipset.
> 
> 
> ```
> ...



Wait a minute, i will add your PCI IDs to my driver.
I uploaded the new version of driver. Test it please.


----------



## Halt (Jan 10, 2010)

egorenar said:
			
		

> Wait a minute, i will add your PCI IDs to my driver.
> I uploaded the new version of driver. Test it please.



Hi, while I can not tested work in client mode, hostap mod does not work.


```
rt28600: <Ralink RT2760 PCI> mem 0xd0400000-0xd040ffff irq 17 at device 0.0 on pci4                                                             
rt28600:attaching                                                
rt28600: EEPROM rev=0x0102                                                       
rt28600: EEPROM mac address=00:06:4f:76:3d:7b                                        
rt28600: EEPROM RF rev=0x0003, paths=1T2R                                                       
rt28600: EEPROM NIC config: HW radio cntl=0, Tx AGC cntl=0, ext LNA gains=0/0                                                        
rt28600: EEPROM country code=255/255                                                     
rt28600: EEPROM freq offset=0x28                                                      
rt28600: EEPROM LED cntl=0x01, LEDs=0x5555/0x9e99/0x8d88                                                          
rt28600: EEPROM LNA gains=0x00/0xff                                                  
rt28600: invalid EEPROM LNA gain: 2                                                                
rt28600: invalid EEPROM LNA gain: 3                                                                
rt28600: EEPROM Tx power compensation deltas=0(2MHz), 0(5MHz)                                                          
rt28600: EEPROM Tx power compensation #0=0xaacc6666(20MHz), 0xaacc6666(40MHz/2GHz), 0xaacc6666(40MHz/5GHz)                                           
rt28600: EEPROM Tx power compensation #1=0xaacc6688(20MHz), 0xaacc6688(40MHz/2GHz), 0xaacc6688(40MHz/5GHz)                                           
rt28600: EEPROM Tx power compensation #2=0xaacc6688(20MHz), 0xaacc6688(40MHz/2GHz), 0xaacc6688(40MHz/5GHz)                                           
rt28600: EEPROM Tx power compensation #3=0xaacc6688(20MHz), 0xaacc6688(40MHz/2GHz), 0xaacc6688(40MHz/5GHz)                                           
rt28600: EEPROM Tx power compensation #4=0xffff6688(20MHz), 0xffff6688(40MHz/2GHz), 0xffff6688(40MHz/5GHz)                                           
rt28600: EEPROM TSSI 2GHz: 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, step=255                                                         
rt28600: EEPROM TSSI 5GHz: 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, step=255                                                         
rt28600: invalid EEPROM powersave level                                                            
rt28600: EEPROM powersave level=0x00ff                                                     
rt28600: MAC/BBP RT2860 (rev 0x28600102), RF RT2720                                                           
rt28600: [ITHREAD]
```


```
[gw] /home/wtf# cat /etc/rc.conf
wlans_rt28600="wlan0"
ifconfig_wlan0="inet 192.168.33.1 netmask 255.255.255.0 ssid FREE country RU"


ifconfig
...
rt28600: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:06:4f:76:3d:7b
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
        status: associated
wlan0: flags=8c43<UP,BROADCAST,RUNNING,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:06:4f:76:3d:7b
        inet 192.168.33.1 netmask 0xffffff00 broadcast 192.168.33.255
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        ssid FREE channel 4 (2427 Mhz 11g)
        country US authmode OPEN privacy OFF txpower 0 bmiss 7 scanvalid 60
        protmode CTS wme burst bintval 0


[gw] /home/wtf# ifconfig wlan0 inet 192.168.33.1 netmask 255.255.255.0 ssid FREE mode 11g mediaopt hostap
ifconfig: SIOCSIFMEDIA (media): Device not configured
[gw] /home/wtf# ifconfig wlan0 list caps
drivercaps=4f85ed01<STA,IBSS,HOSTAP,AHDEMO,TXPMGT,SHSLOT,SHPREAMBLE,MONITOR,MBSS,WPA1,WPA2,BURST,WME,WDS,TXFRAG>
cryptocaps=1b<WEP,TKIP,AES_CCM,TKIPMIC>
[gw] /home/wtf# ifconfig -m wlan0
wlan0: flags=8c43<UP,BROADCAST,RUNNING,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:06:4f:76:3d:7b
        inet 192.168.33.1 netmask 0xffffff00 broadcast 192.168.33.255
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
        status: no carrier
        supported media:
                <unknown subtype>
                <unknown subtype>
                media autoselect mode 11ng
                media OFDM/54Mbps mode autoselect
                media OFDM/48Mbps mode autoselect
                media OFDM/36Mbps mode autoselect
                media OFDM/24Mbps mode autoselect
                media OFDM/18Mbps mode autoselect
                media OFDM/12Mbps mode autoselect
                media OFDM/9Mbps mode autoselect
                media OFDM/6Mbps mode autoselect
                media DS/11Mbps mode autoselect
                media DS/5.5Mbps mode autoselect
                media DS/2Mbps mode autoselect
                media DS/1Mbps mode autoselect
                media OFDM/54Mbps mode 11g
                media OFDM/48Mbps mode 11g
                media OFDM/36Mbps mode 11g
                media OFDM/24Mbps mode 11g
                media OFDM/18Mbps mode 11g
                media OFDM/12Mbps mode 11g
                media OFDM/9Mbps mode 11g
                media OFDM/6Mbps mode 11g
                media DS/11Mbps mode 11g
                media DS/5.5Mbps mode 11g
                media DS/2Mbps mode 11g
                media DS/1Mbps mode 11g
                media autoselect mode 11g
                media DS/11Mbps mode 11b
                media DS/5.5Mbps mode 11b
                media DS/2Mbps mode 11b
                media DS/1Mbps mode 11b
                media autoselect mode 11b
                media autoselect mode autoselect
        ssid FREE channel 11 (2462 Mhz 11g)
        country US authmode OPEN privacy OFF txpower 0 bmiss 7 scanvalid 60
        protmode CTS wme burst bintval 0
```


----------



## Halt (Jan 10, 2010)

These settings solved the problem with hostap.


```
create_args_wlan0="wlanmode hostap mode 11g"
```

Works greate. But only mode 11g, not mode 11ng.


```
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:06:4f:76:3d:7b
        inet 192.168.33.1 netmask 0xffffff00 broadcast 192.168.33.255
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11ng <hostap> (autoselect <hostap>)
        status: no carrier
        ssid "FREE " channel 1 (2412 Mhz 11b)
        country US authmode OPEN privacy OFF txpower 0 scanvalid 60 wme burst
        dtimperiod 1 -dfs

...

wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500                          
        ether 00:06:4f:76:3d:7b                                                                      
        inet 192.168.33.1 netmask 0xffffff00 broadcast 192.168.33.255                                
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap>                            
        status: running                                                                              
        ssid "FREE " channel 1 (2412 Mhz 11g) bssid 00:06:4f:76:3d:7b                                
        country US authmode OPEN privacy OFF txpower 0 scanvalid 60                                  
        protmode CTS wme burst dtimperiod 1 -dfs                                                     
[gw] /home/wtf# ifconfig -m wlan0                                                                    
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500                          
        ether 00:06:4f:76:3d:7b                                                                      
        inet 192.168.33.1 netmask 0xffffff00 broadcast 192.168.33.255                                
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap>                            
        status: running                                                                              
        supported media:                                                                             
                <unknown subtype>                                                                    
                <unknown subtype>                                                                    
                media autoselect mode 11ng mediaopt hostap                                           
                media OFDM/54Mbps mode autoselect mediaopt hostap                                    
                media OFDM/48Mbps mode autoselect mediaopt hostap                                    
                media OFDM/36Mbps mode autoselect mediaopt hostap                                    
                media OFDM/24Mbps mode autoselect mediaopt hostap                                    
                media OFDM/18Mbps mode autoselect mediaopt hostap                                    
                media OFDM/12Mbps mode autoselect mediaopt hostap                                    
                media OFDM/9Mbps mode autoselect mediaopt hostap                                     
                media OFDM/6Mbps mode autoselect mediaopt hostap                                     
                media DS/11Mbps mode autoselect mediaopt hostap                                      
                media DS/5.5Mbps mode autoselect mediaopt hostap                                     
                media DS/2Mbps mode autoselect mediaopt hostap                                       
                media DS/1Mbps mode autoselect mediaopt hostap                                       
                media OFDM/54Mbps mode 11g mediaopt hostap                                           
                media OFDM/48Mbps mode 11g mediaopt hostap                                           
                media OFDM/36Mbps mode 11g mediaopt hostap                                           
                media OFDM/24Mbps mode 11g mediaopt hostap                                           
                media OFDM/18Mbps mode 11g mediaopt hostap                                           
                media OFDM/12Mbps mode 11g mediaopt hostap                                           
                media OFDM/9Mbps mode 11g mediaopt hostap                                            
                media OFDM/6Mbps mode 11g mediaopt hostap                                            
                media DS/11Mbps mode 11g mediaopt hostap                                             
                media DS/5.5Mbps mode 11g mediaopt hostap                                            
                media DS/2Mbps mode 11g mediaopt hostap                                              
                media DS/1Mbps mode 11g mediaopt hostap                                              
                media autoselect mode 11g mediaopt hostap                                            
                media DS/11Mbps mode 11b mediaopt hostap                                             
                media DS/5.5Mbps mode 11b mediaopt hostap                                            
                media DS/2Mbps mode 11b mediaopt hostap                                              
                media DS/1Mbps mode 11b mediaopt hostap                                              
                media autoselect mode 11b mediaopt hostap                                            
                media autoselect mode autoselect mediaopt hostap                                     
        ssid "FREE " channel 1 (2412 Mhz 11g) bssid 00:06:4f:76:3d:7b                                
        country US authmode OPEN privacy OFF txpower 0 scanvalid 60                                  
        protmode CTS wme burst dtimperiod 1 -dfs
```


----------



## egorenar (Jan 10, 2010)

Halt said:
			
		

> These settings solved the problem with hostap.
> 
> 
> ```
> ...



HOSTAP configuration is a little different on FreeBSD 8.
I had no opportunity to test my driver with rt2760 chip, so
it is very good that you can test it now. Thanks for feedback.

Yeah, i know, 802.11n is still work in progress :e

Please send me any bug and problem reports.
Thanks.

:e :e :e


----------



## gallon (Jan 18, 2010)

Thank you Egorenar!

Shame on me I wasted a day trying to get my rt2860 up directly :r

Using config via wlan everything works okay (n.b. on 9.0-CURRENT@i386).

Thx again. EEE is nothing without WiFi (or a gprs modem when in the country, hehe!)!


----------



## egorenar (Jan 24, 2010)

I have finally added 802.11n support to rt2860 and rt2870 device drivers on FreeBSD 8 !!! :e
It is working but still has some issues.
HT 20MHz und 40MHz, A-MSDU, short GI are supported.
A-MPDU and BlockAcks are still not supported.

I'm actually surfing with HT40 mode but transfer rate is still not very good :-(

The best transfer rate i got till now was 4.2 Mbyte /s 

I will test it a bit more and try to fix the problems.
Then i will upload it here. But i need your feedback.
Please send me bug and problem reports.
Till now only 2-3 users sent me feedback regularly.

:e :e :e


----------



## code7395 (Jan 24, 2010)

Great job
Please add this Trendnet TEW-644UB


----------



## egorenar (Jan 24, 2010)

code7395 said:
			
		

> Great job
> Please add this Trendnet TEW-644UB



I need USB vendor and product ID of your NIC.


----------



## code7395 (Jan 24, 2010)

sorry,
vid: 0x148f
pid: 0x2770

thanks


----------



## egorenar (Jan 24, 2010)

code7395 said:
			
		

> sorry,
> vid: 0x148f
> pid: 0x2770
> 
> thanks



You have Ralink RT2770 chip. The driver should support this chip.

:e :e :e


----------



## code7395 (Jan 24, 2010)

fine,
I compiled the two versions (fbsd8_amd64 + fbsd7.2_i386) over last days
when trying to apply (rc.conf, ifconfig,netif restart..) suggestions on this topic my device remains recognized as ugen0 and never comes up.

also, rt 28700 does not exist when i ifconfig-it, neitheir does wlan0, assigned by rc.conf
can you think of a solution for my case.

although i do the testings on both fbsd72i386 and pfsense 1.2.3, my need is to get it to work with pfsense.
please help
:\


----------



## code7395 (Jan 24, 2010)

if i just get it to work on freebsd the matter of pfsense is as easy as uploading the compiled module and kldloading it (that's not the problem)


----------



## egorenar (Jan 24, 2010)

code7395 said:
			
		

> if i just get it to work on freebsd the matter of pfsense is as easy as uploading the compiled module and kldloading it (that's not the problem)



The driver should support it but i still need to add your device IDs or else it will not be detected.

I uploaded the new driver version with 802.11n support and added your chip. Please test it and provide feedback. Thanks.

Link: http://forums.freebsd.org/showpost.php?p=55365

:e :e :e


----------



## code7395 (Jan 24, 2010)

thanks,
i'll give feedback as soon as am finished with testing


----------



## code7395 (Jan 24, 2010)

ok, minor err with usb

```
ugen0.2: <Ralink> at usbus0
rt28700: <1.0> on usbus0
rt28700: attaching
rt28700: could not allocate USB transfers: error=USB_ERR_NO_PIPE
device_attach: rt28700 attach returned 6
rt28700: <1.0> on usbus0
rt28700: attaching
rt28700: could not allocate USB transfers: error=USB_ERR_NO_PIPE
device_attach: rt28700 attach returned 6
uhub_explore:611: illegal enable change, port 1
```
any thoughts


----------



## egorenar (Jan 24, 2010)

code7395 said:
			
		

> ok, minor err with usb
> 
> ```
> ugen0.2: <Ralink> at usbus0
> ...



OK, we need to find out how many endpoints your device has.

1. # usbconfig -u 0 -a 2 -i 0 dump_all_config_desc

And post the result of the command here please.


----------



## code7395 (Jan 24, 2010)

```
ugen0.2: <802.11 n WLAN Ralink> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON


 Configuration index 0

    bLength = 0x0009 
    bDescriptorType = 0x0002 
    wTotalLength = 0x0035 
    bNumInterfaces = 0x0001 
    bConfigurationValue = 0x0001 
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x0080 
    bMaxPower = 0x00e1 

    Interface 0
      bLength = 0x0009 
      bDescriptorType = 0x0004 
      bInterfaceNumber = 0x0000 
      bAlternateSetting = 0x0000 
      bNumEndpoints = 0x0005 
      bInterfaceClass = 0x00ff 
      bInterfaceSubClass = 0x00ff 
      bInterfaceProtocol = 0x00ff 
      iInterface = 0x0005  <1.0>

     Endpoint 0
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0081 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 1
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0001 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 2
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0002 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 3
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0003 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

     Endpoint 4
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0004 
        bmAttributes = 0x0002 
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000
```


----------



## egorenar (Jan 24, 2010)

code7395 said:
			
		

> ```
> ugen0.2: <802.11 n WLAN Ralink> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
> 
> 
> ...



Aha, as i thought, your device has 5 endpoints but my rt2870 chip has 7 endpoints. I need to investigate that.

I will give you a feedback later when i'm done.

Did you try if_run driver ? You can find it in another forum here.

:e :e :e


----------



## code7395 (Jan 24, 2010)

maybe this could help: usb in a nutshell


----------



## code7395 (Jan 24, 2010)

out of purpose,ralink on linux


----------



## egorenar (Jan 24, 2010)

code7395 said:
			
		

> out of purpose,ralink on linux



Don't worry. I have already found a solution. I just need a bit of time to implement it.

:e :e :e


----------



## egorenar (Jan 24, 2010)

code7395 said:
			
		

> ```
> ugen0.2: <802.11 n WLAN Ralink> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
> 
> 
> ...



My device has 7 endpoints: 1 Rx queue and 6 Tx queue (4 EDCA + MGMT + HCCA). Your device has 5 endpoints: 1 Rx queue and
4 Tx queues (4 EDCA). Your device doesn't have MGMT and HCCA Tx queues but it is not a problem because HCCA queue is never used and MGMT queue can be replaced by one of the EDCA Tx queues. The Linux driver does this in that way 

Wait a minute and i'm going to update the driver.

:e :e :e


----------



## egorenar (Jan 24, 2010)

OK, i fixed the driver rt2870 (FreeBSD 8) so that it should not have any problems with devices that have only 5 USB endpoints. Please test it.


----------



## code7395 (Jan 24, 2010)

beein on the way


----------



## egorenar (Jan 24, 2010)

code7395 said:
			
		

> beein on the way



Download the driver again because i found an error in it that could crash your computer. Sorry.

:e :e :e


----------



## code7395 (Jan 24, 2010)

after pugging the device in i get this

```
rt28700: invalid EEPROM LNA gain #2: 0x00
rt28700: invalid EEPROM LNA gain #3: 0x00
rt28700: EEPROM LNA gains=0x00/0xff/0xff/0xff
rt28700: EEPROM RSSI offsets 2GHZ=0/0/0
rt28700: EEPROM RSSI offsets 5GHZ=0/0/0
RT28700: EEPROM Tx power per rate deltas=0(2MHz), 0(5MHz)
RT28700: EEPROM Tx power per rate #0=0xaaaa4444(20MHz), 0xaaaa4444(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
RT28700: EEPROM Tx power per rate #1=0xaaaa4444(20MHz), 0xaaaa4444(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
RT28700: EEPROM Tx power per rate #2=0xaaaa4444(20MHz), 0xaaaa4444(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
RT28700: EEPROM Tx power per rate #3=0xaaaa4444(20MHz), 0xaaaa4444(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
RT28700: EEPROM Tx power per rate #4=0xaaaa4444(20MHz), 0xaaaa4444(40MHz/2GHz), 0xaaaa6688(40MHz/5GHz)
rt28700: EEPROM TSSI offsets 2GHZ: 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, step=255
rt28700: EEPROM TSSI offsets 5GHZ: 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, step=255
rt28700:MAC/BBP RT2870 (rev 0x28720202), RF RT2720
rt28700: skip channel 10, could not find extension channel
rt28700: skip channel 11, could not find extension channel
rt28700: skip channel 12, could not find extension channel
rt28700: skip channel 13, could not find extension channel
rt28700: skip channel 14, could not find extension channel
uhub_explore:611: illegal enable change, port 2
```
even though, when i do ifconfig i see rt28700 beeing present

```
rt28700: flags=8802<BROADCAST,SIMPLEX,MULTICAST> METRIC 0MTU 2290
        ether <XX:XX:XX:XX:XX:XX>
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
```
does that show any problem
anyway,
Thank you for this big effort, and wish you could make it compatible for 7.2 i386


----------



## code7395 (Jan 24, 2010)

Doh! didn't see your last post
will do


----------



## code7395 (Jan 24, 2010)

crashed already


----------



## egorenar (Jan 24, 2010)

code7395 said:
			
		

> after pugging the device in i get this
> 
> ```
> rt28700: invalid EEPROM LNA gain #2: 0x00
> ...



Everything is OK, it's only debug messages, the driver is loaded.
WLAN works on FreeBSD 8 a bit different then on FreeBSD 7.
You need to create a wlan device:

# ifconfig wlan0 create wlandev rt28700 wlanmode sta up

And you also have to configure wpa_supplicant if you want to use security in your WLAN. 

And don't worry i'm going to modify the rt2870 driver for FreeBSD 7.2 next week so that it will support your device.
That is if i have time because Mass Effect 2 is coming next week 

:e :e :e


----------



## code7395 (Jan 24, 2010)

Thank u
will keep in touch


----------



## code7395 (Jan 24, 2010)

what is "Mass Effect 2"


----------



## code7395 (Jan 24, 2010)

maybe if i know it i could erase it so u get more time to teach dumb people like i am :e :stud


----------



## egorenar (Jan 24, 2010)

code7395 said:
			
		

> what is "Mass Effect 2"



Mass Effect 2 is a game, RPG for PC and Xbox 360.
It has nothing with WLAN to do :e

:e :e :e


----------



## code7395 (Jan 24, 2010)

fine,
back in trouble till than,
when i was trying to create wlan0 with ifconfig like u suggested, something went wrong and my machine rebooted. any thoughts
/var/log/messages complaints about

```
kernel: Fatal trap 12: page fault while in kernel mode
kernel: cpuid = 0; apic id = 00
kernel: fault virtual adress    = 0xb0
kernel: fault code              = supervisor write data, page not present
```
...


----------



## egorenar (Jan 24, 2010)

code7395 said:
			
		

> fine,
> back in trouble till than,
> when i was trying to create wlan0 with ifconfig like u suggested, something went wrong and my machine rebooted. any thoughts
> /var/log/messages complaints about
> ...



Unfortunately, I cannot test your device by myself but if you are willing we can do it together.
First, it would be good if you could add debugger support to your kernel and recompile it. With debugger it is easier to find problems because the message you posted doesn't say anything to me :e


----------



## DutchDaemon (Jan 24, 2010)

Guys, take a breath, or switch to a messenger or IRC. You're turning this into a chatbox.


----------



## code7395 (Jan 24, 2010)

after reboot , doing a netif restart brings this:

```
rt28700: initializing
rt28700: loading 8051 microcode
rt28700: 8051 microcode was successfully loaded

Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual adress    = 0x520
fault code              = supervisor write data, page not present
instruction pointer     = 0x20:0xffffffff81024ab9
stack pointer           = 0x28:0xffffff800a83a8c0
frame pointer           = 0x28:0xffffff800a83a8f0
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 1405 (ifconfig)
trap number             = 12
panic: page fault
cpuid = 0
Uptime: 16m29s
Cannot dump. Device not defined or unavailable.
Automatic reboot in 15 seconds - press a key on the console to abort
--> Press a key on the console to reboot,
--> or switch off the system now.
```


----------



## code7395 (Jan 24, 2010)

sorry mate, soon we'll be tired and maybe dead on the forum 
:e:e:e


----------



## egorenar (Jan 24, 2010)

code7395 said:
			
		

> fine,
> back in trouble till than,
> when i was trying to create wlan0 with ifconfig like u suggested, something went wrong and my machine rebooted. any thoughts
> /var/log/messages complaints about
> ...



OK, already fixed the problem and teste it. It works for me with only 5 endpoints. Download the driver again.

OK, if you have other questions or problems just send them to my ICQ account.


----------



## code7395 (Jan 24, 2010)

dear moderator , i promise i will get a chat alternative after this. sorry.
egorenar till i get an icq touch, please review ur code, now it doesen't wait for if config to show the panic message above and reboot the system, it does it as soon as i plug the device in.

sorry mod.


----------



## egorenar (Jan 24, 2010)

code7395 said:
			
		

> dear moderator , i promise i will get a chat alternative after this. sorry.
> egorenar till i get an icq touch, please review ur code, now it doesen't wait for if config to show the panic message above and reboot the system, it does it as soon as i plug the device in.
> 
> sorry mod.



Sorry, i uploaded the wrong version. Please try again.

:e :e :e


----------



## code7395 (Jan 24, 2010)

same error


----------



## code7395 (Jan 24, 2010)

please get ur icq on


----------



## greyulv (Jan 26, 2010)

Hey egorenar

Looking forward for the 7.2 support for 802.11n and rt2860.  Got a new N++ router last week.

G


----------



## egorenar (Jan 26, 2010)

greyulv said:
			
		

> Hey egorenar
> 
> Looking forward for the 7.2 support for 802.11n and rt2860.  Got a new N++ router last week.
> 
> G



I'm going to add 802.11n support to rt2870 and rt2860 for FreeBSD 7.2 this week.

:e :e :e


----------



## yandzee (Jan 26, 2010)

I can't configure connection with y router. Help please. 

```
ifconfig rt28600 ssid my_router wepmode on wepkey my_key authmode shared
ifconfig inet 192.168.1.100 net mask 255.255.255.0
```
Not connect.
I use WEP Shared connection!


----------



## yandzee (Jan 26, 2010)

Or connect but ping google.com doesn't work.


----------



## egorenar (Jan 26, 2010)

yandzee said:
			
		

> Or connect but ping google.com doesn't work.



You also need to adjust your routing table.
What says "netstat -rn" ?


----------



## egorenar (Jan 26, 2010)

yandzee said:
			
		

> I can't configure connection with y router. Help please.
> 
> ```
> ifconfig rt28600 ssid my_router wepmode on wepkey my_key authmode shared
> ...



You cannot do it on FreeBSD 8.
First you have to create a wlan interface, e.g. wlan0

Example:


```
ifconfig wlan0 create wlandev rt28600 wlanmode sta
```

After that you can configure the wlan interface:


```
ifconfig wlan0 ssid my_router wepmode on wepkey my_key authmode shared
ifconfig wlan0 inet 192.168.1.100 net mask 255.255.255.0
```

See also this: http://forums.freebsd.org/showthread.php?t=8784

:e :e :e


----------



## mpranj (Jan 27, 2010)

*:O*

I almost gave up on this... But as far as I see there is *progress* here    Any chance this may be included in a future official version of freebsd?


----------



## egorenar (Jan 27, 2010)

Does anybody have any idea where i can find net80211 mailing list or IRC. I have some questions regarding 802.11n stack implementation in FreeBSD and i don't know whom to ask.

:e :e :e


----------



## tim-m89 (Jan 27, 2010)

egorenar said:
			
		

> Does anybody have any idea where i can find net80211 mailing list or IRC. I have some questions regarding 802.11n stack implementation in FreeBSD and i don't know whom to ask.
> 
> :e :e :e



http://lists.freebsd.org/mailman/listinfo/freebsd-net

others


----------



## yandzee (Jan 27, 2010)

```
ifconfig wlan0 create wlandev rt28600 wlanmode sta
ifconfig:SIOCIFCREATE2: Invalid argument
```


----------



## egorenar (Jan 27, 2010)

yandzee said:
			
		

> ifconfig wlan0 create wlandev rt28600 wlanmode sta
> ifconfig:SIOCIFCREATE2: Invalid argument



Are you using FBSD 7 or FBSD 8 ?


----------



## yandzee (Jan 27, 2010)

egorenar said:
			
		

> Are you using FBSD 7 or FBSD 8 ?


FreeBSD 7.2 RELEASE


----------



## egorenar (Jan 27, 2010)

egorenar said:
			
		

> Of course, you can't have 2 default gateways  Either you must disable the Ethernet NIC or you need to modify the routing table manually.
> 
> But you said in one of your previous posts that your system crashed. Did you figure out what was wrong ?
> 
> :e :e :e





			
				yandzee said:
			
		

> FreeBSD 7.2 RELEASE



OK, then forget about "ifconfig create", it's only for FBSD 8.
You have problems with routing ?
What says "netstat -nr" ?

:e


----------



## yandzee (Jan 27, 2010)

egorenar said:
			
		

> OK, then forget about "ifconfig create", it's only for FBSD 8.
> You have problems with routing ?
> What says "netstat -nr" ?
> 
> :e



ifconfig

```
ale0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=319b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MCAST,WOL_MAGIC>
	ether 00:23:54:63:50:a6
	media: Ethernet autoselect (none)
	status: no carrier
rt28600: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 00:22:43:4a:47:2d
	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
	status: no carrier
	ssid "" channel 1 (2412 Mhz 11b)
	authmode OPEN privacy OFF txpower 50 bmiss 7 scanvalid 60 wme burst
	bintval 0
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 
	inet6 ::1 prefixlen 128 
	inet 127.0.0.1 netmask 0xff000000
```

netstat -nr 


```
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
127.0.0.1          127.0.0.1          UH          0        0    lo0

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::1                               ::1                           UHL         lo0
fe80::%lo0/64                     fe80::1%lo0                   U           lo0
fe80::1%lo0                       link#3                        UHL         lo0
ff01:3::/32                       fe80::1%lo0                   UC          lo0
ff02::%lo0/32                     fe80::1%lo0                   UC          lo0
```


----------



## egorenar (Jan 27, 2010)

yandzee said:
			
		

> ifconfig
> 
> ```
> ale0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
> ...



status: no carrier

Your rt28600 device is not associtaed with an AP.
Are you using wpa_supplicant to associate ?


----------



## yandzee (Jan 27, 2010)

egorenar said:
			
		

> status: no carrier
> 
> Your rt28600 device is not associtaed with an AP.
> Are you using wpa_supplicant to associate ?


I can set up rt28600.
status: associated 

ping google.com is not working.


----------



## yandzee (Jan 27, 2010)

What is AP mode?
how to set up wpa_supplicant?
need authmode shared


----------



## egorenar (Jan 27, 2010)

yandzee said:
			
		

> What is AP mode?
> how to set up wpa_supplicant?
> need authmode shared



Write to my ICQ or Jabber account, then i could help you faster.


----------



## yandzee (Jan 27, 2010)

egorenar said:
			
		

> Write to my ICQ or Jabber account, then i could help you faster.



What is you icq number?


----------



## egorenar (Jan 27, 2010)

yandzee said:
			
		

> What is you icq number?



See my profile.


----------



## tim-m89 (Jan 28, 2010)

I tried using the latest 1 and did a reboot to see how it would normally start. That caused a kernel panic on boot.

I'm sticking with an older version that I backed up. (I said on page 4 that I was getting random crashed - those are still happening, don't know the cause and memcheck reports fine)

Can you host it off site with all version available with as much info on the changes as possible? It would be much easy than going to page 3 each time to get some version that could have breaking changes.

My AP is configure for b+g+n & wpa1_aes + wpa2_aes.

It would have used G last time so maybe now that it's trying to use N that could be were the buggy code is at?

Also if there are any ways non-financialy I can help just ask.


----------



## egorenar (Jan 28, 2010)

tim-m89 said:
			
		

> I tried using the latest 1 and did a reboot to see how it would normally start. That caused a kernel panic on boot.
> 
> I'm sticking with an older version that I backed up. (I said on page 4 that I was getting random crashed - those are still happening, don't know the cause and memcheck reports fine)
> 
> ...



Yeah, 802.11n AP not tested yet, i only tested 802.11n a little bit in STA mode.

You could help me a lot by enabling debugger in your kernel, then you could send me crash dumps. It would help me a lot to find bugs.


----------



## egorenar (Jan 28, 2010)

tim-m89 said:
			
		

> I tried using the latest 1 and did a reboot to see how it would normally start. That caused a kernel panic on boot.
> 
> I'm sticking with an older version that I backed up. (I said on page 4 that I was getting random crashed - those are still happening, don't know the cause and memcheck reports fine)
> 
> ...



Which FreeBSD version are you using ?


----------



## egorenar (Jan 28, 2010)

tim-m89 said:
			
		

> Can you host it off site with all version available with as much info on the changes as possible? It would be much easy than going to page 3 each time to get some version that could have breaking changes.



Yes, you are probably right and i need git repository or something like that. But it is not priority 1 now.

:e :e :e


----------



## tim-m89 (Jan 29, 2010)

freebsd 8 amd64 is the version I am using. I will look into debugging, I don't find this too easy and if it means intentionally causing my computer to not de mount the filessystems then I probably won't be too interested.


----------



## egorenar (Jan 29, 2010)

tim-m89 said:
			
		

> freebsd 8 amd64 is the version I am using. I will look into debugging, I don't find this too easy and if it means intentionally causing my computer to not de mount the filessystems then I probably won't be too interested.



I think when the kernel crashes, the filesystem is not unmounted anyway :e
And you can enable or disable debugging with sysctl when FreeBSD runs.

FreeBSD kernel debugging: http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug-online-ddb.html


----------



## egorenar (Feb 1, 2010)

tim-m89 said:
			
		

> Can you host it off site with all version available with as much info on the changes as possible? It would be much easy than going to page 3 each time to get some version that could have breaking changes.



Created GIT repository for all drivers.
Link: http://repo.or.cz/w/ralink_drivers.git
I will not post new driver versions here anymore !!!

:e :e :e


----------



## egorenar (Feb 1, 2010)

tim-m89 said:
			
		

> I tried using the latest 1 and did a reboot to see how it would normally start. That caused a kernel panic on boot.
> 
> I'm sticking with an older version that I backed up. (I said on page 4 that I was getting random crashed - those are still happening, don't know the cause and memcheck reports fine)
> 
> ...



I think i have found the problem you encountered. amd64 has problems with jumbo frames. I will fix it in the next days.
I have already fixed a similar problem with jumbo frames in rt2860 driver.


----------



## egorenar (Feb 2, 2010)

tim-m89 said:
			
		

> I tried using the latest 1 and did a reboot to see how it would normally start. That caused a kernel panic on boot.
> 
> I'm sticking with an older version that I backed up. (I said on page 4 that I was getting random crashed - those are still happening, don't know the cause and memcheck reports fine)
> 
> ...



I checked in a new driver version with amd64 fixes. Please test it and report back. Thanks.

:e :e :e


----------



## tim-m89 (Feb 3, 2010)

egorenar said:
			
		

> I checked in a new driver version with amd64 fixes. Please test it and report back. Thanks.
> 
> :e :e :e



Sorry but it doesn't work for me:


```
# kldload rt2870.ko
kldload: can't load rt2870.ko: Exec format error
```


----------



## egorenar (Feb 3, 2010)

tim-m89 said:
			
		

> Sorry but it doesn't work for me:
> 
> 
> ```
> ...



Hm, very strange, did you build a new kernel or change the driver's Makefile ?
I have no problems with my FreeBSD 8 custom kernel. But i have i386 acrh.
Make sure you recompile the driver and load it from local directory because
the compiled kernel module is not copied to /boot/kernel/ directory automatically.
You have to do it by yourself.

kldload ./rt2870.ko


----------



## egorenar (Feb 3, 2010)

tim-m89 said:
			
		

> Sorry but it doesn't work for me:
> 
> 
> ```
> ...



Sorry, my error :e I fixed this issue. Please try again. Thanks.

Alex.


----------



## tim-m89 (Feb 4, 2010)

egorenar said:
			
		

> Sorry, my error :e I fixed this issue. Please try again. Thanks.
> 
> Alex.



The driver now loads but causes my computer to crash. I Didn't get round to ever figuring out the crash dump as what I read so far the usual way would be to have swap size bigger than ram and it would be automatic (my swap size is smaller) and I have yet to setup anything else.

In the meantime if it is easier I have attached the old driver that works for me for you to compare with your latest code:


----------



## egorenar (Feb 4, 2010)

tim-m89 said:
			
		

> The driver now loads but causes my computer to crash. I Didn't get round to ever figuring out the crash dump as what I read so far the usual way would be to have swap size bigger than ram and it would be automatic (my swap size is smaller) and I have yet to setup anything else.
> 
> In the meantime if it is easier I have attached the old driver that works for me for you to compare with your latest code:



The chance is low that i find the problem on my own, i need your help, I would appreciate it. Just install debugger, you don't need swap space.

Alex.


----------



## tim-m89 (Feb 5, 2010)

egorenar said:
			
		

> The chance is low that i find the problem on my own, i need your help, I would appreciate it. Just install debugger, you don't need swap space.
> 
> Alex.



OK I have the online debugger working. I don't know how to use this. What commands should I use once it fires.


----------



## egorenar (Feb 5, 2010)

tim-m89 said:
			
		

> OK I have the online debugger working. I don't know how to use this. What commands should I use once it fires.



1. Boot freebsd
2. Don't load rt2870.ko module yet !!!
3. Change to virtual console 1 (Ctrl-Alt-F1) and don't change to X back in the following steps !!!
4. Activate debugger with: `# sysctl debug.debugger_on_panic=1`
   (optional, needed only if you compiled your kernel with "options KDB_UNATTENDED")
5. Now load rt2870.ko module
6. Try to get a panic :e
7. When a panic occurs, the debugger is activated
8. Type "bt" to print a backtrace and take photo for me 

Alex.


----------



## tim-m89 (Feb 5, 2010)

egorenar said:
			
		

> 1. Boot freebsd
> 2. Don't load rt2870.ko module yet !!!
> 3. Change to virtual console 1 (Ctrl-Alt-F1) and don't change to X back in the following steps !!!
> 4. Activate debugger with: sysctl debug.debugger_on_panic=1
> ...



When you said "don't need swap" I though you meant it was possible to do a dump without it. OK hold on and I will see if I can borrow a camera...

UPDATE:

Here hope it's clear enough for you: rt2870-error-shots.tar.bz2 - 2.11MB


----------



## egorenar (Feb 5, 2010)

tim-m89 said:
			
		

> When you said "don't need swap" I though you meant it was possible to do a dump without it. OK hold on and I will see if I can borrow a camera...
> 
> UPDATE:
> 
> Here hope it's clear enough for you: rt2870-error-shots.tar.bz2 - 2.11MB



Thanks, it helped me further :e
You are using 802.11n, are you ?
I implemented BA (A-MPDUs) in in the last version of driver but could not test it because i couldn't make my AP send me ADDBA requests. But
obviously your AP sends you ADDBA requests. I will investigate the problem. Temporal solution for you is to use only 802.11g mode in your AP.

Thanks.

Alex.


----------



## egorenar (Feb 5, 2010)

tim-m89 said:
			
		

> When you said "don't need swap" I though you meant it was possible to do a dump without it. OK hold on and I will see if I can borrow a camera...
> 
> UPDATE:
> 
> Here hope it's clear enough for you: rt2870-error-shots.tar.bz2 - 2.11MB



OK, fixed this bug, forgot to arquire a lock :e
Try it again.
Could you please enable ADDBA/DELBA debugging on your machine and send me a log:

```
# kenv hw.rt2870.debug=0x00000800  <--- this enables Block ACK debugging messages
# kldload rt2870.ko
# dmesg
```

What AP do you have ?

Thanks for your help, awaiting your response


----------



## tim-m89 (Feb 5, 2010)

egorenar said:
			
		

> Could you please enable ADDBA/DELBA debugging on your machine and send me a log:
> 
> ```
> # kenv hw.rt2870.debug=0x00000800  <--- this enables Block ACK debugging messages
> ...



dmesg is attached. I had to make sure N was disabled on my router for it to associate though. It seems to work fine on B/G.



			
				egorenar said:
			
		

> What AP do you have ?



Belkin F5D8631-4 version: 2000 with latest firmware up to date.


----------



## egorenar (Feb 6, 2010)

tim-m89 said:
			
		

> dmesg is attached. I had to make sure N was disabled on my router for it to associate though. It seems to work fine on B/G.
> 
> 
> 
> Belkin F5D8631-4 version: 2000 with latest firmware up to date.



Do you have time so we could analyze this problem with ADDBA requests together ? I cannot test it by myself.

:e :e :e


----------



## mf93 (Feb 11, 2010)

i downloaded your driver, but where do i get the firmware for this...?


----------



## mf93 (Feb 11, 2010)

sorry, i found the firmware, but where do i put it?


----------



## mf93 (Feb 11, 2010)

sorry i fixed my firmware issues this question however i cannot solve- when i do ifconfig rt28700 channel any ssid "NETGEAR" i get 

```
ifconfig: SIOCS80211: Invalid Argument
```
can you please tell me what this problem is it has utterly confused me?


----------



## tim-m89 (Feb 11, 2010)

mf93 do:


```
ifconfig wlan create wlandev rt28700
```

then use wlan0


----------



## egorenar (Feb 11, 2010)

mf93 said:
			
		

> sorry i fixed my firmware issues this question however i cannot solve- when i do ifconfig rt28700 channel any ssid "NETGEAR" i get
> 
> ```
> ifconfig: SIOCS80211: Invalid Argument
> ...



You don't need any firmware, it's already embedded into the driver.
What FreeBSD version are you using ?

If you are using FreeBSD 8 then first you have to create a WLAN device:


```
ifconfig wlan0 create wlandev rt28700 wlanmode sta
```

and then you can do


```
ifconfig wlan0 channel ... etc
```

Why are you not using WPA supplicant ?


----------



## mf93 (Feb 11, 2010)

thank you that fixed that...now however im using dhcp to make sure the internet works and then i am switching to manual...however when i do dhclient wlan0 i get this:

```
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 18
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 11
no DCHPOFFERS received.
No working leases persistent in database-sleeping.
```
i no my dhcp works because my laptop right next to it is connected via dhcp and its getting a solid connection---what could be the problem?


----------



## egorenar (Feb 11, 2010)

mf93 said:
			
		

> thank you that fixed that...now however im using dhcp to make sure the internet works and then i am switching to manual...however when i do dhclient wlan0 i get this:
> 
> ```
> DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
> ...



Are you sure you are associated with your AP ?
Run ifconfig and post the output here.


----------



## mf93 (Feb 11, 2010)

```
# ifconfig
re0: ...
fwe0: ...
fwip0:...
lo0:...
rt28700: flags=8843<UP BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290 
     ether **:**:**:**:**:**
     media: IEEE 802.11 Wireless Ethernet autoselect mode 11ng
     status: assosciated
wlan0: flags=8843<UP BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290 
     ether **:**:**:**:**:**
     inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
     media: IEEE 802.11 Wireless Ethernet<unknown subtype>
     status:associated
     ssid NETGEAR channel 1 (2412 Mhz 11g ht/20) bssid **:**:**:**:**:**
     country US authmode OPEN privacy OFF txpower 0 bmiss 7 scanvalid 60
     protmode CTS -ampdutx ampdurx ampdulimit 64k ampdudensity 8 shortgi
     wme burst
```
the MAC addresses have been starred out


----------



## egorenar (Feb 12, 2010)

mf93 said:
			
		

> ```
> # ifconfig
> re0: ...
> fwe0: ...
> ...



I see you are using 802.11n HT20 mode. Do you also have problems with DHCP if you are using 802.11g only mode. Try to configure your AP to use 802.11g mode only and post the result here.
And check you MAC access list in your AP. A wireshark capture would help me further. It is possible that your AP sends you ADDBA requests in order to be able to send A-MPDUs and Block ACKs but in the current net80221 stack (it is a part of the kernel) the sending of ADDBA responses is broken. So try to capture the association with your AP and send me the capture so i could analyze it. If your AP is really sending ADBBA requests then i can provide you a patch for net80211 that fixes the problem with ADDBA in net80211. I tested this patch with another guy and it works fine 

Another and easier possibility to find out if your AP sends you ADDBA requests is to enable the internal driver debugging:

1. Unload the driver with

```
# kldunload ./rt2870.ko
```

2. Set kernel environment variable

```
# kenv hw.rt2870.debug=0x00000800
```

This enables ADDBA debugging in the driver

3. Load the driver

```
# kldload ./rt2870.ko
```

4. Connect to your AP

5. Post the output of

```
$ dmesg | grep rt2870
```

*tim-m89* has the same problem with ADDBA requests in 802.11n mode.

Thanks.


----------



## mf93 (Feb 12, 2010)

```
# dmesg | grep rt2870
rt28700: <Cisco-Linksys LLC Dual-Band Wireless-N USB Networ, class 0/0, rev 2.00/1.01, addr 2> on usbus5
rt28700: MAC/BBP RT2870 (rev 0x28720202), RF RT2850
rt28700: skip channel 10, could not find extension channel
rt28700: skip channel 11, could not find extension channel
rt28700: skip channel 12, could not find extension channel
rt28700: skip channel 13, could not find extension channel
rt28700: skip channel 14, could not find extension channel
rt28700: skip channel 64, could not find extension channel
rt28700: skip channel 140, could not find extension channel
rt28700: skip channel 165, could not find extension channel
rt28700: <Cisco-Linksys LLC Dual-Band Wireless-N USB Networ, class 0/0, rev 2.00/1.01, addr 2> on usbus5
rt28700: attaching
rt28700: MAC/BBP RT2870 (rev 0x28720202), RF RT2850
rt28700: skip channel 10, could not find extension channel
rt28700: skip channel 11, could not find extension channel
rt28700: skip channel 12, could not find extension channel
rt28700: skip channel 13, could not find extension channel
rt28700: skip channel 14, could not find extension channel
rt28700: skip channel 64, could not find extension channel
rt28700: skip channel 140, could not find extension channel
rt28700: skip channel 165, could not find extension channel
rt28700: initializing
rt28700: loading 8051 microcode
rt28700: 8051 microcode was successfully loaded
```


----------



## egorenar (Feb 12, 2010)

mf93 said:
			
		

> ```
> # dmesg | grep rt2870
> rt28700: <Cisco-Linksys LLC Dual-Band Wireless-N USB Networ, class 0/0, rev 2.00/1.01, addr 2> on usbus5
> rt28700: MAC/BBP RT2870 (rev 0x28720202), RF RT2850
> ...


Make sure you run dmesg after you are associated and after you run dhclient.

Did you try 802.11g mode ?


----------



## mf93 (Feb 13, 2010)

```
# ifconfig                                                  
re0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>                                                           
        ether **:**:**:**:**:**                                                 
        media: Ethernet autoselect (10baseT/UTP <half-duplex>)                  
        status: no carrier                                                      
fwe0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500                 
        options=8<VLAN_MTU>                                                     
        ether **:**:**:**:**:**                                                 
        ch 1 dma -1                                                             
fwip0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500                
        lladdr 0.79.70.5b.0.0.24.1d.a.2.ff.fe.0.0.0.0                           
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384               
        options=3<RXCSUM,TXCSUM>                                                
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4                              
        inet6 ::1 prefixlen 128                                                 
        inet 127.0.0.1 netmask 0xff000000                                       
rt28700: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290   
        ether **:**:**:**:**:**                                                
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11ng               
        status: associated                                                      
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500     
        ether **:**:**:**:**:**                                                 
        inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255               
        media: IEEE 802.11 Wireless Ethernet<unknown subtype>                   
        status: associated                                                      
        ssid NETGEAR channel 1 (2412 Mhz 11g ht/20) bssid **:**:**:**:**:**    
        country US authmode OPEN privacy OFF txpower 0 bmiss 7 scanvalid 60     
        protmode CTS -ampdutx ampdurx ampdulimit 64k ampdudensity 8 shortgi     
        wme burst                                                               
# dhclient wlan0
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 19
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

# dmesg | grep rt2870
rt28700: <Cisco-Linksys LLC Dual-Band Wireless-N USB Networ, class 0/0, rev 2.00/1.01, addr 2> on usbus5
rt28700: MAC/BBP RT2870 (rev 0x28720202), RF RT2850
rt28700: skip channel 10, could not find extension channel
rt28700: skip channel 11, could not find extension channel
rt28700: skip channel 12, could not find extension channel
rt28700: skip channel 13, could not find extension channel
rt28700: skip channel 14, could not find extension channel
rt28700: skip channel 64, could not find extension channel
rt28700: skip channel 140, could not find extension channel
rt28700: skip channel 165, could not find extension channel
rt28700: <Cisco-Linksys LLC Dual-Band Wireless-N USB Networ, class 0/0, rev 2.00/1.01, addr 2> on usbus5
rt28700: attaching
rt28700: MAC/BBP RT2870 (rev 0x28720202), RF RT2850
rt28700: skip channel 10, could not find extension channel
rt28700: skip channel 11, could not find extension channel
rt28700: skip channel 12, could not find extension channel
rt28700: skip channel 13, could not find extension channel
rt28700: skip channel 14, could not find extension channel
rt28700: skip channel 64, could not find extension channel
rt28700: skip channel 140, could not find extension channel
rt28700: skip channel 165, could not find extension channel
rt28700: initializing
rt28700: loading 8051 microcode
rt28700: 8051 microcode was successfully loaded
#
```


----------



## egorenar (Feb 13, 2010)

mf93 said:
			
		

> ```
> # ifconfig
> re0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
> options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
> ...



Please try 802.11g mode.
You are using HT20 mode !!!

2412 Mhz 11g ht/20 is not 802.11g mode but 802.11n HT20


----------



## mf93 (Feb 13, 2010)

how do i change it to 11g?


----------



## mf93 (Feb 13, 2010)

alright i changed it to 11g but now it cant find the link to associate...and dmesg | grep rt2870 shows the same thing and dmesg without the grep shows wlan0 going up and down like 300 hundred times


----------



## egorenar (Feb 13, 2010)

mf93 said:
			
		

> alright i changed it to 11g but now it cant find the link to associate...and dmesg | grep rt2870 shows the same thing and dmesg without the grep shows wlan0 going up and down like 300 hundred times



You have to change it in your AP and not on FreeBSD


----------



## mf93 (Feb 13, 2010)

im sorry but im really confused-usually i either have a wired ethernet connection or a laptop with a wireless card built in with freeBSD(or linux, depending on the OS i use for that particular box) native support...this is the first time with a USB wireless card---what do you mean change it in the AP?


----------



## egorenar (Feb 13, 2010)

mf93 said:
			
		

> im sorry but im really confused-usually i either have a wired ethernet connection or a laptop with a wireless card built in with freeBSD(or linux, depending on the OS i use for that particular box) native support...this is the first time with a USB wireless card---what do you mean change it in the AP?



I mean you have to configure your Access Point (box with antennas to which you connect) in 802.11g mode. Usually there is a web interface to your AP and with it you can reconfigure it. I guess 802.11n mode is default on your AP.

I tested my driver with HT20 and HT40 802.11n mode and it works fine with wpa_supplicant.
Did you try to use wpa_supplicant ?

You can write to my ICQ or Jabber account, that way i could help you faster 
Or else the moderator will complain that we are turning this forum into a private chat room


----------



## mf93 (Feb 13, 2010)

hmm...alright ill try that---i think it should work fine with wpa_supplicant because i have almost the exact same setup as you(linksys wusb600n, amd64 phenom quad core processor) thank you so much and i am so thankful to see someone make good drivers for a device that is not well supported in linux or *BSD


----------



## mf93 (Feb 13, 2010)

im sorry but ive never used wpa_supplicant before could you help me get started?


----------



## egorenar (Feb 13, 2010)

mf93 said:
			
		

> im sorry but ive never used wpa_supplicant before could you help me get started?



Write to my ICQ account or else the moderator will complain about chatting in the forum


----------



## DutchDaemon (Feb 13, 2010)

Get a room, guys!


----------



## rene@ (Feb 16, 2010)

just installed the driver on my Eee901 (rt2860) from a few hours ago, seems to work fine.  I've turned encryption off (!) for now, I'll dig into wpa_supplicant tomorrow or so.  Would 802.1X work using wpa_supplicant? It is used at work.


----------



## egorenar (Feb 17, 2010)

rene@ said:
			
		

> just installed the driver on my Eee901 (rt2860) from a few hours ago, seems to work fine.  I've turned encryption off (!) for now, I'll dig into wpa_supplicant tomorrow or so.  Would 802.1X work using wpa_supplicant? It is used at work.



I didn't test it but WPA/WPA2 with AES and TKIP works fine.
And please test 802.11n mode.


----------



## rene@ (Feb 17, 2010)

egorenar said:
			
		

> I didn't test it but WPA/WPA2 with AES and TKIP works fine.
> And please test 802.11n mode.



I don't have any 802.11n APs available I'm afraid.

WPA-PSK in AP mode indeed works fine, as well as (unencrypted) IBSS mode.

I also tried 802.1X in AP mode at work, but the authentication failed. The latter could also be caused by having slightly incorrect parameters, the exact settings are somewhat hard to get right.  I did notice a message that the kernel couldn't turn off WPA mode, even after a fresh reboot with only the 802.1X section in wpa_supplicant.conf, and this message:

```
ioctl[SIOCS80211, op 26, arg 0x0]: Operation not supported
```

This is on a 8.0-RELEASE/i386 Asus Eee 901.


----------



## egorenar (Feb 18, 2010)

rene@ said:
			
		

> I don't have any 802.11n APs available I'm afraid.
> 
> WPA-PSK in AP mode indeed works fine, as well as (unencrypted) IBSS mode.
> 
> ...



Could you please post your wpa_supplicant.conf here.
And enable debugging in wpa_supplicant, like this:


```
# wpa_supplicant -dd -i wlan0 -c /etc/wpa_supplicant.conf
```


----------



## rene@ (Feb 18, 2010)

egorenar said:
			
		

> Could you please post your wpa_supplicant.conf here.
> And enable debugging in wpa_supplicant, like this:
> 
> 
> ...



I've attached the config file, a log of wpa_supplicant is available on request (32kB).

The "official" Windows instructions are at http://w3.id.tue.nl/nl/intranet/ict/wireless/ (in Dutch with English screenshots), in contrast to the instructions one can use a different login for the local Windows and the network.


----------



## egorenar (Feb 18, 2010)

rene@ said:
			
		

> I've attached the config file, a log of wpa_supplicant is available on request (32kB).
> 
> The "official" Windows instructions are at http://w3.id.tue.nl/nl/intranet/ict/wireless/ (in Dutch with English screenshots), in contrast to the instructions one can use a different login for the local Windows and the network.



I need a wpa_supplicant log.


----------



## egorenar (Feb 18, 2010)

rene@ said:
			
		

> I've attached the config file, a log of wpa_supplicant is available on request (32kB).
> 
> The "official" Windows instructions are at http://w3.id.tue.nl/nl/intranet/ict/wireless/ (in Dutch with English screenshots), in contrast to the instructions one can use a different login for the local Windows and the network.



I found this:


```
network={
      ssid="YOUR-SSID"
      scan_ssid=1
      key_mgmt=WPA-EAP
      pairwise=CCMP TKIP
      group=CCMP TKIP
      eap=PEAP
      identity="XXXXX@yourdomain.com"
      password="YOUR-PASSWORD"
      ca_cert="/etc/certs/cacert.pem"
      phase1="peapver=0"
      phase2="MSCHAPV2"
   }
```

Link: http://www.codealias.info/technotes/wireless_security_wpa/wap2_with_eap-peap_using_wpa_supplicant_and_client_ssl_certificates_linux_setup


----------



## csbucur (Feb 18, 2010)

egorenar said:
			
		

> How to configure rt2870 driver:
> 
> 1. Load KLM rt2870.ko
> 
> ...


Hi,
I use the wireless device, Iptime RAlink rt2870 chip, and I install FreeBSD 8.0 release (I am a beginner  ) and I want to know if before this step I must to do something else. Thanks. Your posts are very usefull for me.


----------



## egorenar (Feb 18, 2010)

csbucur said:
			
		

> Hi,
> I use the wireless device, Iptime RAlink rt2870 chip, and I install FreeBSD 8.0 release (I am a beginner  ) and I want to know if before this step I must to do something else. Thanks. Your posts are very usefull for me.



Hi,

you have to install kernel sources in order to be able to compile the driver. Or have you already compiled the driver ? Do you have 802.11n AP ?


----------



## csbucur (Feb 18, 2010)

Hi,

Yes I made the steps that you write (1. kldload rt2870.ko) and I write into the file /etc/rc.conf the line <<ifconfig_rt....etc"
I have a Router wireless Linksys WRT54GL


----------



## egorenar (Feb 18, 2010)

csbucur said:
			
		

> Hi,
> 
> Yes I made the steps that you write (1. kldload rt2870.ko) and I write into the file /etc/rc.conf the line <<ifconfig_rt....etc"
> I have a Router wireless Linksys WRT54GL



And then ?

Write to my ICQ account or to my private message box
or else the moderator will complain about chatting in the forum

:e :e :e

PS: Hm, ICQ is not working now :-(

Update: ICQ working again


----------



## rene@ (Feb 18, 2010)

egorenar said:
			
		

> I need a wpa_supplicant log.



Ok, attached. The line that starts with ^C is where I indeed pressed Control-C.


----------



## egorenar (Feb 19, 2010)

rene@ said:
			
		

> Ok, attached. The line that starts with ^C is where I indeed pressed Control-C.



Did you try this config ?


```
network={
      ssid="YOUR-SSID"
      scan_ssid=1
      key_mgmt=WPA-EAP
      pairwise=CCMP TKIP
      group=CCMP TKIP
      eap=PEAP
      identity="XXXXX@yourdomain.com"
      password="YOUR-PASSWORD"
      ca_cert="/etc/certs/cacert.pem"
      phase1="peapver=0"
      phase2="MSCHAPV2"
   }
```

I took a look into the wpa_supplicant log and your WPA supplicant
didn't even try to associate with the AP:


```
12: 00:1d:e5:8d:51:b2 ssid='tue' wpa_ie_len=0 rsn_ie_len=0 caps=0x31

   skip - privacy mismatch

   skip - SSID mismatch

13: 00:12:80:44:c8:22 ssid='tue' wpa_ie_len=0 rsn_ie_len=0 caps=0x31

   skip - privacy mismatch

   skip - SSID mismatch

14: 00:0f:90:f5:0e:32 ssid='tue' wpa_ie_len=0 rsn_ie_len=0 caps=0x31

   skip - privacy mismatch

   skip - SSID mismatch

15: 00:24:14:31:ac:f2 ssid='tue' wpa_ie_len=0 rsn_ie_len=0 caps=0x31

   skip - privacy mismatch

   skip - SSID mismatch

16: 00:19:a9:0e:c7:c2 ssid='tue' wpa_ie_len=0 rsn_ie_len=0 caps=0x31

   skip - privacy mismatch

   skip - SSID mismatch

17: 00:0f:f7:48:9c:02 ssid='tue' wpa_ie_len=0 rsn_ie_len=0 caps=0x31

   skip - privacy mismatch

   skip - SSID mismatch

18: 00:19:a9:0e:ca:92 ssid='tue' wpa_ie_len=0 rsn_ie_len=0 caps=0x31

   skip - privacy mismatch

   skip - SSID mismatch
```


----------



## rene@ (Feb 19, 2010)

egorenar said:
			
		

> Did you try this config ?
> 
> 
> ```
> ...



A slightly modified configuration (attached) actually works


----------



## rene@ (Feb 23, 2010)

rene@ said:
			
		

> A slightly modified configuration (attached) actually works



At work I once lost the rather weak radio signal and after that the card had difficulties re-associating.  wpa_supplicant did not succeed in associating to an access point afterwards, and 'ifconfig wlan0 list scan' either displayed no results or took 'uncomfortably' long to finish.  After a reboot everything worked fine again.


----------



## tim-m89 (Feb 24, 2010)

rene@ said:
			
		

> ```
> ifconfig wlan0 list scan
> ```
> either displayed no results or took 'uncomfortably' long to finish.



Next time this happens try the scan, re-associating, list networks etc from wpa_cli.


----------



## egorenar (Feb 24, 2010)

rene@ said:
			
		

> At work I once lost the rather weak radio signal and after that the card had difficulties re-associating.  wpa_supplicant did not succeed in associating to an access point afterwards, and 'ifconfig wlan0 list scan' either displayed no results or took 'uncomfortably' long to finish.  After a reboot everything worked fine again.



Did you notice any strange messages in the system log, eg Tx watchdog ?


----------



## greyulv (Feb 25, 2010)

egorenar: is the rt2860 7.2 driver ready for 802.11n?  I noticed the latest one changed my connection from OFDM/36mbps to DS/11mbps.

Grey


----------



## egorenar (Feb 25, 2010)

greyulv said:
			
		

> egorenar: is the rt2860 7.2 driver ready for 802.11n?  I noticed the latest one changed my connection from OFDM/36mbps to DS/11mbps.
> 
> Grey



802.11n mode is equally supported on both systems, fbsd72 and fbsd8.
Tested on freebsd72 with my 802.11n AP.
Are you using the latest version from GIT repository ?
You could enable driver debugging and send me the system log, it will help me to analyze your problem.


```
# sysctl dev.rt2860.0.debug=0xffffffff
```


----------



## Sgaduuw (Mar 3, 2010)

Thanks for the hard work!
The rt2860 driver works like a charm on my eeepc 901 
Running FreeBSD 8.0, connecting to an 802.11n accesspoint

On occasion, 'ifconfig wlan0 scan' fails to return anything, but it doesn't bother me too much since I dont connect to new APs on a daily basis


----------



## egorenar (Mar 4, 2010)

Sgaduuw said:
			
		

> Thanks for the hard work!
> The rt2860 driver works like a charm on my eeepc 901
> Running FreeBSD 8.0, connecting to an 802.11n accesspoint
> 
> On occasion, 'ifconfig wlan0 scan' fails to return anything, but it doesn't bother me too much since I dont connect to new APs on a daily basis



Thanks for feedback.

What average transfer rates do you experience in 802.11n mode ?


----------



## Sgaduuw (Mar 4, 2010)

egorenar said:
			
		

> What average transfer rates do you experience in 802.11n mode ?



Oh testing that was the last thing on my mind since I mainly use my eeepc for simple browsing on the couch 
I'll run some performance tests over the weekend, I should have some free time then.


----------



## egorenar (Mar 4, 2010)

Fixed the issue with SM power save mode in 802.11n mode which caused my AP to use only MCS smaller than 8 in 802.11n mode. So update the driver please.
And found a bug in net80211 on FreeBSD 7.2:

http://www.freebsd.org/cgi/query-pr.cgi?pr=144476

So, guys who use FreeBSD 7.2 i recommend to patch and recompile the kernel in order to get
higher download rates in 802.11n mode. The bug doesn't exist on FreeBSD 8.

:e :e :e


----------



## egorenar (Mar 5, 2010)

Added new HT feature - MIMO power save.
Only FreeBSD 8 for now.
FreeBSD 7.2 requires more work 

:e :e :e

Update: Added MIMO PS support to FreeBSD 7.2 drivers.


----------



## JohnT (Mar 9, 2010)

I downloaded the latest driver from the Repository, I am running Freebsd 8.
When I extract it and type "make" I get the following error:


```
Warning: Object directory not changed from original /mnt/rt2870_fbsd8
@ -> /usr/src/sys
ln @: Operation not supported.
*** Error code 1.
```


----------



## jkkn (Mar 9, 2010)

*Support of rt2860 driver? - a few issues*

Hey,

Thanks for implementing rt2860 in FreeBSD - this is really awesome.

For the same reason I just bought a "Linksys WMP600N Wireless-N PCI Adapter" and it seem to work (nearly) with the latest driver as of today from the git repository.

1) First is this the best place for support or is there another forum?

I am using the PCI adapter as a hostap router for my FreeBSD box.
The adapter is setup using wlan0 and it is bridged using bridge0 with my network card, em1.

2) I get the following warnings in dmesg - someone want to debug on that?

```
rt28600: <Ralink RT2860 PCI> mem 0xff960000-0xff96ffff irq 19 at device 3.0 on pci3
rt28600: invalid EEPROM powersave level
rt28600: MAC/BBP RT2860 (rev 0x28600103), RF RT2850
rt28600: skip channel 10, could not find extension channel
rt28600: skip channel 11, could not find extension channel
rt28600: skip channel 12, could not find extension channel
rt28600: skip channel 13, could not find extension channel
rt28600: skip channel 14, could not find extension channel
rt28600: skip channel 64, could not find extension channel
rt28600: skip channel 140, could not find extension channel
rt28600: skip channel 165, could not find extension channel
rt28600: [ITHREAD]
```
3) I have an issue that after a while (approximately 7-8 hours) the link "dies", meaning I can still connect to the wireless network, but it will no longer route any packages before I bring down rt2860 and wlan0 and up again and restart the hostap-daemon. Any ideas? - how to debug this?

4) Another issue is that if I enable WPA2 (or WPA) broadcast? packets? are no longer routed onto the wireless-net. I see this in two scenarios: IPv6 router advertisement packets (rtadvd) are seen using a tcpdump wlan0 on the server but never arrives at the client. Disabling WPA seem to solve this problem.

5) Another issue (but this might be related to me overseeing a configuration option?) - when connecting multiple clients to the hostap - the clients cannot see each other, e.g. the ARP-requests are not being routed between the wireless clients?!

Regards,
Kristian


----------



## JohnT (Mar 9, 2010)

The card is a Rokland n3 by the way.


----------



## egorenar (Mar 9, 2010)

JohnT said:
			
		

> I downloaded the latest driver from the Repository, I am running Freebsd 8.
> When I extract it and type "make" I get the following error:
> 
> Warning: Object directory not changed from original /mnt/rt2870_fbsd8
> ...



Kernel source installed ?


----------



## egorenar (Mar 9, 2010)

jkkn said:
			
		

> 1) First is this the best place for support or is there another forum?
> em1.



You could send me emails or write to my Jabber/ICQ account if you want.
I appreciate every feedback.



			
				jkkn said:
			
		

> 2) I get the following warnings in dmesg - someone want to debug on that?
> rt28600: <Ralink RT2860 PCI> mem 0xff960000-0xff96ffff irq 19 at device 3.0 on pci3
> rt28600: invalid EEPROM powersave level
> rt28600: MAC/BBP RT2860 (rev 0x28600103), RF RT2850
> ...



Just ignore them, these are only information messages.



			
				jkkn said:
			
		

> 3) I have an issue that after a while (approximately 7-8 hours) the link "dies", meaning I can still connect to the wireless network, but it will no longer route any packages before I bring down rt2860 and wlan0 and up again and restart the hostap-daemon. Any ideas? - how to debug this?
> 
> 4) Another issue is that if I enable WPA2 (or WPA) broadcast? packets? are no longer routed onto the wireless-net. I see this in two scenarios: IPv6 router advertisement packets (rtadvd) are seen using a tcpdump wlan0 on the server but never arrives at the client. Disabling WPA seem to solve this problem.
> 
> 5) Another issue (but this might be related to me overseeing a configuration option?) - when connecting multiple clients to the hostap - the clients cannot see each other, e.g. the ARP-requests are not being routed between the wireless clients?!



First, i need more information from you.
Send me please your configuration, e.g. ifconfig output and so on.
You can delete any passwords from files that you will send me.

What OS is running on your clients ? And what NICs are using on your clients ?

And wireshark captures would help me greatly.

I must say that HOSTAP mode is very little tested, because i'm not ablet to test it properly by myself, i have only one PC at home  So your feedback is important to me.

Thanks.


----------



## JohnT (Mar 9, 2010)

egorenar said:
			
		

> Kernel source installed ?


Yes I have the kernel sources installed.


----------



## egorenar (Mar 9, 2010)

JohnT said:
			
		

> Yes I have the kernel sources installed.



Describe please to me what you did exactly.
What hardware architecture do you have ?

That should work:

```
$ git clone git://repo.or.cz/ralink_drivers/rt2870_fbsd8.git
$ cd rt2870_fbsd8
$ make
# kldload ./rt2870.ko
```

If you didn't clone the directory but downloaded it from the web interface, then
make sure you change to the right directory, it's "rt2870_fbsd8". And in this directory you should run "make". If you type "ls -l" in that directory then you should see *.c, *.h files and Makefile.

Alex.


----------



## JohnT (Mar 9, 2010)

Ok I have it built, I have followed the instructions on page one to load the kernel driver. I am running FreeBSD 8.0 in i386. However nothing is there in ifconfig. I do get 

```
ugen4.5: <RaLink> at usbus4.
```

Thank for your help.


----------



## egorenar (Mar 10, 2010)

JohnT said:
			
		

> Ok I have it built, I have followed the instructions on page one to load the kernel driver. I am running FreeBSD 8.0 in i386. However nothing is there in ifconfig. I do get
> 
> ```
> ugen4.5: <RaLink> at usbus4.
> ...



Please post here the output of the following command:


```
# usbconfig  dump_device_desc
```

Perhaps your device is not supported.


----------



## JohnT (Mar 10, 2010)

I get:


```
ugen4.5: <802.11 n WLAN Ralink> at usbus4, cfg=0 md=HOST spd=HIGH (480mbps) pwr=ON

blength = 0x0012
bDescriptorType = 0x0001
bcbUSB = 0x0200
bDeviceClass = 0x0000
bDeviceSubClass = 0x0000
bDeviceProtocol = 0x0000
bMaxPacketSize0 = 0x0040
idVendor = 0x148f
idProduct =0x3070
bcbDevice = 0x0101
iManufacturer = 0x0001 <Ralink>
iProduct = 0x0002 <802.11 n WLAN>
iSerialNumber = 0x0003 <1.0>
bNumConfigurations = 0x0001
```


----------



## egorenar (Mar 10, 2010)

JohnT said:
			
		

> I get:
> 
> 
> ```
> ...



My driver doesn't support this device, sorry.
But your device will work with run driver, but no 802.11n.


----------



## egorenar (Mar 10, 2010)

jkkn said:
			
		

> Hey,
> 
> Thanks for implementing rt2860 in FreeBSD - this is really awesome.
> 
> ...



I have fixed the problem with ARP requests and broadcast/multicast packets.
Please test again.

Thanks for feedback.

:e:e:e


----------



## JohnT (Mar 11, 2010)

egorenar said:
			
		

> My driver doesn't support this device, sorry.
> But your device will work with run driver, but no 802.11n.


I don't need to use 802.11n, How will it work with run driver? 

Thanks for all your help.


----------



## egorenar (Mar 11, 2010)

JohnT said:
			
		

> I don't need to use 802.11n, How will it work with run driver?
> 
> Thanks for all your help.



Look here: http://forums.freebsd.org/showthread.php?t=7562


----------



## egorenar (Mar 12, 2010)

Added WDS support to rt2860 device driver.
I will add multiple BSS support soon 
Upto 8 HOSTAPs, many WDSs and STAs simultaneously !!!

For FreeBSD 7.2 no multi BSS support :-(

:e :e :e

Update: Added also to rt2870 for FreeBSD 8.0


----------



## nirnr00t (Mar 18, 2010)

Does it support WPA2 SEC and AES+PSK encryption?


----------



## egorenar (Mar 18, 2010)

nirnr00t said:
			
		

> Does it support WPA2 SEC and AES+PSK encryption?



Yes.


----------



## nirnr00t (Mar 19, 2010)

Now I get last source tarball for rt2860-fbsd8 and install FreeBSD 8.0R (generic, source installed) on eee pc 901. I unpack it to /root and make && make config && klload rt2860


```
rt28600: <Ralink RT2790 PCIe> mem (...)
rt28600: invalid EEPROM LNA gain #2: 0x00
rt28600: invalid EEPROM LNA gain #3: 0x00
rt28600: invalid EEPROM powersave level
rt28600: MAC/BBP RT2860 (rev 0x28720200), RF RT2720
rt28600: skip channel 10, could not find extension channel
(last for channel 10-14)
rt28600: [ITREAD]
```

Doing 

```
ifconfig rt28600 chanel 6 ssid unknown up
ifconfig: chanel: bad value
```

Wlan works fine on ubuntu. I try to do it by assign to wlan0 interface, by change chanels - fail.

Do
`ifconfig rt28600 up`
normaly
`ifconfig rt28600 list scan`
And it cannot get scan results.

Any ideas?


----------



## egorenar (Mar 19, 2010)

nirnr00t said:
			
		

> Now I get last source tarball for rt2860-fbsd8 and install FreeBSD 8.0R (generic, source installed) on eee pc 901. I unpack it to /root and make && make config && klload rt2860
> 
> rt28600: <Ralink RT2790 PCIe> mem (...)
> rt28600: invalid EEPROM LNA gain #2: 0x00
> ...



On freebsd 8 wlan works a bit different than on 7.2.
First you have to create a wlan device and then you can scan or associate.


```
# ifconfig wlan0 create wlandev rt28600 wlanmode sta
# ifconfig wlan0 channel 6 ssid ... up
# ifconfig wlan0 list scan
```

Look into FreeBSD WLAN documentation


----------



## tim-m89 (Mar 19, 2010)

egorenar said:
			
		

> On freebsd 8 wlan works a bit different than on 7.2.
> First you have to create a wlan device and then you can scan or associate.
> 
> 
> ...



This has came up before (myself making that mistake). So people don't have to manually read all 10 pages of this thread I tried to summarize all the useful information on the first post and I'm quite sure this was included. If anyone wants to include more info then I can add that too.


----------



## nirnr00t (Mar 19, 2010)

nirnr00t said:
			
		

> ```
> ifconfig rt28600 chanel 6 ssid unknown up
> ifconfig: chanel: bad value
> ```
> *I try to do it by assign to wlan0 interface*, by change chanels - fail.



OK, earlier i creaded wlan by type it in rc.conf, but now i do as you say 
It was created success.

```
rapture# ifconfig wlan0 list scan
rapture#
```
But I have my open non-encrypted wlan and wlan by near hotel (it encrypted ;( )
Try to force:

```
rapture# ifconfig wlan0 chanel 6 ssid unknown up
ifconfig: chanel: bad value
rapture#
```
Chanel 1-6 don't work


----------



## nirnr00t (Mar 19, 2010)

Sorry, with channel - it my mistake 
But list scan result empty. ifconfig wlan0 show status: no carrier , but ssid and channel set


----------



## nirnr00t (Mar 19, 2010)

Sorry. all ok.
Thank you very much )


----------



## egorenar (Mar 19, 2010)

I have bought today a new Ralink device, RT3572.
And i was able to test my rt2870 driver in HOSTAP mode.
I used RT3572 as client on Linux.
I have got upto 8.6 mbyte/s in 802.11n mode with a 40 MHz channel !!!
The AP and the client were in different rooms.

But i have to do something about interrupts, 5079 per sec !!!
Perhaps polling will fix this issue.

:e :e :e


----------



## g_willikers (Apr 6, 2010)

*Where can I download the source?*

Greetings,
 Let me first preface this by indicating I _am_ aware of the GIT repository.
However, I was recently required to choose a wireless upstream provider to gain
access to the internet. So my current server farm will not have access to the internet
_until_ I am able to build the source for the rt2870. Until then, my only access
to the internet is via the upstreams "officially" supported OS (Winblows).
Given that git is only available to *nix/*nixlike systems, this leaves ppl in my
situation _without_ access to the internet via *nix systems, forced to add support
for the linux ABI in order to use GIT. So I was wondering if anyone can link to an
archive of the source currently available at the GIT repository?

Thank you for all your time and consideration in this matter.

--Chris


----------



## g_willikers (Apr 6, 2010)

DO'H!
I originally went to the git://
goint to thr http:// provides the option to download latest in _archive_ form.
Sorry for the noise.

--Chris


----------



## tim-m89 (Apr 6, 2010)

Each commit has a download link for a tgz and a zip (where it says snapshot eg: latest 2870 for fbsd8) but even if it didn't it wouldn't matter because git works fine on windows.


----------



## g_willikers (Apr 6, 2010)

*does the 2870 version work in 8.0?*

Greetings,
 I just checked out a copy of HEAD from the 2870 branch
(http://repo.or.cz/w/ralink_drivers/rt2870_fbsd8.git/snapshot/HEAD.tar.gz).
Built it, kld loaded it. Everything looked as expected.
I added it to loader.conf (rt2870_load="YES")
bounced the box, but no joy 
Nothing shows in messages during *verbose*load.
issuing
ifconfig wlan0 create wlandev rt28700
returns
SIOCIFCREATE2: Device not configured

currently dualbooting w2k3 enterprise LVE && Freebsd-8.0 (GENERIC)

What additional info can I provide?

Thank you for all your time and consideration in this matter.

--Chris


----------



## g_willikers (Apr 6, 2010)

tim-m89 said:
			
		

> Each commit has a download link for a tgz and a zip (where it says snapshot eg: latest 2870 for fbsd8) but even if it didn't it wouldn't matter because git works fine on windows.



Thank you very much for your reply.
I discovered this almost immediately after making this post && added a "quickreply".
But it was decided by this forum to *approve* the post by moderator *before*
allowing it to show up in this forum. I guess if I should make more than 2 posts
within a 24 hour period I get _flagged_. x( - sheesh!

Anyway, thanks again, and please note I _tried_ 

--Chris


----------



## tim-m89 (Apr 6, 2010)

g_willikers said:
			
		

> Built it, kld loaded it. Everything looked as expected.
> I added it to loader.conf (rt2870_load="YES")
> bounced the box, but no joy



make sure the driver is in /boot/kernel/ for the loader.conf to work on boot. If you can kldload it though then you know you don't actually have to reboot.



			
				g_willikers said:
			
		

> ifconfig wlan0 create wlandev rt28700
> returns
> SIOCIFCREATE2: Device not configured



If the wifi adapter is supported and the driver is loaded the rt28700 should appear in the ifconfig output. What adapter do you have? If this is done you then create the wifi interface dev with the command that you tried, then the remainder of the work is wpa, tcp/ip, dns & routing (if you can ping your router then do a 'route add default ip.address.of.gateway')



			
				g_willikers said:
			
		

> What additional info can I provide?



Have you read the first post of this thread. I can't think of anything else it needs right now.


----------



## g_willikers (Apr 6, 2010)

tim-m89 said:
			
		

> What wifi adapter do you have?



I'm using the ENCORE ENUWI-N3
it's a usb 802.11n adapter. I just finished zipping up the win drivers thinking I
might try using NDISCVT(8) || NDISGEN(8)

I'm going to attempt to attach the archive should they be of any help to anyone else.

Thank you very much for taking the time to respond tim-m89. :beergrin

UPDATE: Their upload "feature" isn't responding.  I'll try to upload later.

--Chris


----------



## g_willikers (Apr 6, 2010)

tim-m89 said:
			
		

> make sure the driver is in /boot/kernel/ for the loader.conf to work on boot. If you can kldload it though then you know you don't actually have to reboot.



I built it as root && loaded it via kldload ./rt2870.ko
kldstat indicated it was loaded.
So I copied it to /boot/kernel && /boot/modules
added rt2870_load="YES" to /boot/loader.conf && rebooted.



			
				tim-m89 said:
			
		

> If the wifi adapter is supported and the driver is loaded the rt28700 should appear in the ifconfig output. What adapter do you have? If this is done you then create the wifi interface dev with the command that you tried, then the remainder of the work is wpa, tcp/ip, dns & routing (if you can ping your router then do a 'route add default ip.address.of.gateway')
> 
> 
> 
> Have you read the first post of this thread. I can't think of anything else it needs right now.



I read the first post and seems like i've followed it correctly "no?"

Thank you again for your thoughtful response.

--Chris


----------



## g_willikers (Apr 6, 2010)

*Is there any way to add my dongle to the list of supported devices for this driver?*

Greetings,
 Here's all the output I was able to produce for my dongle:

```
[b]# uname -a[/b]
FreeBSD l400.ultimatedns.NET 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:48:17 UTC 2009
root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
```


```
[b]# kldstat[/b]
Id Refs Address    Size     Name
 1    5 0xc0400000 b6dfe0   kernel
 2    1 0xc0f6e000 17c98    rt2870.ko
```


```
[b]# cat /var/log/messages | grep uge[/b]
Apr  5 23:05:10 l400 kernel: ugen0.1: <Intel> at usbus0
Apr  5 23:05:10 l400 kernel: ugen0.2: <Ralink> at usbus0
Apr  5 23:05:10 l400 kernel: ugen0.3: <vendor 0x0402> at usbus0
Apr  6 03:33:40 l400 kernel: ugen0.1: <Intel> at usbus0
Apr  6 03:33:40 l400 kernel: ugen0.2: <Ralink> at usbus0
```

This is the _only_ references to the rt2870 I can get FreeBSD to create
after making/installing the driver && booting with the dongle attached.

Thank you for all your time and consideration in this matter.

--Chris


----------



## g_willikers (Apr 6, 2010)

*Here's the inf file for the dongle*

Greetings,
 If the forums offered an "EDIT" button, I would have simply appended this to my last post,
but...

Anyway, here is the INF file from the Windows driver for the ENCORE ENUWI-N3 that uses the
RALINK rt2870 chipset.

SEE ATTACHED

--Chris


----------



## egorenar (Apr 6, 2010)

g_willikers said:
			
		

> Greetings,
> If the forums offered an "EDIT" button, I would have simply appended this to my last post,
> but...
> 
> ...



Please post here the output of the following command:


```
# usbconfig  dump_device_desc
```

I added new USB Ralink device. If you have Ralink RT2870 USB device 0x148F:0x2870 then it should work now. Check GIT repository again.


----------



## g_willikers (Apr 6, 2010)

Greetings egorenar, and thank you for your response.


			
				egorenar said:
			
		

> Please post here the output of the following command:
> 
> 
> ```
> ...


I already provided the output of that command, as well as some others in my post just before
the post you are replying to (this one) 



			
				egorenar said:
			
		

> I added new USB Ralink device. If you have Ralink RT2870 USB device 0x148F:0x2870 then it should work now. Check GIT repository again.


I'll have a look. I'm not sure how to find the hex number - I'll see if it's in dmesg || messages.

Thank you for all your time and consideration.

--Chris


----------



## egorenar (Apr 6, 2010)

g_willikers said:
			
		

> Greetings egorenar, and thank you for your response.
> 
> I already provided the output of that command, as well as some others in my post just before
> the post you are replying to (this one)
> ...



After running 


```
usbconfig  dump_device_desc
```

you will see the hex numbers


----------



## g_willikers (Apr 6, 2010)

Greetings egorenar,
 Sorry I _produced_ the output for the prior post. But forgot to paste it in - DO'H!

OK here it is:

```
[b]# usbconfig[/b]
[color="Teal"]## checkout of HEAD-2001-03-26[/color]
ugen0.1: <UHCI root HUB Intel> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen0.2: <802.11 n WLAN Ralink> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen0.3: <JD FireFly Lexar> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
```


```
[b]# usbconfig[/b]
[color="Teal"]## checkout of HEAD-2001-04-06[/color]
ugen0.1: <UHCI root HUB Intel> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen0.2: <802.11 n WLAN Ralink> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen0.3: <JD FireFly Lexar> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
```

I checked out your most recent version of HEAD,
I kldunloaded the prior version, deleted them from /boot/modules && /boot/kernel,
unpacked the new version, built it, copied rt2870.ko && rt2870.ko.symbols to:
/boot/modules && /boot/kernel, kldloaded it kldstat indicated it was loaded fine.
So I bounced the box with the rt2870_load="YES" in loader.conf && the necessary
entries in rc.conf. But no joy. Only a terse entry in /var/log/messages - no more.

Is there anything else I can do that may help to make this work?

Thank you *very* much egorenar, for all your time and consideration.

--Chris


----------



## g_willikers (Apr 6, 2010)

*I have unpacked the rt2870.sys file into it's individual components...*

The tree consists of

```
.rsc   D   1,556
.text  F 614,514
.rdata F  34,752
.data  F  54,944
INT    F   2,500
.reloc F   9,678
------------------------
contents of .rsc
MOFDATA D 648
VERSION D 908
------------------------
contents of .rsc/MOFDATA
NDISMOFRESORCE F 648
------------------------
contents of .rsc/VERSION
1              F 908
```

I can upload the individual items within the rt2870.sys file, or I can pack the .sys file
and upload it. But because of the size limits imposed in these forums, I will need to
pack it into volums (segments) which will automatically find each other when unpacked.
Thereby returning into it's original form.
If this would be of any help. Please let me know, and I'll upload it/them into any form
that would be useful.

Thanks again.

--Chris


----------



## egorenar (Apr 7, 2010)

g_willikers said:
			
		

> Greetings egorenar,
> Sorry I _produced_ the output for the prior post. But forgot to paste it in - DO'H!
> 
> OK here it is:
> ...



You should post the output of the command with parameter or else i cannot see vendor and product id.


```
# usbconfig  dump_device_desc
```


----------



## g_willikers (Apr 7, 2010)

egorenar said:
			
		

> You should post the output of the command with parameter or else i cannot see vendor and product id.
> 
> 
> ```
> ...



Sorry, I didn't see the "dump_device_desc" in the man pages, and wasn't thinking. :r
Sorry for the bother.

Here is the information:
	
	



```
[b]usbconfig dump_device_desc[/b]
[color="Teal"]## AFTER checkout of HEAD-2001-04-06[/color]
ugen0.1: <UHCI root HUB Intel> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen0.2: <802.11 n WLAN Ralink> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0000
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x203d
  idProduct = 0x1480
  bcdDevice = 0x0101
  iManufacturer = 0x0001  <Ralink>
  iProduct = 0x0002  <802.11 n WLAN>
  iSerialNumber = 0x0003  <1.0>
  bNumConfigurations = 0x0001
```

Again, sorry for the bother, and thank you very much for all your time and consideration.

--Chris


----------



## egorenar (Apr 7, 2010)

g_willikers said:
			
		

> Sorry, I didn't see the "dump_device_desc" in the man pages, and wasn't thinking. :r
> Sorry for the bother.
> 
> Here is the information:
> ...




```
idVendor = 0x203d
idProduct = 0x1480
```

I think it has rt3070 chip and not rt2870. Try "run" driver, i think it supports your device.


----------



## g_willikers (Apr 8, 2010)

egorenar said:
			
		

> ```
> idVendor = 0x203d
> idProduct = 0x1480
> ```
> ...



Thank you very much egorenar, for all your help.
I will give that a try. FWIW the Windows boxen that I'm using this on, installed
and is using the rt2870.sys driver that the CD for the dongle installed. I looked
at attempting to dis-assemble the dongle. But they've done a very good job of
sealing it (better than most). So I'm afraid that I might damage the antenna if I
try to dis-assemble it.

In any case, I'll try the "run" driver, and report back with my findings.

Thank you again egorenar, for all your time and consideration.

--Chris (g_willikers)


----------



## g_willikers (Apr 9, 2010)

g_willikers said:
			
		

> Thank you very much egorenar, for all your help.
> I will give that a try. FWIW the Windows boxen that I'm using this on, installed
> and is using the rt2870.sys driver that the CD for the dongle installed. I looked
> at attempting to dis-assemble the dongle. But they've done a very good job of
> ...



@egorenar
Thank you! beer:beer
It turns out that your suggestion was the "magic" - at least making/loading the driver
shows my dongle:

```
[b]# kldload runfw[/b]
firmware: 'runfw' version 1: 8192 bytes loaded at 0xc2c9054c
```
and

```
[b]# kldload if_run[/b]
run0: <1.0> on usbus0
run0: MAC/BBP RT3070 (rev 0x0201), RF RT3020 (MIMO 1T1R), address XX:XX:XX:XX:XX:XX
run0: firmware RT2870 loaded
run0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
run0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36M
bps 48Mbps 54Mbps
```
where XX:XX:... was the address (masked by XX)

Thank you again for all your time and consideration - I *really* appreciate it.

--Chris


----------



## nirnr00t (Apr 9, 2010)

Eee pc 901, FreeBSD 8.0-STABLE, last rt2860 driver

Dmesg

```
rt28600: Tx watchdog timeout: resetting
rt28600: Tx watchdog timeout: resetting
rt28600: Tx watchdog timeout: resetting
rt28600: Tx watchdog timeout: resetting
```
After that sometimes (when transfer much information), wlan0 down and, then, imidiatly, up. This leads to the fact that the network falls but routes (netstat -n -r) is ok (needs to dhclient wlan0 to network up).


----------



## egorenar (Apr 10, 2010)

nirnr00t said:
			
		

> Eee pc 901, FreeBSD 8.0-STABLE, last rt2860 driver
> 
> Dmesg
> 
> ...



I need more information in order to fix this.
What were you doing before you got these messages ?
Did it happen often ?


----------



## nirnr00t (Apr 12, 2010)

I can do  what you want to get information 
After start I get from router (ifconfig_wlan0="DHCP WPA") ip. Than i start firefox and serf some pages (much trafic). Than i read it (0 trafic) and try to load another pages but fail.

```
PING 192.168.0.1 (192.168.0.1): 56 data bytes

--- 192.168.0.1 ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
```
Ok, we retry (dhclient wlan0) and continue surf but at random (1-10 min) netfork fail again. In ifconfig network status stay "associated" 
I try to repeat it by console login and ping -c 500 host, but no luck. Probably, it depends of hight load.
Kern without polling.


----------



## nirnr00t (Apr 14, 2010)

Discover some info: 
Die to calcru problem, i was replaced default timecounter with TSC. Now i get back to standard and (get the calcru: went backward message  )problem with driver appears less (in 8-10 min). 
Now problem look that: same time after load, when net load is 0, network desapears. It follows by messages "rx watchdog timeout..." and "wlan down, wlan UP" Routes ok, ifconfig associated, but ping to default host fails. If start ping, nothing no conclusions on the screen. After aprox. 30 seconds network up, ping get 3-4 mess "no route to host" and get ok.
What command to compile driver with max debug options?


----------



## egorenar (Apr 15, 2010)

nirnr00t said:
			
		

> Discover some info:
> Die to calcru problem, i was replaced default timecounter with TSC. Now i get back to standard and (get the calcru: went backward message  )problem with driver appears less (in 8-10 min).
> Now problem look that: same time after load, when net load is 0, network desapears. It follows by messages "rx watchdog timeout..." and "wlan down, wlan UP" Routes ok, ifconfig associated, but ping to default host fails. If start ping, nothing no conclusions on the screen. After aprox. 30 seconds network up, ping get 3-4 mess "no route to host" and get ok.
> What command to compile driver with max debug options?



By default debugging is deactivated.

How to activate debugging:


```
# sysctl dev.rt2860.0.debug=<DEBUG_FLAGS>

DEBUG_FLAGS:

RT2860_DEBUG_EEPROM = 0x00000001
RT2860_DEBUG_RX = 0x00000002
RT2860_DEBUG_TX = 0x00000004
RT2860_DEBUG_INTR = 0x00000008
RT2860_DEBUG_STATE = 0x00000010
RT2860_DEBUG_CHAN = 0x00000020
RT2860_DEBUG_NODE = 0x00000040
RT2860_DEBUG_KEY = 0x00000080
RT2860_DEBUG_PROT = 0x00000100
RT2860_DEBUG_WME = 0x00000200
RT2860_DEBUG_BEACON = 0x00000400
RT2860_DEBUG_BA = 0x00000800
RT2860_DEBUG_STATS = 0x00001000
RT2860_DEBUG_RATE = 0x00002000
RT2860_DEBUG_PERIODIC = 0x00004000
RT2860_DEBUG_WATCHDOG = 0x00008000
RT2860_DEBUG_ANY = 0xffffffff

Example: sysctl dev.rt2860.0.debug=0x00000006

0x00000006 = 0x00000002 | 0x00000004          - activates Rx and Tx debugging
```

You can combine debug flags with each other.

Wireshark logs would be also nice to have.


----------



## qwerty2200 (Apr 15, 2010)

My system FreeBSD 8.0 release
I've bought DLink DWA-525 PCI WIFI card with chipset rt2860

I used Windows drivers from official dlink server
The card works with ndis driver, but HOSTAP mode is not supported

I've download the latest version of the driver rt2870_bsd8 from git, made rt2860.ko and loaded module into kernel, but my card still can't be detected by the system.

```
#pciconf -lv
none2@pci0:3:0:0:       class=0x028000 card=0x3c041186 chip=0x30601814 rev=0x00 hdr=0x00
    vendor     = 'Ralink Technology, Corp'
    class      = network
```

Thank you in advance!


----------



## egorenar (Apr 15, 2010)

qwerty2200 said:
			
		

> My system FreeBSD 8.0 release
> I've bought DLink DWA-525 PCI WIFI card with chipset rt2860
> 
> I used Windows drivers from official dlink server
> ...



Sorry, but the card has not rt2860 but rt3060 chip. It is not supported by my driver now. Maybe later.


----------



## nirnr00t (Apr 29, 2010)

egorenar said:
			
		

> By default debugging is deactivated.
> 
> How to activate debugging:
> 
> ...



About a week of debugging get thats not driver problem. And some users report that they, too, is happening it with other wifi drivers (maybe it stack problem). Sorry for the inconvenience.


----------



## Anderstend (May 21, 2010)

Hallo,

i tried your driver (rt2860) with pfsense (freebsd7.2) works perfectly 
but there are problems on pfsense 2.0 (freebsd8) I always get kernel panic. So I tried to activate it manually in freebsd-shell:
ifconfig wlan0 create wlandev rt28600 wlanmode hostap
ifconfig wlan0 ssid CLUB channel 5 mode 11g up
the card is active and seems to work. But in this moment I try to connect by wlan-client a kernel-panic happens.
Fatal trap 12: page fault while in kernel mode
Fault code = supervisor read, page not present
And so onâ€¦
Can you help me please?


----------



## egorenar (May 22, 2010)

Anderstend said:
			
		

> Hallo,
> 
> i tried your driver (rt2860) with pfsense (freebsd7.2) works perfectly
> but there are problems on pfsense 2.0 (freebsd8) I always get kernel panic. So I tried to activate it manually in freebsd-shell:
> ...



Hi, thanks for feedback.

In order to be able to help you, i need more information.
Would you install the kernel debugger on our system. Then you could produce a backtrace for me when a panic happens again and it would help me immensely.

Alex.


----------



## Anderstend (May 22, 2010)

Ok i do my best,

but i dont realy know how to install the kernel debugger...

i have to search for it...


----------



## Anderstend (May 22, 2010)

ok i saw the debug-flags... is this something you need?

and which debug-flags will help you?

Alex


----------



## egorenar (May 22, 2010)

Anderstend said:
			
		

> ok i saw the debug-flags... is this something you need?
> 
> and which debug-flags will help you?
> 
> Alex



Look here: http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug-online-ddb.html

You have to add debugging options and compile a new kernel.


----------



## yandzee (May 22, 2010)

*rt2860 driver*

When the driver rt2860 officially will be made?


----------



## Anderstend (May 23, 2010)

egorenar said:
			
		

> Look here: http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug-online-ddb.html
> 
> You have to add debugging options and compile a new kernel.



Sorry but this seems to difficult for me... i tried building a kernel short times ago with no success...

...i have no experiance of building kernel


----------



## egorenar (May 24, 2010)

Anderstend said:
			
		

> Sorry but this seems to difficult for me... i tried building a kernel short times ago with no success...
> 
> ...i have no experiance of building kernel



I could help you if you want. It's not hard.
Else i cannot do anything to fix the problem you encountered.

Alex


----------



## Anderstend (May 24, 2010)

Ok i think i got the kernel debugger by an dev-kernel...

Now i need your help, how i get the information you need??

Alex


----------



## Anderstend (May 24, 2010)

i see a "db>" at kernel-panic... i can type "show" and so on, with a lot of options...

it will be good if you can tell me the command-line which give the output you need for debugging.


----------



## egorenar (May 24, 2010)

Anderstend said:
			
		

> i see a "db>" at kernel-panic... i can type "show" and so on, with a lot of options...
> 
> it will be good if you can tell me the command-line which give the output you need for debugging.



Just type "bt" and then enter


----------



## Anderstend (May 25, 2010)

Here is the Output:



```
Tracing pid 0 tid  td 0xc2af9000
rt2860_rx_done_task(c2b1e000,1,c0e44f93,51,c2b71758,...) at rt2860_rx_done_task+0x6ed
taskqueue_run(c2b71740,c2b71758,0,c0e3393a,0,...) at taskqueue_run+0x103
taskqueue_thread_loop(c2b1e9f8,cacf1d38,c0e3b1db,344,c12a47a0,000) at taskqueue_thread_loop+0x86
fork_exit(c09d5a80,c2b1e9f8,cacf1d38) at fork_exit+0xb8
fork_trampoline() at fork_trampoline+0x8
--- trap 0, eip = 0, esp = 0xcacf1d70, ebp = 0 ---
```


i hope this is helpfull.

Alex


----------



## egorenar (May 25, 2010)

Anderstend said:
			
		

> Here is the Output:
> 
> 
> Tracing pid 0 tid  td 0xc2af9000
> ...



Could you please take a photo of your screen. Thanks.


----------



## Anderstend (May 25, 2010)

Ok, there it is


----------



## egorenar (May 26, 2010)

Anderstend said:
			
		

> Ok, there it is
> 
> View attachment 855



OK, thanks, i will analyze the problem.


----------



## egorenar (May 26, 2010)

Anderstend said:
			
		

> Here is the Output:
> 
> 
> 
> ...



Please send me the binary rt2860.ko so i could disassemble it.
I tested the driver in HOSTAP mode today and couldn't reproduce the problem.

ALex.


----------



## Anderstend (May 26, 2010)

Ok here it is.

View attachment rt2860.tar.gz


----------



## egorenar (May 27, 2010)

Anderstend said:
			
		

> Ok here it is.
> 
> View attachment 856



Thanks, i disassembled the driver and found the place where the problem occurs 
NULL pointer access  But i don't have a solution yet. It's very strange. You are using amd64 ?


----------



## Anderstend (May 27, 2010)

Ist an very Old System with AMD Duron...

I want to use this as WLAN-Hotspot..

I don't realy understand the problem, because it works with FreeBSD 7.2...


----------



## egorenar (May 28, 2010)

Anderstend said:
			
		

> Ist an very Old System with AMD Duron...
> 
> I want to use this as WLAN-Hotspot..
> 
> I don't realy understand the problem, because it works with FreeBSD 7.2...



FreeBSD 8 and FreeBSD 7.2 have very different net80211 subsystems. net80211 subsystem on FreeBSD 8 supports vaps, FreeBSD 7 doesn't.


----------



## Anderstend (May 28, 2010)

Is there any possibility to solve the problem in time?

I often work with php, python, vba and javascript... because i am good in finding solutions at programing... but i never tried to make a driver.. so i dont know what to do with it...

if you have an abstract problem, i can help you perhaps...


----------



## egorenar (May 29, 2010)

Anderstend said:
			
		

> Is there any possibility to solve the problem in time?
> 
> I often work with php, python, vba and javascript... because i am good in finding solutions at programing... but i never tried to make a driver.. so i dont know what to do with it...
> 
> if you have an abstract problem, i can help you perhaps...



I know what the problem is but i have no clue why it happens. It shouldn't happen under normal conditions. And i'm using my driver on FreeBSD 8 constantly and have no problems at all. That is what makes me confused. Is pfSense very different from FreeBSD 8 ? I have no experience with it. Do you use the latest driver from repository ?

Alex.


----------



## Anderstend (May 29, 2010)

egorenar said:
			
		

> I know what the problem is but i have no clue why it happens. It shouldn't happen under normal conditions. And i'm using my driver on FreeBSD 8 constantly and have no problems at all. That is what makes me confused. Is pfSense very different from FreeBSD 8 ? I have no experience with it. Do you use the latest driver from repository ?
> 
> Alex.



I use the latest driver from repository...

is it because freebsd8-stable? or are there any packages missing?
i install src-> base,sys manually to have the possibility compile the driver..
but for that i have to use the distribution freebsd8-release...

perhaps the problem occurs because of one of this things.....


----------



## egorenar (May 29, 2010)

Anderstend said:
			
		

> I use the latest driver from repository...
> 
> is it because freebsd8-stable? or are there any packages missing?
> i install src-> base,sys manually to have the possibility compile the driver..
> ...



I didn't update my kernel sources after installation.
Perhaps that is why it works on my system.
I will try to update my kernel sources and test.

ALex.


----------



## Anderstend (May 29, 2010)

I do this as a trick to have shell at pfsense

 - i install pfsense 1.2.2 dev (freebsd7.0) with shell
 - update the src (sys base) for freebss8.0-release
 - upgrade to freebsd 2.0 (freebsd8.0-stable)

i do the same to get pfsense 1.2.3 (freebsd7.2) with shell
 - in this case your driver works


----------



## egorenar (May 29, 2010)

Anderstend said:
			
		

> I do this as a trick to have shell at pfsense
> 
> - i install pfsense 1.2.2 dev (freebsd7.0) with shell
> - update the src (sys base) for freebss8.0-release
> ...



Simple question 
You are using the driver for freebsd 8 or for freebsd 7 ?
Because there are 2 different versions of the driver.
Only to make sure you are using the right driver


----------



## Anderstend (May 30, 2010)

egorenar said:
			
		

> Simple question
> You are using the driver for freebsd 8 or for freebsd 7 ?
> Because there are 2 different versions of the driver.
> Only to make sure you are using the right driver



Ok, this would be to simple 
i know your git repository... i use the always the right driver 

i only wanted to say, that install pfsense 1.2.2 dev (fbsd7), then sysinstall base and sys and then upgrade to pfsense 1.2.3 (fbsd7.2) works without problems with your driver for fbsd7.2...


----------



## Anderstend (May 31, 2010)

Seems to be the same problem in this topic:

http://forum.pfsense.org/index.php/topic,23106.0.html


----------



## Anderstend (Jun 7, 2010)

Do you know an Solution for this Problem?


----------



## tim-m89 (Jun 8, 2010)

Anderstend said:
			
		

> Do you know an Solution for this Problem?



That thread finishes with a solution: the pci card wasn't correctly seated.


----------



## Anderstend (Jun 8, 2010)

but this is not the solution oy my problem, my card is correctly seated...

...only the problems at the begin of the thread are similar to mine... and there were some solution statements which can be helpful perhaps..


----------



## Anderstend (Jun 14, 2010)

egorenar said:
			
		

> I didn't update my kernel sources after installation.
> Perhaps that is why it works on my system.
> I will try to update my kernel sources and test.
> 
> ALex.



Hello Alex,

sorry for all the discussion before, now i got the installation more consistant by installing freebsd 8 with developers kernel at once.

Now i get the kernel panic by changing to hostap. I took pictures of the alerts.


----------



## Anderstend (Jun 14, 2010)

i hope you can help me...


----------



## egorenar (Jun 15, 2010)

I will look at it. Thanks for feedback.

Alex.


----------



## Anderstend (Jun 15, 2010)

egorenar said:
			
		

> I will look at it. Thanks for feedback.
> 
> Alex.



Here is the driver:

http://rapidshare.com/files/399351938/rt2860.tar.gz.html?killcode=7480356221322636459


----------



## egorenar (Jun 15, 2010)

Anderstend said:
			
		

> Here is the driver:
> 
> http://rapidshare.com/files/399351938/rt2860.tar.gz.html?killcode=7480356221322636459



What did you do exactly before panic ? Did you try to destroy HOSTAP wlan interface ?


----------



## egorenar (Jun 15, 2010)

I checked in a new driver version. Please test it again.

Alex.


----------



## Anderstend (Jun 15, 2010)

egorenar said:
			
		

> I checked in a new driver version. Please test it again.
> 
> Alex.



Infrastrukture runs and hostap with autochannel, but i can't connect to it... in this time i give it channel the kernel panic happens...

i will try the new driver and give you feedback shortly...


----------



## Anderstend (Jun 16, 2010)

egorenar said:
			
		

> I checked in a new driver version. Please test it again.
> 
> Alex.



Yeah, the driver works without any kernel panic and it seems to be set in the right mode.

Now another problem occurs. i can connect to the hostap by wlan but i always get no connection to the network.

it seems the dhcp does not working correctly.


----------



## egorenar (Jun 16, 2010)

Anderstend said:
			
		

> Yeah, the driver works without any kernel panic and it seems to be set in the right mode.
> 
> Now another problem occurs. i can connect to the hostap by wlan but i always get no connection to the network.
> 
> it seems the dhcp does not working correctly.



Could you provide me with a tcpdump capture, start capturing on wlan interface BEFORE you connect !!!

Example how to capture:

```
# tcpdump -i wlan0 -s0 -y IEEE802_11_RADIO -w capture.pcap
```


----------



## egorenar (Jun 16, 2010)

And make sure you update net80211 stack code because release 8.0 contains bugs.


----------



## Anderstend (Jun 16, 2010)

egorenar said:
			
		

> And make sure you update net80211 stack code because release 8.0 contains bugs.



Ok i will try... but i dont know how to update the net80211 stack code...


----------



## Anderstend (Jun 16, 2010)

Now it seems to be working... i will test it in the next time...

Thank you very much.. well done!!!


----------



## xnd (Jul 3, 2010)

*D-link dwa-525*

So, is it worth to buy D-LINK DWA-525 for FreeBSD 8.0 router as Access Point or not?

If yes, please writhe short instruction what to do after install FreeBSD 8.0.


----------



## dbrashear (Jul 8, 2010)

current git, freebsd8 on 8.1-PRERELEASE, hostap mode, offers a consistent panic at fault address 0x0 in rt28700 taskq; i'll see about a better backtrace.


----------



## xnd (Jul 12, 2010)

finally bought asus dwa-501 without 802.11n but firmly working as AP but had to change default device driver for it (Instructions're here http://kooo-debian.blogspot.com/2009/03/hostapd-pci-wifi_26.html)


----------



## xnd (Jul 12, 2010)

xnd said:
			
		

> bought asus dwa-501


 mistyping... of cause dwa-510


----------



## qwerty2200 (Jul 21, 2010)

Steadily hovering device and a hard hang system

My system FreeBSD 8.0 release
WIFI USB TrendNet TEW-644UB


```
Jul 21 13:25:25 home_server kernel: rt28700: could not transmit buffer: qid=0, error=USB_ERR_TIMEOUT
Jul 21 13:25:56 home_server last message repeated 6 times
Jul 21 13:26:01 home_server kernel: rt28700: could not transmit buffer: qid=0, error=USB_ERR_TIMEOUT
Jul 21 15:12:29 home_server kernel: rt28700: could not multi read MAC register: reg=0x1718, error=USB_ERR_TIMEOUT
Jul 21 15:12:32 home_server kernel: rt28700: could not multi read MAC register: reg=0x1718, error=USB_ERR_TIMEOUT
Jul 21 15:12:32 home_server kernel: rt28700: could not transmit buffer: qid=0, error=USB_ERR_TIMEOUT
```


----------



## tim-m89 (Jul 31, 2010)

My system freezes up on shutdown almost every time. It has been happening for a long time but I could rarely get to the debugger screen for some reason. I managed to get 3 images of the screen today when it froze on shutdown. They are all the same screen taken in case parts were unclear. Are these meaningful to you?

http://imgur.com/uS2GP.jpg

http://imgur.com/sLrIL.jpg

http://imgur.com/BcF0f.jpg

I am using this driver by the way.

Thanks

Edit:

Also I found out my system will freeze up by opening a wpa_cli window and typing terminate. I haven't much from you lately Alex. I'm really so grateful for this driver still and I hope you are still active in the development of it. Thanks a lot for all your skills.


----------



## swanseahost (Aug 12, 2010)

*Pfsense Install Wifi*

Firstly, I am sorry if I am posting the wrong forum.  I have a Ralink RT2760 Wireless NIC and would like to use it on Pfsense.  I have read a forum : http://forums.freebsd.org/showthread.php?t=7010 which shows you how to get the driver onto the system however, I cannot run the make command as it is not installed.

Any ideas would be appreciated.  I have also contacted pfsense 

THANKS


----------



## DutchDaemon (Aug 12, 2010)

Topics about PC-BSD / FreeNAS / DesktopBSD / m0N0WALL / pfSense


----------



## nirnr00t (Aug 29, 2010)

Can i ask, Why this driver not in base system?


----------



## dbrashear (Aug 30, 2010)

The "run" driver now in the base system (in 8.1 release) appears to have similar set of supported hardware. It requires options run and runfw.


----------



## What2516 (Dec 8, 2010)

running PC-BSD 8.1. Installed drivers. Configured wireless. Now every time I attempt to configure, after entering root password nothing happens. Tried pinging router and there's no connection. 

I first installed freebsd but decided it was a little over my head for my first BSD so hopefully I'm not scolded for coming here after switching to PCBSD.


Thanks in advance for any advice.


----------



## DutchDaemon (Dec 8, 2010)

What2516: so long as you're aware of the risks of applying FreeBSD advice to PC-BSD: http://forums.freebsd.org/showthread.php?t=7290


----------



## What2516 (Dec 8, 2010)

Thanks for that information. I actually searched over on the PC BSD forums only to find that a sticky directing people back to the freebsd forums for the ralink 2870 driver.

Some added detail in case anyone is willing to help. The driver actually worked the first time I booted with it installed and I was able to find the wireless networks around me and associate to it. After doing that my X session became unresponsive and I couldn't even drop to a command line. So I reboot and try to access my wireless device but it's unresponsive. I enter root pw and the pw is accepted then nothing happens. 

If there's any output I can post that would be useful I will do so.


Thanks


----------



## vhapkin (Dec 15, 2010)

*help me with support of rt3090 chipset*

Hello,

I have notebook HP G62-B16ER with preinstalled suse 11 operation system.
I installed FreeBSD 8.1 (with last updates), but wifi adapter doesn't work because kernel doesn't support Ralink rt3090 chipset.
I have tried to use ndis driver from Windows xp (32 bit) but it bring to core dump.
If I understand correctly this adapter is not very different from rt2870 and it has open source code for linux.
Can you add support of rt3090 chipset to your driver, please?

Best regards,
Vladimir Shapki


----------



## richardpl (Dec 15, 2010)

Can you also please give more details about ndis crash?


----------



## vhapkin (Dec 16, 2010)

Sorry, I've made a mistake. Rt3090 is very different from rt2870, it's architecture is similar to rt3070 (all in one chip), comparing by bus it is similar to rt2860 (PCI bus).



			
				richardpl said:
			
		

> Can you also please give more details about ndis crash?


I will try to get more info tomorrow.


----------



## vhapkin (Dec 16, 2010)

I copied core dump:
http://www.mediafire.com/download.php?d5kcc5ebl7ff8v0
http://depositfiles.com/files/tdkgbx9y5
http://www.megaupload.com/?d=AVTA9BCO

create wlan0:

```
#ifconfig wlan0 create wlandev ndis0
ifconfig:
re0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
	ether 68:b5:99:67:a3:90
	media: Ethernet autoselect (none)
	status: no carrier
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=3<RXCSUM,TXCSUM>
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 
	inet6 ::1 prefixlen 128 
	inet 127.0.0.1 netmask 0xff000000 
	nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
ndis0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
	ether e0:2a:82:19:02:21
	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
	status: no carrier
wlan0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether e0:2a:82:19:02:21
	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
	status: no carrier
	ssid "" channel 1 (2412 MHz 11b)
	country US authmode OPEN privacy OFF txpower 0 bmiss 7 mcastrate 11
	mgmtrate 11 scanvalid 60 bintval 0
```

a command bring to core dump

```
#ifconfig wlan0 up scan
```


----------



## richardpl (Dec 16, 2010)

backtrace would be more useful. If cause of double fault is small stack, solution is very simple. But texdump is right answer because vmcore is not useful to me.

Also code from here:
http://gitorious.org/NDISulator/
https://github.com/richardpl/NDISulator/

Have improved debug support so feel free to try it.


----------



## vhapkin (Dec 17, 2010)

richardpl said:
			
		

> backtrace would be more useful. If cause of double fault is small stack, solution is very simple. But texdump is right answer because vmcore is not useful to me.
> 
> Also code from here:
> http://gitorious.org/NDISulator/
> ...



I have patched ndis module. Where can I find textdump?


----------



## richardpl (Dec 17, 2010)

First enable textdump, read textdump(4).


----------



## vhapkin (Dec 18, 2010)

Thanks, textdump can be found on:
http://depositfiles.com/files/fsz02qzp3
http://www.megaupload.com/?d=FK5T3AMG


----------



## richardpl (Dec 18, 2010)

Does panic happens also if you set ssid to some random thing *before* bringing interface UP via ifconfig(8)?

For example:
`# ifconfig wlan0 ssid test && ifconfig wlan0 up scan`

If that does not work modify NDIS_KSTACK_PAGES from 8 to 16 in /sys/compat/ndis/ntoskrnl_var.h and recompile and reinstall or/and reload ndis.ko module.


----------



## vhapkin (Dec 20, 2010)

I have tried adding ssid to ifconfig and setting NDIS_KSTACK_PAGES to 16 and 64, but it did not help.
Do you have any other suggestions?
core dump with NDIS_KSTACK_PAGES set to 64:
http://www.megaupload.com/?d=GMV9D8U7
http://depositfiles.com/files/5banskqed


----------



## richardpl (Dec 20, 2010)

Enable debug stuff with `# sysctl debug.ndis=-1` after you load ndis and if_ndis but *before* loading miniport module.

This will dump burst of information on console, it would be nice if you set history buffer to max with vidcontrol before  loading module.


----------



## vhapkin (Dec 20, 2010)

I have used next script:

```
#!/bin/sh
#ddb script "kdb.enter.panic=textdump set; capture on; show allpcpu; bt; ps; alltrace; show alllock; call doadump; reset"

sleep 5
kldload ndis
sysctl debug.ndis=-1
kldload /boot/modules/rt2860_sys.ko
ifconfig wlan0 create wlandev ndis0
sleep 0.1
ifconfig wlan0 ssid "ACORP-W422G"
sleep 0.1
ifconfig wlan0 up scan
sleep 1
```

textdump:
http://www.megaupload.com/?d=G7UYBSE8
http://depositfiles.com/files/nby9gmcll


----------



## richardpl (Dec 20, 2010)

It always crash when checking for hang. Could you try to make ndis_ticktask() function in if_ndis.c empty to see if this will make any improvement, recompile/reload if_ndis.ko module after this.

Also try to find other driver versions.

If none of this works recompile kernel with WITNESS and INVARIANTS.


----------



## vhapkin (Dec 22, 2010)

richardpl said:
			
		

> Could you try to make ndis_ticktask() function in if_ndis.c empty to see if this will make any improvement, recompile/reload if_ndis.ko module after this.


It did not help.



			
				richardpl said:
			
		

> Also try to find other driver versions.


I will try.



			
				richardpl said:
			
		

> If none of this works recompile kernel with WITNESS and INVARIANTS.


I have prepared new text dump with WITNESS and INVARIANTS options:
http://www.megaupload.com/?d=DNLOEGMT
http://depositfiles.com/files/r25i8gj91


----------



## vhapkin (Jan 3, 2011)

I tried driver versions 3.1.0, 1.4.12 and 1.4.7 (last version 3.1.8) but did not work (I used NDISulator from 17 december).
I also tried using 64x version of driver on FreeBSD 64 and I got core dump.
I tried making last version of NDISulator on FreeBSD 64 but I had error:


```
server#	make clean

cd /usr/src/sys/modules/ndis && make clean
rm -f export_syms ndis.ko ndis.kld subr_pe.o subr_ndis.o subr_hal.o subr_ntoskrnl.o kern_ndis.o kern_windrv.o subr_usbd.o winx_wrap.o opt_usb.h 
pci_if.h bus_if.h device_if.h vnode_if.h vnode_if_newproto.h vnode_if_typedef.h
cd /usr/src/sys/modules/if_ndis && make clean
rm -f export_syms if_ndis.ko if_ndis.kld if_ndis.o if_ndis_pci.o if_ndis_pccard.o if_ndis_usb.o opt_usb.h opt_ndis.h opt_wlan.h card_if.h 
pci_if.h bus_if.h device_if.h
cd /usr/src/usr.sbin/ndiscvt && make clean
rm -f y.output ndiscvt ndiscvt.o subr_pe.o inf.o inf-token.o inf-parse.o ndiscvt.8.gz ndisgen.8.gz ndiscvt.8.cat.gz ndisgen.8.cat.gz inf-
token.c inf-parse.c y.tab.c y.tab.h
server#	make build

cd /usr/src/sys/modules/ndis && make
Warning: Object directory not changed from original /usr/src/sys/modules/ndis
awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h
awk -f @/tools/vnode_if.awk @/kern/vnode_if.src -p
awk -f @/tools/vnode_if.awk @/kern/vnode_if.src -q
awk -f @/tools/vnode_if.awk @/kern/vnode_if.src -h
:> opt_usb.h
cc -pipe -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 --param large-function-
growth=1000 -fno-common  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow  
-msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -
Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -
c /usr/src/sys/modules/ndis/../../compat/ndis/subr_pe.c
cc -pipe -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 --param large-function-
growth=1000 -fno-common  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow  
-msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -
Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -
c /usr/src/sys/modules/ndis/../../compat/ndis/subr_ndis.c
/usr/src/sys/modules/ndis/../../compat/ndis/subr_ndis.c: In function 'NdisAllocateMemory':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_ndis.c:391: warning: format '%llu' expects type 'long long unsigned int', but argument 5 has 
type 'uint64_t'
/usr/src/sys/modules/ndis/../../compat/ndis/subr_ndis.c: In function 'NdisMFreeSharedMemory':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_ndis.c:1253: warning: format '%llu' expects type 'long long unsigned int', but argument 7 has 
type 'uint64_t'
/usr/src/sys/modules/ndis/../../compat/ndis/subr_ndis.c: In function 'NdisMMapIoSpace':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_ndis.c:1302: warning: format '%llu' expects type 'long long unsigned int', but argument 5 has 
type 'uint64_t'
cc -pipe -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 --param large-function-
growth=1000 -fno-common  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow  
-msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -
Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -
c /usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'WRITE_PORT_ULONG':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:101: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:101: error: (Each undeclared identifier is reported only once
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:101: error: for each function it appears in.)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'WRITE_PORT_USHORT':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:108: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'WRITE_PORT_UCHAR':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:115: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'WRITE_PORT_BUFFER_ULONG':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:122: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'WRITE_PORT_BUFFER_USHORT':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:130: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'WRITE_PORT_BUFFER_UCHAR':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:138: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'READ_PORT_USHORT':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:146: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'READ_PORT_ULONG':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:153: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'READ_PORT_UCHAR':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:160: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'READ_PORT_BUFFER_ULONG':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:167: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'READ_PORT_BUFFER_USHORT':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:175: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'READ_PORT_BUFFER_UCHAR':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:183: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
*** Error code 1

Stop in /usr/src/sys/modules/ndis.
*** Error code 1

Stop in /usr/ndisulator.
Exit 1
```


----------



## richardpl (Jan 5, 2011)

You must use stable branch, master branch is for CURRENT.
I try to keep stable branch compatible with 8 STABLE.

FreeBSD amd64 have bigger stack (4 instead of 2) when manipulating oids (I'm not really sure if stack exhaustion is source of your problem). Please provide backtrace in amd64 case, thanks.


----------



## vhapkin (Jan 12, 2011)

I installed amd64 8 STABLE and all worked fine.
I also tried installing i386 8 STABLE but it does not work.

Thank you very much.


----------



## richardpl (Jan 13, 2011)

Can you confirm again that NDISulator works on amd64 with that driver?


----------



## vhapkin (Jan 17, 2011)

I will recheck working of NDISulator with this driver on versions 8.0 STABLE and 8.1 RELEASE soon.


----------



## vhapkin (Jan 25, 2011)

I checked driver (3.1.8 from winxp64) on 8.0 and 8.1 releases of amd64 architecture. On 8.0 driver works normaly but on 8.1 I got core dump when driver is loading.


----------



## richardpl (Jan 25, 2011)

And backtrace is? Give at least screenshoot. So 8.2 PRERELEASE aka STABLE on amd64 does not crash?
Testing historic versions is no more relevant because many things changed.


----------



## vhapkin (Jan 27, 2011)

On 8.2 PRERELEASE driver works normaly but reloading the module causes coredump.

Dumps of 8.1 and 8.0 RELEASE:
http://www.megaupload.com/?d=U5AXS7ZM
http://www.mediafire.com/?2b2mljd2haf314q
http://depositfiles.com/files/9nq7o026w


----------



## richardpl (Jan 27, 2011)

None of the coredumps are useful. Coredumps for 8.2 PRERELEASE are empty.
Older coredumps are useless because older versions than 8.2 are known to be broken on amd64 and I fixed many issues for 8.2


----------



## vhapkin (Jan 28, 2011)

I did not known about 8.0 and 8.1.
On 8.2 for long copy operation I got coredump:

http://www.megaupload.com/?d=T9SNB5WI
http://www.mediafire.com/?ep7q6gglvli8k83
http://depositfiles.com/files/16yfhicm4


----------



## richardpl (Jan 28, 2011)

The git code doesn't have that panic check, it is KASSERT instead and should be disabled by default.

So try git code with kernel (with disabled INVARIANTS). Maybe driver can survive a bit longer.


----------



## tim-m89 (Jan 28, 2011)

It seems like a lot of people are having problems with this. For me when the driver unloads it either works or crashes the whole system. Every time I shutdown I unmount all non essential drives first then run sync. I shutdown and it seems random chance on whether it will work or crash.

This is a shame and it would be great if there was a developer to take over and revive this project....


----------



## vhapkin (Jan 31, 2011)

richardpl said:
			
		

> The git code doesn't have that panic check, it is KASSERT instead and should be disabled by default.
> 
> So try git code with kernel (with disabled INVARIANTS). Maybe driver can survive a bit longer.



I do not understand what I need to do. Do I need to try building new version of ndisulator from http://gitorious.org/NDISulator? I am getting error when it builds. As for 'disabled INVARIANTS', I did not enable this option in kernel.



			
				tim-m89 said:
			
		

> It seems like a lot of people are having problems with this. For me when the driver unloads it either works or crashes the whole system. Every time I shutdown I unmount all non essential drives first then run sync. I shutdown and it seems random chance on whether it will work or crash.
> 
> This is a shame and it would be great if there was a developer to take over and revive this project....



I agree with you.


----------



## richardpl (Jan 31, 2011)

vhapkin said:
			
		

> I do not understand what I need to do. Do I need to try building new version of ndisulator from http://gitorious.org/NDISulator? I am getting error when it builds. As for 'disabled INVARIANTS', I did not enable this option in kernel.



You need stable branch of git code and FreeBSD 8 STABLE. If build fails post error output. (Please follow instructions in README file)


----------



## vhapkin (Feb 1, 2011)

```
FreeBSD test64.home 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #1: Thu Jan 27 01:51:30 SAMT 2011     
[email]root@test64.home[/email]:/usr/obj/usr/src/sys/MYKERNEL  amd64
```

Is it STABLE?


```
Script started on Mon Jan 31 22:09:56 2011
root(root) has logged on ttyv1 from local
test64#	make attach

mounting NDISulator code on top of FreeBSD code
mount_nullfs src/sys/compat/ndis /usr/src/sys/compat/ndis
mount_nullfs src/sys/dev/if_ndis /usr/src/sys/dev/if_ndis
mount_nullfs src/sys/modules/ndis /usr/src/sys/modules/ndis
mount_nullfs src/sys/modules/if_ndis /usr/src/sys/modules/if_ndis
mount_nullfs src/usr.sbin/ndiscvt /usr/src/usr.sbin/ndiscvt
test64#	make clean

cd /usr/src/sys/modules/ndis && make clean
rm -f export_syms ndis.ko ndis.kld subr_pe.o subr_ndis.o subr_hal.o subr_ntoskrnl.o kern_ndis.o kern_windrv.o subr_usbd.o winx_wrap.o opt_usb.h 
pci_if.h bus_if.h device_if.h vnode_if.h vnode_if_newproto.h vnode_if_typedef.h
cd /usr/src/sys/modules/if_ndis && make clean
rm -f export_syms if_ndis.ko if_ndis.kld if_ndis.o if_ndis_pci.o if_ndis_pccard.o if_ndis_usb.o opt_usb.h opt_ndis.h opt_wlan.h card_if.h 
pci_if.h bus_if.h device_if.h
cd /usr/src/usr.sbin/ndiscvt && make clean
rm -f y.output ndiscvt ndiscvt.o subr_pe.o inf.o inf-token.o inf-parse.o ndiscvt.8.gz ndisgen.8.gz ndiscvt.8.cat.gz ndisgen.8.cat.gz inf-
token.c inf-parse.c y.tab.c y.tab.h
test64#	make build

cd /usr/src/sys/modules/ndis && make
Warning: Object directory not changed from original /usr/src/sys/modules/ndis
awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h
awk -f @/tools/vnode_if.awk @/kern/vnode_if.src -p
awk -f @/tools/vnode_if.awk @/kern/vnode_if.src -q
awk -f @/tools/vnode_if.awk @/kern/vnode_if.src -h
:> opt_usb.h
cc -O2 -pipe -fno-strict-aliasing -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-
growth=100 --param large-function-growth=1000 -fno-common  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-
sse2 -mno-sse3 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-
protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -
Wno-pointer-sign -fformat-extensions -c /usr/src/sys/modules/ndis/../../compat/ndis/subr_pe.c
cc -O2 -pipe -fno-strict-aliasing -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-
growth=100 --param large-function-growth=1000 -fno-common  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-
sse2 -mno-sse3 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-
protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -
Wno-pointer-sign -fformat-extensions -c /usr/src/sys/modules/ndis/../../compat/ndis/subr_ndis.c
/usr/src/sys/modules/ndis/../../compat/ndis/subr_ndis.c: In function 'NdisAllocateMemory':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_ndis.c:391: warning: format '%llu' expects type 'long long unsigned int', but argument 5 has 
type 'uint64_t'
/usr/src/sys/modules/ndis/../../compat/ndis/subr_ndis.c: In function 'NdisMFreeSharedMemory':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_ndis.c:1253: warning: format '%llu' expects type 'long long unsigned int', but argument 7 has 
type 'uint64_t'
cc -O2 -pipe -fno-strict-aliasing -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-
growth=100 --param large-function-growth=1000 -fno-common  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-
sse2 -mno-sse3 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-
protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -
Wno-pointer-sign -fformat-extensions -c /usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'WRITE_PORT_ULONG':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:101: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:101: error: (Each undeclared identifier is reported only once
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:101: error: for each function it appears in.)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'WRITE_PORT_USHORT':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:108: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'WRITE_PORT_UCHAR':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:115: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'WRITE_PORT_BUFFER_ULONG':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:122: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'WRITE_PORT_BUFFER_USHORT':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:130: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'WRITE_PORT_BUFFER_UCHAR':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:138: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'READ_PORT_USHORT':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:146: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'READ_PORT_ULONG':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:153: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'READ_PORT_UCHAR':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:160: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'READ_PORT_BUFFER_ULONG':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:167: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'READ_PORT_BUFFER_USHORT':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:175: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c: In function 'READ_PORT_BUFFER_UCHAR':
/usr/src/sys/modules/ndis/../../compat/ndis/subr_hal.c:183: error: 'X86_BUS_SPACE_IO' undeclared (first use in this function)
*** Error code 1

Stop in /usr/src/sys/modules/ndis.
*** Error code 1

Stop in /root/ralink/ndisulator.
Exit 1
test64#	make clean

cd /usr/src/sys/modules/ndis && make clean
rm -f export_syms ndis.ko ndis.kld subr_pe.o subr_ndis.o subr_hal.o subr_ntoskrnl.o kern_ndis.o kern_windrv.o subr_usbd.o winx_wrap.o opt_usb.h 
pci_if.h bus_if.h device_if.h vnode_if.h vnode_if_newproto.h vnode_if_typedef.h
cd /usr/src/sys/modules/if_ndis && make clean
rm -f export_syms if_ndis.ko if_ndis.kld if_ndis.o if_ndis_pci.o if_ndis_pccard.o if_ndis_usb.o opt_usb.h opt_ndis.h opt_wlan.h card_if.h 
pci_if.h bus_if.h device_if.h
cd /usr/src/usr.sbin/ndiscvt && make clean
rm -f y.output ndiscvt ndiscvt.o subr_pe.o inf.o inf-token.o inf-parse.o ndiscvt.8.gz ndisgen.8.gz ndiscvt.8.cat.gz ndisgen.8.cat.gz inf-
token.c inf-parse.c y.tab.c y.tab.h
test64#	make detach

umounting NDISulator code
umount /usr/src/sys/compat/ndis
umount /usr/src/sys/dev/if_ndis
umount /usr/src/sys/modules/ndis
umount /usr/src/sys/modules/if_ndis
umount /usr/src/usr.sbin/ndiscvt
test64#	exit

exit

Script done on Mon Jan 31 22:10:20 2011
```

Have I done something wrong?


----------



## richardpl (Feb 8, 2011)

You are not using stable branch of git code.


----------



## vhapkin (Feb 10, 2011)

I never worked with git and was not able to find stable version at first.
Yesterday I installed stable version of ndisulator and was doing copying for an hour.
All works fine.
Thank you very much.


----------



## tim-m89 (Feb 11, 2011)

vhapkin said:
			
		

> I never worked with git and was not able to find stable version at first.
> Yesterday I installed stable version of ndisulator and was doing copying for an hour.
> All works fine.
> Thank you very much.



There isn't really a stable version of these drivers. It's all dev quality. Use nothing but the latest snapshot unless told otherwise.


----------



## Day_JJ (Feb 13, 2011)

*[Solved] Ralink rt2870 wifi support?*

I am trying to install and configure a WiFi card that utilizes the RaLink rt2860 chipset. I did a new installation of FreeBSD 8.1 and then upgraded to 8.2 PreRelease. 



			
				tim-m89 said:
			
		

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



Then, I followed the above instructions and downloaded the the rt2860 driver for 8.0 ran the make, copied the appropriate files to /boot/kernel, and ran the ifconfig manually to test.

Everything went properly until the ifconfig command. Then I received the following response:

```
ifconfig: SIOCIFCREATE2: Device not configured
```

Is there something else I need to do to make the configure work properly? Or, did something change in 8.1 / 8.2 that requires a different process?

TIA


----------



## richardpl (Feb 13, 2011)

Did you loaded created module? Is interface shown after that?


----------



## Day_JJ (Feb 13, 2011)

*[Solved] Ralink rt2870 wifi support?*

Yes, the module was loaded and it is displayed in the module list by kldstat.


----------



## Day_JJ (Feb 13, 2011)

Day_JJ said:
			
		

> Yes, the module was loaded manually and it is displayed in the module list by kldstat.



(Missed the second part - sorry.) 
No interface is shown by ifconfig. However, I thought nothing would be shown until after the "ifconfig create..." step. Did I misunderstand what tim-m89 meant?


> 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


In GENERIC, Ralink RT2500 wireless cards have device names of ral*. Is that what I should see in the ifconfig display?


----------



## vhapkin (Feb 14, 2011)

tim-m89 said:
			
		

> There isn't really a stable version of these drivers. It's all dev quality. Use nothing but the latest snapshot unless told otherwise.



I saw this driver. It does not support my chip (rt3090).
Thanks.


----------



## Day_JJ (Feb 15, 2011)

Day_JJ said:
			
		

> I am trying to install and configure a WiFi card that utilizes the RaLink rt2860 chipset.



It looks like I had bad information. 

My WiFi card is a PCI card from B-Link - a BL-LW04-A2. The documentation I have found indicates that the card utilizes the RaLink RT2760 rather than the RT2860 chip. However, earlier in the thread (January 9th 2010), in a response to a post by Halt, egorenar indicated that the RT2860 driver should support the RT2760 chipset for this card (quote shortened):


			
				Halt said:
			
		

> Hi, I have wifi chipset RT2760, for this chipset uses ralink driver rt2860. But your driver does not find this chipset.
> 
> ```
> <snip>
> ...



My system reports indicate the card is present but reports it to have the RT3062 chipset. 

```
# pciconf -lvcb
<snip>
none1@pci0:1:2:0:	class=0x028000 card=0x30621814 chip=0x30621814 rev=0x00 hdr=0x00
    vendor     = 'Ralink Technology, Corp.'
    class      = network
    bar   [10] = type Memory, range 32, base 0xf9000000, size 65536, enabled
    cap 01[40] = powerspec 3  supports D0 D3  current D0
<snip>
```

A post in Linux wireless networking development reports "a diff of firmware.h shows no difference in ralink pci drivers (RT3562_RT3062, RT2860, RT3090)" and a download of the RT3062 Linux driver from the RaLink web site uses the same code as for the RT2860.

Does something else need to be done to the driver to find this card? Or is it something I can do by a patch or parameter?


----------



## aleev (Feb 15, 2011)

Hi! Egornar. Good job!

Is your driver set can work with rt3572 chip (LinkSys WUSB600n v.2) ?
Can say, that my ASUS WL-130N (pci) work fine with your RT2860 under FreeBSD 8.1-RELEASE.

One more question: Do you have any HCL for your driver set?

Thanx for you answers!


----------



## Day_JJ (Feb 15, 2011)

*Rt3062*

Hi egorenar,

It looks like you have spent a lot of time and work on RT2860/RT2870 support. If you are still enhancing the driver, can it be extended for the RT3062 chipset also?


----------



## wentworth (Mar 15, 2011)

*Still get issues with RT2860*

Hi all,

I have an Asus EEE 901 running i386 FreeBSD 8.2-RELEASE. I upgraded from 8.0-RELEASE a couple of weeks ago because I was getting intermittent failures of the rt2860 driver (the "rt28600: Tx watchdog timeout: resetting" messaged others have noticed), and I saw the new release was out. I recompiled egorenar's driver and loaded it. It works, but I'm still seeing the Tx watchdog timeouts after a while and like others, ifconfig still shows associated but no packets make it through.

I also tried the ndisgen tool using the latest Windows 32-bit drivers from their website, but every time I try bringing up the interface I get a kernel panic with a double fault, as again others have noticed.

My questions are:
1. Has anybody found a solution to the Tx Watchdog timeout issue?
2. If not, I saw that richardpl mentioned a solution to the NDIS issue, which involves patching ndis modules and recompiling. I'm not against that, but all the patches are against 8-STABLE, and I'd rather stick with 8-RELEASE. I searched Google and these forums but couldn't find mcuh about the NDIS problem other than richardpl's comments and the links to the patches against 8-STABLE. Does anybody have NDIS patches against 8.2-RELEASE?

Thanks much for your help!


----------



## richardpl (Mar 17, 2011)

The stable branch of my code should compile and work on 8.2 RELEASE. If it does not work for any reason (panic, compile, performance ...), post error output here or directly to me.


----------



## wentworth (Mar 20, 2011)

Hey richardpl,

I got a chance to try your ndis code today. I checked out the lastest version from the stable branch and compiled according to your directions (make attach && make build etc). Again, I'm on FreeBSD 8.2-RELEASE i386 build. The code comiled fine and replaced my if_ndis.ko and ndis.ko files in /boot/kernel/, as expected. I then used ndisgen with the latest win32 drivers from Ralink to generate a .ko file for my rt2860 card.

When I load rt2860_sys.ko (which in turn loads if_ndis.ko and ndis.ko), I get the following output:

```
NDIS: no match for ExEventObjectType
ndis0: <802.11n Wireless LAN Card> mem 0xf7ff0000-0xf7ffffff irq 19 at device 0.0 on pci1
ndis0: [ITHREAD]
wlan0: Ethernet address: [MY_MAC_ADDRESS]

Fatal double fault:
eip = 0xc61978b9
esp = 0xe7dd4d08
ebp = 0xe7dd5a38
cpuid = 0; apic id = 00
panic: double fault
cpuid = 0
KDB: stack backtrace:
#0 0xc05f008d at kdb_backtrace+0x48
#1 0xc05c06bc at panic+0x108
#2 0xc08acd76 at trap_fatal+0
Uptime: 1m18s
Cannot dump. Device not defined or unavailable.
Automatic reboot in 15 seconds - press a key on the console to abort
```

I can't dump because it's an Asus EEE 901 PC, so I don't have any swap space. The double fault was the same problem I saw with the 8.2-RELEASE ndis code, and I think it was the same problem a year ago when I tried ndis on 8.0-RELEASE. Like I said before, I'd use the rt2860 driver from earlier in this thread, but I keep getting Tx watchdog timeout errors that are also unresolved. Any other ideas?

Thanks for the suggestion though, and I'd be happy to try something else if you have an idea.


----------



## richardpl (Mar 20, 2011)

double fault may be caused by very small kernel STACK on i386. And ndis drivers like to use bigger STACK.

Recompile custom kernel with KSTACK_PAGES set to 12.


----------



## wentworth (Mar 20, 2011)

*KSTACK_PAGES=12 seems to work*

Hey richardpl,

Thanks for the tip - I recompiled my kernel with KSTACK_PAGES=12 and it did not crash. Since rebuilding the kernel overwrote the new if_ndis.ko and ndis.ko files I made yesterday, I decided to see if it would work with the original ndis driver I build using the 8.2-RELEASE code. The kernel booted fine and ifconfig said I was associated with the router, but I wasn't getting any actual network traffic (my router is configured to use WPA/WPA2 Personal with TKIP using Tomato custom firmware). I restarted the network and got a kernel panic, but I didn't hit a key in time to stop it from rebooting.

So I tried again using the if_ndis.ko and ndis.ko files I made with your NDISulator code, as well as the rt2860 driver I build with your code. When booting with your code, I also no longer get a panic. However, here's an oddity: even though my ndis driver (rt2860_sys.ko) is loaded on start in /boot/loader.conf, the ndis0 and wlan0 interfaces do not show on ifconfig. kldstat shows rt2860_sys.ko, if_ndis/ko, and ndis.ko all loaded. If I unload rt2860_sys.ko and reload it, then it is recognized and wireless works! Does your code fix something with authenticating on WPA/WPA2 networks?

So thanks for the fix (haven't noticed an Tx watchdog timeouts yet), but do you have any idea why my card doesn't attach the first time my driver is loaded?

Thanks again!


----------



## richardpl (Mar 22, 2011)

You even have message (in CAPS) in *dmesg* that loading minimport driver (created with *ndisgen*) from loader.conf is not allowed.

This is because some drivers use a routine which depends on another system thread, but while booting there is only one thread running. Before this you would get panic while booting with those drivers, I fixed panic but such drivers will remain broken after boot until you reload driver - so I just disallowed loading drivers while booting.


----------



## predicador (Mar 27, 2011)

*PCI card with rt2870 chipset not working*

Hi!

I've followed egorenar instructions to compile and load rt2870 driver in my FreeBSD 8.2 release installation. The driver is loaded, but my card is not detected:


```
[predicador@kaitain] /usr/home/predicador# ifconfig wlan0 create wlandev rt28700
ifconfig: SIOCIFCREATE2: Device not configured
```

Here is some relevant info:


```
[predicador@kaitain] /usr/home/predicador# kldstat
Id Refs Address            Size     Name
 1  127 0xffffffff80100000 df7168   kernel
 2    2 0xffffffff80ef8000 ed10     ntfs.ko
 3    1 0xffffffff80f07000 fd8      ntfs_iconv.ko
 4    5 0xffffffff80f08000 6b68     libiconv.ko
 5    1 0xffffffff80f0f000 1ad510   zfs.ko
 6    2 0xffffffff810bd000 3990     opensolaris.ko
 7    1 0xffffffff810c1000 1cbd0    geom_eli.ko
 8    2 0xffffffff810de000 2ab80    crypto.ko
 9    3 0xffffffff81109000 dc40     zlib.ko
10    1 0xffffffff81117000 1e5f8    geom_journal.ko
11    1 0xffffffff81136000 20fe0    geom_mirror.ko
12    1 0xffffffff81157000 3158     geom_uzip.ko
13    1 0xffffffff8115b000 10468    sbp.ko
14    1 0xffffffff8116c000 413b0    if_bwn.ko
15    2 0xffffffff811ae000 c9e8     siba_bwn.ko
16    1 0xffffffff811bb000 e730     if_ipw.ko
17    1 0xffffffff811ca000 13578    if_iwi.ko
18    1 0xffffffff811de000 1ebf0    if_iwn.ko
19    1 0xffffffff811fd000 12498    if_wpi.ko
20    4 0xffffffff81210000 75118    sound.ko
21    1 0xffffffff81286000 13bd8    snd_uaudio.ko
22    1 0xffffffff8129a000 1d930    rt2870.ko
```


```
[predicador@kaitain] /usr/home/predicador# pciconf -lvcb                          
none1@pci0:4:0:0:       class=0x028000 card=0x30621814 chip=0x30621814 rev=0x00 hdr=0x00
    vendor     = 'Ralink Technology, Corp.'
    class      = network
    bar   [10] = type Memory, range 32, base 0xfebf0000, size 65536, enabled
    cap 01[40] = powerspec 3  supports D0 D3  current D0
```

Maybe my card ids should be added to the driver, as I've seen in other posts...
Any help on this?

Thanks in advance!


----------



## tim-m89 (Mar 28, 2011)

predicador said:
			
		

> Hi!
> 
> I've followed egorenar instructions to compile and load rt2870 driver in my FreeBSD 8.2 release installation. The driver is loaded, but my card is not detected:
> 
> ...



Correct me if I'm wrong but I believe the 2870 is usb where as the 2860 is pci. If it is a usb device then what is the output of this command when run as root:

```
usbconfig dump_device_desc
```


----------



## predicador (Mar 28, 2011)

Well, my card is PCI; I thought I was using the right driver. However, I've tried with 2860 and same result...

This is a very important issue for me, since I can't throw a cable along my living room. Perhaps the fastest solution for me is moving to debian...

thanks a lot for your input


----------



## tim-m89 (Mar 29, 2011)

This driver may be doomed to go unsupported. run driver may support it or maybe rum. I have attached an updated rt2860 that should recognize your chip but it may be very dangerous to use it. It could be a very different product.

Attachment moved to later post->


----------



## venture37 (Mar 30, 2011)

Luckily this driver still works with -CURRENT, successfully using this with my RT2700E card which run(4) in the tree doesn't support as there is only support for USB devices & not PCIe


```
rt28600@pci0:3:0:0:	class=0x028000 card=0x27901814 chip=0x07811814 rev=0x00 hdr=0x00
    vendor     = 'Ralink Technology, Corp.'
    device     = 'Wireless (RT2860/RT2890)'
    class      = network
```


```
rt28600: <Ralink RT2790 PCIe> mem 0xf7f00000-0xf7f0ffff irq 17 at device 0.0 on pci3
rt28600: invalid EEPROM LNA gain #2: 0x00
rt28600: invalid EEPROM LNA gain #3: 0x00
rt28600: invalid EEPROM powersave level
rt28600: MAC/BBP RT2860 (rev 0x28720200), RF RT2720
rt28600: skip channel 10, could not find extension channel
rt28600: skip channel 11, could not find extension channel
rt28600: skip channel 12, could not find extension channel
rt28600: skip channel 13, could not find extension channel
rt28600: skip channel 14, could not find extension channel
```


----------



## gavo58 (Apr 5, 2011)

tim-m89 said:
			
		

> This driver may be doomed to go unsupported. run driver may support it or maybe rum. I have attached an updated rt2860 that should recognize your chip but it may be very dangerous to use it. It could be a very different product.



Sadly, the driver that you posted will not compile for me.  I have the same card as this fellow.


```
none2@pci0:3:1:0:       class=0x028000 card=0x30621814 chip=0x30621814 rev=0x00 hdr=0x00
    vendor     = 'Ralink Technology, Corp.'
    class      = network
    bar   [10] = type Memory, range 32, base 0xe2000000, size 65536, enabled
    cap 01[40] = powerspec 3  supports D0 D3  current D0
```
I have tried several drivers without success.

I am running 8.2 amd64.

Thanks!


----------



## tim-m89 (Apr 6, 2011)

gavo58 said:
			
		

> Sadly, the driver that you posted will not compile for me....



Try this attached driver and post the output when you run the command 
	
	



```
make
```
 within the directory of the Makefile

if there really was an error it might of been because I forgot to clean the old one.

If are sure there is no compile error this time then to get it working (requires super user permissions):

```
cp rt2860.ko /boot/modules/
chmod 555 /boot/modules/rt2860.ko
```
load it up without rebooting:

```
kldload rt2860.ko
```
set up the wlan now:

```
ifconfig wlan0 create wlandev rt28600
```
Then do your ifconfig things on the newly created wlan0 and it should work. Instruction on first post for boot time config.


----------



## venture37 (Apr 16, 2011)

venture37 said:
			
		

> Luckily this driver still works with -CURRENT, successfully using this with my RT2700E card which run(4) in the tree doesn't support as there is only support for USB devices & not PCIe
> 
> 
> ```
> ...



The card is a AzureWave AW-NE766-VOA
Model No: RT2700E


----------



## wani (Jun 3, 2011)

Hello,

I just installed FreeBSD for the first time and I don't have an ethernet connection (only wireless). My PCI adapter's model is WMP600N which I believe is supported by egorenar's rt2860 driver. I compiled the code with *make* but when I write [CMD=""]#./rt2860.sh[/CMD]
I get an error saying the command doesn't exist.

I saw someone using kldload, but when I try it I get an error.


```
#kldload ./rt2860.ko
link_elf: symbol ieee80211_amrr_tx_complete undefined
kldload: can't load ./rt2860.ko : no such file or directory
```

I used *chmod +x* on both files in case it was the problem. And in rt2860.sh I changed

```
#!/bin/sh
```
to

```
#!/bin/csh
```
(but I've been told to forget about the .sh file.)

So I also tried copying rt2860.ko in /boot/modules. Changed the rights with [CMD=""]chmod 555 /boot/modules/rt2860.ko[/CMD] but again 
	
	



```
kldload rt2860.ko
link_elf: symbol ieee80211_amrr_tx_complete undefined
kldload: can't load ./rt2860.ko : no such file or directory
```

I am quite the newbie with UNIX, is there something more I should have done?

Thanks.


----------



## tim-m89 (Jun 9, 2011)

Hi Wani, make sure you have got the latest source and you have chosen the correct one for your hardware and FreeBSD version.

Do a *make clean* in its directory and then build and install it as usual.

If that doesn't work then try rebuilding your kernel.


----------



## molli123 (Oct 3, 2011)

tim-m89 said:
			
		

> Hi Wani, make sure you have got the latest source and you have chosen the correct one for your hardware and FreeBSD version.


hi,

is there still development on this driver? It seems at least 15 months old.

Did anyone try it in FreeBSD9? Are there plans to integrate it into BASE?


----------



## hopto (Jan 20, 2012)

Help please with the driver for wifi card D-link dwa-525 chipset rt3060...


----------



## DutchDaemon (Jan 21, 2012)

Open a new topic, because your request has little to do with the subject of this topic.


----------



## alphakiller (Oct 23, 2014)

Hi guys,  *I*'m new on this forum, *I*'ve installed freebsd FreeBSD 10.0 a few days ago on my *A*cer *A*spire 1300 notebook and *I* have no experience with *BSD system_s_. My notebook didn't have a wireless chip, so I bought a _USB_ Wifi dongle with the *R*alink rt2870 chip. Can I install this driver on my notebook? *O*r, is there another way to get it working? Thanks.


----------



## alphakiller (Oct 27, 2014)

Solved upgrading FreeBSD to the latest 10.0-RC3 and configuring settings as described in Wireless Network, from the official guide. Hope that can be useful


----------

