From owner-svn-src-all@FreeBSD.ORG Fri Aug 24 07:32:35 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 C924D106566B; Fri, 24 Aug 2012 07:32:35 +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 B3BC08FC0C; Fri, 24 Aug 2012 07:32:35 +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 q7O7WZEH091998; Fri, 24 Aug 2012 07:32:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7O7WZbb091994; Fri, 24 Aug 2012 07:32:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201208240732.q7O7WZbb091994@svn.freebsd.org> From: Adrian Chadd Date: Fri, 24 Aug 2012 07:32:35 +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: r239642 - head/sys/dev/ath/ath_hal/ar5212 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: Fri, 24 Aug 2012 07:32:36 -0000 Author: adrian Date: Fri Aug 24 07:32:35 2012 New Revision: 239642 URL: http://svn.freebsd.org/changeset/base/239642 Log: Add the method to fetch the default DFS parameters for the AR5212 PHY. I need to check whether new parameters were added for the AR5413 NIC. PR: kern/170904 Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Fri Aug 24 06:56:44 2012 (r239641) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Fri Aug 24 07:32:35 2012 (r239642) @@ -633,6 +633,8 @@ extern void ar5212AniReset(struct ath_ha extern HAL_BOOL ar5212IsNFCalInProgress(struct ath_hal *ah); extern HAL_BOOL ar5212WaitNFCalComplete(struct ath_hal *ah, int i); extern void ar5212EnableDfs(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); +extern HAL_BOOL ar5212GetDfsDefaultThresh(struct ath_hal *ah, + HAL_PHYERR_PARAM *pe); extern void ar5212GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe); extern HAL_BOOL ar5212ProcessRadarEvent(struct ath_hal *ah, struct ath_rx_status *rxs, uint64_t fulltsf, const char *buf, Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Aug 24 06:56:44 2012 (r239641) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri Aug 24 07:32:35 2012 (r239642) @@ -137,6 +137,7 @@ static const struct ath_hal_private ar52 /* DFS Functions */ .ah_enableDfs = ar5212EnableDfs, .ah_getDfsThresh = ar5212GetDfsThresh, + .ah_getDfsDefaultThresh = ar5212GetDfsDefaultThresh, .ah_procRadarEvent = ar5212ProcessRadarEvent, .ah_isFastClockEnabled = ar5212IsFastClockEnabled, .ah_get11nExtBusy = ar5212Get11nExtBusy, Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Fri Aug 24 06:56:44 2012 (r239641) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Fri Aug 24 07:32:35 2012 (r239642) @@ -1163,6 +1163,35 @@ ar5212EnableDfs(struct ath_hal *ah, HAL_ OS_REG_WRITE(ah, AR_PHY_RADAR_0, val | AR_PHY_RADAR_0_ENA); } +/* + * Parameters for the AR5212 PHY. + * + * TODO: figure out what values were added for the AR5413 and later + * PHY; update these here. + */ +#define AR5212_DFS_FIRPWR -41 +#define AR5212_DFS_RRSSI 12 +#define AR5212_DFS_HEIGHT 20 +#define AR5212_DFS_PRSSI 22 +#define AR5212_DFS_INBAND 6 + +HAL_BOOL +ar5212GetDfsDefaultThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) +{ + + pe->pe_firpwr = AR5212_DFS_FIRPWR; + pe->pe_rrssi = AR5212_DFS_RRSSI; + pe->pe_height = AR5212_DFS_HEIGHT; + pe->pe_prssi = AR5212_DFS_PRSSI; + pe->pe_inband = AR5212_DFS_INBAND; + /* XXX look up what is needed for the AR5413 */ + pe->pe_relpwr = 0; + pe->pe_relstep = 0; + pe->pe_maxlen = 0; + + return (AH_TRUE); +} + void ar5212GetDfsThresh(struct ath_hal *ah, HAL_PHYERR_PARAM *pe) { @@ -1250,7 +1279,7 @@ ar5212Get11nExtBusy(struct ath_hal *ah) } /* - * There's no channel survey support for the AR5211. + * There's no channel survey support for the AR5212. */ HAL_BOOL ar5212GetMibCycleCounts(struct ath_hal *ah, HAL_SURVEY_SAMPLE *hsample)