From owner-svn-src-all@FreeBSD.ORG Tue Jul 19 15:24:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD94E1065674; Tue, 19 Jul 2011 15:24:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A45A28FC1A; Tue, 19 Jul 2011 15:24:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6JFOiT3077799; Tue, 19 Jul 2011 15:24:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6JFOict077797; Tue, 19 Jul 2011 15:24:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107191524.p6JFOict077797@svn.freebsd.org> From: Adrian Chadd Date: Tue, 19 Jul 2011 15:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224220 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 15:24:44 -0000 Author: adrian Date: Tue Jul 19 15:24:44 2011 New Revision: 224220 URL: http://svn.freebsd.org/changeset/base/224220 Log: This sets the BSS channel for each VAP for the given interface. It's only relevant in STA mode. The CSA forces a channel switch for the interface, but doesn't update the VAP channel. Approved by: re (bz) Modified: head/sys/net80211/ieee80211_proto.c Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Tue Jul 19 15:22:35 2011 (r224219) +++ head/sys/net80211/ieee80211_proto.c Tue Jul 19 15:24:44 2011 (r224220) @@ -1501,6 +1501,11 @@ ieee80211_csa_startswitch(struct ieee802 ieee80211_notify_csa(ic, c, mode, count); } +/* + * Complete the channel switch by transitioning all CSA VAPs to RUN. + * This is called by both the completion and cancellation functions + * so each VAP is placed back in the RUN state and can thus transmit. + */ static void csa_completeswitch(struct ieee80211com *ic) { @@ -1518,6 +1523,12 @@ csa_completeswitch(struct ieee80211com * * Complete an 802.11h channel switch started by ieee80211_csa_startswitch. * We clear state and move all vap's in CSA state to RUN state * so they can again transmit. + * + * Although this may not be completely correct, update the BSS channel + * for each VAP to the newly configured channel. The setcurchan sets + * the current operating channel for the interface (so the radio does + * switch over) but the VAP BSS isn't updated, leading to incorrectly + * reported information via ioctl. */ void ieee80211_csa_completeswitch(struct ieee80211com *ic) @@ -1527,6 +1538,10 @@ ieee80211_csa_completeswitch(struct ieee KASSERT(ic->ic_flags & IEEE80211_F_CSAPENDING, ("csa not pending")); ieee80211_setcurchan(ic, ic->ic_csa_newchan); + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) + if (vap->iv_state == IEEE80211_S_CSA) + vap->iv_bss->ni_chan = ic->ic_curchan; + csa_completeswitch(ic); }