]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/PlatformDriverOverride.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / PlatformDriverOverride.h
CommitLineData
d1f95000 1/** @file\r
8a7d75b0 2 Platform Driver Override protocol as defined in the UEFI 2.1 specification.\r
d1f95000 3\r
9095d37b 4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
d1f95000 6\r
d1f95000 7**/\r
8\r
9#ifndef __EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_H__\r
10#define __EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_H__\r
11\r
99e8ed21 12///\r
13/// Global ID for the Platform Driver Override Protocol\r
14///\r
d1f95000 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
9095d37b 26/**\r
d1f95000 27 Retrieves the image handle of the platform override driver for a controller in the system.\r
9095d37b 28\r
d1f95000 29 @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_\r
9095d37b 30 PROTOCOL instance.\r
d1f95000 31 @param ControllerHandle The device handle of the controller to check if a driver override\r
9095d37b 32 exists.\r
d1f95000 33 @param DriverImageHandle On input, a pointer to the previous driver image handle returned\r
9095d37b
LG
34 by GetDriver(). On output, a pointer to the next driver\r
35 image handle.\r
36\r
d1f95000 37 @retval EFI_SUCCESS The driver override for ControllerHandle was returned in\r
9095d37b 38 DriverImageHandle.\r
d1f95000 39 @retval EFI_NOT_FOUND A driver override for ControllerHandle was not found.\r
d9de7921 40 @retval EFI_INVALID_PARAMETER The handle specified by ControllerHandle is NULL.\r
d1f95000 41 @retval EFI_INVALID_PARAMETER DriverImageHandle is not a handle that was returned on a\r
9095d37b
LG
42 previous call to GetDriver().\r
43\r
d1f95000 44**/\r
45typedef\r
46EFI_STATUS\r
8b13229b 47(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER)(\r
d1f95000 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
9095d37b 53/**\r
d1f95000 54 Retrieves the device path of the platform override driver for a controller in the system.\r
9095d37b 55\r
d9de7921 56 @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL instance.\r
d1f95000 57 @param ControllerHandle The device handle of the controller to check if a driver override\r
9095d37b 58 exists.\r
1f25dacf
LG
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
630b4187 61 device path. Passing in a pointer to NULL will return the first\r
1f25dacf 62 driver device path for ControllerHandle.\r
9095d37b 63\r
d1f95000 64 @retval EFI_SUCCESS The driver override for ControllerHandle was returned in\r
9095d37b
LG
65 DriverImageHandle.\r
66 @retval EFI_UNSUPPORTED The operation is not supported.\r
d1f95000 67 @retval EFI_NOT_FOUND A driver override for ControllerHandle was not found.\r
d9de7921 68 @retval EFI_INVALID_PARAMETER The handle specified by ControllerHandle is NULL.\r
d1f95000 69 @retval EFI_INVALID_PARAMETER DriverImagePath is not a device path that was returned on a\r
9095d37b
LG
70 previous call to GetDriverPath().\r
71\r
d1f95000 72**/\r
73typedef\r
74EFI_STATUS\r
8b13229b 75(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH)(\r
d1f95000 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
9095d37b 81/**\r
d1f95000 82 Used to associate a driver image handle with a device path that was returned on a prior call to the\r
9095d37b
LG
83 GetDriverPath() service. This driver image handle will then be available through the\r
84 GetDriver() service.\r
85\r
d1f95000 86 @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_\r
9095d37b
LG
87 PROTOCOL instance.\r
88 @param ControllerHandle The device handle of the controller.\r
d1f95000 89 @param DriverImagePath A pointer to the driver device path that was returned in a prior\r
9095d37b 90 call to GetDriverPath().\r
d1f95000 91 @param DriverImageHandle The driver image handle that was returned by LoadImage()\r
9095d37b
LG
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
d1f95000 96 DriverImageHandle was established for the controller specified\r
9095d37b
LG
97 by ControllerHandle.\r
98 @retval EFI_UNSUPPORTED The operation is not supported.\r
d1f95000 99 @retval EFI_NOT_FOUND DriverImagePath is not a device path that was returned on a prior\r
9095d37b
LG
100 call to GetDriverPath() for the controller specified by\r
101 ControllerHandle.\r
d9de7921 102 @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
d1f95000 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
9095d37b 105\r
d1f95000 106**/\r
107typedef\r
108EFI_STATUS\r
8b13229b 109(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED)(\r
d1f95000 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
44717a39 116///\r
9095d37b
LG
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
44717a39 124/// order from highest precedence to lowest precedence.\r
125///\r
d1f95000 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