Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Apr 2011 06:58:02 +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: r220442 - in head/sys/dev/ath/ath_hal: . ar5416
Message-ID:  <201104080658.p386w211067120@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Fri Apr  8 06:58:01 2011
New Revision: 220442
URL: http://svn.freebsd.org/changeset/base/220442

Log:
  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.

Modified:
  head/sys/dev/ath/ath_hal/ah.h
  head/sys/dev/ath/ath_hal/ah_internal.h
  head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c

Modified: head/sys/dev/ath/ath_hal/ah.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah.h	Fri Apr  8 06:55:25 2011	(r220441)
+++ head/sys/dev/ath/ath_hal/ah.h	Fri Apr  8 06:58:01 2011	(r220442)
@@ -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)

Modified: head/sys/dev/ath/ath_hal/ah_internal.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_internal.h	Fri Apr  8 06:55:25 2011	(r220441)
+++ head/sys/dev/ath/ath_hal/ah_internal.h	Fri Apr  8 06:58:01 2011	(r220442)
@@ -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;
 

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c	Fri Apr  8 06:55:25 2011	(r220441)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c	Fri Apr  8 06:58:01 2011	(r220442)
@@ -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 i
 		} 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;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104080658.p386w211067120>