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 
20 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
21 
22 #include <stddef.h>
23 #include <stdlib.h>
24 #include <string.h>
25 #include <errno.h>
26 #include <ipxe/settings.h>
27 #include <ipxe/pci.h>
28 #include <ipxe/efi/efi.h>
32 #include <ipxe/efi/efi_veto.h>
33 
34 /** @file
35  *
36  * EFI driver vetoes
37  *
38  */
39 
40 /** A driver veto */
41 struct efi_veto {
42  /** Veto name (for debugging) */
43  const char *name;
44  /**
45  * Check if driver is vetoed
46  *
47  * @v binding Driver binding protocol
48  * @v loaded Loaded image protocol
49  * @v wtf Component name protocol, if present
50  * @v manufacturer Manufacturer name, if present
51  * @v name Driver name (in "eng" language), if present
52  * @ret vetoed Driver is to be vetoed
53  */
54  int ( * veto ) ( EFI_DRIVER_BINDING_PROTOCOL *binding,
57  const char *manufacturer, const CHAR16 *name );
58 };
59 
60 /**
61  * Unload an EFI driver
62  *
63  * @v driver Driver binding handle
64  * @ret rc Return status code
65  */
66 static int efi_veto_unload ( EFI_HANDLE driver ) {
68  EFI_STATUS efirc;
69  int rc;
70 
71  /* Unload the driver */
72  if ( ( efirc = bs->UnloadImage ( driver ) ) != 0 ) {
73  rc = -EEFI ( efirc );
74  DBGC ( driver, "EFIVETO %s could not unload: %s\n",
75  efi_handle_name ( driver ), strerror ( rc ) );
76  return rc;
77  }
78 
79  return 0;
80 }
81 
82 /**
83  * Disconnect an EFI driver from all handles
84  *
85  * @v driver Driver binding handle
86  * @ret rc Return status code
87  */
88 static int efi_veto_disconnect ( EFI_HANDLE driver ) {
90  EFI_HANDLE *handles;
92  UINTN count;
93  unsigned int i;
94  EFI_STATUS efirc;
95  int rc;
96 
97  /* Enumerate all handles */
98  if ( ( efirc = bs->LocateHandleBuffer ( AllHandles, NULL, NULL,
99  &count, &handles ) ) != 0 ) {
100  rc = -EEFI ( efirc );
101  DBGC ( driver, "EFIVETO %s could not enumerate handles: %s\n",
102  efi_handle_name ( driver ), strerror ( rc ) );
103  goto err_list;
104  }
105 
106  /* Disconnect driver from all handles, in reverse order */
107  for ( i = 0 ; i < count ; i++ ) {
108  handle = handles[ count - i - 1 ];
109  efirc = bs->DisconnectController ( handle, driver, NULL );
110  if ( ( efirc != 0 ) && ( efirc != EFI_NOT_FOUND ) ) {
111  rc = -EEFI ( efirc );
112  DBGC ( driver, "EFIVETO %s could not disconnect",
113  efi_handle_name ( driver ) );
114  DBGC ( driver, " %s: %s\n",
115  efi_handle_name ( handle ), strerror ( rc ) );
116  goto err_disconnect;
117  }
118  }
119 
120  /* Success */
121  rc = 0;
122  DBGC2 ( driver, "EFIVETO %s disconnected all handles\n",
123  efi_handle_name ( driver ) );
124 
125  err_disconnect:
126  bs->FreePool ( handles );
127  err_list:
128  return rc;
129 }
130 
131 /**
132  * Uninstall an EFI driver binding protocol
133  *
134  * @v driver Driver binding handle
135  * @ret rc Return status code
136  */
137 static int efi_veto_uninstall ( EFI_HANDLE driver ) {
139  union {
141  void *interface;
142  } binding;
143  EFI_STATUS efirc;
144  int rc;
145 
146  /* Open driver binding protocol */
147  if ( ( efirc = bs->OpenProtocol (
149  &binding.interface, efi_image_handle, driver,
150  EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) != 0 ) {
151  rc = -EEFI ( efirc );
152  DBGC ( driver, "EFIVETO %s could not open driver binding "
153  "protocol: %s\n", efi_handle_name ( driver ),
154  strerror ( rc ) );
155  return rc;
156  }
157 
158  /* Close driver binding protocol */
160  efi_image_handle, driver );
161 
162  /* Uninstall driver binding protocol */
163  if ( ( efirc = bs->UninstallMultipleProtocolInterfaces (
165  binding.binding, NULL ) ) != 0 ) {
166  rc = -EEFI ( efirc );
167  DBGC ( driver, "EFIVETO %s could not uninstall driver "
168  "binding protocol: %s\n",
169  efi_handle_name ( driver ), strerror ( rc ) );
170  return rc;
171  }
172 
173  DBGC2 ( driver, "EFIVETO %s uninstalled driver binding protocol\n",
174  efi_handle_name ( driver ) );
175  return 0;
176 }
177 
178 /**
179  * Close protocol on handle potentially opened by an EFI driver
180  *
181  * @v driver Driver binding handle
182  * @v handle Potentially opened handle
183  * @v protocol Opened protocol
184  * @ret rc Return status code
185  */
187  EFI_GUID *protocol ) {
192  UINTN count;
193  unsigned int i;
194  EFI_STATUS efirc;
195  int rc;
196 
197  /* Retrieve list of openers */
198  if ( ( efirc = bs->OpenProtocolInformation ( handle, protocol, &openers,
199  &count ) ) != 0 ) {
200  rc = -EEFI ( efirc );
201  DBGC ( driver, "EFIVETO %s could not retrieve openers",
202  efi_handle_name ( driver ) );
203  DBGC ( driver, " of %s %s: %s", efi_handle_name ( handle ),
204  efi_guid_ntoa ( protocol ), strerror ( rc ) );
205  goto err_list;
206  }
207 
208  /* Close anything opened by this driver */
209  for ( i = 0 ; i < count ; i++ ) {
210  opener = &openers[i];
211  if ( opener->AgentHandle != driver )
212  continue;
213  controller = opener->ControllerHandle;
214  DBGC_EFI_OPENER ( driver, handle, protocol, opener );
215  if ( ( efirc = bs->CloseProtocol ( handle, protocol, driver,
216  controller ) ) != 0 ) {
217  rc = -EEFI ( efirc );
218  DBGC ( driver, "EFIVETO %s could not close stray open",
219  efi_handle_name ( driver ) );
220  DBGC ( driver, " of %s: %s\n",
221  efi_handle_name ( handle ), strerror ( rc ) );
222  goto err_close;
223  }
224  }
225 
226  /* Success */
227  rc = 0;
228 
229  err_close:
230  bs->FreePool ( openers );
231  err_list:
232  return rc;
233 }
234 
235 /**
236  * Close handle potentially opened by an EFI driver
237  *
238  * @v driver Driver binding handle
239  * @v handle Potentially opened handle
240  * @ret rc Return status code
241  */
244  EFI_GUID **protocols;
245  UINTN count;
246  unsigned int i;
247  EFI_STATUS efirc;
248  int rc;
249 
250  /* Retrieve list of protocols */
251  if ( ( efirc = bs->ProtocolsPerHandle ( handle, &protocols,
252  &count ) ) != 0 ) {
253  rc = -EEFI ( efirc );
254  DBGC ( driver, "EFIVETO %s could not retrieve protocols",
255  efi_handle_name ( driver ) );
256  DBGC ( driver, " for %s: %s\n",
257  efi_handle_name ( handle ), strerror ( rc ) );
258  goto err_list;
259  }
260 
261  /* Close each protocol */
262  for ( i = 0 ; i < count ; i++ ) {
263  if ( ( rc = efi_veto_close_protocol ( driver, handle,
264  protocols[i] ) ) != 0 )
265  goto err_close;
266  }
267 
268  /* Success */
269  rc = 0;
270 
271  err_close:
272  bs->FreePool ( protocols );
273  err_list:
274  return rc;
275 }
276 
277 /**
278  * Close all remaining handles opened by an EFI driver
279  *
280  * @v driver Driver binding handle
281  * @ret rc Return status code
282  */
283 static int efi_veto_close ( EFI_HANDLE driver ) {
285  EFI_HANDLE *handles;
286  UINTN count;
287  unsigned int i;
288  EFI_STATUS efirc;
289  int rc;
290 
291  /* Enumerate all handles */
292  if ( ( efirc = bs->LocateHandleBuffer ( AllHandles, NULL, NULL,
293  &count, &handles ) ) != 0 ) {
294  rc = -EEFI ( efirc );
295  DBGC ( driver, "EFIVETO %s could not enumerate handles: %s\n",
296  efi_handle_name ( driver ), strerror ( rc ) );
297  goto err_list;
298  }
299 
300  /* Close each handle */
301  for ( i = 0 ; i < count ; i++ ) {
302  if ( ( rc = efi_veto_close_handle ( driver,
303  handles[i] ) ) != 0 )
304  goto err_close;
305  }
306 
307  /* Success */
308  rc = 0;
309  DBGC2 ( driver, "EFIVETO %s closed all remaining handles\n",
310  efi_handle_name ( driver ) );
311 
312  err_close:
313  bs->FreePool ( handles );
314  err_list:
315  return rc;
316 }
317 
318 /**
319  * Terminate an EFI driver with extreme prejudice
320  *
321  * @v driver Driver binding handle
322  * @ret rc Return status code
323  */
324 static int efi_veto_destroy ( EFI_HANDLE driver ) {
325  int rc;
326 
327  /* Disconnect driver from all handles */
328  if ( ( rc = efi_veto_disconnect ( driver ) ) != 0 )
329  return rc;
330 
331  /* Uninstall driver binding protocol */
332  if ( ( rc = efi_veto_uninstall ( driver ) ) != 0 )
333  return rc;
334 
335  /* Close any remaining opened handles */
336  if ( ( rc = efi_veto_close ( driver ) ) != 0 )
337  return rc;
338 
339  DBGC ( driver, "EFIVETO %s forcibly removed\n",
340  efi_handle_name ( driver ) );
341  return 0;
342 }
343 
344 /**
345  * Veto an EFI driver
346  *
347  * @v driver Driver binding handle
348  * @ret rc Return status code
349  */
350 static int efi_veto_driver ( EFI_HANDLE driver ) {
351  int rc;
352 
353  /* Try gracefully unloading the driver */
354  if ( ( rc = efi_veto_unload ( driver ) ) == 0 )
355  return 0;
356 
357  /* If that fails, use a hammer */
358  if ( ( rc = efi_veto_destroy ( driver ) ) == 0 )
359  return 0;
360 
361  return rc;
362 }
363 
364 /**
365  * Veto Ip4ConfigDxe driver on some platforms
366  *
367  * @v binding Driver binding protocol
368  * @v loaded Loaded image protocol
369  * @v wtf Component name protocol, if present
370  * @v manufacturer Manufacturer name, if present
371  * @v name Driver name, if present
372  * @ret vetoed Driver is to be vetoed
373  */
374 static int
378  const char *manufacturer, const CHAR16 *name ) {
379  static const CHAR16 ip4cfg[] = L"IP4 CONFIG Network Service Driver";
380  static const char *dell = "Dell Inc.";
381  static const char *itautec = "Itautec S.A.";
382 
383  /* Check manufacturer and driver name */
384  if ( ! manufacturer )
385  return 0;
386  if ( ! name )
387  return 0;
388  if ( ( strcmp ( manufacturer, dell ) != 0 ) &&
389  ( strcmp ( manufacturer, itautec ) != 0 ) )
390  return 0;
391  if ( memcmp ( name, ip4cfg, sizeof ( ip4cfg ) ) != 0 )
392  return 0;
393 
394  return 1;
395 }
396 
397 /**
398  * Veto HP XhciDxe driver
399  *
400  * @v binding Driver binding protocol
401  * @v loaded Loaded image protocol
402  * @v wtf Component name protocol, if present
403  * @v manufacturer Manufacturer name, if present
404  * @v name Driver name, if present
405  * @ret vetoed Driver is to be vetoed
406  */
407 static int
411  const char *manufacturer, const CHAR16 *name ) {
412  static const CHAR16 xhci[] = L"Usb Xhci Driver";
413  static const char *hp = "HP";
414  struct pci_driver *driver;
415 
416  /* Check manufacturer and driver name */
417  if ( ! manufacturer )
418  return 0;
419  if ( ! name )
420  return 0;
421  if ( strcmp ( manufacturer, hp ) != 0 )
422  return 0;
423  if ( memcmp ( name, xhci, sizeof ( xhci ) ) != 0 )
424  return 0;
425 
426  /* Veto driver only if we have our own xHCI driver */
427  for_each_table_entry ( driver, PCI_DRIVERS ) {
428  if ( driver->class.class ==
431  return 1;
432  }
433  }
434 
435  return 0;
436 }
437 
438 /** Driver vetoes */
439 static struct efi_veto efi_vetoes[] = {
440  {
441  .name = "Ip4Config",
442  .veto = efi_veto_ip4config,
443  },
444  {
445  .name = "HP Xhci",
446  .veto = efi_veto_hp_xhci,
447  },
448 };
449 
450 /**
451  * Find driver veto, if any
452  *
453  * @v driver Driver binding handle
454  * @v manufacturer Manufacturer name, if present
455  * @ret veto Driver veto, or NULL
456  * @ret rc Return status code
457  */
458 static int efi_veto_find ( EFI_HANDLE driver, const char *manufacturer,
459  struct efi_veto **veto ) {
461  union {
463  void *interface;
464  } binding;
465  union {
467  void *interface;
468  } loaded;
469  union {
471  void *interface;
472  } wtf;
473  CHAR16 *name;
474  unsigned int i;
476  EFI_STATUS efirc;
477  int rc;
478 
479  DBGC2 ( &efi_vetoes, "EFIVETO checking %s\n",
480  efi_handle_name ( driver ) );
481 
482  /* Mark as not vetoed */
483  *veto = NULL;
484 
485  /* Open driver binding protocol */
486  if ( ( efirc = bs->OpenProtocol (
488  &binding.interface, efi_image_handle, driver,
489  EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) != 0 ) {
490  rc = -EEFI ( efirc );
491  DBGC ( driver, "EFIVETO %s could not open driver binding "
492  "protocol: %s\n", efi_handle_name ( driver ),
493  strerror ( rc ) );
494  goto err_binding;
495  }
496  image = binding.binding->ImageHandle;
497 
498  /* Open loaded image protocol */
499  if ( ( efirc = bs->OpenProtocol (
501  &loaded.interface, efi_image_handle, image,
502  EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) != 0 ) {
503  rc = -EEFI ( efirc );
504  DBGC ( driver, "EFIVETO %s could not open",
505  efi_handle_name ( driver ) );
506  DBGC ( driver, " %s loaded image protocol: %s\n",
507  efi_handle_name ( image ), strerror ( rc ) );
508  goto err_loaded;
509  }
510 
511  /* Open component name protocol, if present*/
512  if ( ( efirc = bs->OpenProtocol (
514  &wtf.interface, efi_image_handle, driver,
515  EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) != 0 ) {
516  /* Ignore failure; is not required to be present */
517  wtf.interface = NULL;
518  }
519 
520  /* Get driver name, if available */
521  if ( wtf.wtf &&
522  ( ( efirc = wtf.wtf->GetDriverName ( wtf.wtf, "eng",
523  &name ) == 0 ) ) ) {
524  /* Driver has a name */
525  } else {
526  /* Ignore failure; name is not required to be present */
527  name = NULL;
528  }
529 
530  /* Check vetoes */
531  for ( i = 0 ; i < ( sizeof ( efi_vetoes ) /
532  sizeof ( efi_vetoes[0] ) ) ; i++ ) {
533  if ( efi_vetoes[i].veto ( binding.binding, loaded.loaded,
534  wtf.wtf, manufacturer, name ) ) {
535  *veto = &efi_vetoes[i];
536  break;
537  }
538  }
539 
540  /* Success */
541  rc = 0;
542 
543  /* Close protocols */
544  if ( wtf.wtf ) {
546  efi_image_handle, driver );
547  }
550  err_loaded:
552  efi_image_handle, driver );
553  err_binding:
554  return rc;
555 }
556 
557 /**
558  * Remove any vetoed drivers
559  *
560  */
561 void efi_veto ( void ) {
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 }
UEFI DriverBinding Protocol is defined in UEFI specification.
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2030
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
const char * name
Definition: ath9k_hw.c:1984
static int efi_veto_destroy(EFI_HANDLE driver)
Terminate an EFI driver with extreme prejudice.
Definition: efi_veto.c:324
EFI Oprn Protocol Information Entry.
Definition: UefiSpec.h:1376
This protocol is used to retrieve user readable names of drivers and controllers managed by UEFI Driv...
struct pci_class_id class
PCI class ID.
Definition: pci.h:253
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition: efi.h:162
A PCI driver.
Definition: pci.h:247
const char * name
Veto name (for debugging)
Definition: efi_veto.c:43
EFI_HANDLE ControllerHandle
Definition: UefiSpec.h:1378
void efi_veto(void)
Remove any vetoed drivers.
Definition: efi_veto.c:561
EFI_HANDLE AgentHandle
Definition: UefiSpec.h:1377
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
Error codes.
static int efi_veto_close_handle(EFI_HANDLE driver, EFI_HANDLE handle)
Close handle potentially opened by an EFI driver.
Definition: efi_veto.c:242
Retrieve all the handles in the handle database.
Definition: UefiSpec.h:1466
static struct efi_veto efi_vetoes[]
Driver vetoes.
Definition: efi_veto.c:439
#define DBGC(...)
Definition: compiler.h:505
EFI_GUID efi_loaded_image_protocol_guid
Loaded image protocol GUID.
Definition: efi_guid.c:185
static int efi_veto_close_protocol(EFI_HANDLE driver, EFI_HANDLE handle, EFI_GUID *protocol)
Close protocol on handle potentially opened by an EFI driver.
Definition: efi_veto.c:186
EFI driver vetoes.
unsigned short CHAR16
uint32_t class
Class.
Definition: pci.h:187
EFI_IMAGE_UNLOAD UnloadImage
Definition: UefiSpec.h:1916
An executable image.
Definition: image.h:24
EFI Component Name Protocol as defined in the EFI 1.1 specification.
EFI_CLOSE_PROTOCOL CloseProtocol
Definition: UefiSpec.h:1936
static int efi_veto_close(EFI_HANDLE driver)
Close all remaining handles opened by an EFI driver.
Definition: efi_veto.c:283
#define PCI_CLASS_SERIAL_USB_XHCI
xHCI USB controller
Definition: pci.h:140
#define PCI_CLASS_SERIAL
Definition: Pci22.h:266
UEFI 2.0 Loaded image protocol definition.
Can be used on any image handle to obtain information about the loaded image.
Definition: LoadedImage.h:45
static int efi_veto_hp_xhci(EFI_DRIVER_BINDING_PROTOCOL *binding __unused, EFI_LOADED_IMAGE_PROTOCOL *loaded __unused, EFI_COMPONENT_NAME_PROTOCOL *wtf __unused, const char *manufacturer, const CHAR16 *name)
Veto HP XhciDxe driver.
Definition: efi_veto.c:408
An object interface.
Definition: interface.h:124
static int efi_veto_unload(EFI_HANDLE driver)
Unload an EFI driver.
Definition: efi_veto.c:66
#define PCI_CLASS(base, sub, progif)
Construct PCI class.
Definition: pci.h:162
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int fetch_string_setting_copy(struct settings *settings, const struct setting *setting, char **data)
Fetch value of string setting.
Definition: settings.c:873
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
#define EFI_OPEN_PROTOCOL_GET_PROTOCOL
Definition: UefiSpec.h:1299
Configuration settings.
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:724
static int efi_veto_uninstall(EFI_HANDLE driver)
Uninstall an EFI driver binding protocol.
Definition: efi_veto.c:137
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_debug.c:194
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:1866
#define PCI_CLASS_SERIAL_USB
Definition: Pci22.h:272
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
Definition: efi_init.c:34
PCI bus.
static int efi_veto_ip4config(EFI_DRIVER_BINDING_PROTOCOL *binding __unused, EFI_LOADED_IMAGE_PROTOCOL *loaded __unused, EFI_COMPONENT_NAME_PROTOCOL *wtf __unused, const char *manufacturer, const CHAR16 *name)
Veto Ip4ConfigDxe driver on some platforms.
Definition: efi_veto.c:375
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
Definition: tables.h:385
EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces
Definition: UefiSpec.h:1946
UINT64 UINTN
Unsigned value of native width.
This protocol provides the services required to determine if a driver supports a given controller.
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1885
uint8_t manufacturer
Manufacturer string.
Definition: smbios.h:14
EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation
Definition: UefiSpec.h:1937
EFI API.
static int efi_veto_disconnect(EFI_HANDLE driver)
Disconnect an EFI driver from all handles.
Definition: efi_veto.c:88
#define __unused
Declare a variable or data structure as unused.
Definition: compiler.h:573
uint8_t controller
CD-ROM controller number.
Definition: int13.h:18
#define EFI_NOT_FOUND
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:128
EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
Definition: UefiSpec.h:1942
#define DBGC2(...)
Definition: compiler.h:522
int strcmp(const char *first, const char *second)
Compare strings.
Definition: string.c:173
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:1475
EFI_SYSTEM_TABLE * efi_systab
EFI_OPEN_PROTOCOL OpenProtocol
Definition: UefiSpec.h:1935
EFI_GUID efi_component_name_protocol_guid
Component name protocol GUID.
Definition: efi_guid.c:121
uint16_t protocol
Protocol ID.
Definition: stp.h:18
static int efi_veto_driver(EFI_HANDLE driver)
Veto an EFI driver.
Definition: efi_veto.c:350
uint16_t handle
Handle.
Definition: smbios.h:16
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
Definition: string.c:114
EFI_GUID efi_driver_binding_protocol_guid
Driver binding protocol GUID.
Definition: efi_guid.c:149
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
String functions.
A driver veto.
Definition: efi_veto.c:41
Definition: efi.h:50
EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer
Definition: UefiSpec.h:1943
#define PCI_DRIVERS
PCI driver table.
Definition: pci.h:270
#define DBGC_EFI_OPENER(...)
Definition: efi.h:285
EFI_DISCONNECT_CONTROLLER DisconnectController
Definition: UefiSpec.h:1930