Skip to content
Permalink
Browse files

[efi] Disambiguate errors returned by ConnectController

Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Mar 14, 2020
1 parent efc1ae5 commit bdf0e029ae8c9a0e173d5988ee64ff910538af53
Showing with 15 additions and 1 deletion.
  1. +15 −1 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;

0 comments on commit bdf0e02

Please sign in to comment.
You can’t perform that action at this time.