TianoCore EDK2 master
Loading...
Searching...
No Matches
UefiDriverModel.c File Reference
#include "UefiLibInternal.h"

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI EfiLibInstallDriverBinding (IN CONST EFI_HANDLE ImageHandle, IN CONST EFI_SYSTEM_TABLE *SystemTable, IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE DriverBindingHandle)
 
EFI_STATUS EFIAPI EfiLibUninstallDriverBinding (IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding)
 
EFI_STATUS EFIAPI EfiLibInstallAllDriverProtocols (IN CONST EFI_HANDLE ImageHandle, IN CONST EFI_SYSTEM_TABLE *SystemTable, IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE DriverBindingHandle, IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration OPTIONAL, IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL)
 
EFI_STATUS EFIAPI EfiLibUninstallAllDriverProtocols (IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration OPTIONAL, IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL)
 
EFI_STATUS EFIAPI EfiLibInstallDriverBindingComponentName2 (IN CONST EFI_HANDLE ImageHandle, IN CONST EFI_SYSTEM_TABLE *SystemTable, IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE DriverBindingHandle, IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL)
 
EFI_STATUS EFIAPI EfiLibUninstallDriverBindingComponentName2 (IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL)
 
EFI_STATUS EFIAPI EfiLibInstallAllDriverProtocols2 (IN CONST EFI_HANDLE ImageHandle, IN CONST EFI_SYSTEM_TABLE *SystemTable, IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN EFI_HANDLE DriverBindingHandle, IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL, IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration OPTIONAL, IN CONST EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2 OPTIONAL, IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL, IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL)
 
EFI_STATUS EFIAPI EfiLibUninstallAllDriverProtocols2 (IN EFI_DRIVER_BINDING_PROTOCOL *DriverBinding, IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName OPTIONAL, IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2 OPTIONAL, IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration OPTIONAL, IN CONST EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2 OPTIONAL, IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics OPTIONAL, IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2 OPTIONAL)
 

Detailed Description

Library functions that abstract driver model protocols installation and uninstallation.

Copyright (c) 2019, NVIDIA Corporation. All rights reserved. Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file UefiDriverModel.c.

Function Documentation

◆ EfiLibInstallAllDriverProtocols()

EFI_STATUS EFIAPI EfiLibInstallAllDriverProtocols ( IN CONST EFI_HANDLE  ImageHandle,
IN CONST EFI_SYSTEM_TABLE SystemTable,
IN EFI_DRIVER_BINDING_PROTOCOL DriverBinding,
IN EFI_HANDLE  DriverBindingHandle,
IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName  OPTIONAL,
IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration  OPTIONAL,
IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics  OPTIONAL 
)

Installs and completes the initialization of a Driver Binding Protocol instance and optionally installs the Component Name, Driver Configuration and Driver Diagnostics Protocols.

Initializes a driver by installing the Driver Binding Protocol together with the optional Component Name, optional Driver Configure and optional Driver Diagnostic Protocols onto the driver's DriverBindingHandle. If DriverBindingHandle is NULL, then the protocols are installed onto a newly created handle. DriverBindingHandle is typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols. If DriverBinding is NULL, then ASSERT(). If the installation fails, then ASSERT().

Parameters
ImageHandleThe image handle of the driver.
SystemTableThe EFI System Table that was passed to the driver's entry point.
DriverBindingA Driver Binding Protocol instance that this driver is producing.
DriverBindingHandleThe handle that DriverBinding is to be installed onto. If this parameter is NULL, then a new handle is created.
ComponentNameA Component Name Protocol instance that this driver is producing.
DriverConfigurationA Driver Configuration Protocol instance that this driver is producing.
DriverDiagnosticsA Driver Diagnostics Protocol instance that this driver is producing.
Return values
EFI_SUCCESSThe protocol installation successfully completed.
EFI_OUT_OF_RESOURCESThere was not enough memory in pool to install all the protocols.

Definition at line 132 of file UefiDriverModel.c.

◆ EfiLibInstallAllDriverProtocols2()

EFI_STATUS EFIAPI EfiLibInstallAllDriverProtocols2 ( IN CONST EFI_HANDLE  ImageHandle,
IN CONST EFI_SYSTEM_TABLE SystemTable,
IN EFI_DRIVER_BINDING_PROTOCOL DriverBinding,
IN EFI_HANDLE  DriverBindingHandle,
IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName  OPTIONAL,
IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2  OPTIONAL,
IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration  OPTIONAL,
IN CONST EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2  OPTIONAL,
IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics  OPTIONAL,
IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2  OPTIONAL 
)

Installs Driver Binding Protocol with optional Component Name, Component Name 2, Driver Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols.

Initializes a driver by installing the Driver Binding Protocol together with the optional Component Name, optional Component Name 2, optional Driver Configuration, optional Driver Configuration 2, optional Driver Diagnostic, and optional Driver Diagnostic 2 Protocols onto the driver's DriverBindingHandle. DriverBindingHandle is typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols. If DriverBinding is NULL, then ASSERT(). If the installation fails, then ASSERT().

Parameters
ImageHandleThe image handle of the driver.
SystemTableThe EFI System Table that was passed to the driver's entry point.
DriverBindingA Driver Binding Protocol instance that this driver is producing.
DriverBindingHandleThe handle that DriverBinding is to be installed onto. If this parameter is NULL, then a new handle is created.
ComponentNameA Component Name Protocol instance that this driver is producing.
ComponentName2A Component Name 2 Protocol instance that this driver is producing.
DriverConfigurationA Driver Configuration Protocol instance that this driver is producing.
DriverConfiguration2A Driver Configuration Protocol 2 instance that this driver is producing.
DriverDiagnosticsA Driver Diagnostics Protocol instance that this driver is producing.
DriverDiagnostics2A Driver Diagnostics Protocol 2 instance that this driver is producing.
Return values
EFI_SUCCESSThe protocol installation successfully completed.
EFI_OUT_OF_RESOURCESThere was not enough memory in pool to install all the protocols.

Definition at line 586 of file UefiDriverModel.c.

◆ EfiLibInstallDriverBinding()

EFI_STATUS EFIAPI EfiLibInstallDriverBinding ( IN CONST EFI_HANDLE  ImageHandle,
IN CONST EFI_SYSTEM_TABLE SystemTable,
IN EFI_DRIVER_BINDING_PROTOCOL DriverBinding,
IN EFI_HANDLE  DriverBindingHandle 
)

Installs and completes the initialization of a Driver Binding Protocol instance.

Installs the Driver Binding Protocol specified by DriverBinding onto the handle specified by DriverBindingHandle. If DriverBindingHandle is NULL, then DriverBinding is installed onto a newly created handle. DriverBindingHandle is typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols. If DriverBinding is NULL, then ASSERT(). If DriverBinding can not be installed onto a handle, then ASSERT().

Parameters
ImageHandleThe image handle of the driver.
SystemTableThe EFI System Table that was passed to the driver's entry point.
DriverBindingA Driver Binding Protocol instance that this driver is producing.
DriverBindingHandleThe handle that DriverBinding is to be installed onto. If this parameter is NULL, then a new handle is created.
Return values
EFI_SUCCESSThe protocol installation successfully completed.
EFI_OUT_OF_RESOURCESThere was not enough system resources to install the protocol.
OthersStatus from gBS->InstallMultipleProtocolInterfaces().

Definition at line 37 of file UefiDriverModel.c.

◆ EfiLibInstallDriverBindingComponentName2()

EFI_STATUS EFIAPI EfiLibInstallDriverBindingComponentName2 ( IN CONST EFI_HANDLE  ImageHandle,
IN CONST EFI_SYSTEM_TABLE SystemTable,
IN EFI_DRIVER_BINDING_PROTOCOL DriverBinding,
IN EFI_HANDLE  DriverBindingHandle,
IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName  OPTIONAL,
IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2  OPTIONAL 
)

Installs Driver Binding Protocol with optional Component Name and Component Name 2 Protocols.

Initializes a driver by installing the Driver Binding Protocol together with the optional Component Name and optional Component Name 2 protocols onto the driver's DriverBindingHandle. If DriverBindingHandle is NULL, then the protocols are installed onto a newly created handle. DriverBindingHandle is typically the same as the driver's ImageHandle, but it can be different if the driver produces multiple Driver Binding Protocols. If DriverBinding is NULL, then ASSERT(). If the installation fails, then ASSERT().

Parameters
ImageHandleThe image handle of the driver.
SystemTableThe EFI System Table that was passed to the driver's entry point.
DriverBindingA Driver Binding Protocol instance that this driver is producing.
DriverBindingHandleThe handle that DriverBinding is to be installed onto. If this parameter is NULL, then a new handle is created.
ComponentNameA Component Name Protocol instance that this driver is producing.
ComponentName2A Component Name 2 Protocol instance that this driver is producing.
Return values
EFI_SUCCESSThe protocol installation successfully completed.
EFI_OUT_OF_RESOURCESThere was not enough memory in pool to install all the protocols.

Definition at line 410 of file UefiDriverModel.c.

◆ EfiLibUninstallAllDriverProtocols()

EFI_STATUS EFIAPI EfiLibUninstallAllDriverProtocols ( IN EFI_DRIVER_BINDING_PROTOCOL DriverBinding,
IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName  OPTIONAL,
IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration  OPTIONAL,
IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics  OPTIONAL 
)

Uninstalls a Driver Binding Protocol instance and optionally uninstalls the Component Name, Driver Configuration and Driver Diagnostics Protocols.

If DriverBinding is NULL, then ASSERT(). If the uninstallation fails, then ASSERT().

Parameters
DriverBindingA Driver Binding Protocol instance that this driver produced.
ComponentNameA Component Name Protocol instance that this driver produced.
DriverConfigurationA Driver Configuration Protocol instance that this driver produced.
DriverDiagnosticsA Driver Diagnostics Protocol instance that this driver produced.
Return values
EFI_SUCCESSThe protocol uninstallation successfully completed.
OthersStatus from gBS->UninstallMultipleProtocolInterfaces().

Definition at line 272 of file UefiDriverModel.c.

◆ EfiLibUninstallAllDriverProtocols2()

EFI_STATUS EFIAPI EfiLibUninstallAllDriverProtocols2 ( IN EFI_DRIVER_BINDING_PROTOCOL DriverBinding,
IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName  OPTIONAL,
IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2  OPTIONAL,
IN CONST EFI_DRIVER_CONFIGURATION_PROTOCOL *DriverConfiguration  OPTIONAL,
IN CONST EFI_DRIVER_CONFIGURATION2_PROTOCOL *DriverConfiguration2  OPTIONAL,
IN CONST EFI_DRIVER_DIAGNOSTICS_PROTOCOL *DriverDiagnostics  OPTIONAL,
IN CONST EFI_DRIVER_DIAGNOSTICS2_PROTOCOL *DriverDiagnostics2  OPTIONAL 
)

Uninstalls Driver Binding Protocol with optional Component Name, Component Name 2, Driver Configuration, Driver Configuration 2, Driver Diagnostics, and Driver Diagnostics 2 Protocols.

If DriverBinding is NULL, then ASSERT(). If the installation fails, then ASSERT().

Parameters
DriverBindingA Driver Binding Protocol instance that this driver produced.
ComponentNameA Component Name Protocol instance that this driver produced.
ComponentName2A Component Name 2 Protocol instance that this driver produced.
DriverConfigurationA Driver Configuration Protocol instance that this driver produced.
DriverConfiguration2A Driver Configuration Protocol 2 instance that this driver produced.
DriverDiagnosticsA Driver Diagnostics Protocol instance that this driver produced.
DriverDiagnostics2A Driver Diagnostics Protocol 2 instance that this driver produced.
Return values
EFI_SUCCESSThe protocol uninstallation successfully completed.
OthersStatus from gBS->UninstallMultipleProtocolInterfaces().

Definition at line 1597 of file UefiDriverModel.c.

◆ EfiLibUninstallDriverBinding()

EFI_STATUS EFIAPI EfiLibUninstallDriverBinding ( IN EFI_DRIVER_BINDING_PROTOCOL DriverBinding)

Uninstalls a Driver Binding Protocol instance.

If DriverBinding is NULL, then ASSERT(). If DriverBinding can not be uninstalled, then ASSERT().

Parameters
DriverBindingA Driver Binding Protocol instance that this driver produced.
Return values
EFI_SUCCESSThe protocol uninstallation successfully completed.
OthersStatus from gBS->UninstallMultipleProtocolInterfaces().

Definition at line 82 of file UefiDriverModel.c.

◆ EfiLibUninstallDriverBindingComponentName2()

EFI_STATUS EFIAPI EfiLibUninstallDriverBindingComponentName2 ( IN EFI_DRIVER_BINDING_PROTOCOL DriverBinding,
IN CONST EFI_COMPONENT_NAME_PROTOCOL *ComponentName  OPTIONAL,
IN CONST EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2  OPTIONAL 
)

Uninstalls Driver Binding Protocol with optional Component Name and Component Name 2 Protocols.

If DriverBinding is NULL, then ASSERT(). If the uninstallation fails, then ASSERT().

Parameters
DriverBindingA Driver Binding Protocol instance that this driver produced.
ComponentNameA Component Name Protocol instance that this driver produced.
ComponentName2A Component Name 2 Protocol instance that this driver produced.
Return values
EFI_SUCCESSThe protocol installation successfully completed.
OthersStatus from gBS->UninstallMultipleProtocolInterfaces().

Definition at line 495 of file UefiDriverModel.c.