]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/PlatformDriverOverride.h
Remove ASSERT (TotalSize <= sizeof (Buffer));
[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
4ca9b6c4 4 Copyright (c) 2006 - 2008, Intel Corporation \r
d1f95000 5 All rights reserved. This program and the accompanying materials \r
6 are licensed and made available under the terms and conditions of the BSD License \r
7 which accompanies this distribution. The full text of the license may be found at \r
8 http://opensource.org/licenses/bsd-license.php \r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
12\r
d1f95000 13**/\r
14\r
15#ifndef __EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_H__\r
16#define __EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_H__\r
17\r
99e8ed21 18///\r
19/// Global ID for the Platform Driver Override Protocol\r
20///\r
d1f95000 21#define EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL_GUID \\r
22 { \\r
23 0x6b30c738, 0xa391, 0x11d4, {0x9a, 0x3b, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \\r
24 }\r
25\r
26typedef struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL;\r
27\r
28//\r
29// Prototypes for the Platform Driver Override Protocol\r
30//\r
31\r
32/** \r
33 Retrieves the image handle of the platform override driver for a controller in the system.\r
34 \r
35 @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_\r
36 PROTOCOL instance. \r
37 @param ControllerHandle The device handle of the controller to check if a driver override\r
38 exists. \r
39 @param DriverImageHandle On input, a pointer to the previous driver image handle returned\r
40 by GetDriver(). On output, a pointer to the next driver \r
41 image handle. \r
42 \r
43 @retval EFI_SUCCESS The driver override for ControllerHandle was returned in\r
44 DriverImageHandle. \r
45 @retval EFI_NOT_FOUND A driver override for ControllerHandle was not found.\r
46 @retval EFI_INVALID_PARAMETER The handle specified by ControllerHandle is not a valid handle.\r
47 @retval EFI_INVALID_PARAMETER DriverImageHandle is not a handle that was returned on a\r
48 previous call to GetDriver(). \r
49 \r
50**/\r
51typedef\r
52EFI_STATUS\r
8b13229b 53(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER)(\r
d1f95000 54 IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,\r
55 IN EFI_HANDLE ControllerHandle,\r
56 IN OUT EFI_HANDLE *DriverImageHandle\r
57 );\r
58\r
59/** \r
60 Retrieves the device path of the platform override driver for a controller in the system.\r
61 \r
62 @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_\r
63 PROTOCOL instance. \r
64 @param ControllerHandle The device handle of the controller to check if a driver override\r
65 exists. \r
1f25dacf
LG
66 @param DriverImagePath On input, a pointer to the previous driver device path returned by\r
67 GetDriverPath(). On output, a pointer to the next driver\r
68 device path. Passing in a pointer to NULL, will return the first\r
69 driver device path for ControllerHandle.\r
d1f95000 70 \r
71 @retval EFI_SUCCESS The driver override for ControllerHandle was returned in\r
72 DriverImageHandle. \r
73 @retval EFI_UNSUPPORTED The operation is not supported. \r
74 @retval EFI_NOT_FOUND A driver override for ControllerHandle was not found.\r
75 @retval EFI_INVALID_PARAMETER The handle specified by ControllerHandle is not a valid handle.\r
76 @retval EFI_INVALID_PARAMETER DriverImagePath is not a device path that was returned on a\r
77 previous call to GetDriverPath(). \r
78 \r
79**/\r
80typedef\r
81EFI_STATUS\r
8b13229b 82(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH)(\r
d1f95000 83 IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,\r
84 IN EFI_HANDLE ControllerHandle,\r
85 IN OUT EFI_DEVICE_PATH_PROTOCOL **DriverImagePath\r
86 );\r
87\r
88/** \r
89 Used to associate a driver image handle with a device path that was returned on a prior call to the\r
90 GetDriverPath() service. This driver image handle will then be available through the \r
91 GetDriver() service. \r
92 \r
93 @param This A pointer to the EFI_PLATFORM_DRIVER_OVERRIDE_\r
94 PROTOCOL instance. \r
95 @param ControllerHandle The device handle of the controller. \r
96 @param DriverImagePath A pointer to the driver device path that was returned in a prior\r
97 call to GetDriverPath(). \r
98 @param DriverImageHandle The driver image handle that was returned by LoadImage()\r
99 when the driver specified by DriverImagePath was loaded \r
100 into memory. \r
101 \r
102 @retval EFI_SUCCESS The association between DriverImagePath and \r
103 DriverImageHandle was established for the controller specified\r
104 by ControllerHandle. \r
105 @retval EFI_UNSUPPORTED The operation is not supported. \r
106 @retval EFI_NOT_FOUND DriverImagePath is not a device path that was returned on a prior\r
107 call to GetDriverPath() for the controller specified by \r
108 ControllerHandle. \r
109 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid device handle.\r
110 @retval EFI_INVALID_PARAMETER DriverImagePath is not a valid device path.\r
111 @retval EFI_INVALID_PARAMETER DriverImageHandle is not a valid image handle.\r
112 \r
113**/\r
114typedef\r
115EFI_STATUS\r
8b13229b 116(EFIAPI *EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED)(\r
d1f95000 117 IN EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL *This,\r
118 IN EFI_HANDLE ControllerHandle,\r
119 IN EFI_DEVICE_PATH_PROTOCOL *DriverImagePath,\r
120 IN EFI_HANDLE DriverImageHandle\r
121 );\r
122\r
44717a39 123///\r
124/// This protocol matches one or more drivers to a controller. A platform driver \r
125/// produces this protocol, and it is installed on a separate handle. This protocol \r
126/// is used by the ConnectController() boot service to select the best driver \r
127/// for a controller. All of the drivers returned by this protocol have a higher \r
128/// precedence than drivers found from an EFI Bus Specific Driver Override Protocol \r
129/// or drivers found from the general UEFI driver Binding search algorithm. If more \r
130/// than one driver is returned by this protocol, then the drivers are returned in \r
131/// order from highest precedence to lowest precedence.\r
132///\r
d1f95000 133struct _EFI_PLATFORM_DRIVER_OVERRIDE_PROTOCOL {\r
134 EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER GetDriver;\r
135 EFI_PLATFORM_DRIVER_OVERRIDE_GET_DRIVER_PATH GetDriverPath;\r
136 EFI_PLATFORM_DRIVER_OVERRIDE_DRIVER_LOADED DriverLoaded;\r
137};\r
138\r
139extern EFI_GUID gEfiPlatformDriverOverrideProtocolGuid;\r
140\r
141#endif\r