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 615 of file efi_veto.c.

615 {
616 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
617 struct efi_veto veto;
618 EFI_HANDLE *drivers;
620 UINTN count;
621 unsigned int i;
622 char *manufacturer;
623 EFI_STATUS efirc;
624 int rc;
625
626 /* Locate all driver binding protocol handles */
627 if ( ( efirc = bs->LocateHandleBuffer (
629 NULL, &count, &drivers ) ) != 0 ) {
630 rc = -EEFI ( efirc );
631 DBGC ( &efi_vetoes, "EFIVETO could not list all drivers: "
632 "%s\n", strerror ( rc ) );
633 return;
634 }
635
636 /* Get manufacturer name */
637 fetch_string_setting_copy ( NULL, &manufacturer_setting,
638 &manufacturer );
639 DBGC ( &efi_vetoes, "EFIVETO manufacturer is \"%s\"\n", manufacturer );
640
641 /* Unload any vetoed drivers */
642 for ( i = 0 ; i < count ; i++ ) {
643 driver = drivers[ count - i - 1 ];
645 &veto ) ) != 0 ) {
646 DBGC ( driver, "EFIVETO %s could not determine "
647 "vetoing: %s\n",
649 continue;
650 }
651 if ( ! veto.driver )
652 continue;
653 if ( ( rc = efi_veto_driver ( &veto ) ) != 0 ) {
654 DBGC ( driver, "EFIVETO %s could not veto: %s\n",
656 }
657 }
658
659 /* Free manufacturer name */
660 free ( manufacturer );
661
662 /* Free handle list */
663 bs->FreePool ( drivers );
664}
UINT64 UINTN
Unsigned value of native width.
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
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:1531
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:209
static int efi_veto_driver(struct efi_veto *veto)
Veto an EFI driver.
Definition efi_veto.c:366
static struct efi_veto_candidate efi_vetoes[]
Driver vetoes.
Definition efi_veto.c:504
static int efi_veto_find(EFI_HANDLE driver, const char *manufacturer, struct efi_veto *veto)
Find driver veto, if any.
Definition efi_veto.c:531
#define DBGC(...)
Definition compiler.h:505
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:175
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:1931
EFI_FREE_POOL FreePool
Definition UefiSpec.h:1950
EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer
Definition UefiSpec.h:2008
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().