From owner-svn-src-all@FreeBSD.ORG Thu Jan 31 00:14:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD07A2E4; Thu, 31 Jan 2013 00:14:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF926E7F; Thu, 31 Jan 2013 00:14:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0V0EPkN046964; Thu, 31 Jan 2013 00:14:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0V0EP04046963; Thu, 31 Jan 2013 00:14:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301310014.r0V0EP04046963@svn.freebsd.org> From: Adrian Chadd Date: Thu, 31 Jan 2013 00:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246141 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 31 Jan 2013 00:14:25 -0000 Author: adrian Date: Thu Jan 31 00:14:25 2013 New Revision: 246141 URL: http://svnweb.freebsd.org/changeset/base/246141 Log: Work around some rather unfortunate race conditions inside net80211. Right now, ic_curchan seems to be updated rather quickly (ie, during the ioctl) and before the driver gets notified of what's going on. So what I was seeing was: * NIC was in channel X; * It generates PHY errors for channel X; * an ioctl comes along from userland and changes things to channel Y; * .. this updates ic_curchan, but hasn't yet reset the hardware; * in parallel, RX is occuring and it looks at ic_curchan; * .. which is channel Y, so events get stamped with that now. Sigh. Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Thu Jan 31 00:02:49 2013 (r246140) +++ head/sys/dev/ath/if_ath_rx.c Thu Jan 31 00:14:25 2013 (r246141) @@ -431,18 +431,16 @@ ath_rx_tap(struct ifnet *ifp, struct mbu #ifdef AH_SUPPORT_AR5416 sc->sc_rx_th.wr_chan_flags &= ~CHAN_HT; if (rs->rs_status & HAL_RXERR_PHY) { - struct ieee80211com *ic = ifp->if_l2com; - /* * PHY error - make sure the channel flags * reflect the actual channel configuration, * not the received frame. */ - if (IEEE80211_IS_CHAN_HT40U(ic->ic_curchan)) + if (IEEE80211_IS_CHAN_HT40U(sc->sc_curchan)) sc->sc_rx_th.wr_chan_flags |= CHAN_HT40U; - else if (IEEE80211_IS_CHAN_HT40D(ic->ic_curchan)) + else if (IEEE80211_IS_CHAN_HT40D(sc->sc_curchan)) sc->sc_rx_th.wr_chan_flags |= CHAN_HT40D; - else if (IEEE80211_IS_CHAN_HT20(ic->ic_curchan)) + else if (IEEE80211_IS_CHAN_HT20(sc->sc_curchan)) sc->sc_rx_th.wr_chan_flags |= CHAN_HT20; } else if (sc->sc_rx_th.wr_rate & IEEE80211_RATE_MCS) { /* HT rate */ struct ieee80211com *ic = ifp->if_l2com;