summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2017-07-16 21:35:21 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2017-07-16 21:35:21 +0000
commitc6399f26a2ec18b7c073de37e5f6f65683c4a72b (patch)
treeb93bc7734a9db26213029ca237bace8e62685020 /sys
parentbbe6ff4286a5faedef2c712e78f28bb1baee81f6 (diff)
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_iwm.c17
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) {