From 564e7aea543cc6ae8ff71f7dc8037fe62234d1ea Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Thu, 20 Jan 2011 08:40:22 +0000 Subject: [PATCH] Add a comment from my local HAL about what is actually going on here with these ADC DC Gain/Offset calibrations. The whole idea is to calibrate a pair of ADCs to compensate for any differences between them. The AR5416 returns lots of garbage, so there's no need to do the calibration there. The AR9160 returns 0 for secondary ADCs when calibrating 2.4ghz 20mhz modes. It returns valid data for the secondary ADCs when calibrating 2.4ghz HT/40 and any 5ghz mode. --- sys/dev/ath/ath_hal/ar5416/ar5416_cal.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c b/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c index f4d1dc5cbc3..7fab84eb4b1 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c +++ b/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c @@ -40,6 +40,23 @@ static int16_t ar5416GetNf(struct ath_hal *, struct ieee80211_channel *); /* * Determine if calibration is supported by device and channel flags */ + +/* + * ADC GAIN/DC offset calibration is for calibrating two ADCs that + * are acting as one by interleaving incoming symbols. This isn't + * relevant for 2.4GHz 20MHz wide modes because, as far as I can tell, + * the secondary ADC is never enabled. It is enabled however for + * 5GHz modes. + * + * It hasn't been confirmed whether doing this calibration is needed + * at all in the above modes and/or whether it's actually harmful. + * So for now, let's leave it enabled and just remember to get + * confirmation that it needs to be clarified. + * + * See US Patent No: US 7,541,952 B1: + * " Method and Apparatus for Offset and Gain Compensation for + * Analog-to-Digital Converters." + */ static OS_INLINE HAL_BOOL ar5416IsCalSupp(struct ath_hal *ah, const struct ieee80211_channel *chan, HAL_CAL_TYPE calType)