From owner-svn-src-all@FreeBSD.ORG Sat Jun 4 04:15:00 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 534161065674; Sat, 4 Jun 2011 04:15:00 +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 38B868FC0A; Sat, 4 Jun 2011 04:15:00 +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 p544F0wW093324; Sat, 4 Jun 2011 04:15:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p544ExZO093320; Sat, 4 Jun 2011 04:14:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201106040414.p544ExZO093320@svn.freebsd.org> From: Adrian Chadd Date: Sat, 4 Jun 2011 04:14:59 +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: r222668 - head/sys/dev/ath 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: Sat, 04 Jun 2011 04:15:00 -0000 Author: adrian Date: Sat Jun 4 04:14:59 2011 New Revision: 222668 URL: http://svn.freebsd.org/changeset/base/222668 Log: A few changes to make radar detection implementable in a hal_dfs/ module. * If sc->sc_dodfs is set to 1 by the ath_dfs_radar_enable(), set the relevant rx filter bit to begin receiving radar PHY errors. The HAL code already knows how to set the relevant error mask register to enable radar events. * Add a missing call to ath_dfs_radar_enable() after ath_hal_reset() * change ath_dfs_process_phyerr() to take a const char *buf for now, rather than a descriptor. This way it can get access to the packet buffer contents. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athdfs.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Jun 4 04:00:40 2011 (r222667) +++ head/sys/dev/ath/if_ath.c Sat Jun 4 04:14:59 2011 (r222668) @@ -1261,6 +1261,10 @@ ath_resume(struct ath_softc *sc) sc->sc_curchan != NULL ? sc->sc_curchan : ic->ic_curchan, AH_FALSE, &status); ath_reset_keycache(sc); + + /* Let DFS at it in case it's a DFS channel */ + ath_dfs_radar_enable(sc, ic->ic_curchan); + if (sc->sc_resume_up) { if (ic->ic_opmode == IEEE80211_M_STA) { ath_init(sc); @@ -2013,6 +2017,10 @@ ath_calcrxfilter(struct ath_softc *sc) if (ic->ic_opmode == IEEE80211_M_MONITOR) rfilt |= HAL_RX_FILTER_CONTROL; + if (sc->sc_dodfs) { + rfilt |= HAL_RX_FILTER_PHYRADAR; + } + /* * Enable RX of compressed BAR frames only when doing * 802.11n. Required for A-MPDU. @@ -3465,7 +3473,7 @@ ath_rx_proc(void *arg, int npending) if (rs->rs_status & HAL_RXERR_PHY) { sc->sc_stats.ast_rx_phyerr++; /* Process DFS radar events */ - ath_dfs_process_phy_err(sc, ds, tsf, rs); + ath_dfs_process_phy_err(sc, mtod(m, char *), tsf, rs); /* Be suitably paranoid about receiving phy errors out of the stats array bounds */ if (rs->rs_phyerr < 64) Modified: head/sys/dev/ath/if_athdfs.h ============================================================================== --- head/sys/dev/ath/if_athdfs.h Sat Jun 4 04:00:40 2011 (r222667) +++ head/sys/dev/ath/if_athdfs.h Sat Jun 4 04:14:59 2011 (r222668) @@ -35,7 +35,7 @@ extern int ath_dfs_attach(struct ath_sof extern int ath_dfs_detach(struct ath_softc *sc); extern void ath_dfs_radar_enable(struct ath_softc *, struct ieee80211_channel *chan); -extern void ath_dfs_process_phy_err(struct ath_softc *sc, struct ath_desc *ds, +extern void ath_dfs_process_phy_err(struct ath_softc *sc, const char *buf, uint64_t tsf, struct ath_rx_status *rxstat); extern int ath_dfs_process_radar_event(struct ath_softc *sc, struct ieee80211_channel *chan); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sat Jun 4 04:00:40 2011 (r222667) +++ head/sys/dev/ath/if_athvar.h Sat Jun 4 04:14:59 2011 (r222668) @@ -360,6 +360,7 @@ struct ath_softc { /* DFS related state */ void *sc_dfs; /* Used by an optional DFS module */ + int sc_dodfs; /* Whether to enable DFS rx filter bits */ struct task sc_dfstask; /* DFS processing task */ };