TianoCore EDK2 master
Loading...
Searching...
No Matches
DriverSupport.c File Reference
#include "DxeMain.h"
#include "Handle.h"

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI CoreConnectController (IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE *DriverImageHandle OPTIONAL, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL, IN BOOLEAN Recursive)
 
VOID AddSortedDriverBindingProtocol (IN EFI_HANDLE DriverBindingHandle, IN OUT UINTN *NumberOfSortedDriverBindingProtocols, IN OUT EFI_DRIVER_BINDING_PROTOCOL **SortedDriverBindingProtocols, IN UINTN DriverBindingHandleCount, IN OUT EFI_HANDLE *DriverBindingHandleBuffer, IN BOOLEAN IsImageHandle)
 
EFI_STATUS CoreConnectSingleController (IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE *ContextDriverImageHandles OPTIONAL, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL)
 
EFI_STATUS EFIAPI CoreDisconnectController (IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE DriverImageHandle OPTIONAL, IN EFI_HANDLE ChildHandle OPTIONAL)
 

Detailed Description

Support functions to connect/disconnect UEFI Driver model Protocol

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

Definition in file DriverSupport.c.

Function Documentation

◆ AddSortedDriverBindingProtocol()

VOID AddSortedDriverBindingProtocol ( IN EFI_HANDLE  DriverBindingHandle,
IN OUT UINTN NumberOfSortedDriverBindingProtocols,
IN OUT EFI_DRIVER_BINDING_PROTOCOL **  SortedDriverBindingProtocols,
IN UINTN  DriverBindingHandleCount,
IN OUT EFI_HANDLE DriverBindingHandleBuffer,
IN BOOLEAN  IsImageHandle 
)

Add Driver Binding Protocols from Context Driver Image Handles to sorted Driver Binding Protocol list.

Parameters
DriverBindingHandleHandle of the driver binding protocol.
NumberOfSortedDriverBindingProtocolsNumber Of sorted driver binding protocols
SortedDriverBindingProtocolsThe sorted protocol list.
DriverBindingHandleCountDriver Binding Handle Count.
DriverBindingHandleBufferThe buffer of driver binding protocol to be modified.
IsImageHandleIndicate whether DriverBindingHandle is an image handle
Returns
None.

Definition at line 262 of file DriverSupport.c.

◆ CoreConnectController()

EFI_STATUS EFIAPI CoreConnectController ( IN EFI_HANDLE  ControllerHandle,
IN EFI_HANDLE *DriverImageHandle  OPTIONAL,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath  OPTIONAL,
IN BOOLEAN  Recursive 
)

Connects one or more drivers to a controller.

Parameters
ControllerHandleThe handle of the controller to which driver(s) are to be connected.
DriverImageHandleA pointer to an ordered list handles that support the EFI_DRIVER_BINDING_PROTOCOL.
RemainingDevicePathA pointer to the device path that specifies a child of the controller specified by ControllerHandle.
RecursiveIf TRUE, then ConnectController() is called recursively until the entire tree of controllers below the controller specified by ControllerHandle have been created. If FALSE, then the tree of controllers is only expanded one level.
Return values
EFI_SUCCESS1) One or more drivers were connected to ControllerHandle. 2) No drivers were connected to ControllerHandle, but RemainingDevicePath is not NULL, and it is an End Device Path Node.
EFI_INVALID_PARAMETERControllerHandle is NULL.
EFI_NOT_FOUND1) There are no EFI_DRIVER_BINDING_PROTOCOL instances present in the system. 2) No drivers were connected to ControllerHandle.
EFI_SECURITY_VIOLATIONThe user has no permission to start UEFI device drivers on the device path associated with the ControllerHandle or specified by the RemainingDevicePath.

Definition at line 44 of file DriverSupport.c.

◆ CoreConnectSingleController()

EFI_STATUS CoreConnectSingleController ( IN EFI_HANDLE  ControllerHandle,
IN EFI_HANDLE *ContextDriverImageHandles  OPTIONAL,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath  OPTIONAL 
)

Connects a controller to a driver.

Parameters
ControllerHandleHandle of the controller to be connected.
ContextDriverImageHandlesDriverImageHandle A pointer to an ordered list of driver image handles.
RemainingDevicePathRemainingDevicePath A pointer to the device path that specifies a child of the controller specified by ControllerHandle.
Return values
EFI_SUCCESSOne or more drivers were connected to ControllerHandle.
EFI_OUT_OF_RESOURCESNo enough system resources to complete the request.
EFI_NOT_FOUNDNo drivers were connected to ControllerHandle.

Definition at line 393 of file DriverSupport.c.

◆ CoreDisconnectController()

EFI_STATUS EFIAPI CoreDisconnectController ( IN EFI_HANDLE  ControllerHandle,
IN EFI_HANDLE DriverImageHandle  OPTIONAL,
IN EFI_HANDLE ChildHandle  OPTIONAL 
)

Disonnects a controller from a driver

Parameters
ControllerHandleControllerHandle The handle of the controller from which driver(s) are to be disconnected.
DriverImageHandleDriverImageHandle The driver to disconnect from ControllerHandle.
ChildHandleChildHandle The handle of the child to destroy.
Return values
EFI_SUCCESSOne or more drivers were disconnected from the controller.
EFI_SUCCESSOn entry, no drivers are managing ControllerHandle.
EFI_SUCCESSDriverImageHandle is not NULL, and on entry DriverImageHandle is not managing ControllerHandle.
EFI_INVALID_PARAMETERControllerHandle is NULL.
EFI_INVALID_PARAMETERDriverImageHandle is not NULL, and it is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETERChildHandle is not NULL, and it is not a valid EFI_HANDLE.
EFI_OUT_OF_RESOURCESThere are not enough resources available to disconnect any drivers from ControllerHandle.
EFI_DEVICE_ERRORThe controller could not be disconnected because of a device error.

Definition at line 737 of file DriverSupport.c.