diff options
author | Peter Hessler <phessler@cvs.openbsd.org> | 2018-04-28 16:05:57 +0000 |
---|---|---|
committer | Peter Hessler <phessler@cvs.openbsd.org> | 2018-04-28 16:05:57 +0000 |
commit | c1f63c345461e172247990bd02d224460b85a382 (patch) | |
tree | 426803cfe96680445e19eaabd818ab3bd437bed3 /sys/dev/ic | |
parent | ce3d6b0eda89394776fc9bbc4cfabd6aaf385e62 (diff) |
Some drivers handle settting a new wifi link state manually, so make sure
they flush old nodes and set the interface link state to down, like the
framework does.
OK stsp@ pirofti@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/bwfm.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/pgt.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/ic/bwfm.c b/sys/dev/ic/bwfm.c index b7dabd17743..98976945c5d 100644 --- a/sys/dev/ic/bwfm.c +++ b/sys/dev/ic/bwfm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bwfm.c,v 1.42 2018/04/26 12:50:07 pirofti Exp $ */ +/* $OpenBSD: bwfm.c,v 1.43 2018/04/28 16:05:56 phessler Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2016,2017 Patrick Wildt <patrick@blueri.se> @@ -2294,6 +2294,8 @@ bwfm_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) printf("%s: %s -> %s\n", DEVNAME(sc), ieee80211_state_name[ic->ic_state], ieee80211_state_name[nstate]); + ieee80211_set_link_state(ic, LINK_STATE_DOWN); + ieee80211_free_allnodes(ic, 1); ic->ic_state = nstate; splx(s); return 0; diff --git a/sys/dev/ic/pgt.c b/sys/dev/ic/pgt.c index 0fbe8f8f129..0eb9dc07a0a 100644 --- a/sys/dev/ic/pgt.c +++ b/sys/dev/ic/pgt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pgt.c,v 1.92 2018/04/28 14:49:07 stsp Exp $ */ +/* $OpenBSD: pgt.c,v 1.93 2018/04/28 16:05:56 phessler Exp $ */ /* * Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org> @@ -2937,6 +2937,7 @@ pgt_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) ic->ic_mgt_timer = 0; ic->ic_flags &= ~IEEE80211_F_SIBSS; ieee80211_free_allnodes(ic, 1); + ieee80211_set_link_state(ic, LINK_STATE_DOWN); break; case IEEE80211_S_SCAN: ic->ic_if.if_timer = 1; @@ -2946,6 +2947,7 @@ pgt_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) else ieee80211_free_allnodes(ic, 1); + ieee80211_set_link_state(ic, LINK_STATE_DOWN); #ifndef IEEE80211_STA_ONLY /* Just use any old channel; we override it anyway. */ if (ic->ic_opmode == IEEE80211_M_HOSTAP) |