iwlwifi: enforce FreeBSD specific (expected) behaviour
authorBjoern A. Zeeb <bz@FreeBSD.org>
Sun, 25 Sep 2022 21:23:12 +0000 (21:23 +0000)
committerBjoern A. Zeeb <bz@FreeBSD.org>
Sun, 25 Sep 2022 21:41:06 +0000 (21:41 +0000)
commitf808c43ad9234670770601ba32a7426b00bbf528
treedb16740a73d76c70dca15f72b2470a9f8059464f
parentbe280f60dd8e8ef765a76966aac9c6ca7d6264d0
iwlwifi: enforce FreeBSD specific (expected) behaviour

iwlwifi can return early from probe (in FreeBSD attach) while a separate
thread is still grinding loading the firmware and setting things up.
For us this means that kldload succeeded but we may not have a physical
wireless interface (com) yet but the rc framework might already try to
configure a vap on one.

Wait until we get a firmware completion event from the other thread
(on success or error) and block returning.  That way we can ensure that
the "hw" (or com in net80211 terms) is there when we return from attach
matching the expected FreeBSD driver behaviour.

Reported by: J.R. Oldroyd (jr opal.com)
Reported by: probably inderectly showing as other problem
Tested by: J.R. Oldroyd (jr opal.com)
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
sys/contrib/dev/iwlwifi/iwl-drv.c