diff options
-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; } |