Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Feb 2011 10:51:08 +0100
From:      Bernhard Schmidt <bschmidt@freebsd.org>
To:        Alexander Zagrebin <alex@zagrebin.ru>
Cc:        freebsd-net@freebsd.org, PseudoCylon <moonlightakkiy@yahoo.ca>
Subject:   Re: if_run in hostap mode: issue with stations in the power save mode
Message-ID:  <201102081051.08923.bschmidt@freebsd.org>
In-Reply-To: <20110208082428.GA83490@gw.zagrebin.ru>
References:  <20110204060808.GA97298@gw.zagrebin.ru> <201102070911.02791.bschmidt@freebsd.org> <20110208082428.GA83490@gw.zagrebin.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday, February 08, 2011 09:24:29 Alexander Zagrebin wrote:
> Hi!
> 
> On 07.02.2011 09:11:02 +0100, Bernhard Schmidt wrote:
> > For example, if you call 'ifconfig wlan0 ssid <newssid>' the new
> > ssid is passed over using a IOCTL. It would be interesting to know
> > what function in net80211 are called regarding beacon updates and
> > which of those call into the run driver. Ultimately it's about
> > figuring out if special handling for such cases are required and
> > if so, how to do it.
> 
> I've added a debug output on allocation, changing and deallocation of
> a beacon into if_run.c and tried to change SSID while the
> net.wlan.0.debug is -1. Here is the log contents:
> 
> kernel: wlan0: ieee80211_init
> kernel: wlan0: start running, 1 vaps running
> kernel: wlan0: ieee80211_new_state_locked: RUN -> SCAN (nrunning 0
> nscanning 0) kernel: wlan0: ieee80211_newstate_cb: RUN -> INIT arg 0
> kernel: wlan0: hostap_newstate: RUN -> INIT (0)
> kernel: wlan0: node_reclaim: remove
> 0xffffff8003bd7000<00:14:d1:a8:66:1d> from station table, refcnt 1
> kernel: wlan0: ieee80211_alloc_node
> 0xffffff8004eae000<00:14:d1:a8:66:1d> in station table kernel:
> wlan0: [00:14:d1:a8:66:1d] ieee80211_alloc_node: inact_reload 2
> kernel: wlan0: ieee80211_newstate_cb: INIT -> SCAN arg 0
> kernel: wlan0: hostap_newstate: INIT -> SCAN (0)
> kernel: wlan0: ieee80211_create_ibss: creating HOSTAP on channel 6
> kernel: wlan0: ieee80211_alloc_node
> 0xffffff8003bd7000<00:14:d1:a8:66:1d> in station table kernel:
> kernel: wlan0: [00:14:d1:a8:66:1d] ieee80211_alloc_node: inact_reload
> 2 kernel: wlan0: set WME_AC_BE (chan) [acm 0 aifsn 3 logcwmin 4
> logcwmax 6 txop 0] kernel: wlan0: set WME_AC_BE (bss ) [acm 0 aifsn
> 3 logcwmin 4 logcwmax 10 txop 0] kernel: wlan0: set WME_AC_BK (chan)
> [acm 0 aifsn 7 logcwmin 4 logcwmax 10 txop 0] kernel: wlan0: set
> WME_AC_BK (bss ) [acm 0 aifsn 7 logcwmin 4 logcwmax 10 txop 0]
> kernel: wlan0: set WME_AC_VI (chan) [acm 0 aifsn 1 logcwmin 3
> logcwmax 4 txop 94] kernel: wlan0: set WME_AC_VI (bss ) [acm 0 aifsn
> 2 logcwmin 3 logcwmax 4 txop 94] kernel: wlan0: set WME_AC_VO (chan)
> [acm 0 aifsn 1 logcwmin 2 logcwmax 3 txop 47] kernel: wlan0: set
> WME_AC_VO (bss ) [acm 0 aifsn 2 logcwmin 2 logcwmax 3 txop 47]
> kernel: wlan0: ieee80211_wme_updateparams_locked: WME params
> updated, cap_info 0x6 kernel: wlan0: ieee80211_new_state_locked:
> SCAN -> RUN (nrunning 0 nscanning 0) kernel: wlan0:
> ieee80211_newstate_cb: SCAN -> RUN arg -1
> kernel: run0: run_update_beacon_cb: updating beacon
> kernel: wlan0: ieee80211_beacon_update: traffic 0, enable aggressive
> mode kernel: wlan0: update WME_AC_BE (chan+bss) [acm 0 aifsn 2
> logcwmin 4 logcwmax 10 txop 0] kernel: wlan0: update WME_AC_BE
> (chan+bss) logcwmin 3
> kernel: wlan0: ieee80211_wme_updateparams_locked: WME params updated,
> cap_info 0x7 kernel: wlan0: hostap_newstate: SCAN -> RUN (-1)
> kernel: wlan0: synchronized with 00:14:d1:a8:66:1d ssid "test"
> channel 6 start 0Mb kernel: wlan0: [00:14:d1:a8:66:1d]
> ieee80211_node_authorize: inact_reload 20
> 
> As you can see, run_update_beacon_cb() is invoked, but at this time
> the beacon is already allocated. As the beacon is allocated,
> run_update_beacon_cb() invokes ieee80211_beacon_update(). As we
> know, the ieee80211_beacon_update() doesn't update the SSID, so the
> SSID remains untouched.
> Nevertheless the changing or hiding/unhiding a SSID seems to be
> working. It is possible to explain: the station uses an active scan.
> The ieee80211_send_proberesp()/ieee80211_alloc_proberesp() returns
> the frame, containing an updated SSID, but AP continues to broadcast
> beacon with the outdated data.
> The possible solution is to deallocate a beacon on a state change.
> I've decided to deallocate a beacon on 'to RUN' state transition.
> The additional patch is attached.
> I'll do an additional tests later today...

Thank you. That's what I expected actually, when we are going through 
state changes (RUN -> ... -> RUN) net80211 expects us to throw most 
knowledge we have aways. This seems to be safest solution. When the 
beacon mbuf is completely thrown away and created from scratch we can be 
absolutely sure we handled all cases.

-- 
Bernhard



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102081051.08923.bschmidt>