Finished: CALL FOR TESTERS Ralink wireless run(4) usb driver for FreeBSD

kvchung said:
# lspci -v not work
I try pciconf
Code:
pciconf -lv
...
none0@pci0:1:0:0:       class=0x028000 card=0x27901814 chip=0x07811814 rev=0x00 hdr=0x00
    vendor     = 'Ralink Technology, Corp'
    device     = 'Wireless (RT2860/RT2890)'
    class      = network

OK, you have a PCIe card.
VendorID=0x1814 and ProductID=0x0781
Wait a second and i will update my driver.
 
kvchung said:
# lspci -v not work
I try pciconf
Code:
pciconf -lv
...
none0@pci0:1:0:0:       class=0x028000 card=0x27901814 chip=0x07811814 rev=0x00 hdr=0x00
    vendor     = 'Ralink Technology, Corp'
    device     = 'Wireless (RT2860/RT2890)'
    class      = network

OK, i updated the driver, you can try it again
and provide feedback. I could not test my driver with this device
so there is a possibility that some problems can occur.

:e
 
It can find the device now
when I klkload, I get these message in dmesg
Code:
# kldload ./rt28600.ko

rt28600: <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:42:25:27
rt28600: EEPROM RF rev=0x0003, paths=1T2R
rt28600: EEPROM NIC config: Tx AGC control=0
rt28600: EEPROM country code=1/7
rt28600: EEPROM freq offset=0x1c
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: 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
rt28600: [ITHREAD]
wlan0: Ethernet address: 00:22:43:42:25:27
rt28600: initializing
rt28600: loading 8051 microcode
rt28600: 8051 microcode was successfully loaded
wlan0: ieee80211_new_state_locked: pending INIT -> SCAN transition lost

and I started to scan
It can list th APs

Code:
# ifconfig wlan0 up list scan

SSID/MESH ID    BSSID              CHAN RATE   S:N     INT CAPS
NCTU-Wireless   00:0b:86:9c:31:80    1   11M -143:-95   60 ES
0               00:02:6f:22:00:ae    1   54M -137:-95  100 ES
NCTU_NOD lab    00:22:b0:94:c8:f7    6   54M -138:-95  100 ES   MESHCONF MESHCON
F WPS HTCAP WME
Kan Cheng T...  00:23:6c:8d:f5:97   11   54M -136:-95  100 E    HTCAP WME
y955188         00:1f:1f:47:c0:64   11   54M -154:-95  100 EP   MESHCONF MESHCON
F HTCAP RSN WME
NCTU-HOT-1-G    00:90:4b:bd:f4:30   11   54M -141:-95  100 ES
NCTU-HOT-1-A    00:90:4b:bd:f4:40   13   54M -142:-95  100 ES
ndlit           00:12:7f:ca:f0:a0    4   54M -138:-95  100 ES
ndl-ap2         00:1f:9e:c0:19:c0    8   54M -138:-95  100 EPS  WME
Personal        00:24:8c:ec:20:dc    1   54M -145:-95  100 EPS  RSN
guest           00:12:7f:ca:f3:a0   10   54M -137:-95  100 ES
NCTU-Wireless   00:0b:86:9c:4b:30   11   11M -138:-95   60 ES

but wlan0 still no carrier

Code:
# ifconfig 

...
rt28600: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:22:43:42:25:27
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
        status: associated
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:22:43:42:25:27
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        ssid NCTU-Wireless channel 5 (2432 Mhz 11g)
        country US authmode OPEN privacy OFF txpower 0 bmiss 7 scanvalid 60
        bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5
        protmode CTS wme burst bintval 0


Sorry, this is my first time using wireless lan on freebsd...
 
kvchung said:
It can find the device now
when I klkload, I get these message in dmesg
Code:
# kldload ./rt28600.ko

rt28600: <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:42:25:27
rt28600: EEPROM RF rev=0x0003, paths=1T2R
rt28600: EEPROM NIC config: Tx AGC control=0
rt28600: EEPROM country code=1/7
rt28600: EEPROM freq offset=0x1c
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: 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
rt28600: [ITHREAD]
wlan0: Ethernet address: 00:22:43:42:25:27
rt28600: initializing
rt28600: loading 8051 microcode
rt28600: 8051 microcode was successfully loaded
wlan0: ieee80211_new_state_locked: pending INIT -> SCAN transition lost

and I started to scan
It can list th APs

Code:
# ifconfig wlan0 up list scan

SSID/MESH ID    BSSID              CHAN RATE   S:N     INT CAPS
NCTU-Wireless   00:0b:86:9c:31:80    1   11M -143:-95   60 ES
0               00:02:6f:22:00:ae    1   54M -137:-95  100 ES
NCTU_NOD lab    00:22:b0:94:c8:f7    6   54M -138:-95  100 ES   MESHCONF MESHCON
F WPS HTCAP WME
Kan Cheng T...  00:23:6c:8d:f5:97   11   54M -136:-95  100 E    HTCAP WME
y955188         00:1f:1f:47:c0:64   11   54M -154:-95  100 EP   MESHCONF MESHCON
F HTCAP RSN WME
NCTU-HOT-1-G    00:90:4b:bd:f4:30   11   54M -141:-95  100 ES
NCTU-HOT-1-A    00:90:4b:bd:f4:40   13   54M -142:-95  100 ES
ndlit           00:12:7f:ca:f0:a0    4   54M -138:-95  100 ES
ndl-ap2         00:1f:9e:c0:19:c0    8   54M -138:-95  100 EPS  WME
Personal        00:24:8c:ec:20:dc    1   54M -145:-95  100 EPS  RSN
guest           00:12:7f:ca:f3:a0   10   54M -137:-95  100 ES
NCTU-Wireless   00:0b:86:9c:4b:30   11   11M -138:-95   60 ES

but wlan0 still no carrier

Code:
# ifconfig 

...
rt28600: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
        ether 00:22:43:42:25:27
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
        status: associated
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:22:43:42:25:27
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        ssid NCTU-Wireless channel 5 (2432 Mhz 11g)
        country US authmode OPEN privacy OFF txpower 0 bmiss 7 scanvalid 60
        bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5
        protmode CTS wme burst bintval 0


Sorry, this is my first time using wireless lan on freebsd...


Hm, did you modified your rc.conf as i said and of cause you need to configure your wpa_supplicant. Did you do this ?

PS: you can write to my ICQ account and i can help you faster.
 
Just one suggestion:
Could you please re-name the driver?
It is really odd to have device names with more that one digit at the end...
 
I have started to port my rt2870 device driver to FreeBSD 8.
I think in 2 days you can test the first working version.

:e :e :e
 
OK Then I guess I have to upgrade to BSD 8 :)
But still wondering about the Access point mode of your driver?
Is it supporter or for now you are just makeing it for client modes?
 
gnoma said:
OK Then I guess I have to upgrade to BSD 8 :)
But still wondering about the Access point mode of your driver?
Is it supporter or for now you are just makeing it for client modes?

Don't worry, i will support both FreeBSD 7.2 and FreeBSD 8.
FreeBSD 8 version of rt2860 device driver is not better than
FreeBSD 7.2 version of the driver. But FreeBSD 8 supoorts VAPs
and rt2860 chip supports 8 VAPs in hardware, so if you want to
use the newest 802.11 stack features then upgrade to FreeBSD 8.
:)

And yes, i will try to make AP mode working in the next days.



:e:e:e
 
Questions

Hi,

@ egorenar I compiled your driver & can kldload it but i dont get any device in my ifconfig, dmesg shows insertion of ugen device, my usb wifi stick is Edimax EW-7711UTn. Any ideas ?

@ PseudoCylon, I compiled your drivers too, can get them to load & can see run0 device, Are you planning on adding h/w encryption ? as i'm having troubles with wpa_supplicant, i can get it working ok without encryption. I'm using PC-BSD gallileo which is 7.2 based.

The thread is hard to follow at times as it also contains posts relating to other RT chips & drivers.

But all good stuff.
 
Hi dDMC

My driver for 7.2 doesn't support any encryption. (updated on Jan 09, 2010: but, now it supports. Please see the first post for details.) Since I already upgraded to 8.0, there won't be any update on driver for 7.2. Once they upgrade PC-BSD to 8, my driver should work.

I'm still tweaking the driver for 8.0 and current. Update is coming.
 
dDMC said:
Hi,

@ egorenar I compiled your driver & can kldload it but i dont get any device in my ifconfig, dmesg shows insertion of ugen device, my usb wifi stick is Edimax EW-7711UTn. Any ideas ?

@ PseudoCylon, I compiled your drivers too, can get them to load & can see run0 device, Are you planning on adding h/w encryption ? as i'm having troubles with wpa_supplicant, i can get it working ok without encryption. I'm using PC-BSD gallileo which is 7.2 based.

The thread is hard to follow at times as it also contains posts relating to other RT chips & drivers.

But all good stuff.

Hi,

i need USB vendor and product IDs of your device.
So i can add them to my driver.

Try "lsusb -vv" and post here the IDs.

If you have the device (0x7392,0x7718) or (0x7392,0x7717) then you are lucky
and my driver should support it. :)

7392:7711 means you have rt3070 chip in your device and my driver doesn't support this chip.


:e :e :e
 
PseudoCylon, is it still possible to run wpa_supplicant on top of the run0 interface ?

I've been trying WPA-PSK & TKIP but get a IOCTL SIOCS80211 op19 len 60 invalid argument error.
 
Good news guys :)
I ported the first version of rt2870 device driver to FreeBSD 8.
It is not very stable yet but hardware encryption works (WEP, TKIP, AES). I will try to make it stable and then upload it here.

:e :e :e
 
dDMC said:
PseudoCylon, is it still possible to run wpa_supplicant on top of the run0 interface ?

I've been trying WPA-PSK & TKIP but get a IOCTL SIOCS80211 op19 len 60 invalid argument error.

That's because the driver doesn't support any encryption.

But, I have fixed the driver. It is just a band-aid fix, but it handles h/w encryption (WEP 1/2 AES/TKIP). So, wpa_supplicant should work with fixed driver, now.

Hope this is good enough while waiting for PC-BSD 8 release. One for 8 and current is solid one. If your device runs on my driver, it will most definitely run on 8's, too. No need for searching the driver.

How to use
just replace the if_run.c then compile and load.
no need to do any thing with firmware (runfw) not even unloading it if it's already loaded.
-- updated on Jan 09, 2010 --
Or go to the first post for the latest update.
 

Attachments

  • if_run_7.2_bandaid.tar.bz2
    19.6 KB · Views: 226
I promised rt2870 device driver for FreeBSD 8 and here it is.
It is quite stable now. I tested TKIP and AES hardware encryption
and QoS works fine. AP mode is still not working, trying to make it work :)
Please send me your bug reports and feedback.
I would appreciate it. Thanks.

Currently surfing with it on FreeBSD 8 :)

Installation:

1. Extract archive
2. run "make"
3. Load rt2870.ko module with kldload

Have fun.

:e :e :e
 

Attachments

  • rt2870_fbsd8.tar.bz2
    30.4 KB · Views: 277
gnoma said:
OK Then I guess I have to upgrade to BSD 8 :)
But still wondering about the Access point mode of your driver?
Is it supporter or for now you are just makeing it for client modes?

Hi, i have good news for you. I implemented AP mode for rt2860 and rt2870 chip devices and first tests were successfull. I could associate with AP and AES works :e It is the first working version
with AP mode and i will try to test it more before i upload it here. So be patient :)
Association, authentication and WPA handshake works !!! :)

:e :e :e
 
Here is the rt2870 device driver with HOSTAP mode :e
Please test it and report back any bugs and problems.
I only tested association and WPA handshake.
DHCPD works also.
First tests were very good :)
Thanks for feedback in advance.


19.12.2009
Fixed bug in HOSTAP mode with association id == 0

I tested the driver now and it is quite stable, could download large files in HOSTAP mode :)

:e :e :e
 

Attachments

  • rt2870_fbsd8.tar.bz2
    30.8 KB · Views: 246
Thank you about the driver :) I realy can't wait to see it, sounds realy good but...
Code:
# ls
@                       rt2870_eeprom.h         rt2870_rf.h
Makefile                rt2870_io.c             rt2870_rxinfo.h
bus_if.h                rt2870_io.h             rt2870_rxwi.h
device_if.h             rt2870_led.c            rt2870_softc.h
machine                 rt2870_led.h            rt2870_txinfo.h
opt_usb.h               rt2870_read_eeprom.c    rt2870_txwi.h
rt2870.c                rt2870_read_eeprom.h    rt2870_ucode.h
rt2870.sh               rt2870_reg.h            usbdevs.h
rt2870_debug.h          rt2870_rf.c
#
#
# make
Warning: Object directory not changed from original /usr/home/gnoma/New.Folder/rt2870_fbsd8
cc -O2 -fno-strict-aliasing -pipe -DRT2870_DEBUG -D_KERNEL -DKLD_MODULE -std=c99 -nostdinc   -I. -I@ -I@/contrib/altq -finline-limit=8000 
--param inline-unit-growth=100 --param large-function-growth=1000 -fno-common -g -mno-align-long-strings -mpreferred-stack-boundary=2  
-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-
prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -c rt2870_io.c
In file included from rt2870_io.h:21,
                 from rt2870_io.c:18:
rt2870_softc.h:144: error: field 'vap' has incomplete type
rt2870_io.c: In function 'rt2870_io_vendor_req':
rt2870_io.c:383: error: storage size of 'usb_req' isn't known
rt2870_io.c:384: error: 'usb_error_t' undeclared (first use in this function)
rt2870_io.c:384: error: (Each undeclared identifier is reported only once
rt2870_io.c:384: error: for each function it appears in.)
rt2870_io.c:384: error: expected ';' before 'error'
rt2870_io.c:391: warning: left-hand operand of comma expression has no effect
rt2870_io.c:392: warning: left-hand operand of comma expression has no effect
rt2870_io.c:393: warning: left-hand operand of comma expression has no effect
rt2870_io.c:395: error: 'error' undeclared (first use in this function)
rt2870_io.c:396: warning: passing argument 1 of 'usbd_do_request_flags' from incompatible pointer type
rt2870_io.c:396: warning: passing argument 2 of 'usbd_do_request_flags' from incompatible pointer type
rt2870_io.c:396: warning: passing argument 4 of 'usbd_do_request_flags' makes integer from pointer without a cast
rt2870_io.c:396: warning: passing argument 6 of 'usbd_do_request_flags' makes integer from pointer without a cast
rt2870_io.c:396: error: too many arguments to function 'usbd_do_request_flags'
rt2870_io.c:383: warning: unused variable 'usb_req'
*** Error code 1

Stop in /usr/home/gnoma/New.Folder/rt2870_fbsd8.
#

Is this normal???
 
gnoma said:
Thank you about the driver :) I realy can't wait to see it, sounds realy good but...
Code:
# ls
@                       rt2870_eeprom.h         rt2870_rf.h
Makefile                rt2870_io.c             rt2870_rxinfo.h
bus_if.h                rt2870_io.h             rt2870_rxwi.h
device_if.h             rt2870_led.c            rt2870_softc.h
machine                 rt2870_led.h            rt2870_txinfo.h
opt_usb.h               rt2870_read_eeprom.c    rt2870_txwi.h
rt2870.c                rt2870_read_eeprom.h    rt2870_ucode.h
rt2870.sh               rt2870_reg.h            usbdevs.h
rt2870_debug.h          rt2870_rf.c
#
#
# make
Warning: Object directory not changed from original /usr/home/gnoma/New.Folder/rt2870_fbsd8
cc -O2 -fno-strict-aliasing -pipe -DRT2870_DEBUG -D_KERNEL -DKLD_MODULE -std=c99 -nostdinc   -I. -I@ -I@/contrib/altq -finline-limit=8000 
--param inline-unit-growth=100 --param large-function-growth=1000 -fno-common -g -mno-align-long-strings -mpreferred-stack-boundary=2  
-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-
prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -c rt2870_io.c
In file included from rt2870_io.h:21,
                 from rt2870_io.c:18:
rt2870_softc.h:144: error: field 'vap' has incomplete type
rt2870_io.c: In function 'rt2870_io_vendor_req':
rt2870_io.c:383: error: storage size of 'usb_req' isn't known
rt2870_io.c:384: error: 'usb_error_t' undeclared (first use in this function)
rt2870_io.c:384: error: (Each undeclared identifier is reported only once
rt2870_io.c:384: error: for each function it appears in.)
rt2870_io.c:384: error: expected ';' before 'error'
rt2870_io.c:391: warning: left-hand operand of comma expression has no effect
rt2870_io.c:392: warning: left-hand operand of comma expression has no effect
rt2870_io.c:393: warning: left-hand operand of comma expression has no effect
rt2870_io.c:395: error: 'error' undeclared (first use in this function)
rt2870_io.c:396: warning: passing argument 1 of 'usbd_do_request_flags' from incompatible pointer type
rt2870_io.c:396: warning: passing argument 2 of 'usbd_do_request_flags' from incompatible pointer type
rt2870_io.c:396: warning: passing argument 4 of 'usbd_do_request_flags' makes integer from pointer without a cast
rt2870_io.c:396: warning: passing argument 6 of 'usbd_do_request_flags' makes integer from pointer without a cast
rt2870_io.c:396: error: too many arguments to function 'usbd_do_request_flags'
rt2870_io.c:383: warning: unused variable 'usb_req'
*** Error code 1

Stop in /usr/home/gnoma/New.Folder/rt2870_fbsd8.
#

Is this normal???

Do you compile on FreeBSD 7.2. Because this version is for FreeBSD 8 :)
 
And here is the rt2860 device driver for FreeBSD 8 with HOSTAP mode
and interrupt mitigation to improve performance :)

Please send your feedback to me and bug reports. Thanks.

19.12.2009
Fixed bug in HOSTAP mode with association id == 0

:e :e :e
 

Attachments

  • rt2860_fbsd8.tar.bz2
    34.6 KB · Views: 292
Ops. I realy did it on freebsd 7.2
Sorry I don't have the time to upgrade to fbsd8 right now. May be tomorrow I'll test it.
 
Back
Top