17.3 Bus Specific Driver Override Protocol Installation

The example below shows a fragment from the Driver Binding Protocol Start() that installs the Bus Specific Driver Override Protocol instance onto a child handle produced by the bus driver.

Example 165-Install Bus Specific Driver Override Protocol

#include <Uefi.h>
#include <Protocol/DriverBinding.h>
#include <Protocol/BusSpecificDriverOverride.h>
#include <Library/UefiBootServicesTableLib.h>
EFI_STATUS EFIAPI
AbcStart (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
)
{
EFI_STATUS Status;
ABC_PRIVATE_DATA *Private;
EFI_HANDLE ChildHandle;
. .
Status = gBS->InstallMultipleProtocolInterfaces (
ChildHandle,
&gEfiBusSpecificDriverOverrideProtocolGuid,
&Private->BusSpecificDriverOverride,
NULL
);
. .
}

The following example shows a fragment from the Driver Binding Protocol Stop() function that uninstalls the Bus Specific Driver Override Protocol instance from a child handle produced by the bus driver.

Example 166-Uninstall Bus Specific Driver Override Protocol

#include <Uefi.h>
#include <Protocol/DriverBinding.h>
#include <Protocol/BusSpecificDriverOverride.h>
#include <Library/UefiBootServicesTableLib.h>
EFI_STATUS
EFIAPI
AbcStop (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle,
IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer
)
{
EFI_STATUS Status;
ABC_PRIVATE_DATA *Private;
EFI_HANDLE ChildHandle;
. .
Status = gBS->UninstallMultipleProtocolInterfaces (
ChildHandle,
&gEfiBusSpecificDriverOverrideProtocolGuid,
&Private->BusSpecificDriverOverride,
NULL
);
. .
}