Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src-draft/trunk]: src/sys/dev/pci Reorder state machine initialization, afte...



details:   https://anonhg.NetBSD.org/src-all/rev/b32ed538ac7c
branches:  trunk
changeset: 951010:b32ed538ac7c
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Wed Jul 01 12:31:21 2020 +1000

description:
Reorder state machine initialization, after the hw has been configured.

diffstat:

 sys/dev/pci/if_iwn.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (44 lines):

diff -r 992a79cad031 -r b32ed538ac7c sys/dev/pci/if_iwn.c
--- a/sys/dev/pci/if_iwn.c      Wed Jul 01 12:30:22 2020 +1000
+++ b/sys/dev/pci/if_iwn.c      Wed Jul 01 12:31:21 2020 +1000
@@ -6887,11 +6887,6 @@
        ifp->if_flags &= ~IFF_OACTIVE;
        ifp->if_flags |= IFF_RUNNING;
 
-       if (ic->ic_opmode == IEEE80211_M_MONITOR)
-               ieee80211_new_state(vap, IEEE80211_S_RUN, -1);
-       else if (vap->iv_roaming != IEEE80211_ROAMING_MANUAL)
-               ieee80211_new_state(vap, IEEE80211_S_SCAN, -1);
-
        iwn_init_channels(ic);
        ieee80211_chan_init(ic);
        ieee80211_media_status(ifp, &imr);
@@ -6903,6 +6898,12 @@
 out:
        mutex_exit(&sc->sc_mtx);
        ieee80211_init(ifp);
+
+       if (ic->ic_opmode == IEEE80211_M_MONITOR)
+               ieee80211_new_state(vap, IEEE80211_S_RUN, -1);
+       else if (vap->iv_roaming != IEEE80211_ROAMING_MANUAL)
+               ieee80211_new_state(vap, IEEE80211_S_SCAN, -1);
+
        return 0;
 
 fail:  mutex_exit(&sc->sc_mtx);
@@ -6923,13 +6924,13 @@
        ifp->if_timer = sc->sc_tx_timer = 0;
        ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
 
-       ieee80211_new_state(vap, IEEE80211_S_INIT, -1);
-
        /* Power OFF hardware. */
        iwn_hw_stop(sc);
 
        if (!disable)
                mutex_exit(&sc->sc_mtx);
+
+       ieee80211_new_state(vap, IEEE80211_S_INIT, -1);
 }
 
 /*



Home | Main Index | Thread Index | Old Index