Date: Mon, 13 Dec 2010 17:53:41 +0000 (UTC) From: Bernhard Schmidt <bschmidt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r216411 - stable/8/sys/dev/wpi Message-ID: <201012131753.oBDHrfAf089465@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bschmidt Date: Mon Dec 13 17:53:41 2010 New Revision: 216411 URL: http://svn.freebsd.org/changeset/base/216411 Log: MFC r216238: Fix scanning after loosing a connection. The firmware assumes that as long as an association ID is set any scan is supposed to be a background scan. This implies that the firmware will switch back to the associated channel after a certain threshold, though, we are not notified about that. We currently catch this case by a timer which will reset the firmware after a 'scan timeout', though, upper layers are not notified about that and will simply hang until manual intervention. Fix this by resetting the firmware's knowledge about any association on RUN -> ASSOC and !INIT -> SCAN transitions. Approved by: re (kib) Modified: stable/8/sys/dev/wpi/if_wpi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/wpi/if_wpi.c ============================================================================== --- stable/8/sys/dev/wpi/if_wpi.c Mon Dec 13 17:53:38 2010 (r216410) +++ stable/8/sys/dev/wpi/if_wpi.c Mon Dec 13 17:53:41 2010 (r216411) @@ -1248,8 +1248,25 @@ wpi_newstate(struct ieee80211vap *vap, e IEEE80211_UNLOCK(ic); WPI_LOCK(sc); - if (nstate == IEEE80211_S_AUTH) { - /* The node must be registered in the firmware before auth */ + if (nstate == IEEE80211_S_SCAN && vap->iv_state != IEEE80211_S_INIT) { + /* + * On !INIT -> SCAN transitions, we need to clear any possible + * knowledge about associations. + */ + error = wpi_config(sc); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: device config failed, error %d\n", + __func__, error); + } + } + if (nstate == IEEE80211_S_AUTH || + (nstate == IEEE80211_S_ASSOC && vap->iv_state == IEEE80211_S_RUN)) { + /* + * The node must be registered in the firmware before auth. + * Also the associd must be cleared on RUN -> ASSOC + * transitions. + */ error = wpi_auth(sc, vap); if (error != 0) { device_printf(sc->sc_dev,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012131753.oBDHrfAf089465>