iPXE
efi_veto.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 Michael Brown <mbrown@fensystems.co.uk>.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301, USA.
18 */
19
20FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
21FILE_SECBOOT ( PERMITTED );
22
23#include <stddef.h>
24#include <stdlib.h>
25#include <string.h>
26#include <errno.h>
27#include <ipxe/settings.h>
28#include <ipxe/pci.h>
29#include <ipxe/efi/efi.h>
34#include <ipxe/efi/efi_veto.h>
35
36/** @file
37 *
38 * EFI driver vetoes
39 *
40 */
41
42/** A driver veto candidate */
44 /** Veto name (for debugging) */
45 const char *name;
46 /**
47 * Check if driver is vetoed
48 *
49 * @v binding Driver binding protocol
50 * @v loaded Loaded image protocol
51 * @v manufacturer Manufacturer name, if present
52 * @v name Driver name, if present
53 * @ret vetoed Driver is to be vetoed
54 */
55 int ( * veto ) ( EFI_DRIVER_BINDING_PROTOCOL *binding,
57 const char *manufacturer, const CHAR16 *name );
58};
59
60/** A driver veto */
61struct efi_veto {
62 /** Driver binding handle */
64 /** Driving binding protocol */
66 /** Image handle */
68 /** Loaded image protocol */
70};
71
72/**
73 * Unload an EFI driver
74 *
75 * @v veto Driver veto
76 * @ret rc Return status code
77 */
78static int efi_veto_unload ( struct efi_veto *veto ) {
79 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
80 EFI_HANDLE driver = veto->driver;
81 EFI_HANDLE image = veto->image;
82 struct efi_dropped_tpl tpl;
83 EFI_STATUS efirc;
84 int rc;
85
86 /* Unload the driver at external TPL */
87 efi_drop_tpl ( &tpl );
88 efirc = bs->UnloadImage ( image );
89 efi_undrop_tpl ( &tpl );
90 if ( efirc != 0 ) {
91 rc = -EEFI ( efirc );
92 DBGC ( driver, "EFIVETO %s could not unload",
93 efi_handle_name ( driver ) );
94 DBGC ( driver, " %s: %s\n", efi_handle_name ( image ),
95 strerror ( rc ) );
96 return rc;
97 }
98
99 return 0;
100}
101
102/**
103 * Disconnect an EFI driver from all handles
104 *
105 * @v veto Driver veto
106 * @ret rc Return status code
107 */
108static int efi_veto_disconnect ( struct efi_veto *veto ) {
109 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
110 EFI_HANDLE driver = veto->driver;
111 EFI_HANDLE *handles;
113 UINTN count;
114 unsigned int i;
115 EFI_STATUS efirc;
116 int rc;
117
118 /* Enumerate all handles */
119 if ( ( efirc = bs->LocateHandleBuffer ( AllHandles, NULL, NULL,
120 &count, &handles ) ) != 0 ) {
121 rc = -EEFI ( efirc );
122 DBGC ( driver, "EFIVETO %s could not enumerate handles: %s\n",
123 efi_handle_name ( driver ), strerror ( rc ) );
124 goto err_list;
125 }
126
127 /* Disconnect driver from all handles, in reverse order */
128 for ( i = 0 ; i < count ; i++ ) {
129 handle = handles[ count - i - 1 ];
130 if ( ( rc = efi_disconnect ( handle, driver ) ) != 0 ) {
131 DBGC ( driver, "EFIVETO %s could not disconnect",
132 efi_handle_name ( driver ) );
133 DBGC ( driver, " %s: %s\n",
135 goto err_disconnect;
136 }
137 }
138
139 /* Success */
140 rc = 0;
141 DBGC2 ( driver, "EFIVETO %s disconnected all handles\n",
142 efi_handle_name ( driver ) );
143
144 err_disconnect:
145 bs->FreePool ( handles );
146 err_list:
147 return rc;
148}
149
150/**
151 * Uninstall an EFI driver binding protocol
152 *
153 * @v veto Driver veto
154 * @ret rc Return status code
155 */
156static int efi_veto_uninstall ( struct efi_veto *veto ) {
157 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
158 EFI_HANDLE driver = veto->driver;
160 EFI_STATUS efirc;
161 int rc;
162
163 /* Open driver binding protocol */
164 if ( ( rc = efi_open ( driver, &efi_driver_binding_protocol_guid,
165 &binding ) ) != 0 ) {
166 DBGC ( driver, "EFIVETO %s could not open driver binding "
167 "protocol: %s\n", efi_handle_name ( driver ),
168 strerror ( rc ) );
169 return rc;
170 }
171
172 /* Uninstall driver binding protocol */
173 if ( ( efirc = bs->UninstallMultipleProtocolInterfaces (
175 binding, NULL ) ) != 0 ) {
176 rc = -EEFI ( efirc );
177 DBGC ( driver, "EFIVETO %s could not uninstall driver "
178 "binding protocol: %s\n",
179 efi_handle_name ( driver ), strerror ( rc ) );
180 return rc;
181 }
182
183 DBGC2 ( driver, "EFIVETO %s uninstalled driver binding protocol\n",
184 efi_handle_name ( driver ) );
185 return 0;
186}
187
188/**
189 * Close protocol on handle potentially opened by an EFI driver
190 *
191 * @v veto Driver veto
192 * @v handle Potentially opened handle
193 * @v protocol Opened protocol
194 * @ret rc Return status code
195 */
197 EFI_GUID *protocol ) {
198 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
199 EFI_HANDLE driver = veto->driver;
200 EFI_HANDLE image = veto->image;
204 UINTN count;
205 unsigned int i;
206 EFI_STATUS efirc;
207 int rc;
208
209 /* Retrieve list of openers */
210 if ( ( efirc = bs->OpenProtocolInformation ( handle, protocol, &openers,
211 &count ) ) != 0 ) {
212 rc = -EEFI ( efirc );
213 DBGC ( driver, "EFIVETO %s could not retrieve openers",
214 efi_handle_name ( driver ) );
215 DBGC ( driver, " of %s %s: %s", efi_handle_name ( handle ),
217 goto err_list;
218 }
219
220 /* Close anything opened by this driver */
221 for ( i = 0 ; i < count ; i++ ) {
222 opener = &openers[ count - i - 1 ];
223 if ( ( opener->AgentHandle != driver ) &&
224 ( opener->AgentHandle != image ) ) {
225 continue;
226 }
228 DBGC_EFI_OPENER ( driver, handle, protocol, opener );
229 if ( ( efirc = bs->CloseProtocol ( handle, protocol, driver,
230 controller ) ) != 0 ) {
231 rc = -EEFI ( efirc );
232 DBGC ( driver, "EFIVETO %s could not close stray open",
233 efi_handle_name ( driver ) );
234 DBGC ( driver, " of %s: %s\n",
236 goto err_close;
237 }
238 }
239
240 /* Success */
241 rc = 0;
242
243 err_close:
244 bs->FreePool ( openers );
245 err_list:
246 return rc;
247}
248
249/**
250 * Close handle potentially opened by an EFI driver
251 *
252 * @v veto Driver veto
253 * @v handle Potentially opened handle
254 * @ret rc Return status code
255 */
256static int efi_veto_close_handle ( struct efi_veto *veto, EFI_HANDLE handle ) {
257 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
258 EFI_HANDLE driver = veto->driver;
259 EFI_GUID **protocols;
261 UINTN count;
262 unsigned int i;
263 EFI_STATUS efirc;
264 int rc;
265
266 /* Retrieve list of protocols */
267 if ( ( efirc = bs->ProtocolsPerHandle ( handle, &protocols,
268 &count ) ) != 0 ) {
269 rc = -EEFI ( efirc );
270 DBGC ( driver, "EFIVETO %s could not retrieve protocols",
271 efi_handle_name ( driver ) );
272 DBGC ( driver, " for %s: %s\n",
274 goto err_list;
275 }
276
277 /* Close each protocol */
278 for ( i = 0 ; i < count ; i++ ) {
279 protocol = protocols[ count - i - 1];
280 if ( ( rc = efi_veto_close_protocol ( veto, handle,
281 protocol ) ) != 0 )
282 goto err_close;
283 }
284
285 /* Success */
286 rc = 0;
287
288 err_close:
289 bs->FreePool ( protocols );
290 err_list:
291 return rc;
292}
293
294/**
295 * Close all remaining handles opened by an EFI driver
296 *
297 * @v veto Driver veto
298 * @ret rc Return status code
299 */
300static int efi_veto_close ( struct efi_veto *veto ) {
301 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
302 EFI_HANDLE driver = veto->driver;
303 EFI_HANDLE *handles;
305 UINTN count;
306 unsigned int i;
307 EFI_STATUS efirc;
308 int rc;
309
310 /* Enumerate all handles */
311 if ( ( efirc = bs->LocateHandleBuffer ( AllHandles, NULL, NULL,
312 &count, &handles ) ) != 0 ) {
313 rc = -EEFI ( efirc );
314 DBGC ( driver, "EFIVETO %s could not enumerate handles: %s\n",
315 efi_handle_name ( driver ), strerror ( rc ) );
316 goto err_list;
317 }
318
319 /* Close each handle */
320 for ( i = 0 ; i < count ; i++ ) {
321 handle = handles[ count - i - 1 ];
322 if ( ( rc = efi_veto_close_handle ( veto, handle ) ) != 0 )
323 goto err_close;
324 }
325
326 /* Success */
327 rc = 0;
328 DBGC2 ( driver, "EFIVETO %s closed all remaining handles\n",
329 efi_handle_name ( driver ) );
330
331 err_close:
332 bs->FreePool ( handles );
333 err_list:
334 return rc;
335}
336
337/**
338 * Terminate an EFI driver with extreme prejudice
339 *
340 * @v veto Driver veto
341 * @ret rc Return status code
342 */
343static int efi_veto_destroy ( struct efi_veto *veto ) {
344 EFI_HANDLE driver = veto->driver;
345 int rc;
346
347 /* Disconnect driver from all handles */
348 if ( ( rc = efi_veto_disconnect ( veto ) ) != 0 )
349 return rc;
350
351 /* Uninstall driver binding protocol */
352 if ( ( rc = efi_veto_uninstall ( veto ) ) != 0 )
353 return rc;
354
355 /* Close any remaining opened handles */
356 if ( ( rc = efi_veto_close ( veto ) ) != 0 )
357 return rc;
358
359 DBGC ( driver, "EFIVETO %s forcibly removed\n",
360 efi_handle_name ( driver ) );
361 return 0;
362}
363
364/**
365 * Veto an EFI driver
366 *
367 * @v veto Driver veto
368 * @ret rc Return status code
369 */
370static int efi_veto_driver ( struct efi_veto *veto ) {
371 int rc;
372
373 /* Try gracefully unloading the driver */
374 if ( ( rc = efi_veto_unload ( veto ) ) == 0 )
375 return 0;
376
377 /* If that fails, use a hammer */
378 if ( ( rc = efi_veto_destroy ( veto ) ) == 0 )
379 return 0;
380
381 return rc;
382}
383
384/**
385 * Veto Ip4ConfigDxe driver on some platforms
386 *
387 * @v binding Driver binding protocol
388 * @v loaded Loaded image protocol
389 * @v manufacturer Manufacturer name, if present
390 * @v name Driver name, if present
391 * @ret vetoed Driver is to be vetoed
392 */
393static int
396 const char *manufacturer, const CHAR16 *name ) {
397 static const CHAR16 ip4cfg[] = L"IP4 CONFIG Network Service Driver";
398 static const char *dell = "Dell Inc.";
399 static const char *itautec = "Itautec S.A.";
400
401 /* Check manufacturer and driver name */
402 if ( ! manufacturer )
403 return 0;
404 if ( ! name )
405 return 0;
406 if ( ( strcmp ( manufacturer, dell ) != 0 ) &&
407 ( strcmp ( manufacturer, itautec ) != 0 ) )
408 return 0;
409 if ( memcmp ( name, ip4cfg, sizeof ( ip4cfg ) ) != 0 )
410 return 0;
411
412 return 1;
413}
414
415/**
416 * Veto HP XhciDxe driver
417 *
418 * @v binding Driver binding protocol
419 * @v loaded Loaded image protocol
420 * @v manufacturer Manufacturer name, if present
421 * @v name Driver name, if present
422 * @ret vetoed Driver is to be vetoed
423 */
424static int
427 const char *manufacturer, const CHAR16 *name ) {
428 static const CHAR16 xhci[] = L"Usb Xhci Driver";
429 static const char *hp = "HP";
430 struct pci_driver *driver;
431
432 /* Check manufacturer and driver name */
433 if ( ! manufacturer )
434 return 0;
435 if ( ! name )
436 return 0;
437 if ( strcmp ( manufacturer, hp ) != 0 )
438 return 0;
439 if ( memcmp ( name, xhci, sizeof ( xhci ) ) != 0 )
440 return 0;
441
442 /* Veto driver only if we have our own xHCI driver */
444 if ( driver->class.class ==
447 return 1;
448 }
449 }
450
451 return 0;
452}
453
454/**
455 * Veto VMware UefiPxeBcDxe driver
456 *
457 * @v binding Driver binding protocol
458 * @v loaded Loaded image protocol
459 * @v manufacturer Manufacturer name, if present
460 * @v name Driver name, if present
461 * @ret vetoed Driver is to be vetoed
462 */
463static int
466 const char *manufacturer, const CHAR16 *name ) {
467 static const CHAR16 uefipxebc[] = L"UEFI PXE Base Code Driver";
468 static const char *vmware = "VMware, Inc.";
469
470 /* Check manufacturer and driver name */
471 if ( ! manufacturer )
472 return 0;
473 if ( ! name )
474 return 0;
475 if ( strcmp ( manufacturer, vmware ) != 0 )
476 return 0;
477 if ( memcmp ( name, uefipxebc, sizeof ( uefipxebc ) ) != 0 )
478 return 0;
479
480 return 1;
481}
482
483/** Driver vetoes */
485 {
486 .name = "Ip4Config",
487 .veto = efi_veto_ip4config,
488 },
489 {
490 .name = "HP Xhci",
491 .veto = efi_veto_hp_xhci,
492 },
493 {
494 .name = "VMware UefiPxeBc",
496 },
497};
498
499/**
500 * Find driver veto, if any
501 *
502 * @v driver Driver binding handle
503 * @v manufacturer Manufacturer name, if present
504 * @ret veto Driver veto to fill in
505 * @ret rc Return status code
506 */
507static int efi_veto_find ( EFI_HANDLE driver, const char *manufacturer,
508 struct efi_veto *veto ) {
513 CHAR16 *name;
514 unsigned int i;
516 EFI_STATUS efirc;
517 int rc;
518
519 /* Mark as not vetoed */
520 memset ( veto, 0, sizeof ( *veto ) );
521
522 /* Open driver binding protocol */
523 if ( ( rc = efi_open ( driver, &efi_driver_binding_protocol_guid,
524 &binding ) ) != 0 ) {
525 DBGC ( driver, "EFIVETO %s could not open driver binding "
526 "protocol: %s\n", efi_handle_name ( driver ),
527 strerror ( rc ) );
528 return rc;
529 }
530 image = binding->ImageHandle;
531
532 /* Open loaded image protocol */
534 &loaded ) ) != 0 ) {
535 DBGC ( driver, "EFIVETO %s could not open",
536 efi_handle_name ( driver ) );
537 DBGC ( driver, " %s loaded image protocol: %s\n",
538 efi_handle_name ( image ), strerror ( rc ) );
539 return rc;
540 }
541
542 /* Open component name protocol, if present */
544 &wtf2 ) ) != 0 ) {
545 /* Ignore failure; is not required to be present */
546 }
547
548 /* Open obsolete component name protocol, if present */
550 &wtf ) ) != 0 ) {
551 /* Ignore failure; is not required to be present */
552 }
553
554 /* Get driver name, if available */
555 if ( ( wtf2 && ( ( efirc = wtf2->GetDriverName ( wtf2, "en",
556 &name ) == 0 ) ) ) ||
557 ( wtf && ( ( efirc = wtf->GetDriverName ( wtf, "eng",
558 &name ) == 0 ) ) ) ) {
559 /* Driver has a name */
560 } else {
561 /* Ignore failure; name is not required to be present */
562 name = NULL;
563 }
564
565 /* Check vetoes */
566 DBGC2 ( &efi_vetoes, "EFIVETO checking %s [%p,%p)\n",
567 efi_handle_name ( driver ), loaded->ImageBase,
568 ( loaded->ImageBase + loaded->ImageSize ) );
569 for ( i = 0 ; i < ( sizeof ( efi_vetoes ) /
570 sizeof ( efi_vetoes[0] ) ) ; i++ ) {
571 if ( efi_vetoes[i].veto ( binding, loaded, manufacturer,
572 name ) ) {
573 DBGC ( driver, "EFIVETO %s is vetoed (%s)\n",
574 efi_handle_name ( driver ),
575 efi_vetoes[i].name );
576 veto->driver = driver;
577 veto->binding = binding;
578 veto->image = image;
579 veto->loaded = loaded;
580 break;
581 }
582 }
583
584 return 0;
585}
586
587/**
588 * Remove any vetoed drivers
589 *
590 */
591void efi_veto ( void ) {
592 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
593 struct efi_veto veto;
594 EFI_HANDLE *drivers;
596 UINTN count;
597 unsigned int i;
598 char *manufacturer;
599 EFI_STATUS efirc;
600 int rc;
601
602 /* Locate all driver binding protocol handles */
603 if ( ( efirc = bs->LocateHandleBuffer (
605 NULL, &count, &drivers ) ) != 0 ) {
606 rc = -EEFI ( efirc );
607 DBGC ( &efi_vetoes, "EFIVETO could not list all drivers: "
608 "%s\n", strerror ( rc ) );
609 return;
610 }
611
612 /* Get manufacturer name */
613 fetch_string_setting_copy ( NULL, &manufacturer_setting,
614 &manufacturer );
615 DBGC ( &efi_vetoes, "EFIVETO manufacturer is \"%s\"\n", manufacturer );
616
617 /* Unload any vetoed drivers */
618 for ( i = 0 ; i < count ; i++ ) {
619 driver = drivers[ count - i - 1 ];
621 &veto ) ) != 0 ) {
622 DBGC ( driver, "EFIVETO %s could not determine "
623 "vetoing: %s\n",
625 continue;
626 }
627 if ( ! veto.driver )
628 continue;
629 if ( ( rc = efi_veto_driver ( &veto ) ) != 0 ) {
630 DBGC ( driver, "EFIVETO %s could not veto: %s\n",
632 }
633 }
634
635 /* Free manufacturer name */
636 free ( manufacturer );
637
638 /* Free handle list */
639 bs->FreePool ( drivers );
640}
UINT64 UINTN
Unsigned value of native width.
unsigned short CHAR16
2-byte Character.
#define NULL
NULL pointer (VOID *).
Definition Base.h:321
UEFI Component Name 2 Protocol as defined in the UEFI 2.1 specification.
struct _EFI_COMPONENT_NAME2_PROTOCOL EFI_COMPONENT_NAME2_PROTOCOL
EFI Component Name Protocol as defined in the EFI 1.1 specification.
struct _EFI_COMPONENT_NAME_PROTOCOL EFI_COMPONENT_NAME_PROTOCOL
UEFI DriverBinding Protocol is defined in UEFI specification.
struct _EFI_DRIVER_BINDING_PROTOCOL EFI_DRIVER_BINDING_PROTOCOL
UEFI 2.0 Loaded image protocol definition.
#define PCI_CLASS_SERIAL
Definition Pci22.h:266
#define PCI_CLASS_SERIAL_USB
Definition Pci22.h:272
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
@ ByProtocol
Retrieve the set of handles from the handle database that support a specified protocol.
Definition UefiSpec.h:1530
@ AllHandles
Retrieve all the handles in the handle database.
Definition UefiSpec.h:1521
struct arbelprm_rc_send_wqe rc
Definition arbel.h:3
const char * name
Definition ath9k_hw.c:1986
int efi_disconnect(EFI_HANDLE device, EFI_HANDLE driver)
Disconnect UEFI driver(s).
Definition efi_connect.c:91
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition efi_debug.c:652
EFI_GUID efi_loaded_image_protocol_guid
Loaded image protocol GUID.
Definition efi_guid.c:274
EFI_GUID efi_component_name2_protocol_guid
Component name 2 protocol GUID.
Definition efi_guid.c:162
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition efi_guid.c:733
EFI_GUID efi_driver_binding_protocol_guid
Driver binding protocol GUID.
Definition efi_guid.c:210
EFI_GUID efi_component_name_protocol_guid
Component name protocol GUID.
Definition efi_guid.c:158
void efi_undrop_tpl(struct efi_dropped_tpl *tpl)
Restore dropped task priority level.
Definition efi_init.c:430
void efi_drop_tpl(struct efi_dropped_tpl *tpl)
Drop task priority level temporarily to external level.
Definition efi_init.c:414
void efi_veto(void)
Remove any vetoed drivers.
Definition efi_veto.c:591
static int efi_veto_driver(struct efi_veto *veto)
Veto an EFI driver.
Definition efi_veto.c:370
static int efi_veto_vmware_uefipxebc(EFI_DRIVER_BINDING_PROTOCOL *binding __unused, EFI_LOADED_IMAGE_PROTOCOL *loaded __unused, const char *manufacturer, const CHAR16 *name)
Veto VMware UefiPxeBcDxe driver.
Definition efi_veto.c:464
static int efi_veto_disconnect(struct efi_veto *veto)
Disconnect an EFI driver from all handles.
Definition efi_veto.c:108
static struct efi_veto_candidate efi_vetoes[]
Driver vetoes.
Definition efi_veto.c:484
static int efi_veto_close_handle(struct efi_veto *veto, EFI_HANDLE handle)
Close handle potentially opened by an EFI driver.
Definition efi_veto.c:256
static int efi_veto_close(struct efi_veto *veto)
Close all remaining handles opened by an EFI driver.
Definition efi_veto.c:300
static int efi_veto_close_protocol(struct efi_veto *veto, EFI_HANDLE handle, EFI_GUID *protocol)
Close protocol on handle potentially opened by an EFI driver.
Definition efi_veto.c:196
static int efi_veto_ip4config(EFI_DRIVER_BINDING_PROTOCOL *binding __unused, EFI_LOADED_IMAGE_PROTOCOL *loaded __unused, const char *manufacturer, const CHAR16 *name)
Veto Ip4ConfigDxe driver on some platforms.
Definition efi_veto.c:394
static int efi_veto_unload(struct efi_veto *veto)
Unload an EFI driver.
Definition efi_veto.c:78
static int efi_veto_uninstall(struct efi_veto *veto)
Uninstall an EFI driver binding protocol.
Definition efi_veto.c:156
static int efi_veto_destroy(struct efi_veto *veto)
Terminate an EFI driver with extreme prejudice.
Definition efi_veto.c:343
static int efi_veto_hp_xhci(EFI_DRIVER_BINDING_PROTOCOL *binding __unused, EFI_LOADED_IMAGE_PROTOCOL *loaded __unused, const char *manufacturer, const CHAR16 *name)
Veto HP XhciDxe driver.
Definition efi_veto.c:425
static int efi_veto_find(EFI_HANDLE driver, const char *manufacturer, struct efi_veto *veto)
Find driver veto, if any.
Definition efi_veto.c:507
EFI driver vetoes.
Error codes.
#define __unused
Declare a variable or data structure as unused.
Definition compiler.h:598
#define DBGC2(...)
Definition compiler.h:547
#define DBGC(...)
Definition compiler.h:530
static unsigned int count
Number of entries.
Definition dwmac.h:220
uint8_t controller
CD-ROM controller number.
Definition int13.h:7
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:921
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:951
EFI API.
#define DBGC_EFI_OPENER(...)
Definition efi.h:350
#define efi_open(handle, protocol, interface)
Open protocol for ephemeral use.
Definition efi.h:453
#define EFI_HANDLE
Definition efi.h:53
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition efi.h:181
EFI_SYSTEM_TABLE * efi_systab
Configuration settings.
uint8_t manufacturer
Manufacturer string.
Definition smbios.h:3
uint16_t handle
Handle.
Definition smbios.h:5
String functions.
void * memset(void *dest, int character, size_t len) __nonnull
char wtf[42]
Authenticator response string.
Definition mschapv2.h:7
PCI bus.
#define PCI_CLASS(base, sub, progif)
Construct PCI class.
Definition pci.h:170
#define PCI_CLASS_SERIAL_USB_XHCI
xHCI USB controller
Definition pci.h:144
#define PCI_DRIVERS
PCI driver table.
Definition pci.h:278
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
uint16_t protocol
Protocol ID.
Definition stp.h:7
char * strerror(int errno)
Retrieve string representation of error number.
Definition strerror.c:79
int strcmp(const char *first, const char *second)
Compare strings.
Definition string.c:174
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
Definition string.c:115
EFI Boot Services Table.
Definition UefiSpec.h:1930
EFI_FREE_POOL FreePool
Definition UefiSpec.h:1949
EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation
Definition UefiSpec.h:2001
EFI_IMAGE_UNLOAD UnloadImage
Definition UefiSpec.h:1980
EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
Definition UefiSpec.h:2006
EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces
Definition UefiSpec.h:2010
EFI_CLOSE_PROTOCOL CloseProtocol
Definition UefiSpec.h:2000
EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer
Definition UefiSpec.h:2007
Can be used on any image handle to obtain information about the loaded image.
Definition LoadedImage.h:45
UINT64 ImageSize
The size in bytes of the loaded image.
Definition LoadedImage.h:70
VOID * ImageBase
The base address at which the image was loaded.
Definition LoadedImage.h:69
EFI Oprn Protocol Information Entry.
Definition UefiSpec.h:1431
EFI_HANDLE AgentHandle
Definition UefiSpec.h:1432
EFI_HANDLE ControllerHandle
Definition UefiSpec.h:1433
EFI_COMPONENT_NAME2_GET_DRIVER_NAME GetDriverName
EFI_HANDLE ImageHandle
The image handle of the UEFI driver that produced this instance of the EFI_DRIVER_BINDING_PROTOCOL.
An EFI dropped task priority level.
Definition efi.h:88
A driver veto candidate.
Definition efi_veto.c:43
const char * name
Veto name (for debugging).
Definition efi_veto.c:45
int(* veto)(EFI_DRIVER_BINDING_PROTOCOL *binding, EFI_LOADED_IMAGE_PROTOCOL *loaded, const char *manufacturer, const CHAR16 *name)
Check if driver is vetoed.
Definition efi_veto.c:55
A driver veto.
Definition efi_veto.c:61
EFI_DRIVER_BINDING_PROTOCOL * binding
Driving binding protocol.
Definition efi_veto.c:65
EFI_HANDLE driver
Driver binding handle.
Definition efi_veto.c:63
EFI_LOADED_IMAGE_PROTOCOL * loaded
Loaded image protocol.
Definition efi_veto.c:69
EFI_HANDLE image
Image handle.
Definition efi_veto.c:67
An executable image.
Definition image.h:24
uint32_t class
Class.
Definition pci.h:195
A PCI driver.
Definition pci.h:255
struct pci_class_id class
PCI class ID.
Definition pci.h:261
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
Definition tables.h:386