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

614  {
616  struct efi_veto veto;
617  EFI_HANDLE *drivers;
619  UINTN count;
620  unsigned int i;
621  char *manufacturer;
622  EFI_STATUS efirc;
623  int rc;
624 
625  /* Locate all driver binding protocol handles */
626  if ( ( efirc = bs->LocateHandleBuffer (
628  NULL, &count, &drivers ) ) != 0 ) {
629  rc = -EEFI ( efirc );
630  DBGC ( &efi_vetoes, "EFIVETO could not list all drivers: "
631  "%s\n", strerror ( rc ) );
632  return;
633  }
634 
635  /* Get manufacturer name */
636  fetch_string_setting_copy ( NULL, &manufacturer_setting,
637  &manufacturer );
638  DBGC ( &efi_vetoes, "EFIVETO manufacturer is \"%s\"\n", manufacturer );
639 
640  /* Unload any vetoed drivers */
641  for ( i = 0 ; i < count ; i++ ) {
642  driver = drivers[ count - i - 1 ];
643  if ( ( rc = efi_veto_find ( driver, manufacturer,
644  &veto ) ) != 0 ) {
645  DBGC ( driver, "EFIVETO %s could not determine "
646  "vetoing: %s\n",
647  efi_handle_name ( driver ), strerror ( rc ) );
648  continue;
649  }
650  if ( ! veto.driver )
651  continue;
652  if ( ( rc = efi_veto_driver ( &veto ) ) != 0 ) {
653  DBGC ( driver, "EFIVETO %s could not veto: %s\n",
654  efi_handle_name ( driver ), strerror ( rc ) );
655  }
656  }
657 
658  /* Free manufacturer name */
659  free ( manufacturer );
660 
661  /* Free handle list */
662  bs->FreePool ( drivers );
663 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
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:174
static int efi_veto_driver(struct efi_veto *veto)
Veto an EFI driver.
Definition: efi_veto.c:365
#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:530
EFI_HANDLE driver
Driver binding handle.
Definition: efi_veto.c:62
static struct efi_veto_candidate efi_vetoes[]
Driver vetoes.
Definition: efi_veto.c:503
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:873
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:78
static void(* free)(struct refcnt *refcnt))
Definition: refcnt.h:54
EFI Boot Services Table.
Definition: UefiSpec.h:1930
UINT64 UINTN
Unsigned value of native width.
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1949
uint8_t manufacturer
Manufacturer string.
Definition: smbios.h:14
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
Retrieve the set of handles from the handle database that support a specified protocol.
Definition: UefiSpec.h:1530
EFI_SYSTEM_TABLE * efi_systab
EFI_GUID efi_driver_binding_protocol_guid
Driver binding protocol GUID.
Definition: efi_guid.c:208
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
A driver veto.
Definition: efi_veto.c:60
Definition: efi.h:61
EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer
Definition: UefiSpec.h:2007

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