diff options
-rw-r--r-- | sys/net80211/ieee80211.c | 7 | ||||
-rw-r--r-- | sys/net80211/ieee80211_proto.c | 11 | ||||
-rw-r--r-- | sys/net80211/ieee80211_proto.h | 3 |
3 files changed, 15 insertions, 6 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c index c5b476165e3..6899fdd13a1 100644 --- a/sys/net80211/ieee80211.c +++ b/sys/net80211/ieee80211.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211.c,v 1.37 2009/11/02 22:31:50 sobrado Exp $ */ +/* $OpenBSD: ieee80211.c,v 1.38 2009/11/21 18:09:31 damien Exp $ */ /* $NetBSD: ieee80211.c,v 1.19 2004/06/06 05:45:29 dyoung Exp $ */ /*- @@ -547,7 +547,10 @@ ieee80211_media_status(struct ifnet *ifp, struct ifmediareq *imr) imr->ifm_status = IFM_AVALID; imr->ifm_active = IFM_IEEE80211; - if (ic->ic_state == IEEE80211_S_RUN) + if (ic->ic_state == IEEE80211_S_RUN && + (ic->ic_opmode != IEEE80211_M_STA || + !(ic->ic_flags & IEEE80211_F_RSNON) || + ic->ic_bss->ni_port_valid)) imr->ifm_status |= IFM_ACTIVE; imr->ifm_active |= IFM_AUTO; switch (ic->ic_opmode) { diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index d8db4dc8f31..c3a6a5a99c5 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_proto.c,v 1.40 2009/03/26 20:34:54 damien Exp $ */ +/* $OpenBSD: ieee80211_proto.c,v 1.41 2009/11/21 18:09:31 damien Exp $ */ /* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */ /*- @@ -89,7 +89,6 @@ const char * const ieee80211_phymode_name[] = { }; int ieee80211_newstate(struct ieee80211com *, enum ieee80211_state, int); -void ieee80211_set_link_state(struct ieee80211com *, int); void ieee80211_proto_attach(struct ifnet *ifp) @@ -949,7 +948,6 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, } break; case IEEE80211_S_RUN: - ieee80211_set_link_state(ic, LINK_STATE_UP); switch (ostate) { case IEEE80211_S_INIT: case IEEE80211_S_AUTH: @@ -982,6 +980,13 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, (ic->ic_flags & IEEE80211_F_USEPROT) ? " protection enabled" : ""); } + if (!(ic->ic_flags & IEEE80211_F_RSNON)) { + /* + * NB: When RSN is enabled, we defer setting + * the link up until the port is valid. + */ + ieee80211_set_link_state(ic, LINK_STATE_UP); + } ic->ic_mgt_timer = 0; (*ifp->if_start)(ifp); break; diff --git a/sys/net80211/ieee80211_proto.h b/sys/net80211/ieee80211_proto.h index ba94c86c9e9..1322ec8a4fa 100644 --- a/sys/net80211/ieee80211_proto.h +++ b/sys/net80211/ieee80211_proto.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_proto.h,v 1.38 2009/01/28 18:55:18 damien Exp $ */ +/* $OpenBSD: ieee80211_proto.h,v 1.39 2009/11/21 18:09:31 damien Exp $ */ /* $NetBSD: ieee80211_proto.h,v 1.3 2003/10/13 04:23:56 dyoung Exp $ */ /*- @@ -63,6 +63,7 @@ extern void ieee80211_proto_detach(struct ifnet *); struct ieee80211_node; struct ieee80211_rxinfo; struct ieee80211_rsnparams; +extern void ieee80211_set_link_state(struct ieee80211com *, int); extern u_int ieee80211_get_hdrlen(const struct ieee80211_frame *); extern void ieee80211_input(struct ifnet *, struct mbuf *, struct ieee80211_node *, struct ieee80211_rxinfo *); |