From owner-freebsd-wireless@FreeBSD.ORG Fri Aug 24 17:50:03 2012 Return-Path: Delivered-To: freebsd-wireless@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D9556106564A for ; Fri, 24 Aug 2012 17:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BE4F38FC08 for ; Fri, 24 Aug 2012 17:50:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q7OHo305049218 for ; Fri, 24 Aug 2012 17:50:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q7OHo3xP049217; Fri, 24 Aug 2012 17:50:03 GMT (envelope-from gnats) Date: Fri, 24 Aug 2012 17:50:03 GMT Message-Id: <201208241750.q7OHo3xP049217@freefall.freebsd.org> To: freebsd-wireless@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: kern/170904: commit references a PR X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Aug 2012 17:50:03 -0000 The following reply was made to PR kern/170904; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/170904: commit references a PR Date: Fri, 24 Aug 2012 17:40:21 +0000 (UTC) Author: adrian Date: Fri Aug 24 17:39:57 2012 New Revision: 239658 URL: http://svn.freebsd.org/changeset/base/239658 Log: Remove the hard-coded AR5416-series parameters and instead use the DFS parameters fetched from the HAL. Check whether the specific chipset supports RADAR reporting before enabling DFS; or some of the (unset) DFS methods may fail. Tested: * AR5210 (correctly didn't enable radar PHY reporting) * AR5212 (correctly enabled radar PHY reporting w/ the correct default parameters.) TODO: * Now that I have this capability check in place, I could remove the (empty) DFS methods from AR5210/AR5211. * Test on AR5416, AR9160, AR9280. PR: kern/170904 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 Fri Aug 24 17:37:51 2012 (r239657) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Fri Aug 24 17:39:57 2012 (r239658) @@ -72,28 +72,6 @@ __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 */ @@ -125,30 +103,27 @@ ath_dfs_radar_enable(struct ath_softc *s #if 0 HAL_PHYERR_PARAM pe; + /* Check if the hardware supports radar reporting */ + /* XXX TODO: migrate HAL_CAP_RADAR/HAL_CAP_AR to somewhere public! */ + if (ath_hal_getcapability(sc->sc_ah, + HAL_CAP_PHYDIAG, 0, NULL) != HAL_OK) + return (0); + /* Check if the current channel is radar-enabled */ if (! IEEE80211_IS_CHAN_DFS(chan)) return (0); + /* Fetch the default parameters */ + memset(&pe, '\0', sizeof(pe)); + if (! ath_hal_getdfsdefaultthresh(sc->sc_ah, &pe)) + return (0); + /* Enable radar PHY error reporting */ sc->sc_dodfs = 1; - /* - * 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; + /* Tell the hardware to enable radar reporting */ pe.pe_enabled = 1; - + /* Flip on extension channel events only if doing HT40 */ if (IEEE80211_IS_CHAN_HT40(chan)) pe.pe_extchannel = 1; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"