mirror of https://github.com/ipxe/ipxe.git
[efi] Rename efi_blacklist to efi_veto
Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/171/head
parent
580d9b00da
commit
0e26220902
|
@ -1,13 +0,0 @@
|
||||||
#ifndef _IPXE_EFI_BLACKLIST_H
|
|
||||||
#define _IPXE_EFI_BLACKLIST_H
|
|
||||||
|
|
||||||
/** @file
|
|
||||||
*
|
|
||||||
* EFI driver blacklist
|
|
||||||
*/
|
|
||||||
|
|
||||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
|
||||||
|
|
||||||
extern void efi_unload_blacklist ( void );
|
|
||||||
|
|
||||||
#endif /* _IPXE_EFI_BLACKLIST_H */
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
#ifndef _IPXE_EFI_VETO_H
|
||||||
|
#define _IPXE_EFI_VETO_H
|
||||||
|
|
||||||
|
/** @file
|
||||||
|
*
|
||||||
|
* EFI driver vetoes
|
||||||
|
*/
|
||||||
|
|
||||||
|
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||||
|
|
||||||
|
extern void efi_veto_unload ( void );
|
||||||
|
|
||||||
|
#endif /* _IPXE_EFI_VETO_H */
|
|
@ -380,7 +380,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||||
#define ERRFILE_cert_cmd ( ERRFILE_OTHER | 0x004f0000 )
|
#define ERRFILE_cert_cmd ( ERRFILE_OTHER | 0x004f0000 )
|
||||||
#define ERRFILE_acpi_settings ( ERRFILE_OTHER | 0x00500000 )
|
#define ERRFILE_acpi_settings ( ERRFILE_OTHER | 0x00500000 )
|
||||||
#define ERRFILE_ntlm ( ERRFILE_OTHER | 0x00510000 )
|
#define ERRFILE_ntlm ( ERRFILE_OTHER | 0x00510000 )
|
||||||
#define ERRFILE_efi_blacklist ( ERRFILE_OTHER | 0x00520000 )
|
#define ERRFILE_efi_veto ( ERRFILE_OTHER | 0x00520000 )
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
|
|
@ -27,43 +27,43 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||||
#include <ipxe/efi/Protocol/DriverBinding.h>
|
#include <ipxe/efi/Protocol/DriverBinding.h>
|
||||||
#include <ipxe/efi/Protocol/LoadedImage.h>
|
#include <ipxe/efi/Protocol/LoadedImage.h>
|
||||||
#include <ipxe/efi/Protocol/ComponentName.h>
|
#include <ipxe/efi/Protocol/ComponentName.h>
|
||||||
#include <ipxe/efi/efi_blacklist.h>
|
#include <ipxe/efi/efi_veto.h>
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
*
|
*
|
||||||
* EFI driver blacklist
|
* EFI driver vetoes
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** A blacklisted driver */
|
/** A driver veto */
|
||||||
struct efi_blacklist {
|
struct efi_veto {
|
||||||
/** Name */
|
/** Veto name (for debugging) */
|
||||||
const char *name;
|
const char *name;
|
||||||
/**
|
/**
|
||||||
* Check if driver is blacklisted
|
* Check if driver is vetoed
|
||||||
*
|
*
|
||||||
* @v binding Driver binding protocol
|
* @v binding Driver binding protocol
|
||||||
* @v loaded Loaded image protocol
|
* @v loaded Loaded image protocol
|
||||||
* @v wtf Component name protocol, if present
|
* @v wtf Component name protocol, if present
|
||||||
* @ret blacklisted Driver is the blacklisted driver
|
* @ret vetoed Driver is to be vetoed
|
||||||
*/
|
*/
|
||||||
int ( * blacklist ) ( EFI_DRIVER_BINDING_PROTOCOL *binding,
|
int ( * veto ) ( EFI_DRIVER_BINDING_PROTOCOL *binding,
|
||||||
EFI_LOADED_IMAGE_PROTOCOL *loaded,
|
EFI_LOADED_IMAGE_PROTOCOL *loaded,
|
||||||
EFI_COMPONENT_NAME_PROTOCOL *wtf );
|
EFI_COMPONENT_NAME_PROTOCOL *wtf );
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Blacklist Dell Ip4ConfigDxe driver
|
* Veto Dell Ip4ConfigDxe driver
|
||||||
*
|
*
|
||||||
* @v binding Driver binding protocol
|
* @v binding Driver binding protocol
|
||||||
* @v loaded Loaded image protocol
|
* @v loaded Loaded image protocol
|
||||||
* @v wtf Component name protocol, if present
|
* @v wtf Component name protocol, if present
|
||||||
* @ret blacklisted Driver is the blacklisted driver
|
* @ret vetoed Driver is to be vetoed
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
efi_blacklist_dell_ip4config ( EFI_DRIVER_BINDING_PROTOCOL *binding __unused,
|
efi_veto_dell_ip4config ( EFI_DRIVER_BINDING_PROTOCOL *binding __unused,
|
||||||
EFI_LOADED_IMAGE_PROTOCOL *loaded __unused,
|
EFI_LOADED_IMAGE_PROTOCOL *loaded __unused,
|
||||||
EFI_COMPONENT_NAME_PROTOCOL *wtf ) {
|
EFI_COMPONENT_NAME_PROTOCOL *wtf ) {
|
||||||
static const CHAR16 ip4cfg[] = L"IP4 CONFIG Network Service Driver";
|
static const CHAR16 ip4cfg[] = L"IP4 CONFIG Network Service Driver";
|
||||||
static const char dell[] = "Dell Inc.";
|
static const char dell[] = "Dell Inc.";
|
||||||
char manufacturer[ sizeof ( dell ) ];
|
char manufacturer[ sizeof ( dell ) ];
|
||||||
|
@ -86,23 +86,22 @@ efi_blacklist_dell_ip4config ( EFI_DRIVER_BINDING_PROTOCOL *binding __unused,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Blacklisted drivers */
|
/** Driver vetoes */
|
||||||
static struct efi_blacklist efi_blacklists[] = {
|
static struct efi_veto efi_vetoes[] = {
|
||||||
{
|
{
|
||||||
.name = "Dell Ip4Config",
|
.name = "Dell Ip4Config",
|
||||||
.blacklist = efi_blacklist_dell_ip4config,
|
.veto = efi_veto_dell_ip4config,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find driver blacklisting, if any
|
* Find driver veto, if any
|
||||||
*
|
*
|
||||||
* @v driver Driver binding handle
|
* @v driver Driver binding handle
|
||||||
* @ret blacklist Driver blacklisting, or NULL
|
* @ret veto Driver veto, or NULL
|
||||||
* @ret rc Return status code
|
* @ret rc Return status code
|
||||||
*/
|
*/
|
||||||
static int efi_blacklist ( EFI_HANDLE driver,
|
static int efi_veto ( EFI_HANDLE driver, struct efi_veto **veto ) {
|
||||||
struct efi_blacklist **blacklist ) {
|
|
||||||
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
|
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
|
||||||
union {
|
union {
|
||||||
EFI_DRIVER_BINDING_PROTOCOL *binding;
|
EFI_DRIVER_BINDING_PROTOCOL *binding;
|
||||||
|
@ -121,11 +120,11 @@ static int efi_blacklist ( EFI_HANDLE driver,
|
||||||
EFI_STATUS efirc;
|
EFI_STATUS efirc;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
DBGC2 ( &efi_blacklists, "EFIBL checking %s\n",
|
DBGC2 ( &efi_vetoes, "EFIVETO checking %s\n",
|
||||||
efi_handle_name ( driver ) );
|
efi_handle_name ( driver ) );
|
||||||
|
|
||||||
/* Mark as not blacklisted */
|
/* Mark as not vetoed */
|
||||||
*blacklist = NULL;
|
*veto = NULL;
|
||||||
|
|
||||||
/* Open driver binding protocol */
|
/* Open driver binding protocol */
|
||||||
if ( ( efirc = bs->OpenProtocol (
|
if ( ( efirc = bs->OpenProtocol (
|
||||||
|
@ -133,7 +132,7 @@ static int efi_blacklist ( EFI_HANDLE driver,
|
||||||
&binding.interface, efi_image_handle, driver,
|
&binding.interface, efi_image_handle, driver,
|
||||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) != 0 ) {
|
EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) != 0 ) {
|
||||||
rc = -EEFI ( efirc );
|
rc = -EEFI ( efirc );
|
||||||
DBGC ( driver, "EFIBL %s could not open driver binding "
|
DBGC ( driver, "EFIVETO %s could not open driver binding "
|
||||||
"protocol: %s\n", efi_handle_name ( driver ),
|
"protocol: %s\n", efi_handle_name ( driver ),
|
||||||
strerror ( rc ) );
|
strerror ( rc ) );
|
||||||
goto err_binding;
|
goto err_binding;
|
||||||
|
@ -146,7 +145,7 @@ static int efi_blacklist ( EFI_HANDLE driver,
|
||||||
&loaded.interface, efi_image_handle, image,
|
&loaded.interface, efi_image_handle, image,
|
||||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) != 0 ) {
|
EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) != 0 ) {
|
||||||
rc = -EEFI ( efirc );
|
rc = -EEFI ( efirc );
|
||||||
DBGC ( driver, "EFIBL %s could not open",
|
DBGC ( driver, "EFIVETO %s could not open",
|
||||||
efi_handle_name ( driver ) );
|
efi_handle_name ( driver ) );
|
||||||
DBGC ( driver, " %s loaded image protocol: %s\n",
|
DBGC ( driver, " %s loaded image protocol: %s\n",
|
||||||
efi_handle_name ( image ), strerror ( rc ) );
|
efi_handle_name ( image ), strerror ( rc ) );
|
||||||
|
@ -162,12 +161,12 @@ static int efi_blacklist ( EFI_HANDLE driver,
|
||||||
wtf.interface = NULL;
|
wtf.interface = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check blacklistings */
|
/* Check vetoes */
|
||||||
for ( i = 0 ; i < ( sizeof ( efi_blacklists ) /
|
for ( i = 0 ; i < ( sizeof ( efi_vetoes ) /
|
||||||
sizeof ( efi_blacklists[0] ) ) ; i++ ) {
|
sizeof ( efi_vetoes[0] ) ) ; i++ ) {
|
||||||
if ( efi_blacklists[i].blacklist ( binding.binding,
|
if ( efi_vetoes[i].veto ( binding.binding, loaded.loaded,
|
||||||
loaded.loaded, wtf.wtf ) ) {
|
wtf.wtf ) ) {
|
||||||
*blacklist = &efi_blacklists[i];
|
*veto = &efi_vetoes[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -190,12 +189,12 @@ static int efi_blacklist ( EFI_HANDLE driver,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unload any blacklisted drivers
|
* Unload any vetoed drivers
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void efi_unload_blacklist ( void ) {
|
void efi_veto_unload ( void ) {
|
||||||
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
|
EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
|
||||||
struct efi_blacklist *blacklist;
|
struct efi_veto *veto;
|
||||||
EFI_HANDLE *drivers;
|
EFI_HANDLE *drivers;
|
||||||
EFI_HANDLE driver;
|
EFI_HANDLE driver;
|
||||||
UINTN num_drivers;
|
UINTN num_drivers;
|
||||||
|
@ -208,26 +207,26 @@ void efi_unload_blacklist ( void ) {
|
||||||
ByProtocol, &efi_driver_binding_protocol_guid,
|
ByProtocol, &efi_driver_binding_protocol_guid,
|
||||||
NULL, &num_drivers, &drivers ) ) != 0 ) {
|
NULL, &num_drivers, &drivers ) ) != 0 ) {
|
||||||
rc = -EEFI ( efirc );
|
rc = -EEFI ( efirc );
|
||||||
DBGC ( &efi_blacklists, "EFIBL could not list all drivers: "
|
DBGC ( &efi_vetoes, "EFIVETO could not list all drivers: "
|
||||||
"%s\n", strerror ( rc ) );
|
"%s\n", strerror ( rc ) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unload any blacklisted drivers */
|
/* Unload any vetoed drivers */
|
||||||
for ( i = 0 ; i < num_drivers ; i++ ) {
|
for ( i = 0 ; i < num_drivers ; i++ ) {
|
||||||
driver = drivers[i];
|
driver = drivers[i];
|
||||||
if ( ( rc = efi_blacklist ( driver, &blacklist ) ) != 0 ) {
|
if ( ( rc = efi_veto ( driver, &veto ) ) != 0 ) {
|
||||||
DBGC ( driver, "EFIBL could not determine "
|
DBGC ( driver, "EFIVETO could not determine "
|
||||||
"blacklisting for %s: %s\n",
|
"vetoing for %s: %s\n",
|
||||||
efi_handle_name ( driver ), strerror ( rc ) );
|
efi_handle_name ( driver ), strerror ( rc ) );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ( ! blacklist )
|
if ( ! veto )
|
||||||
continue;
|
continue;
|
||||||
DBGC ( driver, "EFIBL unloading %s (%s)\n",
|
DBGC ( driver, "EFIVETO unloading %s (%s)\n",
|
||||||
efi_handle_name ( driver ), blacklist->name );
|
efi_handle_name ( driver ), veto->name );
|
||||||
if ( ( efirc = bs->UnloadImage ( driver ) ) != 0 ) {
|
if ( ( efirc = bs->UnloadImage ( driver ) ) != 0 ) {
|
||||||
DBGC ( driver, "EFIBL could not unload %s: %s\n",
|
DBGC ( driver, "EFIVETO could not unload %s: %s\n",
|
||||||
efi_handle_name ( driver ), strerror ( rc ) );
|
efi_handle_name ( driver ), strerror ( rc ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -27,7 +27,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
||||||
#include <ipxe/efi/efi_snp.h>
|
#include <ipxe/efi/efi_snp.h>
|
||||||
#include <ipxe/efi/efi_autoboot.h>
|
#include <ipxe/efi/efi_autoboot.h>
|
||||||
#include <ipxe/efi/efi_watchdog.h>
|
#include <ipxe/efi/efi_watchdog.h>
|
||||||
#include <ipxe/efi/efi_blacklist.h>
|
#include <ipxe/efi/efi_veto.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EFI entry point
|
* EFI entry point
|
||||||
|
@ -79,8 +79,8 @@ EFI_STATUS EFIAPI _efi_start ( EFI_HANDLE image_handle,
|
||||||
*/
|
*/
|
||||||
static int efi_probe ( struct root_device *rootdev __unused ) {
|
static int efi_probe ( struct root_device *rootdev __unused ) {
|
||||||
|
|
||||||
/* Unloaded any blacklisted drivers */
|
/* Unloaded any vetoed drivers */
|
||||||
efi_unload_blacklist();
|
efi_veto_unload();
|
||||||
|
|
||||||
/* Connect our drivers */
|
/* Connect our drivers */
|
||||||
return efi_driver_connect_all();
|
return efi_driver_connect_all();
|
||||||
|
|
Loading…
Reference in New Issue