From owner-svn-src-all@freebsd.org Thu May 19 04:46:23 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 0B479B41AC4; Thu, 19 May 2016 04:46:23 +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 D6FDE1292; Thu, 19 May 2016 04:46:22 +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 u4J4kLa0072087; Thu, 19 May 2016 04:46:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4J4kLCu072086; Thu, 19 May 2016 04:46:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605190446.u4J4kLCu072086@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:46:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300191 - head/sys/gnu/dev/bwn/phy_n 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:46:23 -0000 Author: adrian Date: Thu May 19 04:46:21 2016 New Revision: 300191 URL: https://svnweb.freebsd.org/changeset/base/300191 Log: [bwn] improve N-PHY debuggability a little bit. Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c ============================================================================== --- head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Thu May 19 04:45:50 2016 (r300190) +++ head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c Thu May 19 04:46:21 2016 (r300191) @@ -1406,6 +1406,7 @@ static uint8_t bwn_radio_2056_rcal(struc if (phy->rev != 3) return 0; + DPRINTF(mac->mac_sc, BWN_DEBUG_RF, "%s: called\n", __func__); mast2 = BWN_RF_READ(mac, B2056_SYN_PLL_MAST2); BWN_RF_WRITE(mac, B2056_SYN_PLL_MAST2, mast2 | 0x7); @@ -1432,6 +1433,8 @@ static uint8_t bwn_radio_2056_rcal(struc static void bwn_radio_init2056_pre(struct bwn_mac *mac) { + DPRINTF(mac->mac_sc, BWN_DEBUG_RF, "%s: called\n", __func__); + BWN_PHY_MASK(mac, BWN_NPHY_RFCTL_CMD, ~BWN_NPHY_RFCTL_CMD_CHIP0PU); /* Maybe wl meant to reset and set (order?) RFCTL_CMD_OEPORFORCE? */ @@ -1445,6 +1448,8 @@ static void bwn_radio_init2056_pre(struc static void bwn_radio_init2056_post(struct bwn_mac *mac) { + DPRINTF(mac->mac_sc, BWN_DEBUG_RF, "%s: called\n", __func__); + BWN_RF_SET(mac, B2056_SYN_COM_CTRL, 0xB); BWN_RF_SET(mac, B2056_SYN_COM_PU, 0x2); BWN_RF_SET(mac, B2056_SYN_COM_RESET, 0x2); @@ -1462,6 +1467,8 @@ static void bwn_radio_init2056_post(stru */ static void bwn_radio_init2056(struct bwn_mac *mac) { + DPRINTF(mac->mac_sc, BWN_DEBUG_RF, "%s: called\n", __func__); + bwn_radio_init2056_pre(mac); b2056_upload_inittabs(mac, 0, 0); bwn_radio_init2056_post(mac); @@ -6375,6 +6382,7 @@ static void bwn_nphy_pmu_spur_avoid(stru /* XXX bhnd */ if (bwn_is_bus_siba(mac)) { + DPRINTF(sc, BWN_DEBUG_RESET, "%s: spuravoid %d\n", __func__, avoid); siba_pmu_spuravoid_pllupdate(sc->sc_dev, avoid); } } @@ -6391,7 +6399,7 @@ static void bwn_nphy_channel_setup(struc uint16_t tmp16; if (bwn_channel_band(mac, new_channel) == BWN_BAND_5G) { - DPRINTF(sc, BWN_DEBUG_RESET, "%s: BAND_2G\n", __func__); + DPRINTF(sc, BWN_DEBUG_RESET, "%s: BAND_5G; chan=%d\n", __func__, ch); /* Switch to 2 GHz for a moment to access BWN_PHY_B_BBCFG */ BWN_PHY_MASK(mac, BWN_NPHY_BANDCTL, ~BWN_NPHY_BANDCTL_5GHZ); @@ -6403,7 +6411,7 @@ static void bwn_nphy_channel_setup(struc BWN_WRITE_2(mac, BWN_PSM_PHY_HDR, tmp16); BWN_PHY_SET(mac, BWN_NPHY_BANDCTL, BWN_NPHY_BANDCTL_5GHZ); } else if (bwn_channel_band(mac, new_channel) == BWN_BAND_2G) { - DPRINTF(sc, BWN_DEBUG_RESET, "%s: BAND_2G\n", __func__); + DPRINTF(sc, BWN_DEBUG_RESET, "%s: BAND_2G; chan=%d\n", __func__, ch); BWN_PHY_MASK(mac, BWN_NPHY_BANDCTL, ~BWN_NPHY_BANDCTL_5GHZ); tmp16 = BWN_READ_2(mac, BWN_PSM_PHY_HDR); BWN_WRITE_2(mac, BWN_PSM_PHY_HDR, tmp16 | 4); @@ -6731,10 +6739,11 @@ bwn_nphy_op_software_rfkill(struct bwn_m if (BWN_READ_4(mac, BWN_MACCTL) & BWN_MACCTL_ON) BWN_ERRPRINTF(mac->mac_sc, "MAC not suspended\n"); + DPRINTF(mac->mac_sc, BWN_DEBUG_RESET | BWN_DEBUG_PHY, + "%s: called; rev=%d, rf_on=%d, active=%d\n", __func__, + phy->rev, mac->mac_phy.rf_on, active); + if (active) { - DPRINTF(mac->mac_sc, BWN_DEBUG_RESET | BWN_DEBUG_PHY, - "%s: called; rev=%d, rf_on=%d\n", __func__, - phy->rev, mac->mac_phy.rf_on); if (phy->rev >= 19) { /* TODO */ } else if (phy->rev >= 7) {