summaryrefslogtreecommitdiffstats
path: root/sys/dev/iwn
diff options
context:
space:
mode:
authorbschmidt <bschmidt@FreeBSD.org>2010-07-15 09:34:00 +0000
committerbschmidt <bschmidt@FreeBSD.org>2010-07-15 09:34:00 +0000
commitc7180de9b584cc2c7b903ecccaa7958d395efe31 (patch)
tree4bb94b90fe25e942f2b4217399e4f7e4f5d19586 /sys/dev/iwn
parente2298f42c63ae12ad8634a2513d7432b6da131fd (diff)
downloadFreeBSD-src-c7180de9b584cc2c7b903ecccaa7958d395efe31.zip
FreeBSD-src-c7180de9b584cc2c7b903ecccaa7958d395efe31.tar.gz
Detect active chains differently to work around a firmware bug which
would mark non-existing chains as active. Obtained from: OpenBSD MFC after: 1 week
Diffstat (limited to 'sys/dev/iwn')
-rw-r--r--sys/dev/iwn/if_iwn.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c
index c6720e2..4dc0352 100644
--- a/sys/dev/iwn/if_iwn.c
+++ b/sys/dev/iwn/if_iwn.c
@@ -4134,10 +4134,14 @@ iwn_collect_noise(struct iwn_softc *sc,
val = MAX(calib->rssi[2], val);
/* Determine which antennas are connected. */
- sc->chainmask = 0;
+ sc->chainmask = sc->rxchainmask;
for (i = 0; i < 3; i++)
- if (val - calib->rssi[i] <= 15 * 20)
- sc->chainmask |= 1 << i;
+ if (val - calib->rssi[i] > 15 * 20)
+ sc->chainmask &= ~(1 << i);
+ DPRINTF(sc, IWN_DEBUG_CALIBRATE,
+ "%s: RX chains mask: theoretical=0x%x, actual=0x%x\n",
+ __func__, sc->rxchainmask, sc->chainmask);
+
/* If none of the TX antennas are connected, keep at least one. */
if ((sc->chainmask & sc->txchainmask) == 0)
sc->chainmask |= IWN_LSB(sc->txchainmask);
OpenPOWER on IntegriCloud