svn commit: r210411 -
user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416
Adrian Chadd
adrian at FreeBSD.org
Fri Jul 23 12:51:24 UTC 2010
Author: adrian
Date: Fri Jul 23 12:51:23 2010
New Revision: 210411
URL: http://svn.freebsd.org/changeset/base/210411
Log:
Bring over an NF calibration fix from the latest linux wireless-testing ath9k
code.
The inline comment explains what is going on - on the ar5416 and ar9160
(at least) writing -50 to the CCA registers during Noise Floor calibration can
result in the RX side going deaf.
This has been tested on an SR-71 (AR9160 based) 11n MiniPCI card.
The initial NF calibration on startup takes longer than the initial
CCA register loading. It may be possible this occurs during periodic
recalibrations.
Obtained from: Linux
Modified:
user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
Modified: user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
==============================================================================
--- user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Fri Jul 23 12:30:29 2010 (r210410)
+++ user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Fri Jul 23 12:51:23 2010 (r210411)
@@ -552,6 +552,22 @@ ar5416LoadNF(struct ath_hal *ah, const s
}
/*
+ * We timed out waiting for the noisefloor to load, probably due to an
+ * in-progress rx. Simply return here and allow the load plenty of time
+ * to complete before the next calibration interval. We need to avoid
+ * trying to load -50 (which happens below) while the previous load is
+ * still in progress as this can cause rx deafness. Instead by returning
+ * here, the baseband nf cal will just be capped by our present
+ * noisefloor until the next calibration timer.
+ */
+ if (j == 1000) {
+ HALDEBUG(ah, HAL_DEBUG_ANY, "Timeout while waiting for nf "
+ "to load: AR_PHY_AGC_CONTROL=0x%x\n",
+ OS_REG_READ(ah, AR_PHY_AGC_CONTROL));
+ return;
+ }
+
+ /*
* Restore maxCCAPower register parameter again so that we're not capped
* by the median we just loaded. This will be initial (and max) value
* of next noise floor calibration the baseband does.
More information about the svn-src-user
mailing list