From owner-svn-src-all@FreeBSD.ORG Sat Apr 28 22:03:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5F18E106566B; Sat, 28 Apr 2012 22:03:20 +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 4A4A08FC0A; Sat, 28 Apr 2012 22:03:20 +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 q3SM3Kpe082554; Sat, 28 Apr 2012 22:03:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3SM3KPY082548; Sat, 28 Apr 2012 22:03:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201204282203.q3SM3KPY082548@svn.freebsd.org> From: Adrian Chadd Date: Sat, 28 Apr 2012 22:03:20 +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: r234774 - in head/sys/dev/ath/ath_hal: ar5212 ar5416 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, 28 Apr 2012 22:03:20 -0000 Author: adrian Date: Sat Apr 28 22:03:19 2012 New Revision: 234774 URL: http://svn.freebsd.org/changeset/base/234774 Log: After thinking about this a bit more, let's not keep statistics per-channel in the HAL. That's very memory hungry (32k just for channel statistics) which would be better served by keeping a summary in the ANI state. Or, later, keep a survey history in net80211. So: * Migrate the ah_chansurvey array to be a single entry, for the current channel. * Change the ioctl interface and ANI code to just reference that. * Clear the ah_chansurvey array during channel reset, both in the AR5212 and AR5416 reset path. Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Sat Apr 28 21:50:30 2012 (r234773) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Sat Apr 28 22:03:19 2012 (r234774) @@ -320,7 +320,7 @@ struct ath_hal_5212 { struct ar5212AniParams ah_aniParams5; /* 5GHz parameters */ struct ar5212AniState *ah_curani; /* cached last reference */ struct ar5212AniState ah_ani[AH_MAXCHAN]; /* per-channel state */ - HAL_CHANNEL_SURVEY ah_chansurvey[AH_MAXCHAN]; /* channel survey */ + HAL_CHANNEL_SURVEY ah_chansurvey; /* channel survey */ /* AR5416 uses some of the AR5212 ANI code; these are the ANI methods */ HAL_BOOL (*ah_aniControl) (struct ath_hal *, HAL_ANI_CMD cmd, int param); Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Sat Apr 28 21:50:30 2012 (r234773) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Sat Apr 28 22:03:19 2012 (r234774) @@ -1092,10 +1092,7 @@ ar5212GetDiagState(struct ath_hal *ah, i } break; case HAL_DIAG_CHANSURVEY: - if (AH_PRIVATE(ah)->ah_curchan == NULL) - return AH_FALSE; - *result = - &ahp->ah_chansurvey[AH_PRIVATE(ah)->ah_curchan->ic_devdata]; + *result = &ahp->ah_chansurvey; *resultsize = sizeof(HAL_CHANNEL_SURVEY); return AH_TRUE; } Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Sat Apr 28 21:50:30 2012 (r234773) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Sat Apr 28 22:03:19 2012 (r234774) @@ -195,6 +195,9 @@ ar5212Reset(struct ath_hal *ah, HAL_OPMO saveFrameSeqCount = OS_REG_READ(ah, AR_D_SEQNUM); } else saveFrameSeqCount = 0; /* NB: silence compiler */ + + /* Blank the channel survey statistics */ + OS_MEMZERO(&ahp->ah_chansurvey, sizeof(ahp->ah_chansurvey)); #if 0 /* * XXX disable for now; this appears to sometimes cause OFDM Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Sat Apr 28 21:50:30 2012 (r234773) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Sat Apr 28 22:03:19 2012 (r234774) @@ -827,10 +827,8 @@ ar5416AniGetListenTime(struct ath_hal *a ath_hal_printf(ah, "%s: ah_curchan = NULL?\n", __func__); return (0); } - /* XXX bounds check? */ - if (AH_PRIVATE(ah)->ah_curchan != AH_NULL) - cs = - &ahp->ah_chansurvey[AH_PRIVATE(ah)->ah_curchan->ic_devdata]; + + cs = &ahp->ah_chansurvey; /* * Fetch the current statistics, squirrel away the current Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sat Apr 28 21:50:30 2012 (r234773) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sat Apr 28 22:03:19 2012 (r234774) @@ -118,6 +118,9 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO } HALASSERT(AH_PRIVATE(ah)->ah_eeversion >= AR_EEPROM_VER14_1); + /* Blank the channel survey statistics */ + OS_MEMZERO(&ahp->ah_chansurvey, sizeof(ahp->ah_chansurvey)); + /* XXX Turn on fast channel change for 5416 */ /* * Preserve the bmiss rssi threshold and count threshold