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

Dein said:
It looks like I found some crash scenario.

1. Config:
HostAP mode 11g
hostap.conf
Code:
hw_mode=g
interface=wlan0
logger_syslog=-1
logger_syslog_level=0
logger_stdout=-1
logger_stdout_level=0
debug=3
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel
#### IEEE 802.11 related config ####
ssid=freebsd
macaddr_acl=0
auth_algs=1
#### IEEE 802.1X related config ####
ieee8021x=0
#### WPA/IEEE 802.11i config #####
wpa=3
wpa_passphrase=11111111
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
2. Notebook (asus eee) connected via wifi from Windows Home to freebsd. Signal level fine. Starting [CMD="ping -t -l 1024 qbic"][/CMD]
3. Go far from AP till signal lost.
4. Returning to coverage...
5. Freebsd crashed with:
Code:
wlan0: ieee80211_new_state_locked: pending INIT -> SCAN transition lost
Sleeping thread (tid 100053, pid 0) owns a non-sleepable lock
panic: sleeping thread
cpuid = 0

P.S. mmm do you have any bugtracking system like JIRA or bugzilla?

Does it happen every time you do it ?
Crash dump would be most useful for me. Did your system save
the crash dump ? Unfortunately, i cannot test this scenario by myself because i have only one PC and a hardware AP :-(

An i don't have any bugtracking system but you can send everything to my email account.
 
Dein said:
It looks like I found some crash scenario.

1. Config:
HostAP mode 11g
hostap.conf
Code:
hw_mode=g
interface=wlan0
logger_syslog=-1
logger_syslog_level=0
logger_stdout=-1
logger_stdout_level=0
debug=3
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel
#### IEEE 802.11 related config ####
ssid=freebsd
macaddr_acl=0
auth_algs=1
#### IEEE 802.1X related config ####
ieee8021x=0
#### WPA/IEEE 802.11i config #####
wpa=3
wpa_passphrase=11111111
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
2. Notebook (asus eee) connected via wifi from Windows Home to freebsd. Signal level fine. Starting [CMD="ping -t -l 1024 qbic"][/CMD]
3. Go far from AP till signal lost.
4. Returning to coverage...
5. Freebsd crashed with:
Code:
wlan0: ieee80211_new_state_locked: pending INIT -> SCAN transition lost
Sleeping thread (tid 100053, pid 0) owns a non-sleepable lock
panic: sleeping thread
cpuid = 0

P.S. mmm do you have any bugtracking system like JIRA or bugzilla?

I could reproduce this error by simply restarting hostapd daemon.

Code:
# /etc/rc.d/hostapd restart

I'm working now on a solution.

UPDATE
I have found a solution. Whe i'm done implementing it, i will upload the new version
of driver. The problem is LOCKING in 802.11 stack :-(

UPDATE
Bug fixed, new version here http://forums.freebsd.org/showpost.php?p=55365

:e :e :e
 
ergorenar the driver is great, now works just fine. I tryed this scenario to go out of range and I had no problems. After manualy ifconfig ofcorse.
I tryed a heavy download, gaming, all night constant pinging and there was no problem. It works great. I guess I am to lazy do migrate on BSD8 so I can make it on boot ifconfig-ing but it is still great.
Thank you! You are the man!
 
gnoma said:
ergorenar the driver is great, now works just fine. I tryed this scenario to go out of range and I had no problems. After manualy ifconfig ofcorse.
I tryed a heavy download, gaming, all night constant pinging and there was no problem. It works great. I guess I am to lazy do migrate on BSD8 so I can make it on boot ifconfig-ing but it is still great.
Thank you! You are the man!

Thanks for feedback. I appreciate it.

The problem you mentoned appears only with rt2870 device driver.
And you are using rt2860 device driver.

And i'm investigating the problem with autoloading on FreeBSD 7.2

:e :e :e
 
The run(4) driver, ported from OpenBSD by PseudoCylon, has now been committed to FreeBSD 9-CURRENT.
 
There are updates on the driver for 8.0 and CURRENT. (The same driver still works on both.) The driver is posted at [thread=7562]the first thread[/thread].

Most of updates apply to RT3572 chipset. Also, new firmware is required (included in the tarball) by this updates. Please update both driver and firmware.

And, some patches to RT30XX chipset.

Details are on RELEASE_NOTES included.
 
Supports for HOSTAP mode has been added, and it's been working for 80+ hours straight. Try it out.

As usual, you can get it at [thread=7562] the first thread[/thread].
 
@freenaswrls
Sorry, not from me. I'm quite handful with CURRENT and 8.0. I only know one individual trying to make it work on pfSense. That's about it. You would be luckier if you post questions at their forums/mailing list. They are listed [thread=7290]here[/thread]

@GeorgeMitchell
High Five! Thank you for testing.
 
PseudoCylon said:
@freenaswrls
Sorry, not from me. I'm quite handful with CURRENT and 8.0. I only know one individual trying to make it work on pfSense. That's about it. You would be luckier if you post questions at their forums/mailing list. They are listed [thread=7290]here[/thread]

okay, thanks a lot!
 
thanks for your work.

I got a usb rt2870 and had checked out head kernel code.

I can see run0 interface.
when I try wpa_supplicant -i run0 -c ./homewireless.conf -ddd

wpa_supplicant log shows

Code:
ioctl[SIOCG80211, op 98, len 32]: Invalid argument
wpa_driver_bsd_init: failed to get device capabilities: Invalid argument
Failed to initialize driver interface.
.....

should I upgrade wpa_supplicant? Or something else wrong?

homewireless.conf:
Code:
nework={
ssid="home"
psk="xxxxxx"
}

thanks.
 
bsdfan said:
when I try wpa_supplicant -i [b]run0[/b] -c ./homewireless.conf -ddd

First you need to create wlan with
# ifconfig wlan create wlandev [b]run0[/b]
Then,
# wpa_supplicant -B -i [b]wlan0[/b] -c ./homewireless.conf

You only need to use run0 when creating wlan. Once wlan is created, use wlan0 instead of run0. i.e ifoncif wlan0 up, ifconfig wlan0 down, e.t.c. This is new to 8.0. Here are more [thread=8784]details[/thread].
 
thanks!
I figured that out too after I read document.
but with 9.0-CURRENT kernel but 8.0 release userland, not sure why wpa_supplicant got all of scan ssid "", although I can see the mac is from my ap but the ssid is empty and ifconfig can scan correctly.

I will try a full 9.0 -current.

thanks again!
 
bsdfan said:
but with 9.0-CURRENT kernel but 8.0 release userland, not sure why wpa_supplicant got all of scan ssid "", although I can see the mac is from my ap but the ssid is empty and ifconfig can scan correctly.

You've might already swiched to CURRENT, but are you saying
% ifconfig wlan0 list scan
shows correct SSID on CURRENT, but all empty SSID on 8.0? (Though, you get correct BSSID on both, CURRENT and 8.0.)
 
No.
Actually I compiled head kernel source on 8.0 release so I had 9.0-current kernel on 8.0 release userland.
"ifconfig wlan0 list scan" does show correct essid but the scan results from wpa_supplicant didn't(many empty ssids) so I thought it must be something changed in 802.11 stack but wpa_supplicant didn't follow yet.
then I downloaded 9.0-current iso(it was compiled in feb.2010) and install it, update kernel source to head and recompile kernel(it will have your run support), now wpa_supplicant can show ssid correctly.
now it can work with wpa_supplicant on 9.0-current although there are other filesystem bugs with 9.0-current so I have to go back to 8.0 and recompile world!

thank you very much!
 
It seems that there is a problem with 5G, 2.4G seems ok. When I scan a 5.765G(chan 153), it can't find it and it takes many times to find once but it seems Linux can easily find it.

thanks
 
First, 11n support hasn't been added, yet. But...

You can speed up scanning process on 5G channels with
# ifconfig wlan0 outdoor
This will limit scanning on channels 149 and above. Due to regulatory constraints, this might not work, i.e. in US. Then, set mode to 11a
# ifconfig wlan0 mode 11a
This will skip scanning on b/g channels. Otherwise, it scans from channel 1. With "outdoor" option, device will scan + assoc (with 11a + chan 153 AP) in a few second.
 
thanks for reply.
can I know what is necessary for 11n?

>Due to regulatory constraints, this might not work, i.e. in US. Then, set mode to 11a
Is this limited by the hardware? I enabled the debug info from linux driver and I see country code is in eeprom's parameter.

good to know the "mode 11a"
 
bsdfan said:
can I know what is necessary for 11n?
To be quick, make list of channels and tell h/w to use it and to behave as 11n device.

bsdfan said:
Is this limited by the hardware? I enabled the debug info from linux driver and I see country code is in eeprom's parameter.
No. It is limited by s/w. Those ifconfig options are little cheats to finish scan quicker. So, the device can find chan 153 quicker. (Without any cheat, scanning all available channels (1 to 173) should be finished within 10 sec.)
 
PseudoCylon said:
Thanks. I'm looking forward to having a patch.

I have found some bugs, too. Check the repository, just in case.

thanks!

one question is why you change it from 8 to 10? according to Linux 2870 driver, pAd->EEPROMDefaultValue[0-18], first 3 is nic1,2, country region, but in LInux driver code it only read 8 uint16t from eeprom, and the left 8 will be 0.
so what is the real number of bbps setting?

Code:
         /* read vender BBP settings */

1395         for (i = 0; i < 10; i++) {

1396                 run_srom_read(sc, RT2860_EEPROM_BBP_BASE + i, &val);

1397                 sc->bbp[i].val = val & 0xff;

1398                 sc->bbp[i].reg = val >> 8;

1399                 DPRINTF("BBP%d=0x%02x\n", sc->bbp[i].reg, sc->bbp[i].val)

thanks,
 
bsdfan said:
one question is why you change it from 8 to 10? according to Linux 2870 driver, pAd->EEPROMDefaultValue[0-18], first 3 is nic1,2, country region, but in LInux driver code it only read 8 uint16t from eeprom, and the left 8 will be 0.
so what is the real number of bbps setting?
Short answer is 19.

There are 19 short values to read.
bsdfan said:
pAd->EEPROMDefaultValue[0-18]
[0-18] means 19 slots. My driver and linux driver agree with it.

My code reads word at a time, so I need to loop 10 times. (Looping 9½ times won't work.)

Linux driver should look like
Code:
pAd->EEPROMDefaultValue[0] = nic1;
pAd->EEPROMDefaultValue[1] = nic2;
pAd->EEPROMDefaultValue[2] = country;

for(i = 0; i < 8; i++){
read_eeprom16(aAd, EEPROM_BBP_BASE + i*2, tmp);
pAd->EEPROMDefaultValue[i + 3] = tmp;
}
reads first 3 bytes and then loop 8 times to read 4th to 19th byte. (3 + word x 8 = 19 bytes)
 
PseudoCylon said:
-- Update on Jan 29, 2010 --

The run(4) driver has been committed to FreeBSD 9-CURRENT.

The driver works with
RT2700U == RT2770 MAC/BBP + RT2720 (1T2R) or RT2750 (dual-band 1T2R) radio
RT2800U == RT2870 MAC/BBP + RT2820 (2T3R) or RT2850 (dual-band 2T3R) radio
RT3000U == RT3070 MAC/BBP + RT3020 (1T1R), RT3021 (1T2R) or RT3022 (2T2R) single-band radio
list of known devices are posted at thread #3

Here are the latest releases of drivers. (last update Mar 04, 2010)

for CURRENT users
As joel@ has announced for me, the driver has been committed (r203134). All you have to do is to synchronize your source. (for the latest release, check out my git repository, see below)

for 8.0 users run-8.0-REL_3.tar.bz2 << You can click this.
Or, you can git(1) at git://dev.nasreddine.com/run.git or http view (Please fetch 'hostap_rc' branch.)

for 7.2 users View attachment 739 << You can click this.
The final version
I have upgraded all my boxes to 8.0 or CURRENT, so I cannot do anything for 7.2 driver. "Final" means no more update, not complete. But it supports STA mode and h/w encryption. Hope this is good enough until upgrading to 8.

Thank you for testing and reporting problems.

-- Followings are original post. Left it here for log purpose --
Hello every one!

I'm porting run (ru'N' not ru'M') driver View attachment 426, and I've made it work (-encryption). Actually, I'm posting this by using that driver. You can find a list of supported devices here.
http://www.openbsd.org/cgi-bin/man....anpath=OpenBSD+Current&arch=amd64&format=html

It hasn't support encryption yet and has some issues, but I thought it is better than nothing and decided to share. If anyone want to try it out, download tar ball and read README in it.

I'm planning to make encryption work. But, I am an ex-MECHANICAL engineer and I installed very first FreeBSD little over a year ago. So, don't expect too much. It will take several weeks. Or, you can help me out.


-- updated on Nov 10, 2009 --
Now, the driver for CURRENT (and 8 RC) is available at thread #28 (One posted here is for 7.)

-- updated on Nov. 28, 2009 --
-- FIX -- FIX -- FIX -- View attachment 500
Some packet loss/drop and memory leak were identified and fixed. (The perfomance has been improved, too.) Details are on RELEASE_NOTES included.

For those wondering about HOSTAP support, here is the word from the original author. (If you don't know who he is, check how many wireless drivers he has written.)
http://old.nabble.com/Re:-Linksys-WUSB600N-and-Access-Point-p21332878.html
I was looking forward to HOSTAP mode by myself. I might play with it, but don't hope for miracles.

Greetings,
I have some questions about procedure in the README file in the run-8.0-REL_3.tar.bz2
archive.
First, I am dual-booting win2k3 enterprise LVE && freebsd-8. I will have no internet access
for FreeBSD until I get my ENCORE ENUWI-N3 dongle to work in FreeBSD.
The software CD that came with it installed rt2870.sys. I tried egorenar's driver
(http://forums.freebsd.org/showthread.php?p=76769). But he advised me to use the "run" driver. So here I am. :)
Code:
[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
Code:
[b]#usbconfig dump_device_desc[/b]
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

I know this may sound stupid. But being as I have to keep bouncing back-and-forth (reboting)
between windows and freebsd. I want to make sure I don't make this more difficult than
it needs to be.
According the the README:
Code:
How to use
----------
0) read Ralink license at
	sys/contrib/dev/run/LICENSE
1) over write usbdevs
	%cd sys/dev/usb
	#cp usbdevs /usr/src/sys/dev/usb/
	  (or where ever your src files are)
2) make firmware
	%cd sys/modules/runfw
	%make
	#make install
3) make driver
	%cd sys/modules/usb/run
	%make
	#make install
4) load firmware
	#kldload runfw
		(Optional: Driver will load fw for you as long as fw is installed.)
5) load driver
	#kldload if_run
6) create wlan (new to FreeBSD 8.0)
	#ifconfig wlan create wlandev run0
	#ifconfig wlan0 country XX
		substitute "XX" with proper country code. The list of available
		country code can be viewed by running
			%ifconfig wlan0 list countries
		The default country is US. So, if you live in north America region,
		setting country code doesn't matter.
7) configure it for your needs, for example, "ifconfig wlan0 up",
   "wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf", etc.
My copy of the archive run-8.0-REL_3.tar.bz2 has no "sys" folder in it. Yet, I assume
I need to copy (and overwrite) files located in my "sys" && "src/sys" tree - yes?
When referring to sys && src can you please reference "archive" folder vs "system" folder,
so it is real clear which one is which?

Thank you for all your time and consideration.
Thank you also, for all your hard work on this driver.

--Chris (g_willikers)
 
Back
Top