]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[efi] Inhibit calls to Shutdown() for wireless SNP devices
authorMichael Brown <mcb30@ipxe.org>
Wed, 16 Apr 2025 23:29:41 +0000 (00:29 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 17 Apr 2025 13:42:18 +0000 (14:42 +0100)
commit758a50486005b5e612c15d680fa1a8477473fdf2
treed3a2c97093f2ba8fca877f3bba49ec7b590600d7
parentb07cc851f0ad424e36c8f2c3a9673e634560b020
[efi] Inhibit calls to Shutdown() for wireless SNP devices

The UEFI model for wireless network configuration is somewhat
underdefined.  At the time of writing, the EDK2 "UEFI WiFi Connection
Manager" driver provides only one way to configure wireless network
credentials, which is to enter them interactively via an HII form.
Credentials are not stored (or exposed via any protocol interface),
and so any temporary disconnection from the wireless network will
inevitably leave the interface in an unusable state that cannot be
recovered without user intervention.

Experimentation shows that at least some wireless network drivers
(observed with an HP Elitebook 840 G10) will disconnect from the
wireless network when the SNP Shutdown() method is called, or if the
device is not polled sufficiently frequently to maintain its
association to the network.  We therefore inhibit calls to Shutdown()
and Stop() for any such SNP protocol interfaces, and mark our network
device as insomniac so that it will be polled even when closed.

Note that we need to inhibit not only our own calls to Shutdown() and
Stop(), but also those that will be attempted by MnpDxe when we
disconnect it from the SNP handle.  We do this by patching the
installed SNP protocol interface structure to modify the Shutdown()
and Stop() method pointers, which is ugly but unavoidable.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/net/efi/snpnet.c