MFC 270830:

When anouncing link state changes on an 802.11 interface with a vap,
announce the change on the vap's ifnet instead of the main ifnet.  This
matches the behavior of other wireless drivers in the tree and allows the
default devd configuration to correctly start dhclient automatically after
an ndis wireless device associates.

Approved by:	re (marius for 10)
This commit is contained in:
jhb 2014-09-17 18:17:18 +00:00
parent 7475a6ecf5
commit 297fe2e27a

View File

@ -1709,23 +1709,26 @@ ndis_ticktask(d, xsc)
if (sc->ndis_link == 0 &&
sc->ndis_sts == NDIS_STATUS_MEDIA_CONNECT) {
sc->ndis_link = 1;
NDIS_UNLOCK(sc);
if ((sc->ndis_80211 != 0) && (vap != NULL)) {
NDIS_UNLOCK(sc);
ndis_getstate_80211(sc);
ieee80211_new_state(vap, IEEE80211_S_RUN, -1);
}
NDIS_LOCK(sc);
if_link_state_change(sc->ifp, LINK_STATE_UP);
NDIS_LOCK(sc);
if_link_state_change(vap->iv_ifp, LINK_STATE_UP);
} else
if_link_state_change(sc->ifp, LINK_STATE_UP);
}
if (sc->ndis_link == 1 &&
sc->ndis_sts == NDIS_STATUS_MEDIA_DISCONNECT) {
sc->ndis_link = 0;
NDIS_UNLOCK(sc);
if ((sc->ndis_80211 != 0) && (vap != NULL))
if ((sc->ndis_80211 != 0) && (vap != NULL)) {
NDIS_UNLOCK(sc);
ieee80211_new_state(vap, IEEE80211_S_SCAN, 0);
NDIS_LOCK(sc);
if_link_state_change(sc->ifp, LINK_STATE_DOWN);
NDIS_LOCK(sc);
if_link_state_change(vap->iv_ifp, LINK_STATE_DOWN);
} else
if_link_state_change(sc->ifp, LINK_STATE_DOWN);
}
NDIS_UNLOCK(sc);