diff options
author | adrian <adrian@FreeBSD.org> | 2011-04-08 06:58:01 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2011-04-08 06:58:01 +0000 |
commit | 01612edce69b9fa3e691e982df2b503f7a1905bb (patch) | |
tree | a30ba7da19fb8b3d460c58c0f81ca733d828195c | |
parent | 76769431e059b9256d941d1067039835d11ed759 (diff) | |
download | FreeBSD-src-01612edce69b9fa3e691e982df2b503f7a1905bb.zip FreeBSD-src-01612edce69b9fa3e691e982df2b503f7a1905bb.tar.gz |
Export the per-chain ctl/ext noise floor values, raw and uncut, to the
upper-level HAL.
Right now the per-chain noise floor values aren't used anywhere in
the upper-level HAL, so the driver currently has no real reference
to compare the per-chain RSSI values to.
This is needed before per-chain RSSI values (for ctl and ext radios)
are can be thrown upstairs to the net80211 code.
-rw-r--r-- | sys/dev/ath/ath_hal/ah.h | 8 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ah_internal.h | 6 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ar5416/ar5416_cal.c | 8 |
3 files changed, 22 insertions, 0 deletions
diff --git a/sys/dev/ath/ath_hal/ah.h b/sys/dev/ath/ath_hal/ah.h index e7b9c9f..c381703 100644 --- a/sys/dev/ath/ath_hal/ah.h +++ b/sys/dev/ath/ath_hal/ah.h @@ -31,6 +31,14 @@ #include "ah_osdep.h" /* + * The maximum number of TX/RX chains supported. + * This is intended to be used by various statistics gathering operations + * (NF, RSSI, EVM). + */ +#define AH_MIMO_MAX_CHAINS 3 +#define AH_MIMO_MAX_EVM_PILOTS 6 + +/* * __ahdecl is analogous to _cdecl; it defines the calling * convention used within the HAL. For most systems this * can just default to be empty and the compiler will (should) diff --git a/sys/dev/ath/ath_hal/ah_internal.h b/sys/dev/ath/ath_hal/ah_internal.h index c40ba55..c78c0bd 100644 --- a/sys/dev/ath/ath_hal/ah_internal.h +++ b/sys/dev/ath/ath_hal/ah_internal.h @@ -28,6 +28,7 @@ #define AH_MAX(a,b) ((a)>(b)?(a):(b)) #include <net80211/_ieee80211.h> +#include "opt_ah.h" /* needed for AH_SUPPORT_AR5416 */ #ifndef NBBY #define NBBY 8 /* number of bits/byte */ @@ -136,11 +137,16 @@ typedef struct { #define CHANNEL_IQVALID 0x01 /* IQ calibration valid */ #define CHANNEL_ANI_INIT 0x02 /* ANI state initialized */ #define CHANNEL_ANI_SETUP 0x04 /* ANI state setup */ +#define CHANNEL_MIMO_NF_VALID 0x04 /* Mimo NF values are valid */ uint8_t calValid; /* bitmask of cal types */ int8_t iCoff; int8_t qCoff; int16_t rawNoiseFloor; int16_t noiseFloorAdjust; +#ifdef AH_SUPPORT_AR5416 + uint8_t noiseFloorCtl[AH_MIMO_MAX_CHAINS]; + uint8_t noiseFloorExt[AH_MIMO_MAX_CHAINS]; +#endif /* AH_SUPPORT_AR5416 */ uint16_t mainSpur; /* cached spur value for this channel */ } HAL_CHANNEL_INTERNAL; diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c b/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c index 46e56c9..f486ca6 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c +++ b/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c @@ -775,6 +775,7 @@ static int16_t ar5416GetNf(struct ath_hal *ah, struct ieee80211_channel *chan) { int16_t nf, nfThresh; + int i; if (ar5212IsNFCalInProgress(ah)) { HALDEBUG(ah, HAL_DEBUG_ANY, @@ -806,6 +807,13 @@ ar5416GetNf(struct ath_hal *ah, struct ieee80211_channel *chan) } else { nf = 0; } + /* Update MIMO channel statistics, regardless of validity or not (for now) */ + for (i = 0; i < 3; i++) { + ichan->noiseFloorCtl[i] = nfarray[i]; + ichan->noiseFloorExt[i] = nfarray[i + 3]; + } + ichan->privFlags |= CHANNEL_MIMO_NF_VALID; + ar5416UpdateNFHistBuff(AH5416(ah)->ah_cal.nfCalHist, nfarray); ichan->rawNoiseFloor = nf; } |