Date: Sat, 28 Apr 2012 22:03:20 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r234774 - in head/sys/dev/ath/ath_hal: ar5212 ar5416 Message-ID: <201204282203.q3SM3KPY082548@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204282203.q3SM3KPY082548>