]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/DriverConfiguration2.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / DriverConfiguration2.h
CommitLineData
f22a5f43 1/** @file\r
4ca9b6c4 2 UEFI Driver Configuration2 Protocol\r
f22a5f43 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
f22a5f43 6\r
f22a5f43 7**/\r
8\r
e30e5a72 9#ifndef __EFI_DRIVER_CONFIGURATION2_H__\r
10#define __EFI_DRIVER_CONFIGURATION2_H__\r
f22a5f43 11\r
99e8ed21 12///\r
13/// Global ID for the Driver Configuration Protocol defined in UEFI 2.0\r
14///\r
f22a5f43 15#define EFI_DRIVER_CONFIGURATION2_PROTOCOL_GUID \\r
16 { \\r
17 0xbfd7dc1d, 0x24f1, 0x40d9, {0x82, 0xe7, 0x2e, 0x09, 0xbb, 0x6b, 0x4e, 0xbe } \\r
18 }\r
9095d37b 19\r
f22a5f43 20typedef struct _EFI_DRIVER_CONFIGURATION2_PROTOCOL EFI_DRIVER_CONFIGURATION2_PROTOCOL;\r
21\r
22typedef enum {\r
9319d2c2
LG
23 ///\r
24 /// The controller is still in a usable state. No actions\r
25 /// are required before this controller can be used again.\r
26 ///\r
f22a5f43 27 EfiDriverConfigurationActionNone = 0,\r
9319d2c2
LG
28 ///\r
29 /// The driver has detected that the controller is not in a\r
30 /// usable state, and it needs to be stopped.\r
31 ///\r
f22a5f43 32 EfiDriverConfigurationActionStopController = 1,\r
9319d2c2
LG
33 ///\r
34 /// This controller needs to be stopped and restarted\r
35 /// before it can be used again.\r
36 ///\r
f22a5f43 37 EfiDriverConfigurationActionRestartController = 2,\r
9319d2c2
LG
38 ///\r
39 /// A configuration change has been made that requires the platform to be restarted before\r
40 /// the controller can be used again.\r
41 ///\r
f22a5f43 42 EfiDriverConfigurationActionRestartPlatform = 3,\r
43 EfiDriverConfigurationActionMaximum\r
44} EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED;\r
45\r
46#define EFI_DRIVER_CONFIGURATION_SAFE_DEFAULTS 0x00000000\r
47#define EFI_DRIVER_CONFIGURATION_MANUFACTURING_DEFAULTS 0x00000001\r
48#define EFI_DRIVER_CONFIGURATION_CUSTOM_DEFAULTS 0x00000002\r
49#define EFI_DRIVER_CONFIGURATION_PERORMANCE_DEFAULTS 0x00000003\r
50\r
51/**\r
9095d37b 52 Allows the user to set controller specific options for a controller that a\r
f22a5f43 53 driver is currently managing.\r
54\r
4ca9b6c4 55 @param This A pointer to the EFI_DRIVER_CONFIGURATION2_PROTOCOL instance.\r
f22a5f43 56 @param ControllerHandle The handle of the controller to set options on.\r
57 @param ChildHandle The handle of the child controller to set options on. This\r
58 is an optional parameter that may be NULL. It will be NULL\r
630b4187 59 for device drivers, and for bus drivers that wish to set\r
f22a5f43 60 options for the bus controller. It will not be NULL for a\r
61 bus driver that wishes to set options for one of its child\r
62 controllers.\r
7eb05636 63 @param Language A Null-terminated ASCII string that contains one or more RFC 4646\r
4ca9b6c4
LG
64 language codes. This is the list of language codes that this\r
65 protocol supports. The number of languages\r
f22a5f43 66 supported by a driver is up to the driver writer.\r
67 @param ActionRequired A pointer to the action that the calling agent is required\r
68 to perform when this function returns. See "Related\r
69 Definitions" for a list of the actions that the calling\r
70 agent is required to perform prior to accessing\r
71 ControllerHandle again.\r
72\r
73 @retval EFI_SUCCESS The driver specified by This successfully set the\r
74 configuration options for the controller specified\r
630b4187 75 by ControllerHandle.\r
f22a5f43 76 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
77 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
78 @retval EFI_INVALID_PARAMETER ActionRequired is NULL.\r
79 @retval EFI_UNSUPPORTED The driver specified by This does not support setting\r
80 configuration options for the controller specified by\r
81 ControllerHandle and ChildHandle.\r
82 @retval EFI_UNSUPPORTED The driver specified by This does not support the\r
83 language specified by Language.\r
630b4187 84 @retval EFI_DEVICE_ERROR A device error occurred while attempting to set the\r
f22a5f43 85 configuration options for the controller specified\r
86 by ControllerHandle and ChildHandle.\r
87 @retval EFI_OUT_RESOURCES There are not enough resources available to set the\r
88 configuration options for the controller specified\r
89 by ControllerHandle and ChildHandle.\r
90\r
91**/\r
92typedef\r
93EFI_STATUS\r
8b13229b 94(EFIAPI *EFI_DRIVER_CONFIGURATION2_SET_OPTIONS)(\r
f22a5f43 95 IN EFI_DRIVER_CONFIGURATION2_PROTOCOL *This,\r
96 IN EFI_HANDLE ControllerHandle,\r
97 IN EFI_HANDLE ChildHandle OPTIONAL,\r
98 IN CHAR8 *Language,\r
99 OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired\r
100 );\r
101\r
102/**\r
103 Tests to see if a controller's current configuration options are valid.\r
104\r
4ca9b6c4 105 @param This A pointer to the EFI_DRIVER_CONFIGURATION2_PROTOCOL instance.\r
f22a5f43 106 @param ControllerHandle The handle of the controller to test if it's current\r
107 configuration options are valid.\r
108 @param ChildHandle The handle of the child controller to test if it's current\r
109 configuration options are valid. This is an optional\r
110 parameter that may be NULL. It will be NULL for device\r
630b4187 111 drivers. It will also be NULL for bus drivers that wish\r
f22a5f43 112 to test the configuration options for the bus controller.\r
113 It will not be NULL for a bus driver that wishes to test\r
114 configuration options for one of its child controllers.\r
115\r
116 @retval EFI_SUCCESS The controller specified by ControllerHandle and\r
117 ChildHandle that is being managed by the driver\r
118 specified by This has a valid set of configuration\r
119 options.\r
120 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
121 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
122 @retval EFI_UNSUPPORTED The driver specified by This is not currently\r
123 managing the controller specified by ControllerHandle\r
124 and ChildHandle.\r
125 @retval EFI_DEVICE_ERROR The controller specified by ControllerHandle and\r
126 ChildHandle that is being managed by the driver\r
127 specified by This has an invalid set of configuration\r
128 options.\r
129\r
130**/\r
131typedef\r
132EFI_STATUS\r
8b13229b 133(EFIAPI *EFI_DRIVER_CONFIGURATION2_OPTIONS_VALID)(\r
f22a5f43 134 IN EFI_DRIVER_CONFIGURATION2_PROTOCOL *This,\r
135 IN EFI_HANDLE ControllerHandle,\r
136 IN EFI_HANDLE ChildHandle OPTIONAL\r
137 );\r
138\r
139/**\r
140 Forces a driver to set the default configuration options for a controller.\r
141\r
4ca9b6c4 142 @param This A pointer to the EFI_DRIVER_CONFIGURATION2_PROTOCOL instance.\r
f22a5f43 143 @param ControllerHandle The handle of the controller to force default configuration options on.\r
630b4187 144 @param ChildHandle The handle of the child controller to force default configuration options on This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for bus drivers that wish to force default configuration options for the bus controller. It will not be NULL for a bus driver that wishes to force default configuration options for one of its child controllers.\r
f22a5f43 145 @param DefaultType The type of default configuration options to force on the controller specified by ControllerHandle and ChildHandle. See Table 9-1 for legal values. A DefaultType of 0x00000000 must be supported by this protocol.\r
630b4187 146 @param ActionRequired A pointer to the action that the calling agent is required to perform when this function returns. See "Related Definitions" in Section 9.1 for a list of the actions that the calling agent is required to perform prior to accessing ControllerHandle again.\r
f22a5f43 147\r
148 @retval EFI_SUCCESS The driver specified by This successfully forced the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
149 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
150 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
151 @retval EFI_INVALID_PARAMETER ActionRequired is NULL.\r
152 @retval EFI_UNSUPPORTED The driver specified by This does not support forcing the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
153 @retval EFI_UNSUPPORTED The driver specified by This does not support the configuration type specified by DefaultType.\r
154 @retval EFI_DEVICE_ERROR A device error occurred while attempt to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
155 @retval EFI_OUT_RESOURCES There are not enough resources available to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.\r
156\r
157**/\r
158typedef\r
159EFI_STATUS\r
8b13229b 160(EFIAPI *EFI_DRIVER_CONFIGURATION2_FORCE_DEFAULTS)(\r
e30e5a72 161 IN EFI_DRIVER_CONFIGURATION2_PROTOCOL *This,\r
f22a5f43 162 IN EFI_HANDLE ControllerHandle,\r
163 IN EFI_HANDLE ChildHandle OPTIONAL,\r
164 IN UINT32 DefaultType,\r
165 OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired\r
166 );\r
167\r
44717a39 168///\r
169/// Used to set configuration options for a controller that an EFI Driver is managing.\r
170///\r
4ca9b6c4
LG
171struct _EFI_DRIVER_CONFIGURATION2_PROTOCOL {\r
172 EFI_DRIVER_CONFIGURATION2_SET_OPTIONS SetOptions;\r
173 EFI_DRIVER_CONFIGURATION2_OPTIONS_VALID OptionsValid;\r
174 EFI_DRIVER_CONFIGURATION2_FORCE_DEFAULTS ForceDefaults;\r
3354353d 175 ///\r
7eb05636 176 /// A Null-terminated ASCII string that contains one or more RFC 4646\r
9095d37b 177 /// language codes. This is the list of language codes that this protocol supports.\r
3354353d 178 ///\r
4ca9b6c4
LG
179 CHAR8 *SupportedLanguages;\r
180};\r
181\r
f22a5f43 182extern EFI_GUID gEfiDriverConfiguration2ProtocolGuid;\r
183\r
184#endif\r