]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Protocol/PlatformDriverOverride.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / PlatformDriverOverride.h
... / ...
CommitLineData
1/** @file\r
2 Platform Driver Override protocol as defined in the UEFI 2.1 specification.\r
3\r
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
6\r
7**/\r
8\r
9#ifndef __EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_H__\r
10#define __EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_H__\r
11\r
12///\r
13/// Global ID for the Platform Driver Override Protocol\r
14///\r
15#define EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID \\r
16 { \\r
17 0x6b30c738, 0xa391, 0x11d4, {0x9a, 0x3b, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
18 }\r
19\r
20typedef struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL;\r
21\r
22//\r
23// Prototypes for the Platform Driver Override Protocol\r
24//\r
25\r
26/**\r
27 Retrieves the image handle of the platform override driver for a controller in the system.\r
28\r
29 @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_\r
30 PROTOCOL instance.\r
31 @param ControllerHandle The device handle of the controller to check if a driver override\r
32 exists.\r
33 @param DriverImageHandle On input, a pointer to the previous driver image handle returned\r
34 by GetDriver(). On output, a pointer to the next driver\r
35 image handle.\r
36\r
37 @retval EFI_SUCCESS The driver override for ControllerHandle was returned in\r
38 DriverImageHandle.\r
39 @retval EFI_NOT_FOUND A driver override for ControllerHandle was not found.\r
40 @retval EFI_INVALID_PARAMETER The handle specified by ControllerHandle is NULL.\r
41 @retval EFI_INVALID_PARAMETER DriverImageHandle is not a handle that was returned on a\r
42 previous call to GetDriver().\r
43\r
44**/\r
45typedef\r
46EFI_STATUS\r
47(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER)(\r
48 IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,\r
49 IN EFI_HANDLE ControllerHandle,\r
50 IN OUT EFI_HANDLE *DriverImageHandle\r
51 );\r
52\r
53/**\r
54 Retrieves the device path of the platform override driver for a controller in the system.\r
55\r
56 @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL instance.\r
57 @param ControllerHandle The device handle of the controller to check if a driver override\r
58 exists.\r
59 @param DriverImagePath On input, a pointer to the previous driver device path returned by\r
60 GetDriverPath(). On output, a pointer to the next driver\r
61 device path. Passing in a pointer to NULL will return the first\r
62 driver device path for ControllerHandle.\r
63\r
64 @retval EFI_SUCCESS The driver override for ControllerHandle was returned in\r
65 DriverImageHandle.\r
66 @retval EFI_UNSUPPORTED The operation is not supported.\r
67 @retval EFI_NOT_FOUND A driver override for ControllerHandle was not found.\r
68 @retval EFI_INVALID_PARAMETER The handle specified by ControllerHandle is NULL.\r
69 @retval EFI_INVALID_PARAMETER DriverImagePath is not a device path that was returned on a\r
70 previous call to GetDriverPath().\r
71\r
72**/\r
73typedef\r
74EFI_STATUS\r
75(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH)(\r
76 IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,\r
77 IN EFI_HANDLE ControllerHandle,\r
78 IN OUT EFI_DEVICE_PATH_PROTOCOL **DriverImagePath\r
79 );\r
80\r
81/**\r
82 Used to associate a driver image handle with a device path that was returned on a prior call to the\r
83 GetDriverPath() service. This driver image handle will then be available through the\r
84 GetDriver() service.\r
85\r
86 @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_\r
87 PROTOCOL instance.\r
88 @param ControllerHandle The device handle of the controller.\r
89 @param DriverImagePath A pointer to the driver device path that was returned in a prior\r
90 call to GetDriverPath().\r
91 @param DriverImageHandle The driver image handle that was returned by LoadImage()\r
92 when the driver specified by DriverImagePath was loaded\r
93 into memory.\r
94\r
95 @retval EFI_SUCCESS The association between DriverImagePath and\r
96 DriverImageHandle was established for the controller specified\r
97 by ControllerHandle.\r
98 @retval EFI_UNSUPPORTED The operation is not supported.\r
99 @retval EFI_NOT_FOUND DriverImagePath is not a device path that was returned on a prior\r
100 call to GetDriverPath() for the controller specified by\r
101 ControllerHandle.\r
102 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
103 @retval EFI_INVALID_PARAMETER DriverImagePath is not a valid device path.\r
104 @retval EFI_INVALID_PARAMETER DriverImageHandle is not a valid image handle.\r
105\r
106**/\r
107typedef\r
108EFI_STATUS\r
109(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED)(\r
110 IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,\r
111 IN EFI_HANDLE ControllerHandle,\r
112 IN EFI_DEVICE_PATH_PROTOCOL *DriverImagePath,\r
113 IN EFI_HANDLE DriverImageHandle\r
114 );\r
115\r
116///\r
117/// This protocol matches one or more drivers to a controller. A platform driver\r
118/// produces this protocol, and it is installed on a separate handle. This protocol\r
119/// is used by the ConnectController() boot service to select the best driver\r
120/// for a controller. All of the drivers returned by this protocol have a higher\r
121/// precedence than drivers found from an EFI Bus Specific Driver Override Protocol\r
122/// or drivers found from the general UEFI driver Binding search algorithm. If more\r
123/// than one driver is returned by this protocol, then the drivers are returned in\r
124/// order from highest precedence to lowest precedence.\r
125///\r
126struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL {\r
127 EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER GetDriver;\r
128 EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH GetDriverPath;\r
129 EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED DriverLoaded;\r
130};\r
131\r
132extern EFI_GUID gEfiPlatformDriverOverrideProtocolGuid;\r
133\r
134#endif\r