From owner-svn-src-all@freebsd.org Sat May 14 23:41:29 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 8B0AAB3B192; Sat, 14 May 2016 23:41:29 +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 3EED31423; Sat, 14 May 2016 23:41:29 +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 u4ENfSdN088069; Sat, 14 May 2016 23:41:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4ENfSeU088068; Sat, 14 May 2016 23:41:28 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201605142341.u4ENfSeU088068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 14 May 2016 23:41:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299792 - 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: Sat, 14 May 2016 23:41:29 -0000 Author: adrian Date: Sat May 14 23:41:28 2016 New Revision: 299792 URL: https://svnweb.freebsd.org/changeset/base/299792 Log: [bwn] Explicitly only work for SIBA parts; add some placeholder debugging. Set phy-full-init always to 1 for now; PHY-N supports being able to do partial init for things like fast channel changes but I'm going to ignore it all. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Sat May 14 23:38:51 2016 (r299791) +++ head/sys/dev/bwn/if_bwn.c Sat May 14 23:41:28 2016 (r299792) @@ -1149,8 +1149,27 @@ bwn_attach_core(struct bwn_mac *mac) if (error) goto fail; - have_a = (high & BWN_TGSHIGH_HAVE_5GHZ) ? 1 : 0; - have_bg = (high & BWN_TGSHIGH_HAVE_2GHZ) ? 1 : 0; + /* XXX need bhnd */ + if (bwn_is_bus_siba(mac)) { + have_a = (high & BWN_TGSHIGH_HAVE_5GHZ) ? 1 : 0; + have_bg = (high & BWN_TGSHIGH_HAVE_2GHZ) ? 1 : 0; + } else { + device_printf(sc->sc_dev, "%s: not siba; bailing\n", __func__); + error = ENXIO; + goto fail; + } + +#if 0 + device_printf(sc->sc_dev, "%s: high=0x%08x, have_a=%d, have_bg=%d," + " deviceid=0x%04x, siba_deviceid=0x%04x\n", + __func__, + high, + have_a, + have_bg, + siba_get_pci_device(sc->sc_dev), + siba_get_chipid(sc->sc_dev)); +#endif + if (siba_get_pci_device(sc->sc_dev) != 0x4312 && siba_get_pci_device(sc->sc_dev) != 0x4319 && siba_get_pci_device(sc->sc_dev) != 0x4324) { @@ -1335,6 +1354,13 @@ bwn_phy_getinfo(struct bwn_mac *mac, int phy->rf_rev = (tmp & 0xf0000000) >> 28; phy->rf_ver = (tmp & 0x0ffff000) >> 12; phy->rf_manuf = (tmp & 0x00000fff); + + /* + * For now, just always do full init (ie, what bwn has traditionally + * done) + */ + phy->phy_do_full_init = 1; + if (phy->rf_manuf != 0x17f) /* 0x17f is broadcom */ goto unsupradio; if ((phy->type == BWN_PHYTYPE_A && (phy->rf_ver != 0x2060 || @@ -1416,6 +1442,11 @@ bwn_setup_channels(struct bwn_mac *mac, memset(ic->ic_channels, 0, sizeof(ic->ic_channels)); ic->ic_nchans = 0; + DPRINTF(sc, BWN_DEBUG_EEPROM, "%s: called; bg=%d, a=%d\n", + __func__, + have_bg, + have_a); + if (have_bg) bwn_addchannels(ic->ic_channels, IEEE80211_CHAN_MAX, &ic->ic_nchans, &bwn_chantable_bg, IEEE80211_CHAN_G);