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

PseudoCylon said:
@HighTowerThis is a restarting issue I have from the beginning. Some how the device with RF2020 radio chip (one your device has) cannot Rx at all after restarting. 80211 stack thinks no one is around. I spent hours looking into ralink's code and poking different registers, but no luck. Sorry. But some time I suddenly find the solution while working on other issues. When you find some info, let me know.

if I understood you correctly - this is hw problem...
I also wonder, why it is not possible to "reset" device by removing power from it using usbsonfig?
I mean, I can make power_off and power_on, but after loading driver - nothing happens...
I think reseting power via usbconfig can be working workaround after reboot (if use own start up script, instead of starting wifi by system)
 
tried new fw, but didn't fix the problem. (attached new fw, you can swap with old one)

checked linux code, didn't find anything new regarding to resetting chips.

if power_off by usbconfig actually cuts off the current, power_off->reboot might reset the device and make it work again.
 

Attachments

  • rt2870.fw.uu.tar.gz
    6.3 KB · Views: 316
With new FW I have completely the same behaviour. And does it mean, that you have same problem as me? Power_off->reboot have no effect actually.
 
I have devices with different chipsets. Only one with rt3070 mac + rt2020 radio shows the problem. Based on bug reports I have received, rt3070 with other radio chip doesn't have the issue. It's hard to find the cause just looking into source code. But, currently I'm working on setting up radio (making 11NA AP work with 11A stations). I might find the solution.
 
Hello again.

I took the latest driver sources from "master" branch, TX bug reported by JackMiles is fixed and connection is stable, BUT, battery consumption of mobile devices are high and battary discharges rapidly.

I've made experiments with my iPhone (similar situation with smartphone HTC)

1) phone is 100% charged, wifi is disabled, battery level drops down for 1-2% for 8 hours
2) phone is 100% charged, wifi is enabled, connected to d-link (or tp-link) access point, phone is used for conversation, sms and mail reading via fi-wi, battery level drops down for ~9% for 8 hours, so ~1% per hour
3) phone is 100% charged, wifi is enabled, connected to my ap based on ralink, no activity at all, phone is in stand by mode, battery level drops down for ~76% for 8 hours, so ~9-10% per hour

I don't know what is happening, but it looks like phone can't put wi-fi module to powersave mode (or something like this) then connected to ralink. There were no such problem with previous version of driver with tx bug...
 
Could be. It wakes up all stations blindly. Every time a station gets waken up, the station sends extra packets. Hence more battery consumption. Turn off power save mode could save battery.

I haven't found how to make power save mode work on AP mode.
 
Hiya,

PseudoCylon said:
Unfortunately no.
The driver supports some of Ralink chips, but RTL8192 is a Realtek chip (as far as I know).

I installed Free(PC)BCD on my laptop (latest 9.0 snapshot) and before migrating my desktop machine from Archlinux, I need to make my wifi card working..

By looking and this thread and this one, I wonder which driver might be more appropriate for my
Code:
ID 07d1:3c16 D-Link System DWA-125 Wireless N 150 Adapter(rev.A2) [Ralink RT2870]
card?

I use x86_64 (amd64) version and would like working WPA2...
 
Hello,

I just installed FreeBSD for the first time and I don't have 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.

Code:
#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
Code:
#!/bin/sh
to
Code:
#!/bin/csh

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

Thanks.
 
This [thread=7010]thread[/thread] has more information about rt2860 driver.

As far as I know, the driver should be get loaded with kldload(8). You can forget about rt2860.sh.

wani said:
Code:
#kldload ./rt2860.ko
link_elf: symbol ieee80211_amrr_tx_complete undefined

Is that correct? Not
Code:
[b]rt2860[/b]_amrr_tx_complete
or something else?

Are you sure you are using the correct version of the driver? One for 8.0 should still run on 8.2 or CURRENT.
 
Yes, I am pretty sure I took the correct version. I even tried copying rt2860.ko in /boot/modules with a chmod 555 /boot/modules/rt2860.ko but when I call it I get an error again.

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

Anyways thanks a lot for the fast reply, I'll ask on the other thread.
 
11n_rc2 on 8.2 release

As I wanted to have 11n speeds, I have compiled the last 11n_rc2 version of if_run(4) on FreeBSD 8.2-RELEASE. As mentioned in the README, I updated the /usr/src/sys/net80211 directory with the version from 9-CURRENT and recompiled the kernel.

After rebooting the system, the new if_run loads fine and the wlan0 interface gets created. When doing [cmd=]ifconfig wlan0 list scan[/cmd] I can see my AP and many others, so the driver is functional.

However I never get associated with my AccessPoint using WPA. Wpa_supplicant only reports SCAN EVENT RESULTS about once every minute, but never tries to associate. With the old if_run driver, included in FreeBSD 8.2, everything works fine with the same configuration.

Do I need a new version of wpa_supplicant or does anyone know what is happening?

Thanks.
 
Hi,

There are some updates. I have updated the repository. Please try the new driver. Please note the driver is still in developing phase. It may not perform at 100%. But your effort of testing is appreciated.

If it doesn't work, please post the debug message. After loading the driver,# sysctl hw.usb.run.debug=1Then set up the device as usual. You will see the debug message like
Code:
run_newstate: SCAN -> AUTH
run_newstate: AUTH -> ASSOC
run_newstate: ASSOC -> RUN
run_newassoc: rate=NN ridx=NN ctl_ridx=NN
run_updateprot_cb:
run_key_set_cb: wcid=NN, keyix=NN, mode=N, type=N, tx=XX, rx=XX
 
Either with included in -current or using posted above 11n_rc2 driver I still see stalled connection and messages like:
Code:
Jul 17 16:54:20 n kernel: run_bulk_tx_callbackN: USB transfer error, USB_ERR_TIMEOUT
Jul 17 16:54:20 n kernel: run0: device timeout

My device is D-Link DWA-140, from messages:
Code:
Jul 17 16:15:07 n kernel: ugen0.4: <Ralink> at usbus0
Jul 17 16:15:07 n kernel: run0: <Ralink 11n Adapter, class 0/0, rev 2.00/1.01, addr 4> on usbus0
Jul 17 16:15:07 n kernel: run0: MAC/BBP RT3071 (rev 0x021C), RF RT3022 (MIMO 2T2R), address 14:d6:4d:49:67:75
Jul 17 16:15:07 n kernel: run0: firmware RT3071 ver. 0.17 loaded
I use it as access point on ARM machine and it works fine for ~30 seconds until that USB timeout occurs. If it matters, power safe mode was disabled on client.
 
First of all i want to thank PseudoCylon for a great work, after some time with a wired lan now my DWA-140 really works on FreeBSD 9-CURRENT as a client, so i got rid of the wires :) . I have two questions:

- in a february you said about txpower configuration. Do you plan to realize this feature? My whistle show txpower about 32mw, but i have two walls between FBSD and AP, so it's will be great to make whistle power some more (;
- when you plan to commit 11n to source tree? At this moment it looks like stable - for a two days i have no see any freezes or kernel panics.
 
lastuser said:
- in a february you said about txpower configuration. Do you plan to realize this feature? My whistle show txpower about 32mw, but i have two walls between FBSD and AP, so it's will be great to make whistle power some more (;
With current driver, h/w xmit at 100% power. My linksys wireless router is at 28mw, and you get 32mw. That sounds right. Tx power configuration will let you set lower than max xmit pwr. Though, I'm planning to add that feature.

lastuser said:
- when you plan to commit 11n to source tree? At this moment it looks like stable - for a two days i have no see any freezes or kernel panics.
It won't make it to 9.0-REL. But, I found out that something wrong writing on h/w's buffer, yesterday (lots of rx buffer overflow and crc error). I think that's the cause of poor performance (up to 80-90mbps). Once I fix it, it's ready to go (hopefully).
 
PseudoCylon said:
With current driver, h/w xmit at 100% power. My linksys wireless router is at 28mw, and you get 32mw. That sounds right. Tx power configuration will let you set lower than max xmit pwr. Though, I'm planning to add that feature.
Ummm! I ask this because dlink like to understate tx power, for example, my dir300 transmit for a 75mw, althought real chip max power is 100mw (or, maybe, more)

PseudoCylon said:
It won't make it to 9.0-REL. But, I found out that something wrong writing on h/w's buffer, yesterday (lots of rx buffer overflow and crc error). I think that's the cause of poor performance (up to 80-90mbps). Once I fix it, it's ready to go (hopefully).
when you plan to fix and commit to 11n_rc about? maybe, because of this today i see interesting bug (or, maybe, it's my curved hands) - when i fetch big files, speed up to 4-5 mbit, after 10-15 sec fetching wifi link on freebsd stalled for a ~10sec, then wifi link go up. i think 5mbit is not so heavy traffic ):
 
lastuser said:
Ummm! I ask this because dlink like to understate tx power, for example, my dir300 transmit for a 75mw, althought real chip max power is 100mw (or, maybe, more)
I doubt it, unless you have one of these.
http://www.ampedwireless.com/products/ua150c.html

According to the product manual I got from D-Link's website
http://www.dlink.com/products/?tab=3&pid=DWA-140&rev=DWA-140_revB
Transmitter power output: 14dBm
Power consumption: Tx 460mA

14dBm is about 32mW
http://en.wikipedia.org/wiki/DBm
and USB 2.0 specifies power supply as 100mA/unit and may draw max 5 unit/port. So, it is hitting h/w max of USB dangle. (I don't know about your router, though.)

lastuser said:
when you plan to fix and commit to 11n_rc about? maybe, because of this today i see interesting bug (or, maybe, it's my curved hands) - when i fetch big files, speed up to 4-5 mbit, after 10-15 sec fetching wifi link on freebsd stalled for a ~10sec, then wifi link go up. i think 5mbit is not so heavy traffic ):
I've fixed this issue. But, please wait until I fix corrupted on-chip buffer issue. Otherwise you will encounter similar problem.
 
No-no, dir 300 is a wifi-router, not a usb wifi-card :) I simply know about dlink "features" - dlink router firmware mean 100% as 75mW, third-party firmware dd-wrt give me max 200mW on the same router. Because of this i ask you about power: i have dlink dwa-140 dongle and i have some doubt about it real tx power :)
 
Hello,

I installed 8.2-RELEASE (64bit) on a multiboot system, and tried to use a few wifi adapters, namely, a D-link DWL-G122, a Belkin F5D7050 ver. 2000, a D-link DWL-G132 and a D-link DWA-140.

By inserting the devices into the running system, they are detected and for the Belkin and the G132 the ural(4) and uath(4) drivers, respectively are suggested, while for the other no similar indication is provided.

The Belkin works properly, but is unstable, I think due to the age of the device. The G132 has other problems.

My Linux system automatically recognises the other two, detecting the RT2870 chipset, therefore I forced the run(4) driver into /boot/loader.conf, and edited the /etc/rc.conf and /etc/wpa_supplicant.conf according with that driver and my router/AP settings.

There are apparently no error messages, the firmware loads correctly, and both devices accept most ifconfig commands, but the scan never works, and I was able to connect only the G122 to the LAN once and never again, never managed to do it with the DWA-140. Moreover, the DWA detected chipset is surprisingly the RT3022/RT3071 pair, differently from what Linux says.

Shall I replace the run(4) with some of the files posted here?

Thank you.
 
So, DWL-G122 and DWA-140 are supposed to be supported by run(4), but not working. According to the previous posts, at least DWA-140 should work with run(4).

First, comment out all the changes in /boot/loader.conf and /etc/rc.conf until the problem is solved.

Then, do followings one device at a time
1) boot
2) load the driver# kldload if_run
3) plug in the device, and show me what it says. It will print out something like
Code:
run0: <Ralink 11n Adapter, class 0/0, rev 2.00/1.01, addr 2> on usbus2
run0: MAC/BBP RT3071 (rev 0x021C), RF RT3022 (MIMO 2T2R), address 00:00:00:00:00:00
run0: firmware RT3071 loaded
If you see only something like following, do (i)
Code:
ugenX.Y: <Ralink> at usbus2
4)# ifconfig wlan create wlandev run0
5) I assume you are using GENERIC kernel which is compiled with IEEE80211_DEBUG opetion. If not, do (ii) instead.
# wlandebug -i wlan0 scan+auth+assoc+crypto
6) # wpa_supplicant -B -i wlan0 -c /your/wpa_supplicant/conf/file
7) show me what it says.



(i)# usbconfig -d X.Y dump_device_desc [NB] X.Y is the same number from ugenX.Y.
Then tell me what it says.

(ii)# wpa_supplicant -dd -i wlan0 -c /your/wpa_supplicant/conf/fileHopefully this gives me enough info.
 
First of all, thank you very much for your fast reply.
And now, let's see if I manage to report correctly all the important information: I know that it is an overused expression, but "please be patient" :)

3a) with the DWA-140 the output is exactly the one you posted (RT3071 and RT3022)
3b) with the DWL-G122, the output is
Code:
run0: <Ralink 11n Adapter, class 0/0, rev 2.00/1.01, addr 2> on usbus2
run0: MAC/BBP RT3070 (rev 0x0201), RF RT2020 (MIMO 1T1R), address 00:00:00:00:00:00
run0: firmware RT2870 loaded
4) OK
5) the output of the wlandebug command is
Code:
net.wlan.0.debug: 0x0 => 0x10e00000<crypto,assoc,auth,scan>
6) after 5) above, I was overwhelmed by a mass of messages that I cannot deal with, however I saw that eventually everything worked, so I tried repeating the entire process, but omitting point 5); the result is that both the DWA and the DWL perform correctly, both the connection and the scan

At the end, I assume that with my .conf files I didn't start properly the wpa_supplicant, which instead did by launching it with your options.
 
A further investigation showed that:
- points 2) and 3) of your list can be switched with no harm (leaving the device plugged during the boot and launching the driver later)
- replacing kldload with re-enabling the commands in /boot/loader.conf, it does not work, but
- it works if the device is extracted and plugged again

Thus, apparently, the commands in /boot/loader.conf, as follows
Code:
if_run_load="YES"
runfw_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
are not sufficient, but if the device is extracted and plugged again, the driver works properly.
 
Halberdier said:
- it works if the device is extracted and plugged again
With DWL-G122, it is a known issue. Please boot first, then plugin the device. With DWA-140, it should work. If not, do the followings (no need to do with both device, only with DWA-140 is sufficient.)
1) boot with the device is plugged in
2) while the device is not working,# wlandebug -i wlan0 scan+auth+assoc+cryptoEven though you will be overwhelmed, I need some debug messages to find out what goes wrong.
3) wait for 10 to 15 sec.
# wlandebug -i wlan0 0
4) % dmesg | grep -e run0 -e wlan0 >> /file/name/you/choose(A new file, /file/name/you/choose will be created.)
5) attach/post that file, your /boot/loader.conf, and /etc/rc.conf
 
I didn't specify it, the DWL-G122 is rev. E, but you may have guessed it, as it features RT2870.

I don't know what to say, now it works fully and regularly, and even with the DWL-G122, with no need to unplug and re-plug. The only thing I changed is that I installed and added to the /boot/loader.conf the nvidia driver, but I assume that this is completely unrelated.

My apologies if I am wasting your time with unreliable data. However, here we have still some new piece of information, which is that the DWL-G122 (rev. E) works.

I will go on monitoring my system, and if it stop working again, I will try the diagnostic you are suggesting.

Thank you again.
 
Back
Top