summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2010-07-15 19:38:41 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2010-07-15 19:38:41 +0000
commit18d35aed3de76de0dd8e4704caada1978642070f (patch)
treeaab4550cafed4f977335192e6ddcf9c99d8f7907
parent6743ca45cd7ca4848a126cc6a1caa5ebd63f6add (diff)
sync ar5008_bb_load_noisefloor() with ar9003_bb_load_noisefloor().
we must not restore the noisefloor values if load failed on AR5008 family too.
-rw-r--r--sys/dev/ic/ar5008.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/ic/ar5008.c b/sys/dev/ic/ar5008.c
index eff481c68bd..c0fc2f759ea 100644
--- a/sys/dev/ic/ar5008.c
+++ b/sys/dev/ic/ar5008.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5008.c,v 1.10 2010/07/15 19:33:34 damien Exp $ */
+/* $OpenBSD: ar5008.c,v 1.11 2010/07/15 19:38:40 damien Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -1792,15 +1792,15 @@ ar5008_bb_load_noisefloor(struct athn_softc *sc)
AR_CLRBITS(sc, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NO_UPDATE_NF);
AR_SETBITS(sc, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF);
/* Wait for load to complete. */
- for (ntries = 0; ntries < 5; ntries++) {
+ for (ntries = 0; ntries < 1000; ntries++) {
if (!(AR_READ(sc, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF))
break;
DELAY(50);
}
-#ifdef ATHN_DEBUG
- if (ntries == 5 && athn_debug > 0)
- printf("failed to load noisefloor values\n");
-#endif
+ if (ntries == 1000) {
+ DPRINTF(("failed to load noisefloor values\n"));
+ return;
+ }
/* Restore noisefloor values to initial (max) values. */
for (i = 0; i < AR_MAX_CHAINS; i++)