From owner-svn-src-stable@FreeBSD.ORG Sat Jul 31 10:15:18 2010 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64992106564A; Sat, 31 Jul 2010 10:15:18 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 535848FC1B; Sat, 31 Jul 2010 10:15:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6VAFIiC047453; Sat, 31 Jul 2010 10:15:18 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6VAFIkP047451; Sat, 31 Jul 2010 10:15:18 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201007311015.o6VAFIkP047451@svn.freebsd.org> From: Bernhard Schmidt Date: Sat, 31 Jul 2010 10:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210671 - stable/8/sys/dev/iwn X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jul 2010 10:15:18 -0000 Author: bschmidt Date: Sat Jul 31 10:15:18 2010 New Revision: 210671 URL: http://svn.freebsd.org/changeset/base/210671 Log: MFC r210110: Detect active chains differently to work around a firmware bug which would mark non-existing chains as active. Obtained from: OpenBSD Modified: stable/8/sys/dev/iwn/if_iwn.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/8/sys/dev/iwn/if_iwn.c Sat Jul 31 10:12:53 2010 (r210670) +++ stable/8/sys/dev/iwn/if_iwn.c Sat Jul 31 10:15:18 2010 (r210671) @@ -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);