iPXE
efi_veto.h File Reference

EFI driver vetoes. More...

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 FILE_SECBOOT (PERMITTED)
void efi_veto (void)
 Remove any vetoed drivers.

Detailed Description

EFI driver vetoes.

Definition in file efi_veto.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ efi_veto()

void efi_veto ( void )
extern

Remove any vetoed drivers.

Definition at line 591 of file efi_veto.c.

591 {
592 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
593 struct efi_veto veto;
594 EFI_HANDLE *drivers;
596 UINTN count;
597 unsigned int i;
598 char *manufacturer;
599 EFI_STATUS efirc;
600 int rc;
601
602 /* Locate all driver binding protocol handles */
603 if ( ( efirc = bs->LocateHandleBuffer (
605 NULL, &count, &drivers ) ) != 0 ) {
606 rc = -EEFI ( efirc );
607 DBGC ( &efi_vetoes, "EFIVETO could not list all drivers: "
608 "%s\n", strerror ( rc ) );
609 return;
610 }
611
612 /* Get manufacturer name */
613 fetch_string_setting_copy ( NULL, &manufacturer_setting,
614 &manufacturer );
615 DBGC ( &efi_vetoes, "EFIVETO manufacturer is \"%s\"\n", manufacturer );
616
617 /* Unload any vetoed drivers */
618 for ( i = 0 ; i < count ; i++ ) {
619 driver = drivers[ count - i - 1 ];
621 &veto ) ) != 0 ) {
622 DBGC ( driver, "EFIVETO %s could not determine "
623 "vetoing: %s\n",
625 continue;
626 }
627 if ( ! veto.driver )
628 continue;
629 if ( ( rc = efi_veto_driver ( &veto ) ) != 0 ) {
630 DBGC ( driver, "EFIVETO %s could not veto: %s\n",
632 }
633 }
634
635 /* Free manufacturer name */
636 free ( manufacturer );
637
638 /* Free handle list */
639 bs->FreePool ( drivers );
640}
UINT64 UINTN
Unsigned value of native width.
#define NULL
NULL pointer (VOID *).
Definition Base.h:321
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
@ ByProtocol
Retrieve the set of handles from the handle database that support a specified protocol.
Definition UefiSpec.h:1530
struct arbelprm_rc_send_wqe rc
Definition arbel.h:3
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition efi_debug.c:652
EFI_GUID efi_driver_binding_protocol_guid
Driver binding protocol GUID.
Definition efi_guid.c:210
static int efi_veto_driver(struct efi_veto *veto)
Veto an EFI driver.
Definition efi_veto.c:370
static struct efi_veto_candidate efi_vetoes[]
Driver vetoes.
Definition efi_veto.c:484
static int efi_veto_find(EFI_HANDLE driver, const char *manufacturer, struct efi_veto *veto)
Find driver veto, if any.
Definition efi_veto.c:507
#define DBGC(...)
Definition compiler.h:530
static unsigned int count
Number of entries.
Definition dwmac.h:220
#define EFI_HANDLE
Definition efi.h:53
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition efi.h:181
EFI_SYSTEM_TABLE * efi_systab
uint8_t manufacturer
Manufacturer string.
Definition smbios.h:3
static void(* free)(struct refcnt *refcnt))
Definition refcnt.h:55
int fetch_string_setting_copy(struct settings *settings, const struct setting *setting, char **data)
Fetch value of string setting.
Definition settings.c:874
char * strerror(int errno)
Retrieve string representation of error number.
Definition strerror.c:79
EFI Boot Services Table.
Definition UefiSpec.h:1930
EFI_FREE_POOL FreePool
Definition UefiSpec.h:1949
EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer
Definition UefiSpec.h:2007
A driver veto.
Definition efi_veto.c:61
EFI_HANDLE driver
Driver binding handle.
Definition efi_veto.c:63

References ByProtocol, count, DBGC, efi_veto::driver, EEFI, efi_driver_binding_protocol_guid, EFI_HANDLE, efi_handle_name(), efi_systab, efi_veto_driver(), efi_veto_find(), efi_vetoes, fetch_string_setting_copy(), free, EFI_BOOT_SERVICES::FreePool, EFI_BOOT_SERVICES::LocateHandleBuffer, manufacturer, NULL, rc, and strerror().

Referenced by efi_probe().