summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hessler <phessler@cvs.openbsd.org>2018-04-28 16:05:57 +0000
committerPeter Hessler <phessler@cvs.openbsd.org>2018-04-28 16:05:57 +0000
commitc1f63c345461e172247990bd02d224460b85a382 (patch)
tree426803cfe96680445e19eaabd818ab3bd437bed3
parentce3d6b0eda89394776fc9bbc4cfabd6aaf385e62 (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@
-rw-r--r--sys/dev/ic/bwfm.c4
-rw-r--r--sys/dev/ic/pgt.c4
-rw-r--r--sys/dev/pci/if_iwm.c6
-rw-r--r--sys/dev/pci/if_iwn.c6
-rw-r--r--sys/dev/pci/if_wpi.c4
-rw-r--r--sys/dev/usb/if_atu.c3
6 files changed, 21 insertions, 6 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)
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;
diff --git a/sys/dev/usb/if_atu.c b/sys/dev/usb/if_atu.c
index ae65dd61891..a2476c29743 100644
--- a/sys/dev/usb/if_atu.c
+++ b/sys/dev/usb/if_atu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atu.c,v 1.125 2018/04/28 14:49:07 stsp Exp $ */
+/* $OpenBSD: if_atu.c,v 1.126 2018/04/28 16:05:56 phessler Exp $ */
/*
* Copyright (c) 2003, 2004
* Daan Vreeken <Danovitsch@Vitsch.net>. All rights reserved.
@@ -1221,6 +1221,7 @@ atu_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);
ic->ic_state = nstate;
return (0);