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
This commit is contained in:
Bernhard Schmidt 2010-07-15 09:34:00 +00:00
parent b1429c8528
commit 76e46e73c3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=210110

View File

@ -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);