Make the iwx(4) mac context task send its command only if we are still in
authorstsp <stsp@openbsd.org>
Wed, 30 Jun 2021 09:47:20 +0000 (09:47 +0000)
committerstsp <stsp@openbsd.org>
Wed, 30 Jun 2021 09:47:20 +0000 (09:47 +0000)
commit5134a99ff3a5cff1ebc003e0510a8c8f7e2fc791
treeeefa30ed5d3daad5a3274700b76b1d5ac2981e8b
parent9b075b3f4b0d0fe1f04574592e3b2439629c3040
Make the iwx(4) mac context task send its command only if we are still in
RUN state when the task gets to run. Fixes fatal firmware errors where
mac context updates were erroneously sent in states other than RUN state.

Additionally, avoid scheduling a mac context task if a pending newstate
task is going to move us out of RUN state anyway.

Issue debugged by zxystd in OpenIntelWireless itlwm; patch by me.
sys/dev/pci/if_iwx.c