]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Bus/Pci/PciBusDxe/PciDriverOverride.h
f0679c51ec68905fa403f2deb33107b0f97170a9
[mirror_edk2.git] / MdeModulePkg / Bus / Pci / PciBusDxe / PciDriverOverride.h
1 /** @file
2 Functions declaration for Bus Specific Driver Override protoocl.
3
4 Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15
16 #ifndef _EFI_PCI_DRIVER_OVERRRIDE_H_
17 #define _EFI_PCI_DRIVER_OVERRRIDE_H_
18
19 #define DRIVER_OVERRIDE_SIGNATURE SIGNATURE_32 ('d', 'r', 'o', 'v')
20
21 //
22 // PCI driver override driver image list
23 //
24 typedef struct {
25 UINT32 Signature;
26 LIST_ENTRY Link;
27 EFI_HANDLE DriverImageHandle;
28 EFI_DEVICE_PATH_PROTOCOL *DriverImagePath;
29 } PCI_DRIVER_OVERRIDE_LIST;
30
31
32 #define DRIVER_OVERRIDE_FROM_LINK(a) \
33 CR (a, PCI_DRIVER_OVERRIDE_LIST, Link, DRIVER_OVERRIDE_SIGNATURE)
34
35 /**
36 Initializes a PCI Driver Override Instance.
37
38 @param PciIoDevice PCI Device instance.
39
40 **/
41 VOID
42 InitializePciDriverOverrideInstance (
43 IN OUT PCI_IO_DEVICE *PciIoDevice
44 );
45
46 /**
47 Add an overriding driver image.
48
49 @param PciIoDevice Instance of PciIo device.
50 @param DriverImageHandle Image handle of newly added driver image.
51 @param DriverImagePath Device path of newly added driver image.
52
53 @retval EFI_SUCCESS Successfully added driver.
54 @retval EFI_OUT_OF_RESOURCES No memory resource for new driver instance.
55 @retval other Some error occurred when locating gEfiLoadedImageProtocolGuid.
56
57 **/
58 EFI_STATUS
59 AddDriver (
60 IN PCI_IO_DEVICE *PciIoDevice,
61 IN EFI_HANDLE DriverImageHandle,
62 IN EFI_DEVICE_PATH_PROTOCOL *DriverImagePath
63 );
64
65
66 /**
67 Uses a bus specific algorithm to retrieve a driver image handle for a controller.
68
69 @param This A pointer to the EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL instance.
70 @param DriverImageHandle On input, a pointer to the previous driver image handle returned
71 by GetDriver(). On output, a pointer to the next driver
72 image handle. Passing in a NULL, will return the first driver
73 image handle.
74
75 @retval EFI_SUCCESS A bus specific override driver is returned in DriverImageHandle.
76 @retval EFI_NOT_FOUND The end of the list of override drivers was reached.
77 A bus specific override driver is not returned in DriverImageHandle.
78 @retval EFI_INVALID_PARAMETER DriverImageHandle is not a handle that was returned on a
79 previous call to GetDriver().
80
81 **/
82 EFI_STATUS
83 EFIAPI
84 GetDriver (
85 IN EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL *This,
86 IN OUT EFI_HANDLE *DriverImageHandle
87 );
88
89 #endif