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/pci | |
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/pci')
-rw-r--r-- | sys/dev/pci/if_iwm.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_iwn.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_wpi.c | 4 |
3 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index 150cb4dcef6..0d56e5d498d 100644 --- a/sys/dev/pci/if_iwm.c +++ b/sys/dev/pci/if_iwm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwm.c,v 1.227 2018/04/26 12:50:07 pirofti Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.228 2018/04/28 16:05:56 phessler Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh <info@genua.de> @@ -5501,6 +5501,10 @@ iwm_scan(struct iwm_softc *sc) printf("%s: %s -> %s\n", ifp->if_xname, ieee80211_state_name[ic->ic_state], ieee80211_state_name[IEEE80211_S_SCAN]); + if ((sc->sc_flags & IWM_FLAG_BGSCAN) == 0) { + ieee80211_set_link_state(ic, LINK_STATE_DOWN); + ieee80211_free_allnodes(ic, 1); + } ic->ic_state = IEEE80211_S_SCAN; iwm_led_blink_start(sc); wakeup(&ic->ic_state); /* wake iwm_init() */ diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index fb9ac9434b8..6ffe491771c 100644 --- a/sys/dev/pci/if_iwn.c +++ b/sys/dev/pci/if_iwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwn.c,v 1.202 2018/04/26 12:50:07 pirofti Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.203 2018/04/28 16:05:56 phessler Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -1808,6 +1808,10 @@ iwn_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) printf("%s: %s -> %s\n", ifp->if_xname, ieee80211_state_name[ic->ic_state], ieee80211_state_name[nstate]); + if ((sc->sc_flags & IWN_FLAG_BGSCAN) == 0) { + ieee80211_set_link_state(ic, LINK_STATE_DOWN); + ieee80211_free_allnodes(ic, 1); + } ic->ic_state = nstate; return 0; diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index e6b6330d717..c959a156526 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wpi.c,v 1.143 2018/04/26 12:50:07 pirofti Exp $ */ +/* $OpenBSD: if_wpi.c,v 1.144 2018/04/28 16:05:56 phessler Exp $ */ /*- * Copyright (c) 2006-2008 @@ -1057,6 +1057,8 @@ wpi_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) printf("%s: %s -> %s\n", ifp->if_xname, 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; return 0; |