diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -2582,18 +2582,6 @@ * be no-op code - and also if OACTIVE is finally retired, it'll * also be no-op code. */ - if (nstate == IEEE80211_S_RUN) { - /* - * Unblock the VAP queue; a RUN->RUN state can happen - * on a STA+AP setup on the AP vap. See wakeupwaiting(). - */ - vap->iv_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - } - - /* No actual transition, skip post processing */ - if (ostate == nstate) - goto done; - if (nstate == IEEE80211_S_RUN) { /* * OACTIVE may be set on the vap if the upper layer @@ -2602,12 +2590,28 @@ * * Note this can also happen as a result of SLEEP->RUN * (i.e. coming out of power save mode). + * + * Historically this was done only for a state change + * but is needed earlier; see next comment. The 2nd half + * of the work is still only done in case of an actual + * state change below. + */ + /* + * Unblock the VAP queue; a RUN->RUN state can happen + * on a STA+AP setup on the AP vap. See wakeupwaiting(). */ vap->iv_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; /* * XXX TODO Kick-start a VAP queue - this should be a method! */ + } + + /* No actual transition, skip post processing */ + if (ostate == nstate) + goto done; + + if (nstate == IEEE80211_S_RUN) { /* bring up any vaps waiting on us */ wakeupwaiting(vap);