summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2016-05-14 23:41:28 +0000
committeradrian <adrian@FreeBSD.org>2016-05-14 23:41:28 +0000
commit65f466722af51842b55742c37b8ec886416ef1ff (patch)
tree3593e270bf50645efda9541d7eaa4858290efd41
parentc7f4f89fd202c0251617e586b38181e6529c7623 (diff)
downloadFreeBSD-src-65f466722af51842b55742c37b8ec886416ef1ff.zip
FreeBSD-src-65f466722af51842b55742c37b8ec886416ef1ff.tar.gz
[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.
-rw-r--r--sys/dev/bwn/if_bwn.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/sys/dev/bwn/if_bwn.c b/sys/dev/bwn/if_bwn.c
index 562914e..b89d29d 100644
--- a/sys/dev/bwn/if_bwn.c
+++ b/sys/dev/bwn/if_bwn.c
@@ -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 tgshigh)
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, int have_bg, int have_a)
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);
OpenPOWER on IntegriCloud