summaryrefslogtreecommitdiffstats
path: root/src/interface/efi/efi_driver.c
diff options
context:
space:
mode:
authorMichael Brown2020-03-14 10:49:49 +0100
committerMichael Brown2020-03-14 10:49:49 +0100
commitbdf0e029ae8c9a0e173d5988ee64ff910538af53 (patch)
tree14118bc7e97f98dac743bd1518e981b8e9fe4273 /src/interface/efi/efi_driver.c
parent[int13con] Create log partition only when CONSOLE_INT13 is enabled (diff)
downloadipxe-bdf0e029ae8c9a0e173d5988ee64ff910538af53.tar.gz
ipxe-bdf0e029ae8c9a0e173d5988ee64ff910538af53.tar.xz
ipxe-bdf0e029ae8c9a0e173d5988ee64ff910538af53.zip
[efi] Disambiguate errors returned by ConnectController
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/efi/efi_driver.c')
-rw-r--r--src/interface/efi/efi_driver.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/interface/efi/efi_driver.c b/src/interface/efi/efi_driver.c
index 7be2e585..f6038e56 100644
--- a/src/interface/efi/efi_driver.c
+++ b/src/interface/efi/efi_driver.c
@@ -39,6 +39,20 @@ FILE_LICENCE ( GPL2_OR_LATER );
*
*/
+/* Disambiguate the various error causes */
+#define EINFO_EEFI_CONNECT \
+ __einfo_uniqify ( EINFO_EPLATFORM, 0x01, \
+ "Could not connect controllers" )
+#define EINFO_EEFI_CONNECT_PROHIBITED \
+ __einfo_platformify ( EINFO_EEFI_CONNECT, \
+ EFI_SECURITY_VIOLATION, \
+ "Connecting controllers prohibited by " \
+ "security policy" )
+#define EEFI_CONNECT_PROHIBITED \
+ __einfo_error ( EINFO_EEFI_CONNECT_PROHIBITED )
+#define EEFI_CONNECT( efirc ) EPLATFORM ( EINFO_EEFI_CONNECT, efirc, \
+ EEFI_CONNECT_PROHIBITED )
+
static EFI_DRIVER_BINDING_PROTOCOL efi_driver_binding;
/** List of controlled EFI devices */
@@ -457,7 +471,7 @@ static int efi_driver_connect ( EFI_HANDLE device ) {
efi_handle_name ( device ) );
if ( ( efirc = bs->ConnectController ( device, drivers, NULL,
FALSE ) ) != 0 ) {
- rc = -EEFI ( efirc );
+ rc = -EEFI_CONNECT ( efirc );
DBGC ( device, "EFIDRV %s could not connect new drivers: "
"%s\n", efi_handle_name ( device ), strerror ( rc ) );
return rc;