iPXE
Functions
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. More...
 

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  )

Remove any vetoed drivers.

Definition at line 615 of file efi_veto.c.

615  {
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 ];
644  if ( ( rc = efi_veto_find ( driver, manufacturer,
645  &veto ) ) != 0 ) {
646  DBGC ( driver, "EFIVETO %s could not determine "
647  "vetoing: %s\n",
648  efi_handle_name ( driver ), strerror ( rc ) );
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",
655  efi_handle_name ( driver ), strerror ( rc ) );
656  }
657  }
658 
659  /* Free manufacturer name */
660  free ( manufacturer );
661 
662  /* Free handle list */
663  bs->FreePool ( drivers );
664 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2099
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition: efi.h:175
static int efi_veto_driver(struct efi_veto *veto)
Veto an EFI driver.
Definition: efi_veto.c:366
#define DBGC(...)
Definition: compiler.h:505
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
EFI_HANDLE driver
Driver binding handle.
Definition: efi_veto.c:63
static struct efi_veto_candidate efi_vetoes[]
Driver vetoes.
Definition: efi_veto.c:504
static unsigned int count
Number of entries.
Definition: dwmac.h:225
int fetch_string_setting_copy(struct settings *settings, const struct setting *setting, char **data)
Fetch value of string setting.
Definition: settings.c:874
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:79
static void(* free)(struct refcnt *refcnt))
Definition: refcnt.h:55
EFI Boot Services Table.
Definition: UefiSpec.h:1931
UINT64 UINTN
Unsigned value of native width.
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1950
uint8_t manufacturer
Manufacturer string.
Definition: smbios.h:15
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:32
Retrieve the set of handles from the handle database that support a specified protocol.
Definition: UefiSpec.h:1531
EFI_SYSTEM_TABLE * efi_systab
EFI_GUID efi_driver_binding_protocol_guid
Driver binding protocol GUID.
Definition: efi_guid.c:209
#define NULL
NULL pointer (VOID *)
Definition: Base.h:322
A driver veto.
Definition: efi_veto.c:61
Definition: efi.h:62
EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer
Definition: UefiSpec.h:2008

References EFI_SYSTEM_TABLE::BootServices, ByProtocol, count, DBGC, efi_veto::driver, EEFI, efi_driver_binding_protocol_guid, 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().