From owner-svn-src-all@freebsd.org Thu May 19 04:29:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8DB8B4167C; Thu, 19 May 2016 04:29:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B7561A07; Thu, 19 May 2016 04:29:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4J4TPVu066243; Thu, 19 May 2016 04:29:25 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J4TPSY066242; Thu, 19 May 2016 04:29:25 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190429.u4J4TPSY066242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 19 May 2016 04:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300189 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 04:29:26 -0000 Author: adrian Date: Thu May 19 04:29:25 2016 New Revision: 300189 URL: https://svnweb.freebsd.org/changeset/base/300189 Log: [bwn] add extra debugging. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Thu May 19 04:28:49 2016 (r300188) +++ head/sys/dev/bwn/if_bwn.c Thu May 19 04:29:25 2016 (r300189) @@ -2008,6 +2008,8 @@ bwn_core_init(struct bwn_mac *mac) KASSERT(mac->mac_status == BWN_MAC_STATUS_UNINIT, ("%s:%d: fail", __func__, __LINE__)); + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: called\n", __func__); + siba_powerup(sc->sc_dev, 0); if (!siba_dev_isup(sc->sc_dev)) bwn_reset_core(mac, mac->mac_phy.gmode); @@ -2041,6 +2043,7 @@ bwn_core_init(struct bwn_mac *mac) if (error) goto fail0; } + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: chip_init\n", __func__); error = bwn_chip_init(mac); if (error) goto fail0; @@ -2088,6 +2091,7 @@ bwn_core_init(struct bwn_mac *mac) bwn_spu_setdelay(mac, 1); bwn_bt_enable(mac); + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: powerup\n", __func__); siba_powerup(sc->sc_dev, !(siba_sprom_get_bf_lo(sc->sc_dev) & BWN_BFL_CRYSTAL_NOSLOW)); bwn_set_macaddr(mac); @@ -2097,12 +2101,14 @@ bwn_core_init(struct bwn_mac *mac) mac->mac_status = BWN_MAC_STATUS_INITED; + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: done\n", __func__); return (error); fail0: siba_powerdown(sc->sc_dev); KASSERT(mac->mac_status == BWN_MAC_STATUS_UNINIT, ("%s:%d: fail", __func__, __LINE__)); + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: fail\n", __func__); return (error); } @@ -3716,6 +3722,9 @@ bwn_mac_suspend(struct bwn_mac *mac) KASSERT(mac->mac_suspended >= 0, ("%s:%d: fail", __func__, __LINE__)); + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: suspended=%d\n", + __func__, mac->mac_suspended); + if (mac->mac_suspended == 0) { bwn_psctl(mac, BWN_PS_AWAKE); BWN_WRITE_4(mac, BWN_MACCTL, @@ -3746,6 +3755,9 @@ bwn_mac_enable(struct bwn_mac *mac) struct bwn_softc *sc = mac->mac_sc; uint16_t state; + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET, "%s: suspended=%d\n", + __func__, mac->mac_suspended); + state = bwn_shm_read_2(mac, BWN_SHARED, BWN_SHARED_UCODESTAT); if (state != BWN_SHARED_UCODESTAT_SUSPEND && @@ -4783,12 +4795,15 @@ bwn_intr(void *arg) (sc->sc_flags & BWN_FLAG_INVALID)) return (FILTER_STRAY); + DPRINTF(sc, BWN_DEBUG_INTR, "%s: called\n", __func__); + reason = BWN_READ_4(mac, BWN_INTR_REASON); if (reason == 0xffffffff) /* shared IRQ */ return (FILTER_STRAY); reason &= mac->mac_intr_mask; if (reason == 0) return (FILTER_HANDLED); + DPRINTF(sc, BWN_DEBUG_INTR, "%s: reason=0x%08x\n", __func__, reason); mac->mac_reason[0] = BWN_READ_4(mac, BWN_DMA0_REASON) & 0x0001dc00; mac->mac_reason[1] = BWN_READ_4(mac, BWN_DMA1_REASON) & 0x0000dc00;