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

PseudoCylon said:

Ok, heres the comparsion:
Previous driver:
+11g support
-AES CCMP not working (win client says "AES; key absent", didnt thought that is a driver issue...)
-core dump on client disconnection

RSSfix driver:
-no 11g support
+AES CCMP working ok.
+looks like i cant make this driver core dumped
-Strange TX bug:
packets can only be transmitted, when some packets are received. So, this thing works only if i start on my win client pinging this AP. I'f i wont - many packets lost. Testing: starting pings from AP with run driver to win client, and from client to AP. It works. Disabling pings from client to AP - pings from AP to client freezes, no response.


b.t.w. theres some strange thing, happens in all run drivers i tested. starting pings from win client to ap - time almost always <1ms. Start pings from AP to client - time is huge, like
Code:
64 bytes from 10.0.0.2: icmp_seq=0 ttl=128 time=0.859 ms
64 bytes from 10.0.0.2: icmp_seq=1 ttl=128 time=0.892 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=128 time=779.953 ms
64 bytes from 10.0.0.2: icmp_seq=3 ttl=128 time=770.234 ms
64 bytes from 10.0.0.2: icmp_seq=4 ttl=128 time=759.415 ms
Every icmp ping consists of request and reply, 1 tx and 1 rx packet anyway, so this looks very strange to me.
 
PseudoCylon said:
@HighTower'up' and 'scan' cause problem. Just using 'up' also creats the list.
If the driver works on 8.1 this might be caused by some changes in ieee80211 stack. Can you show me the debugging messages? After creating the wlan,
# wlandebug -i wlan0 debug+dumppkts+input+elemid+node+scan+output+stateYour kernel need to be compiled with IEEE08211_DEBUG option.
Or, try
# ifconfig wlan0 ssid freebsdap channel 1# ifconfig wlan0 inet 192.168.0.1you might get lucky.

so, not I almost succeeded!!!
what I've done:
# kldload runfw
# kldload if_run
# ifconfig wlan0 create wlandev run0 wlanmode hostap
# wlandebug -i wlan0 debug+dumppkts+input+elemid+node+scan+output+state
Code:
net.wlan.0.debug: 0x0 => 0x6b380000<debug,dumppkts,input,elemid,node,scan,output,state>
# ifconfig wlan0 ssid freebsdap channel 1
# ifconfig wlan0 inet 192.168.0.1

after that ap with name "freebsdap" because available, but then I connected to it, whole device restarted (((

here is wlandebug log:
Code:
Jan 20 19:31:26 home kernel: run0: <1.0> on usbus3
Jan 20 19:31:26 home kernel: run0: MAC/BBP RT3070 (rev 0x0201), RF RT3020 (MIMO 1T1R), address 00:0d:f0:8d:54:f4
Jan 20 19:31:26 home kernel: run0: firmware RT2870 loaded
Jan 20 19:31:38 home kernel: wlan0: Ethernet address: 00:0d:f0:8d:54:f4
Jan 20 19:32:13 home kernel: wlan0: ieee80211_init
Jan 20 19:32:13 home kernel: wlan0: start running, 0 vaps running
Jan 20 19:32:13 home kernel: wlan0: ieee80211_start_locked: up parent run0
Jan 20 19:32:13 home kernel: wlan0: ieee80211_start: ignore queue, parent run0 not up+running
Jan 20 19:32:14 home kernel: wlan0: start running, 1 vaps running
Jan 20 19:32:14 home kernel: wlan0: ieee80211_new_state_locked: INIT -> SCAN (nrunning 0 nscanning 0)
Jan 20 19:32:14 home kernel: wlan0: ieee80211_newstate_cb: INIT -> INIT arg 0
Jan 20 19:32:14 home kernel: wlan0: hostap_newstate: INIT -> INIT (0)
Jan 20 19:32:14 home kernel: wlan0: ieee80211_newstate_cb: INIT -> SCAN arg 0
Jan 20 19:32:14 home kernel: wlan0: hostap_newstate: INIT -> SCAN (0)
Jan 20 19:32:14 home kernel: wlan0: ieee80211_create_ibss: creating HOSTAP on channel 1
Jan 20 19:32:14 home kernel: wlan0: ieee80211_alloc_node 0xc4dff000<00:0d:f0:8d:54:f4> in station table
Jan 20 19:32:14 home kernel: wlan0: ieee80211_new_state_locked: SCAN -> RUN (nrunning 0 nscanning 0)
Jan 20 19:32:14 home kernel: wlan0: ieee80211_newstate_cb: SCAN -> RUN arg -1
Jan 20 19:32:14 home kernel: wlan0: hostap_newstate: SCAN -> RUN (-1)
Jan 20 19:32:14 home kernel: wlan0: synchronized with 00:0d:f0:8d:54:f4 ssid "freebsdap" channel 1 start 0Mb
Jan 20 19:32:14 home kernel: wlan0: received beacon from 00:24:8c:50:c3:95 rssi 63
Jan 20 19:32:14 home kernel: wlan0: [00:24:8c:50:c3:95] discard unhandled information element, id 47, len 1
Jan 20 19:32:14 home kernel: wlan0: received beacon from 00:24:8c:50:c3:95 rssi 65
Jan 20 19:32:14 home kernel: wlan0: [00:24:8c:50:c3:95] discard unhandled information element, id 47, len 1
Jan 20 19:32:14 home kernel: wlan0: received beacon from 00:24:8c:50:c3:95 rssi 65
...
repeated a lot of times, difference in last numbers, 65 or 63 or 67 or 59
...
Jan 20 19:32:19 home kernel: wlan0: received probe_req from 40:a6:d9:14:e5:5a rssi 27
Jan 20 19:32:19 home kernel: [40:a6:d9:14:e5:5a] discard probe_req frame, ssid mismatch: "ZyXEL"
Jan 20 19:32:19 home kernel: wlan0: received probe_req from 40:a6:d9:14:e5:5a rssi 27
Jan 20 19:32:19 home kernel: [40:a6:d9:14:e5:5a] discard probe_req frame, ssid mismatch: "ZyXEL"
...
ZyXEL - is open AP in ragne
...
text before repeated several times
...
Jan 20 19:32:35 home kernel: wlan0: received beacon from 00:24:8c:50:c3:95 rssi 67
Jan 20 19:32:35 home kernel: wlan0: [00:24:8c:50:c3:95] discard unhandled information element, id 47, len 1
Jan 20 19:32:35 home kernel: wlan0: received probe_req from 40:a6:d9:14:e5:5a rssi 65
Jan 20 19:32:35 home kernel: wlan0: [40:a6:d9:14:e5:5a] recv probe req
Jan 20 19:32:35 home kernel: wlan0: ieee80211_ref_node (ieee80211_send_proberesp:2391) 0xc4dff000<00:0d:f0:8d:54:f4> refcnt 4
Jan 20 19:32:35 home kernel: wlan0: send probe resp on channel 1 to 40:a6:d9:14:e5:5a
Jan 20 19:32:35 home kernel: wlan0: received beacon from 00:24:8c:50:c3:95 rssi 67
Jan 20 19:32:35 home kernel: wlan0: [00:24:8c:50:c3:95] discard unhandled information element, id 47, len 1
Jan 20 19:32:35 home kernel: wlan0: received beacon from 00:24:8c:50:c3:95 rssi 65
Jan 20 19:32:35 home kernel: wlan0: [00:24:8c:50:c3:95] discard unhandled information element, id 47, len 1
...
again repeated a lot of times
...
Jan 20 19:32:39 home kernel: wlan0: [00:24:8c:50:c3:95] discard unhandled information element, id 47, len 1
Jan 20 19:32:39 home kernel: wlan0: received probe_req from 40:a6:d9:14:e5:5a rssi 65
Jan 20 19:32:39 home kernel: wlan0: [40:a6:d9:14:e5:5a] recv probe req
Jan 20 19:32:39 home kernel: wlan0: ieee80211_ref_node (ieee80211_send_proberesp:2391) 0xc4dff000<00:0d:f0:8d:54:f4> refcnt 4
Jan 20 19:32:39 home kernel: wlan0: send probe resp on channel 1 to 40:a6:d9:14:e5:5a
...
Jan 20 19:32:39 home kernel: wlan0: received beacon from 00:24:8c:50:c3:95 rssi 63
Jan 20 19:32:39 home kernel: wlan0: [00:24:8c:50:c3:95] discard unhandled information element, id 47, len 1
Jan 20 19:32:39 home kernel: wlan0: received probe_req from 40:a6:d9:14:e5:5a rssi 25
Jan 20 19:32:39 home kernel: wlan0: [40:a6:d9:14:e5:5a] recv probe req
Jan 20 19:32:39 home kernel: wlan0: ieee80211_ref_node (ieee80211_send_proberesp:2391) 0xc4dff000<00:0d:f0:8d:54:f4> refcnt 4
Jan 20 19:32:39 home kernel: wlan0: send probe resp on channel 1 to 40:a6:d9:14:e5:5a
Jan 20 19:32:39 home kernel: wlan0: received probe_req from 40:a6:d9:14:e5:5a rssi 25
Jan 20 19:32:39 home kernel: wlan0: [40:a6:d9:14:e5:5a] recv probe req
...
Jan 20 19:32:40 home kernel: [40:a6:d9:14:e5:5a] discard probe_req frame, ssid mismatch: "ZyXEL"
Jan 20 19:32:40 home kernel: wlan0: received beacon from 00:24:8c:50:c3:95 rssi 65
Jan 20 19:32:40 home kernel: wlan0: [00:24:8c:50:c3:95] discard 
Jan 20 19:32:40 home kernel: unhandled information element, 
Jan 20 19:32:40 home kernel: id 47, len 1
Jan 20 19:32:40 home kernel: wlan0: received beacon from 00:24:8c:50:c3:95 rssi 63
Jan 20 19:32:40 home kernel: wlan0: [00:24:8c:50:c3:95] discard unhandled information element, id 47, len 1
Jan 20 19:32:40 home kernel: wlan0: received probe_req from 40:a6:d9:14:e5:5a rssi 63
Jan 20 19:32:40 home kernel: [40:a6:d9:14:e5:5a] discard probe_req frame, ssid mismatch: "ZyXEL"
Jan 20 19:32:40 home kernel: wlan0: received beacon from 00:24:8c:50:c3:95 rssi 65
...
Jan 20 19:32:48 home kernel: wlan0: [40:a6:d9:14:e5:5a] recv probe req
Jan 20 19:32:48 home kernel: wlan0: ieee80211_ref_node (ieee80211_send_proberesp:2391) 0xc4dff000<00:0d:f0:8d:54:f4> refcnt 4
Jan 20 19:32:48 home kernel: wlan0: send probe resp on channel 1 to 40:a6:d9:14:e5:5a
Jan 20 19:32:48 home kernel: wlan0: received probe_req from 40:a6:d9:14:e5:5a rssi 23
Jan 20 19:32:48 home kernel: wlan0: [40:a6:d9:14:e5:5a] recv probe req
Jan 20 19:32:48 home kernel: wlan0: ieee80211_ref_node (ieee80211_send_proberesp:2391) 0xc4dff000<00:0d:f0:8d:54:f4> refcnt 4
Jan 20 19:32:48 home kernel: wlan0: send probe resp on channel 1 to 40:a6:d9:14:e5:5a
...
Jan 20 19:33:07 home kernel: wlan0: received beacon from 00:24:8c:50:c3:95 rssi 65
Jan 20 19:33:07 home kernel: wlan0: [00:24:8c:50:c3:95] discard unhandled information element, id 47, len 1
Jan 20 19:33:07 home kernel: wlan0: received probe_req from 40:a6:d9:14:e5:5a rssi 25
Jan 20 19:33:07 home kernel: wlan0: [40:a6:d9:14:e5:5a] recv probe req
Jan 20 19:33:07 home kernel: wlan0: ieee80211_ref_node (ieee80211_send_proberesp:2391) 0xc4dff000<00:0d:f0:8d:54:f4> refcnt 4
Jan 20 19:33:07 home kernel: wlan0: send probe resp on channel 1 to 40:a6:d9:14:e5:5a
Jan 20 19:33:07 home kernel: wlan0: received beacon from 00:24:8c:50:c3:95 rssi 65
Jan 20 19:33:07 home kernel: wlan0: [00:24:8c:50:c3:95] discard unhandled information element, id 47, len 1
Jan 20 19:33:07 home kernel: wlan0: received auth from 40:a6:d9:14:e5:5a rssi 27
Jan 20 19:33:07 home kernel: wlan0: ieee80211_alloc_node 0xc4e67000<40:a6:d9:14:e5:5a> in station table
Jan 20 19:33:07 home kernel: wlan0: ieee80211_ref_node (ieee80211_send_mgmt:1876) 0xc4e67000<40:a6:d9:14:e5:5a> refcnt 2
Jan 20 19:33:07 home kernel: [40:a6:d9:14:e5:5a] send auth on channel 1
Jan 20 19:33:07 home kernel: wlan0: [40:a6:d9:14:e5:5a] station authenticated (open)
Jan 20 19:33:07 home kernel: wlan0: received assoc_req from 40:a6:d9:14:e5:5a rssi 25
Jan 20 19:33:07 home kernel: wlan0: [40:a6:d9:14:e5:5a] station associated at aid 1: short preamble, short slot time, QoS
Jan 20 19:33:07 home kernel: wlan0: ieee80211_ref_node (ieee80211_send_mgmt:1876) 0xc4e67000<40:a6:d9:14:e5:5a> refcnt 3
Jan 20 19:33:07 home kernel: [40:a6:d9:14:e5:5a] send assoc_resp on channel 1
Jan 20 19:33:07 home kernel: wlan0: [40:a6:d9:14:e5:5a] node join
Jan 20 19:33:07 home kernel: wlan0: received beacon from 00:24:8c:50:c3:95 rssi 63
Jan 20 19:33:07 home kernel: wlan0: [00:24:8c:50:c3:95] discard unhandled information element, id 47, len 1
Jan 20 19:33:07 home kernel: wlan0: received beacon from 00:24:8c:50:c3:95 rssi 65
Jan 20 19:33:07 home kernel: wlan0: [00:24:8c:50:c3:95] discard unhandled information element, id 47, len 1
Jan 20 19:33:07 home kernel: wlan0: received beacon from 00:24:8c:50:c3:95 rssi 63
...
Jan 20 19:33:08 home kernel: wlan0: received beacon from 00:24:8c:50:c3:95 rssi 65
Jan 20 19:33:08 home kernel: wlan0: [00:24:8c:50:c3:95] discard unhandled information element, id 47, len 1
after last line - reboot...

but anyway, this is very-very big progress for me!!!
 
@JackMiles
JackMiles said:
-no 11g support[/CODE]
Patches are for one in HEAD. 11n hasn't supported, yet. I just want to patch codes already committed first. Fixes on 11n beta will follow.

JackMiles said:
-Strange TX bug:
Most likely caused by power save mode. The support hasn't added, yet. Can you turn off power save mode on client, for now?


@HighTower
HighTower said:
after that ap with name "freebsdap" because available, but then I connected to it, whole device restarted (((
It seems 8.2-PRERELEASE + AP needs this patch.
http://svn.freebsd.org/viewvc/base?view=revision&revision=217511
And, please use this run(4)
http://gitorious.org/run/run/trees/rssi_fix/dev/usb/wlan
Soon or later, you will encounter the same problem as JackMiles's.

Can you post the debugging messages with 'mode 11g' option?# wlandebug -i wlan0 debug+dumppkts+input+elemid+node+scan+output+state# ifconfig wlan0 ssid freebsdap mode 11g channel 1Not using 'mode 11g' option is OK for workaround, but bug shoud be fixed. Also please give this patch a try.
http://forums.freebsd.org/showpost.php?p=120126&postcount=225
 
PseudoCylon said:
@JackMilesPatches are for one in HEAD. 11n hasn't supported, yet. I just want to patch codes already committed first. Fixes on 11n beta will follow.

Most likely caused by power save mode. The support hasn't added, yet. Can you turn off power save mode on client, for now?
Yes, this helps. Seems like turning off power saving mode fixes Ap-client ping time too. Thank you very much!

b.t.w. , can you recommend some wlan driver source, with comments, or something else to understand how wlan drivers works? I have an experience in writing freebsd kernel modules, but not device drivers, and thinking about porting rtl8192 to freebsd.
 
PseudoCylon said:
@HighTowerIt seems 8.2-PRERELEASE + AP needs this patch.
http://svn.freebsd.org/viewvc/base?view=revision&revision=217511
And, please use this run(4)
http://gitorious.org/run/run/trees/rssi_fix/dev/usb/wlan
Soon or later, you will encounter the same problem as JackMiles's.

Can you post the debugging messages with 'mode 11g' option?# wlandebug -i wlan0 debug+dumppkts+input+elemid+node+scan+output+state# ifconfig wlan0 ssid freebsdap mode 11g channel 1Not using 'mode 11g' option is OK for workaround, but bug shoud be fixed. Also please give this patch a try.
http://forums.freebsd.org/showpost.php?p=120126&postcount=225

I took run sources from http://gitorious.org/run/run/trees/rssi_fix/dev/usb/wlan
later checked changes with http://svn.freebsd.org/viewvc/base?view=revision&revision=217511
the only difference that if_run.c on svn.freebsd.org doesn't have line
Code:
ieee80211_ratectl_node_init(ni);
at line ~2379, but at gitorious.org has.. I decided not to change sources from gitorious.org, so my copy has this line
patch for ifconfig I also took and recompile every thing.

now AP is created, user can connect and not reboot!!!

debug is attached...

so, AP in opened mode - works, I can use dhcpd to give ip adresses to clients

but then I try to create WPA protected ap - smth goes wrong...
opened AP:
Code:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:0d:f0:8d:54:f4
        inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap>
        status: running
        ssid freebsdap channel 1 (2412 MHz 11g) bssid 00:0d:f0:8d:54:f4
        country US authmode OPEN privacy OFF txpower 0 scanvalid 60
        protmode CTS wme dtimperiod 1 -dfs
after I run # /etc/rc.d/hostapd forcestart
with following config /etc/hostapd.conf
Code:
interface=wlan0
driver=bsd
debug=1
ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel
ssid=freebsdap
wpa=1
wpa_passphrase=xxxxx
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP TKIP
after that AP dissapears in available list (((
Code:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:0d:f0:8d:54:f4
        inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap>
        status: running
        ssid freebsdap channel 1 (2412 MHz 11g) bssid 00:0d:f0:8d:54:f4
        country US authmode WPA privacy MIXED deftxkey 2 TKIP 2:128-bit
        txpower 0 scanvalid 60 protmode CTS wme dtimperiod 1 -dfs
 

Attachments

  • wlan.tar.gz
    7.1 KB · Views: 306
PseudoCylon said:
@JackMilesPatches are for one in HEAD. 11n hasn't supported, yet. I just want to patch codes already committed first. Fixes on 11n beta will follow.

Most likely caused by power save mode. The support hasn't added, yet. Can you turn off power save mode on client, for now?

Update... i can make this core dump too. But, it was one time, all other times PC freezes, no core dump, no nothing, fully freeze.
Howto: just connect with invalid (not listed in conf) MAC or KEY. When MAC is invalid - PC freezes. When KEY is invalid - sometimes some messages about wrong key from hostapd , then freeze. One time was core dump.
Happends on both TKIP and CCMP.
 
@HighTower
Code:
driver=bsd
looks linux-ish
Can you use this http://gitorious.org/run/run/trees/key_fix/dev/usb/wlan and# sysctl hw.usb.run.debug=1before# /etc/rc.d/hostapd forcestartand post debug messages?
HighTower said:
after that AP dissapears in available list (((
means AP with rt3070 is still responding (still taking commands, not freezing), just AP doesn't show up on client?


@JackMiles
Does
JackMiles said:
When KEY is invalid...
means intentionally giving wrong key or giving the right key but auth mode isn't working?
JackMiles said:
PC freezes...
I cannot help windows freezing issue, you have to tell steve ballmer but if FreeBSD Box with run(4) is freezing, please try this http://gitorious.org/run/run/trees/fifo_fix/dev/usb/wlan previous code has LOR issue.
JackMiles said:
b.t.w. , can you recommend some wlan driver source, with comments, or something else to understand how wlan drivers works? I have an experience in writing freebsd kernel modules, but not device drivers, and thinking about porting rtl8192 to freebsd.
Not particularly. I used rum(4) just because it is also driver for ralink's chipset. It worked well for me.
 
PseudoCylon said:
@HighTower
Code:
driver=bsd
looks linux-ish
Can you use this http://gitorious.org/run/run/trees/key_fix/dev/usb/wlan and# sysctl hw.usb.run.debug=1before# /etc/rc.d/hostapd forcestartand post debug messages?

I removed
Code:
driver=bsd
from /etc/hostapd.conf
sources are taken and run is recompiled

Also I completely shut down system with removing power cable.. if not to do it (make shutdown or reboot) after creating opened AP, it is strange why, but AP is visible, even if not if_run module is loaded!!!

PseudoCylon said:
means AP with rt3070 is still responding (still taking commands, not freezing), just AP doesn't show up on client?

yes, with new sources the same situation...
If I have opened AP, it is visible by clients, clients can connect to it and traffic goes..
but then I call
# /etc/rc.d/hostapd forcestart
my AP just simply dissapears, clients do not see it and can't connect
but wireless led continue blinking as in normal situation
I've tried commands:
# ifconfig wlan0 list sta
# ifconfig wlan0 list scan
# ifconfig wlan0 down
all of them were executed with no delay and no output ((

new debug is attached...
 

Attachments

  • wlan.tar.gz
    4.8 KB · Views: 310
HighTower said:
Also I completely shut down system with removing power cable.. if not to do it (make shutdown or reboot) after creating opened AP, it is strange why, but AP is visible, even if not if_run module is loaded!!!
mmm... strange. What OS are clients running?
HighTower said:
If I have opened AP, it is visible by clients, clients can connect to it and traffic goes..
but then I call
# /etc/rc.d/hostapd forcestart
my AP just simply dissapears, clients do not see it and can't connect
but wireless led continue blinking as in normal situation
So, what you are doing is
1) set up an open AP,
2) check everything is OK,
3) stat hostapd.
If so, did you switch encryption mode on clients, for FreeBSD boxes, run wpa_supplicant? Debug message shows no client attempted to associate. Even though encryption keys are wrong, clients can associate as long as ssid and encryption mode match. Then, in WPA mode, they will be kicked off.

Anyway, the drive isn't writing the keys properly. Here is fix.
http://gitorious.org/run/run/trees/8.2_PRE/dev/usb/wlan
(If you are lazy, you can use one you have. Just start hostapd right after creating wlan, no extra command between.)

If it doesn't work please post debug message.# wlandebug -i wlan0 debug+crypto+assoc+auth+wpa# sysctl hw.usb.run.debug=1and set up hostap.

If it works, you can turn off annoying debug output with# sysctl hw.usb.run.debug=0
 
PseudoCylon said:
mmm... strange. What OS are clients running?
agree, strange...
iPhone 4 and smartphones with WinMobile 6 - do it this way
WinXP - no...
I have no spare freebsd pc with wireless to test on it (

PseudoCylon said:
So, what you are doing is
1) set up an open AP,
2) check everything is OK,
3) stat hostapd.
wow, now it works!!! really!!! I'm happy :beer

PseudoCylon said:
Anyway, the drive isn't writing the keys properly. Here is fix.
http://gitorious.org/run/run/trees/8.2_PRE/dev/usb/wlan
(If you are lazy, you can use one you have. Just start hostapd right after creating wlan, no extra command between.)
I'm not lazy and I'm interested in this driver, so I'm ready for tests...

and some questions:
- how to do it in best way to start AP with system start?
- is it possible made autochannel selection for AP? like some box routers do then they change channel number depending on smth (may be availability of open APs on the same channel or signal quality or smth else)?
- is it possible to control transmit power?
now it is written
Code:
        TKIP 2:128-bit TKIP 3:128-bit txpower 0 scanvalid 60 protmode CTS wme
        dtimperiod 1 -dfs
what does "txpower 0" mean?

p.s. if you are interested, here is debug log... two clients are connected and work with no problems...
 
addition... don't know is it driver or hostapd problem... but my iPhone now do not automatically connects to my AP... then I select network manually - it asks for network key each time!.. (((((
 
HighTower said:
wow, now it works!!! really!!! I'm happy :beer
2 thumbs up!


HighTower said:
and some questions:
- how to do it in best way to start AP with system start?
Pretty much stradard, use loader.conf(5) and rc.conf(5).


HighTower said:
- is it possible made autochannel selection for AP? like some box routers do then they change channel number depending on smth (may be availability of open APs on the same channel or signal quality or smth else)?
Yes. Just# ifconfig wlan create wlandev run0 wlanmode ap# /etc/rc.d/hostapd forcestartThen it will scan and selects appropriate one like any other routers. I thought you had to use chennel 1.


HighTower said:
- is it possible to control transmit power?
It could, but the support hasn't been added.
HighTower said:
what does "txpower 0" mean?
It means I'm too lazy to fix it. The driver (supposedly) sets txpower properly, but not telling anyone. I noticed it while ago, but I'm just fixing bugs causing troubles, first.


HighTower said:
p.s. if you are interested, here is debug log... two clients are connected and work with no problems...
Thanks for reporting/testing. The debug messages shows the driver behaves as it should be. But, DHCP server is complaining. Check dhcpd.conf.


HighTower said:
addition... don't know is it driver or hostapd problem... but my iPhone now do not automatically connects to my AP... then I select network manually - it asks for network key each time!.. (((((
Most likely steve jobs' problem. AP doesn't tell client to join or give out encryption keys.
* For open AP, any client can associate, so as iPhone.
* For WPA AP, iPhone needs a key, so it asks every time it wants. I don't know why iPhone doesn't remember keys. I don't even have a cellphone.
 
PseudoCylon said:
Pretty much stradard, use loader.conf(5) and rc.conf(5).
I have:
loader.conf
Code:
runfw_load="YES"
if_run_load="YES"
rc.conf
Code:
wlans_run0="wlan0"
create_args_wlan0="wlanmode hostap up"

cloned_interfaces="bridge0"
ifconfig_bridge0="addm wlan0 addm re1"    # << re1 is iface for internal wired net

ifconfig_bridge0="inet 172.16.1.1 netmask 255.255.255.0"

hostapd_enable="YES"
after restart iface wlan0 is created, hostapd is started, wireless led on device is blinking as usuial, but
- AP is not seen
- wlan0 is not added to bringe0

PseudoCylon said:
Then it will scan and selects appropriate one like any other routers. I thought you had to use chennel 1.
I've tried such way, but channel is all the time 1 and not chaning in time... that's why I asked...

PseudoCylon said:
It could, but the support hasn't been added.It means I'm too lazy to fix it. The driver (supposedly) sets txpower properly, but not telling anyone. I noticed it while ago, but I'm just fixing bugs causing troubles, first.
hm.. so driver controls power itself?
no way to set it to max? because then I sit near AP (~3m) I have signal quality ~80%, if I go about 7m (with 2 walls between) quality is ~12%...
and command # ifconfig wlan0 txpower 50
replyes with error
Code:
ifconfig: SIOCS80211: Operation not supported

PseudoCylon said:
But, DHCP server is complaining. Check dhcpd.conf.
I fixed it.. problem was in wrong place of defining static hosts..

PseudoCylon said:
Most likely steve jobs' problem. AP doesn't tell client to join or give out encryption keys.
not sure... because I use iPhone to connect to several WPA2 protected nets with keys (D-Link and TP-Link routers) and I not prompted to enter key each time...
Then I have in my hostapd.conf line
Code:
wpa=1
it connected automatically, but then I change it to
Code:
wpa=2
to have WPA2 instead of WPA, problems started...

another strange thing (may it is related to the fact, that iPhone "forgets" key), the it automatically connects to open AP in range with very-very low signal (~8%)
 
small update:
- problem with iPhone doesn't exists any more
- AP is started successfully while system start up

what I did - simply shutdown the system and removed power cord for 5 minutes... this is issue I already wrote....
it looks like some info about previous wireless chip configuration is not reset after reboot, because actually power is not removed from it while reboot and shutdown if power cord is connected...
 
PseudoCylon said:
Does means intentionally giving wrong key or giving the right key but auth mode isn't working?
Giving right key works fine. Giving really wrong key myself makes some msg about wrong key and when pc freeze.
PseudoCylon said:
I cannot help windows freezing issue, you have to tell steve ballmer but if FreeBSD Box with run(4) is freezing, please try this http://gitorious.org/run/run/trees/fifo_fix/dev/usb/wlan previous code has LOR issue.
FreeBSD Box with run(4) is freezing.
With fifo_fix version all seems ok right now, no freezing.
 
@HighTower
HighTower said:
small update:
- problem with iPhone doesn't exists any more
- AP is started successfully while system start up
what I did - simply shutdown the system and removed power cord for 5 minutes... this is issue I already wrote....
it looks like some info about previous wireless chip configuration is not reset after reboot, because actually power is not removed from it while reboot and shutdown if power cord is connected...
Thst's good. So, it leaves us channels and tx power issue. (I'll try to fix re-power-up issue some day.)
HighTower said:
I've tried such way, but channel is all the time 1 and not chaning in time... that's why I asked...
AP picks the most appropriate channel (least traffic, etc), then stick with it unless you manually change. It seems channel 1 is the one AP picks.
HighTower said:
hm.. so driver controls power itself? no way to set it to max?
Yes (supporsted to). I set what they call "auto tx power." And it should crank up to max when appropriate.
HighTower said:
I sit near AP (~3m) I have signal quality ~80%, if I go about 7m (with 2 walls between) quality is ~12%...
It kinda low, but it look normal. You cannot get the same quality if you walk away from AP. Noise also affects quality. Does another router give better quality? I get the comparable rssi/snr with linksys G router.
HighTower said:
command # ifconfig wlan0 txpower 50
replyes with error
Code:
ifconfig: SIOCS80211: Operation not supported
That's because the driver doesn't support that command. (someday maybe)


@JackMiles
JackMiles said:
FreeBSD Box with run(4) is freezing.
With fifo_fix version all seems ok right now, no freezing.
fifo_fix version fixed the problem, then. I'll submit the patch.
JackMiles said:
PseudoCylon, btw, why maximum speed is about 11mbit in g mode?
How did you get the number, with% ifconfig wlan0 list staor used some packet sniffer? (Power save mode is still of, isn't it?)
 
@PseudoCylon
ok, I can live with current issues about power and channel

but what is really makes me craze is that after reboot AP doesn't work... run0 and wlan0 are created and have "running" status, wireless led is blinking as in normal situation, but AP is not seen and can't be connected to (((
I've tried to play with usconfig + power_off + power_on on wireless device - no result:

# hostapd forcestop
# ifconfig wlan0 destroy
# kldunload if_run
# kldunload runfw
# usbconfig -u 3 -a 1 power_off (or reset)
...
# usbconfig -u 3 -a 1 power_on
# kldload runfw
# kldload if_run
but no run0 device is created and NO messages on console (
 
HighTower said:
If I have opened AP, it is visible by clients, clients can connect to it and traffic goes..
but then I call
# /etc/rc.d/hostapd forcestart
my AP just simply dissapears, clients do not see it and can't connect
but wireless led continue blinking as in normal situation
I've tried commands:
# ifconfig wlan0 list sta
# ifconfig wlan0 list scan
# ifconfig wlan0 down
all of them were executed with no delay and no output ((
HighTower said:
agree, strange...
iPhone 4 and smartphones with WinMobile 6 - do it this way
WinXP - no...
HighTower said:
but what is really makes me craze is that after reboot AP doesn't work... run0 and wlan0 are created and have "running" status, wireless led is blinking as in normal situation, but AP is not seen and can't be connected to (((
Just recapping what we are on.

Combine all of the above, AP fails only
- on reboot (works on cold start) with hostapd (open ap works),
- fails with cell phones (works OK with XP)
correct?

This debug message was collected when AP wasn't visible, wasn't it?
 
PseudoCylon said:
Just recapping what we are on.

Combine all of the above, AP fails only
- on reboot (works on cold start) with hostapd (open ap works),
- fails with cell phones (works OK with XP)
correct?

This debug message was collected when AP wasn't visible, wasn't it?

now exactrly... in my case:
- after cold start (then power cord was removed for several minutes) AP start and work normally in opened mode as well as with hostapd
cell phones see it and can connect with no promles (same as pc and notebooks)

- after reboot or shutdown and start again (if power cord was connected) - run0 and wlan0 devices are created and have "running" status, but AP can't be found by any client (while scan) and clients can't connect to it.. doesn't matter AP is opened or with hostapd

not I'm not sure then was debug messaged made, so lated today I'll post debug after reboot then AP is not visible...
 
PseudoCylon said:
@JackMilesfifo_fix version fixed the problem, then. I'll submit the patch.How did you get the number, with% ifconfig wlan0 list staor used some packet sniffer? (Power save mode is still of, isn't it?)

Sniffer trafshow on wlan0. Actual download time of 100mb file looks like trafshow is absolutely right about speed. Power-saving mode is off, of course.

b.t.w, it's not a driver issue, but maybe you can help. I want my FreeBSD AP to stop scanning other devices, so it will look like "no tx packets at all if noone trying to connect directly to my AP, just waiting for rx". Is it possible ?
 
here are debug messages after reboot...
there are only few lines after several minutes...
 

Attachments

  • wlan.tar.gz
    1.2 KB · Views: 277
@HighTower
HighTower said:
- after reboot or shutdown and start again (if power cord was connected) - run0 and wlan0 devices are created and have "running" status, but AP can't be found by any client (while scan) and clients can't connect to it.. doesn't matter AP is opened or with hostapd

not I'm not sure then was debug messaged made, so lated today I'll post debug after reboot then AP is not visible...
This 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.


@JackMiles
JackMiles said:
Sniffer trafshow on wlan0. Actual download time of 100mb file looks like trafshow is absolutely right about speed. Power-saving mode is off, of course.
At my house, I can get 30mbps including all packet headers if amrr keeps tx rate at the max, 54mpbs. If Tx rate gets lowered, though put gets lowered, too.
JackMiles said:
b.t.w, it's not a driver issue, but maybe you can help. I want my FreeBSD AP to stop scanning other devices, so it will look like "no tx packets at all if noone trying to connect directly to my AP, just waiting for rx". Is it possible ?
I'm not sure if it works with AP, but disabling bgscan# ifconfig wlan0 -bgscanmight do the trick. Or you can add tircky code like
Code:
if (ic->ic_flags & IEEE80211_F_SCAN)
        goto skip_tx;
If you completely silent AP (i.e. stop beacon), nothing will work. You need to find the way to wake AP up.
 
Back
Top