From a7978cf36df87402d74aaaef408969c6a69d7977 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Tue, 24 May 2016 01:20:30 +0000 Subject: [PATCH] [bwn] add extra debugging for non-SIBA devices. This is a no-op at the present moment, but will eventually remind me where the SIBA specific demons lie. Tested: * BCM4322, STA mode --- sys/dev/bwn/if_bwn.c | 15 ++++++++++++--- sys/dev/bwn/if_bwn_phy_common.c | 6 ++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/sys/dev/bwn/if_bwn.c b/sys/dev/bwn/if_bwn.c index d1300249745..4874347d27e 100644 --- a/sys/dev/bwn/if_bwn.c +++ b/sys/dev/bwn/if_bwn.c @@ -4712,11 +4712,9 @@ bwn_rf_turnoff(struct bwn_mac *mac) /* * SSB PHY reset. - * - * XXX TODO: BCMA PHY reset. */ static void -bwn_phy_reset(struct bwn_mac *mac) +bwn_phy_reset_siba(struct bwn_mac *mac) { struct bwn_softc *sc = mac->mac_sc; @@ -4729,6 +4727,17 @@ bwn_phy_reset(struct bwn_mac *mac) DELAY(1000); } +static void +bwn_phy_reset(struct bwn_mac *mac) +{ + + if (bwn_is_bus_siba(mac)) { + bwn_phy_reset_siba(mac); + } else { + BWN_ERRPRINTF(mac->mac_sc, "%s: unknown bus!\n", __func__); + } +} + static int bwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { diff --git a/sys/dev/bwn/if_bwn_phy_common.c b/sys/dev/bwn/if_bwn_phy_common.c index bcc9dc9dfb6..4a3b044de11 100644 --- a/sys/dev/bwn/if_bwn_phy_common.c +++ b/sys/dev/bwn/if_bwn_phy_common.c @@ -157,6 +157,8 @@ bwn_phy_force_clock(struct bwn_mac *mac, int force) else tmp &= ~SIBA_TGSLOW_FGC; siba_write_4(sc->sc_dev, SIBA_TGSLOW, tmp); + } else { + BWN_ERRPRINTF(sc, "%s: unknown bus!\n", __func__); } } @@ -190,6 +192,8 @@ bwn_mac_phy_clock_set(struct bwn_mac *mac, int enabled) else val &= ~BWN_TGSLOW_MACPHYCLKEN; siba_write_4(sc->sc_dev, SIBA_TGSLOW, val); + } else { + BWN_ERRPRINTF(sc, "%s: unknown bus!\n", __func__); } } @@ -205,5 +209,7 @@ bwn_wireless_core_phy_pll_reset(struct bwn_mac *mac) siba_cc_mask32(sc->sc_dev, SIBA_CC_CHIPCTL_DATA, ~0x4); siba_cc_set32(sc->sc_dev, SIBA_CC_CHIPCTL_DATA, 0x4); siba_cc_mask32(sc->sc_dev, SIBA_CC_CHIPCTL_DATA, ~0x4); + } else { + BWN_ERRPRINTF(sc, "%s: unknown bus!\n", __func__); } }