]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Bus/Pci/PciBusDxe/PciDriverOverride.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciDriverOverride.h
1 /** @file
2 Functions declaration for Bus Specific Driver Override protocol.
3
4 Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9
10 #ifndef _EFI_PCI_DRIVER_OVERRRIDE_H_
11 #define _EFI_PCI_DRIVER_OVERRRIDE_H_
12
13 #define DRIVER_OVERRIDE_SIGNATURE SIGNATURE_32 ('d', 'r', 'o', 'v')
14
15 //
16 // PCI driver override driver image list
17 //
18 typedef struct {
19 UINT32 Signature;
20 LIST_ENTRY Link;
21 EFI_HANDLE DriverImageHandle;
22 EFI_DEVICE_PATH_PROTOCOL *DriverImagePath;
23 } PCI_DRIVER_OVERRIDE_LIST;
24
25
26 #define DRIVER_OVERRIDE_FROM_LINK(a) \
27 CR (a, PCI_DRIVER_OVERRIDE_LIST, Link, DRIVER_OVERRIDE_SIGNATURE)
28
29 /**
30 Initializes a PCI Driver Override Instance.
31
32 @param PciIoDevice PCI Device instance.
33
34 **/
35 VOID
36 InitializePciDriverOverrideInstance (
37 IN OUT PCI_IO_DEVICE *PciIoDevice
38 );
39
40 /**
41 Add an overriding driver image.
42
43 @param PciIoDevice Instance of PciIo device.
44 @param DriverImageHandle Image handle of newly added driver image.
45 @param DriverImagePath Device path of newly added driver image.
46
47 @retval EFI_SUCCESS Successfully added driver.
48 @retval EFI_OUT_OF_RESOURCES No memory resource for new driver instance.
49 @retval other Some error occurred when locating gEfiLoadedImageProtocolGuid.
50
51 **/
52 EFI_STATUS
53 AddDriver (
54 IN PCI_IO_DEVICE *PciIoDevice,
55 IN EFI_HANDLE DriverImageHandle,
56 IN EFI_DEVICE_PATH_PROTOCOL *DriverImagePath
57 );
58
59
60 /**
61 Uses a bus specific algorithm to retrieve a driver image handle for a controller.
62
63 @param This A pointer to the EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL instance.
64 @param DriverImageHandle On input, a pointer to the previous driver image handle returned
65 by GetDriver(). On output, a pointer to the next driver
66 image handle. Passing in a NULL, will return the first driver
67 image handle.
68
69 @retval EFI_SUCCESS A bus specific override driver is returned in DriverImageHandle.
70 @retval EFI_NOT_FOUND The end of the list of override drivers was reached.
71 A bus specific override driver is not returned in DriverImageHandle.
72 @retval EFI_INVALID_PARAMETER DriverImageHandle is not a handle that was returned on a
73 previous call to GetDriver().
74
75 **/
76 EFI_STATUS
77 EFIAPI
78 GetDriver (
79 IN EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL *This,
80 IN OUT EFI_HANDLE *DriverImageHandle
81 );
82
83 #endif