|
iPXE
|
EFI driver interface. More...
#include <stddef.h>#include <stdlib.h>#include <stdio.h>#include <string.h>#include <errno.h>#include <ipxe/version.h>#include <ipxe/efi/efi.h>#include <ipxe/efi/Protocol/DriverBinding.h>#include <ipxe/efi/Protocol/ComponentName2.h>#include <ipxe/efi/Protocol/DevicePath.h>#include <ipxe/efi/efi_strings.h>#include <ipxe/efi/efi_path.h>#include <ipxe/efi/efi_driver.h>Go to the source code of this file.
Functions | |
| FILE_LICENCE (GPL2_OR_LATER) | |
| static | LIST_HEAD (efi_devices) |
| List of controlled EFI devices. More... | |
| struct efi_device * | efidev_alloc (EFI_HANDLE device) |
| Allocate new EFI device. More... | |
| void | efidev_free (struct efi_device *efidev) |
| Free EFI device. More... | |
| static struct efi_device * | efidev_find (EFI_HANDLE device) |
| Find EFI device. More... | |
| struct efi_device * | efidev_parent (struct device *dev) |
| Get parent EFI device. More... | |
| static EFI_STATUS EFIAPI | efi_driver_supported (EFI_DRIVER_BINDING_PROTOCOL *driver __unused, EFI_HANDLE device, EFI_DEVICE_PATH_PROTOCOL *child) |
| Check to see if driver supports a device. More... | |
| static EFI_STATUS EFIAPI | efi_driver_start (EFI_DRIVER_BINDING_PROTOCOL *driver __unused, EFI_HANDLE device, EFI_DEVICE_PATH_PROTOCOL *child) |
| Attach driver to device. More... | |
| static EFI_STATUS EFIAPI | efi_driver_stop (EFI_DRIVER_BINDING_PROTOCOL *driver __unused, EFI_HANDLE device, UINTN num_children, EFI_HANDLE *children) |
| Detach driver from device. More... | |
| static EFI_STATUS EFIAPI | efi_driver_name (EFI_COMPONENT_NAME2_PROTOCOL *wtf __unused, CHAR8 *language __unused, CHAR16 **driver_name) |
| Look up driver name. More... | |
| static EFI_STATUS EFIAPI | efi_driver_controller_name (EFI_COMPONENT_NAME2_PROTOCOL *wtf __unused, EFI_HANDLE device, EFI_HANDLE child, CHAR8 *language, CHAR16 **controller_name) |
| Look up controller name. More... | |
| int | efi_driver_install (void) |
| Install EFI driver. More... | |
| void | efi_driver_uninstall (void) |
| Uninstall EFI driver. More... | |
| int | efi_driver_exclude (EFI_HANDLE device, EFI_GUID *protocol) |
| Try to disconnect an existing EFI driver. More... | |
| static int | efi_driver_connect (EFI_HANDLE device) |
| Try to connect EFI driver. More... | |
| static int | efi_driver_disconnect (EFI_HANDLE device) |
| Try to disconnect EFI driver. More... | |
| static int | efi_driver_reconnect (EFI_HANDLE device) |
| Reconnect original EFI driver. More... | |
| static int | efi_driver_handles (int(*method)(EFI_HANDLE handle)) |
| Connect/disconnect EFI driver from all handles. More... | |
| int | efi_driver_connect_all (void) |
| Connect EFI driver to all possible devices. More... | |
| void | efi_driver_disconnect_all (void) |
| Disconnect EFI driver from all possible devices. More... | |
| void | efi_driver_reconnect_all (void) |
| Reconnect original EFI drivers to all possible devices. More... | |
Variables | |
| static EFI_DRIVER_BINDING_PROTOCOL | efi_driver_binding |
| EFI driver binding protocol. More... | |
| static int | efi_driver_disconnecting |
| We are currently disconnecting drivers. More... | |
| static EFI_COMPONENT_NAME2_PROTOCOL | efi_wtf |
| EFI component name protocol. More... | |
EFI driver interface.
Definition in file efi_driver.c.
| FILE_LICENCE | ( | GPL2_OR_LATER | ) |
|
static |
List of controlled EFI devices.
| struct efi_device* efidev_alloc | ( | EFI_HANDLE | device | ) |
Allocate new EFI device.
| device | EFI device handle |
| efidev | EFI device, or NULL on error |
Definition at line 56 of file efi_driver.c.
References device_description::bus_type, BUS_TYPE_EFI, device::children, DBGC, device::desc, efi_device::dev, efi_device::device, device, efi_device_path_protocol_guid, efi_handle_name(), efi_open, efi_path_len(), INIT_LIST_HEAD, list_add, memcpy(), NULL, efi_device::path, rc, device::siblings, strerror(), and zalloc().
Referenced by efi_driver_start(), and mnptemp_create().
| void efidev_free | ( | struct efi_device * | efidev | ) |
Free EFI device.
| efidev | EFI device |
Definition at line 91 of file efi_driver.c.
References assert(), device::children, efi_device::dev, free, list_del, list_empty, and device::siblings.
Referenced by efi_driver_start(), efi_driver_stop(), mnptemp_create(), and mnptemp_destroy().
|
static |
Find EFI device.
| device | EFI device handle (or child handle) |
| efidev | EFI device, or NULL if not found |
Definition at line 104 of file efi_driver.c.
References efi_device::child, efi_device::dev, efi_device::device, list_for_each_entry, NULL, and device::siblings.
Referenced by efi_driver_start(), efi_driver_stop(), and efi_driver_supported().
| struct efi_device* efidev_parent | ( | struct device * | dev | ) |
Get parent EFI device.
| dev | Generic device |
| efidev | Parent EFI device, or NULL |
Definition at line 128 of file efi_driver.c.
References efi_device::dev, list_for_each_entry, NULL, device::parent, and device::siblings.
Referenced by efi_parent_path(), and efi_snp_probe().
|
static |
Check to see if driver supports a device.
| driver | EFI driver |
| device | EFI device |
| child | Path to child device, if any |
| efirc | EFI status code |
Definition at line 153 of file efi_driver.c.
References count, DBGC, DBGCP, EFI_ALREADY_STARTED, efi_devpath_text(), EFI_DRIVERS, efi_handle_name(), EFI_UNSUPPORTED, efidev_find(), for_each_table_entry, efi_driver::name, NULL, rc, and efi_driver::supported.
Referenced by efi_driver_connect().
|
static |
Attach driver to device.
| driver | EFI driver |
| device | EFI device |
| child | Path to child device, if any |
| efirc | EFI status code |
Definition at line 201 of file efi_driver.c.
References DBGC, DBGCP, efi_device::driver, EFI_ALREADY_STARTED, efi_devpath_text(), efi_driver_disconnecting, EFI_DRIVERS, efi_handle_name(), EFI_NOT_READY, EFI_OUT_OF_RESOURCES, efi_raise_tpl(), efi_restore_tpl(), EFI_UNSUPPORTED, efidev_alloc(), efidev_find(), efidev_free(), for_each_table_entry, efi_driver::name, rc, efi_driver::start, strerror(), and efi_driver::supported.
Referenced by efi_driver_connect().
|
static |
Detach driver from device.
| driver | EFI driver |
| device | EFI device |
| pci | PCI device |
| num_children | Number of child devices |
| children | List of child devices |
| efirc | EFI status code |
Definition at line 283 of file efi_driver.c.
References assert(), children, DBGC, DBGCP, efi_device::driver, efi_handle_name(), efi_raise_tpl(), efi_restore_tpl(), efidev_find(), efidev_free(), NULL, and efi_driver::stop.
|
static |
Look up driver name.
| wtf | Component name protocol |
| language | Language to use |
| driver_name | Driver name to fill in |
| efirc | EFI status code |
Definition at line 335 of file efi_driver.c.
References build_wname, name, and product_wname.
|
static |
Look up controller name.
| wtf | Component name protocol |
| device | Device |
| child | Child device, or NULL |
| language | Language to use |
| driver_name | Device name to fill in |
| efirc | EFI status code |
Definition at line 355 of file efi_driver.c.
References efi_component_name2_protocol_guid, efi_open, EFI_UNSUPPORTED, _EFI_COMPONENT_NAME2_PROTOCOL::GetControllerName, NULL, and rc.
| int efi_driver_install | ( | void | ) |
Install EFI driver.
| rc | Return status code |
Definition at line 387 of file efi_driver.c.
References EFI_SYSTEM_TABLE::BootServices, build_timestamp, DBGC, _EFI_DRIVER_BINDING_PROTOCOL::DriverBindingHandle, EEFI, efi_component_name2_protocol_guid, efi_driver_binding, efi_driver_binding_protocol_guid, efi_image_handle, efi_systab, efi_wtf, _EFI_DRIVER_BINDING_PROTOCOL::ImageHandle, EFI_BOOT_SERVICES::InstallMultipleProtocolInterfaces, NULL, rc, strerror(), and _EFI_DRIVER_BINDING_PROTOCOL::Version.
Referenced by efi_init().
| void efi_driver_uninstall | ( | void | ) |
Uninstall EFI driver.
Definition at line 420 of file efi_driver.c.
References EFI_SYSTEM_TABLE::BootServices, efi_component_name2_protocol_guid, efi_driver_binding, efi_driver_binding_protocol_guid, efi_image_handle, efi_systab, efi_wtf, NULL, and EFI_BOOT_SERVICES::UninstallMultipleProtocolInterfaces.
Referenced by efi_init(), and efi_unload().
| int efi_driver_exclude | ( | EFI_HANDLE | device, |
| EFI_GUID * | protocol | ||
| ) |
Try to disconnect an existing EFI driver.
| device | EFI device |
| protocol | Protocol GUID |
| rc | Return status code |
Definition at line 437 of file efi_driver.c.
References EFI_OPEN_PROTOCOL_INFORMATION_ENTRY::AgentHandle, EFI_OPEN_PROTOCOL_INFORMATION_ENTRY::Attributes, EFI_SYSTEM_TABLE::BootServices, count, DBGC, EEFI, efi_disconnect(), efi_guid_ntoa(), efi_handle_name(), EFI_OPEN_PROTOCOL_BY_DRIVER, efi_systab, EFI_BOOT_SERVICES::FreePool, NULL, EFI_BOOT_SERVICES::OpenProtocolInformation, protocol, rc, and strerror().
Referenced by efipci_exclude(), nii_exclude(), snpnet_exclude(), and usbio_exclude().
|
static |
Try to connect EFI driver.
| device | EFI device |
| rc | Return status code |
Definition at line 498 of file efi_driver.c.
References DBGC, DBGC2, DBGC2_EFI_PROTOCOLS, _EFI_DRIVER_BINDING_PROTOCOL::DriverBindingHandle, EEFI, efi_connect(), efi_driver_binding, efi_driver_disconnecting, efi_driver_start(), efi_driver_supported(), EFI_DRIVERS, efi_handle_name(), efi_driver::exclude, for_each_table_entry_reverse, NULL, rc, strerror(), and efi_driver::supported.
Referenced by efi_driver_connect_all().
|
static |
Try to disconnect EFI driver.
| device | EFI device |
| rc | Return status code |
Definition at line 565 of file efi_driver.c.
References _EFI_DRIVER_BINDING_PROTOCOL::DriverBindingHandle, efi_disconnect(), efi_driver_binding, and efi_driver_disconnecting.
Referenced by efi_driver_disconnect_all().
|
static |
Reconnect original EFI driver.
| device | EFI device |
| rc | Return status code |
Definition at line 582 of file efi_driver.c.
References efi_connect(), and NULL.
Referenced by efi_driver_reconnect_all().
|
static |
Connect/disconnect EFI driver from all handles.
| method | Connect/disconnect method |
| rc | Return status code |
Definition at line 596 of file efi_driver.c.
References AllHandles, EFI_SYSTEM_TABLE::BootServices, DBGC, EEFI, efi_driver_binding, efi_systab, EFI_BOOT_SERVICES::FreePool, EFI_BOOT_SERVICES::LocateHandleBuffer, method, NULL, rc, and strerror().
Referenced by efi_driver_connect_all(), efi_driver_disconnect_all(), and efi_driver_reconnect_all().
| int efi_driver_connect_all | ( | void | ) |
Connect EFI driver to all possible devices.
| rc | Return status code |
Definition at line 636 of file efi_driver.c.
References DBGC, efi_driver_binding, efi_driver_connect(), and efi_driver_handles().
Referenced by efi_probe().
| void efi_driver_disconnect_all | ( | void | ) |
Disconnect EFI driver from all possible devices.
| rc | Return status code |
Definition at line 647 of file efi_driver.c.
References DBGC, efi_driver_binding, efi_driver_disconnect(), and efi_driver_handles().
Referenced by efi_remove(), and efi_unload().
| void efi_driver_reconnect_all | ( | void | ) |
Reconnect original EFI drivers to all possible devices.
| rc | Return status code |
Definition at line 658 of file efi_driver.c.
References DBGC, efi_driver_binding, efi_driver_handles(), and efi_driver_reconnect().
Referenced by _efi_start(), efi_block_boot(), and efi_image_exec().
|
static |
EFI driver binding protocol.
Definition at line 42 of file efi_driver.c.
Referenced by efi_driver_connect(), efi_driver_connect_all(), efi_driver_disconnect(), efi_driver_disconnect_all(), efi_driver_handles(), efi_driver_install(), efi_driver_reconnect_all(), and efi_driver_uninstall().
|
static |
We are currently disconnecting drivers.
Definition at line 48 of file efi_driver.c.
Referenced by efi_driver_connect(), efi_driver_disconnect(), and efi_driver_start().
|
static |
EFI component name protocol.
Definition at line 376 of file efi_driver.c.
Referenced by efi_driver_install(), and efi_driver_uninstall().
1.8.15