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)
 
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  )

◆ efi_veto()

void efi_veto ( void  )

Remove any vetoed drivers.

Definition at line 561 of file efi_veto.c.

561  {
563  struct efi_veto *veto;
564  EFI_HANDLE *drivers;
565  EFI_HANDLE driver;
566  UINTN num_drivers;
567  unsigned int i;
568  char *manufacturer;
569  EFI_STATUS efirc;
570  int rc;
571 
572  /* Locate all driver binding protocol handles */
573  if ( ( efirc = bs->LocateHandleBuffer (
575  NULL, &num_drivers, &drivers ) ) != 0 ) {
576  rc = -EEFI ( efirc );
577  DBGC ( &efi_vetoes, "EFIVETO could not list all drivers: "
578  "%s\n", strerror ( rc ) );
579  return;
580  }
581 
582  /* Get manufacturer name */
583  fetch_string_setting_copy ( NULL, &manufacturer_setting,
584  &manufacturer );
585 
586  /* Unload any vetoed drivers */
587  for ( i = 0 ; i < num_drivers ; i++ ) {
588  driver = drivers[i];
589  if ( ( rc = efi_veto_find ( driver, manufacturer,
590  &veto ) ) != 0 ) {
591  DBGC ( driver, "EFIVETO %s could not determine "
592  "vetoing: %s\n",
593  efi_handle_name ( driver ), strerror ( rc ) );
594  continue;
595  }
596  if ( ! veto )
597  continue;
598  DBGC ( driver, "EFIVETO %s is vetoed (%s)\n",
599  efi_handle_name ( driver ), veto->name );
600  if ( ( rc = efi_veto_driver ( driver ) ) != 0 ) {
601  DBGC ( driver, "EFIVETO %s could not veto: %s\n",
602  efi_handle_name ( driver ), strerror ( rc ) );
603  }
604  }
605 
606  /* Free manufacturer name */
607  free ( manufacturer );
608 
609  /* Free handle list */
610  bs->FreePool ( drivers );
611 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2000
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:162
static struct efi_veto efi_vetoes[]
Driver vetoes.
Definition: efi_veto.c:439
#define DBGC(...)
Definition: compiler.h:505
int fetch_string_setting_copy(struct settings *settings, const struct setting *setting, char **data)
Fetch value of string setting.
Definition: settings.c:877
int(* veto)(EFI_DRIVER_BINDING_PROTOCOL *binding, EFI_LOADED_IMAGE_PROTOCOL *loaded, EFI_COMPONENT_NAME_PROTOCOL *wtf, const char *manufacturer, const CHAR16 *name)
Check if driver is vetoed.
Definition: efi_veto.c:54
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:722
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
static int efi_veto_find(EFI_HANDLE driver, const char *manufacturer, struct efi_veto **veto)
Find driver veto, if any.
Definition: efi_veto.c:458
static void(* free)(struct refcnt *refcnt))
Definition: refcnt.h:54
EFI Boot Services Table.
Definition: UefiSpec.h:1836
UINT64 UINTN
Unsigned value of native width.
Definition: ProcessorBind.h:71
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1855
uint8_t manufacturer
Manufacturer string.
Definition: smbios.h:14
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:35
Retrieve the set of handles from the handle database that support a specified protocol.
Definition: UefiSpec.h:1448
EFI_SYSTEM_TABLE * efi_systab
static int efi_veto_driver(EFI_HANDLE driver)
Veto an EFI driver.
Definition: efi_veto.c:350
EFI_GUID efi_driver_binding_protocol_guid
Driver binding protocol GUID.
Definition: efi_guid.c:148
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
A driver veto.
Definition: efi_veto.c:41
Definition: efi.h:50
EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer
Definition: UefiSpec.h:1913

References EFI_SYSTEM_TABLE::BootServices, ByProtocol, DBGC, 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, strerror(), and efi_veto::veto.

Referenced by efi_probe().