diff options
Diffstat (limited to 'sys/dev/ic/bwfm.c')
-rw-r--r-- | sys/dev/ic/bwfm.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sys/dev/ic/bwfm.c b/sys/dev/ic/bwfm.c index 3ba2ee2c4fb..0a92d696577 100644 --- a/sys/dev/ic/bwfm.c +++ b/sys/dev/ic/bwfm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bwfm.c,v 1.32 2018/01/24 13:07:31 patrick Exp $ */ +/* $OpenBSD: bwfm.c,v 1.33 2018/01/31 12:36:13 stsp Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2016,2017 Patrick Wildt <patrick@blueri.se> @@ -2152,26 +2152,30 @@ bwfm_newstate_cb(struct bwfm_softc *sc, void *arg) { struct bwfm_cmd_newstate *cmd = arg; struct ieee80211com *ic = &sc->sc_ic; - enum ieee80211_state ostate, nstate; + struct ifnet *ifp = &ic->ic_if; + enum ieee80211_state nstate = cmd->state; int s; s = splnet(); - ostate = ic->ic_state; - nstate = cmd->state; - DPRINTF(("newstate %s -> %s\n", - ieee80211_state_name[ostate], - ieee80211_state_name[nstate])); switch (nstate) { case IEEE80211_S_SCAN: bwfm_scan(sc); + if (ifp->if_flags & IFF_DEBUG) + printf("%s: %s -> %s\n", DEVNAME(sc), + ieee80211_state_name[ic->ic_state], + ieee80211_state_name[nstate]); ic->ic_state = nstate; splx(s); return; case IEEE80211_S_AUTH: ic->ic_bss->ni_rsn_supp_state = RSNA_SUPP_INITIALIZE; bwfm_connect(sc); - ic->ic_state = cmd->state; + if (ifp->if_flags & IFF_DEBUG) + printf("%s: %s -> %s\n", DEVNAME(sc), + ieee80211_state_name[ic->ic_state], + ieee80211_state_name[nstate]); + ic->ic_state = nstate; if (ic->ic_flags & IEEE80211_F_RSNON) ic->ic_bss->ni_rsn_supp_state = RSNA_SUPP_PTKSTART; splx(s); |