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

660  {
662  struct efi_veto veto;
663  EFI_HANDLE *drivers;
665  UINTN count;
666  unsigned int i;
667  char *manufacturer;
668  EFI_STATUS efirc;
669  int rc;
670 
671  /* Locate all driver binding protocol handles */
672  if ( ( efirc = bs->LocateHandleBuffer (
674  NULL, &count, &drivers ) ) != 0 ) {
675  rc = -EEFI ( efirc );
676  DBGC ( &efi_vetoes, "EFIVETO could not list all drivers: "
677  "%s\n", strerror ( rc ) );
678  return;
679  }
680 
681  /* Get manufacturer name */
682  fetch_string_setting_copy ( NULL, &manufacturer_setting,
683  &manufacturer );
684  DBGC ( &efi_vetoes, "EFIVETO manufacturer is \"%s\"\n", manufacturer );
685 
686  /* Unload any vetoed drivers */
687  for ( i = 0 ; i < count ; i++ ) {
688  driver = drivers[ count - i - 1 ];
689  if ( ( rc = efi_veto_find ( driver, manufacturer,
690  &veto ) ) != 0 ) {
691  DBGC ( driver, "EFIVETO %s could not determine "
692  "vetoing: %s\n",
693  efi_handle_name ( driver ), strerror ( rc ) );
694  continue;
695  }
696  if ( ! veto.driver )
697  continue;
698  if ( ( rc = efi_veto_driver ( &veto ) ) != 0 ) {
699  DBGC ( driver, "EFIVETO %s could not veto: %s\n",
700  efi_handle_name ( driver ), strerror ( rc ) );
701  }
702  }
703 
704  /* Free manufacturer name */
705  free ( manufacturer );
706 
707  /* Free handle list */
708  bs->FreePool ( drivers );
709 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2081
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:171
static int efi_veto_driver(struct efi_veto *veto)
Veto an EFI driver.
Definition: efi_veto.c:378
#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:551
EFI_HANDLE driver
Driver binding handle.
Definition: efi_veto.c:63
static struct efi_veto_candidate efi_vetoes[]
Driver vetoes.
Definition: efi_veto.c:524
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:808
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:1917
UINT64 UINTN
Unsigned value of native width.
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1936
uint8_t manufacturer
Manufacturer string.
Definition: smbios.h:14
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
uint16_t count
Number of entries.
Definition: ena.h:22
Retrieve the set of handles from the handle database that support a specified protocol.
Definition: UefiSpec.h:1520
EFI_SYSTEM_TABLE * efi_systab
EFI_GUID efi_driver_binding_protocol_guid
Driver binding protocol GUID.
Definition: efi_guid.c:183
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
A driver veto.
Definition: efi_veto.c:61
Definition: efi.h:59
EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer
Definition: UefiSpec.h:1994

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