From owner-svn-src-all@FreeBSD.ORG Mon Feb 6 20:23:22 2012 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 E0A151065672; Mon, 6 Feb 2012 20:23:21 +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 CF1B38FC12; Mon, 6 Feb 2012 20:23:21 +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 q16KNLjO051999; Mon, 6 Feb 2012 20:23:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16KNLnI051997; Mon, 6 Feb 2012 20:23:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202062023.q16KNLnI051997@svn.freebsd.org> From: Adrian Chadd Date: Mon, 6 Feb 2012 20:23:21 +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: r231099 - head/sys/dev/ath/ath_dfs/null 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: Mon, 06 Feb 2012 20:23:22 -0000 Author: adrian Date: Mon Feb 6 20:23:21 2012 New Revision: 231099 URL: http://svn.freebsd.org/changeset/base/231099 Log: Contribute some example code which demonstrates how to initialise the radar parameters for the AR5416 and later NICs. These parameters have been tested on the following NICs: * AR5416 * AR9160 * AR9220 * AR9280 And yes, these will return radar pulse parameters and (for AR9160 and later) radar FFT information as PHY errors. This is again not enough to do radar detection, it's just here to faciliate development and validation of radar detection algorithms. The (pulse, not FFT) decoding code for AR5212, AR5416 and later NICs exist in the HAL. This code is disabled for now as generating radar PHY errors can quickly cause issues in busy environment.s Some further debugging of the RX path is needed. Finally, these parameters are likely not useful for the AR5212 era NICs. The madwifi-dfs branch should have suitable example parameters for the 11a era NICs. Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c ============================================================================== --- head/sys/dev/ath/ath_dfs/null/dfs_null.c Mon Feb 6 18:52:40 2012 (r231098) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Mon Feb 6 20:23:21 2012 (r231099) @@ -71,6 +71,28 @@ __FBSDID("$FreeBSD$"); #include /* + * These are default parameters for the AR5416 and + * later 802.11n NICs. They simply enable some + * radar pulse event generation. + * + * These are very likely not valid for the AR5212 era + * NICs. + * + * Since these define signal sizing and threshold + * parameters, they may need changing based on the + * specific antenna and receive amplifier + * configuration. + */ +#define AR5416_DFS_FIRPWR -33 +#define AR5416_DFS_RRSSI 20 +#define AR5416_DFS_HEIGHT 10 +#define AR5416_DFS_PRSSI 15 +#define AR5416_DFS_INBAND 15 +#define AR5416_DFS_RELPWR 8 +#define AR5416_DFS_RELSTEP 12 +#define AR5416_DFS_MAXLEN 255 + +/* * Methods which are required */ @@ -98,16 +120,45 @@ ath_dfs_detach(struct ath_softc *sc) int ath_dfs_radar_enable(struct ath_softc *sc, struct ieee80211_channel *chan) { +#if 0 + HAL_PHYERR_PARAM pe; + /* Check if the current channel is radar-enabled */ if (! IEEE80211_IS_CHAN_DFS(chan)) return (0); + /* Enable radar PHY error reporting */ + sc->sc_dodfs = 1; + /* - * Enabling the radar parameters and setting sc->sc_dodfs = 1 - * would occur here. + * These are general examples of the parameter values + * to use when configuring radar pulse detection for + * the AR5416, AR91xx, AR92xx NICs. They are only + * for testing and do require tuning depending upon the + * hardware and deployment specifics. */ + pe.pe_firpwr = AR5416_DFS_FIRPWR; + pe.pe_rrssi = AR5416_DFS_RRSSI; + pe.pe_height = AR5416_DFS_HEIGHT; + pe.pe_prssi = AR5416_DFS_PRSSI; + pe.pe_inband = AR5416_DFS_INBAND; + pe.pe_relpwr = AR5416_DFS_RELPWR; + pe.pe_relstep = AR5416_DFS_RELSTEP; + pe.pe_maxlen = AR5416_DFS_MAXLEN; + pe.pe_enabled = 1; + + /* Flip on extension channel events only if doing HT40 */ + if (IEEE80211_IS_CHAN_HT40(chan)) + pe.pe_extchannel = 1; + else + pe.pe_extchannel = 0; + + ath_hal_enabledfs(sc->sc_ah, &pe); return (1); +#else + return (0); +#endif } /*