diff options
author | 2017-07-16 21:35:20 +0000 | |
---|---|---|
committer | 2017-07-16 21:35:20 +0000 | |
commit | 708fbc090293538ee1b948f059b14ac3e3a2f3e7 (patch) | |
tree | d8e12788cf45737f1f6e5283ecbd20b2372e2905 | |
parent | Match /clocks node on Allwinner H5. (diff) | |
download | wireguard-openbsd-708fbc090293538ee1b948f059b14ac3e3a2f3e7.tar.xz wireguard-openbsd-708fbc090293538ee1b948f059b14ac3e3a2f3e7.zip |
Some net80211 state changes are triggered by incoming frames, and it is
possible for such frames to move iwm(4) to the same state, e.g. AUTH->AUTH.
Do not bother the firmware with such no-op state changes because that runs
a high risk of hitting firmware errors.
Problem reported by Gregor Best.
-rw-r--r-- | sys/dev/pci/if_iwm.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index dbf3708e012..49494a71405 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.199 2017/07/15 15:48:08 stsp Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.200 2017/07/16 21:35:20 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh <info@genua.de> @@ -5841,17 +5841,18 @@ iwm_newstate_task(void *psc) ieee80211_state_name[ostate], ieee80211_state_name[nstate])); - if (ostate == IEEE80211_S_SCAN && nstate != ostate) + if (nstate == ostate) + return; + + if (ostate == IEEE80211_S_SCAN) iwm_led_blink_stop(sc); - if (nstate <= ostate) { + if (nstate < ostate) { switch (ostate) { case IEEE80211_S_RUN: - if (nstate <= IEEE80211_S_RUN) { - err = iwm_run_stop(sc); - if (err) - goto out; - } + err = iwm_run_stop(sc); + if (err) + goto out; /* FALLTHROUGH */ case IEEE80211_S_ASSOC: if (nstate <= IEEE80211_S_ASSOC) { |