diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-07-28 21:24:53 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-07-28 21:24:53 +0000 |
commit | 230a75587a06168d5d360de70253d641410dee76 (patch) | |
tree | 0b722961edac74baeb19c97c9e73f3ee4d95098c /sys | |
parent | 8e9f06982f62b3c888466e7be07aef39397657df (diff) |
Suspending drivers need to do as little as possible in here, so when the
transition is to INIT, try to not generate management frames if we can
avoid it.
ok damien
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net80211/ieee80211_proto.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index c8f2857f57c..3c3ef608ab4 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_proto.c,v 1.42 2010/06/05 15:54:35 damien Exp $ */ +/* $OpenBSD: ieee80211_proto.c,v 1.43 2010/07/28 21:24:52 deraadt Exp $ */ /* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */ /*- @@ -781,10 +781,16 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, ieee80211_set_link_state(ic, LINK_STATE_DOWN); switch (nstate) { case IEEE80211_S_INIT: + /* + * If mgt = -1, driver is already partway down, so do + * not send management frames. + */ switch (ostate) { case IEEE80211_S_INIT: break; case IEEE80211_S_RUN: + if (mgt == -1) + goto justcleanup; switch (ic->ic_opmode) { case IEEE80211_M_STA: IEEE80211_SEND_MGMT(ic, ni, @@ -809,6 +815,8 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, } /* FALLTHROUGH */ case IEEE80211_S_ASSOC: + if (mgt == -1) + goto justcleanup; switch (ic->ic_opmode) { case IEEE80211_M_STA: IEEE80211_SEND_MGMT(ic, ni, @@ -832,6 +840,7 @@ ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, /* FALLTHROUGH */ case IEEE80211_S_AUTH: case IEEE80211_S_SCAN: +justcleanup: #ifndef IEEE80211_STA_ONLY if (ic->ic_opmode == IEEE80211_M_HOSTAP) timeout_del(&ic->ic_rsn_timeout); |