Make sure iwn(4) firmware and driver stay in sync when a scan is
authorstsp <stsp@openbsd.org>
Thu, 1 Feb 2018 11:21:34 +0000 (11:21 +0000)
committerstsp <stsp@openbsd.org>
Thu, 1 Feb 2018 11:21:34 +0000 (11:21 +0000)
commitcc051f8bae2ed1edc4321321fedbfe7f34ad396e
tree53a5b5642f6393e0800f8b66d74783e23cf1efe4
parent5efa8d23cee8c96ff4ee9b1e4219568e485251f6
Make sure iwn(4) firmware and driver stay in sync when a scan is
requested by ifconfig while associated. For completeness, do the same
for RUN->{ASSOC,AUTH} and AUTH->ASSOC transitions. i.e. always keep
the firmware's association state in sync with the driver's state.
The firmware should only be associated in RUN state.

Fixes a problem where the driver remained in SCAN state forever after
running 'ifconfig iwn0 scan' in associated (i.e. RUN) state, presumably
because the firmware didn't like the driver's scan command and never
signaled completion of the scan.

ok kevlo@ phessler@
sys/dev/pci/if_iwn.c