]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/DriverConfiguration.h
Initial import.
[mirror_edk2.git] / MdePkg / Include / Protocol / DriverConfiguration.h
1 /** @file
2 EFI Driver Configuration Protocol
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. 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 Module Name: DriverConfiguration.h
14
15 **/
16
17 #ifndef __EFI_DRIVER_CONFIGURATION_H__
18 #define __EFI_DRIVER_CONFIGURATION_H__
19
20 //
21 // Global ID for the Driver Configuration Protocol defined in EFI 1.10
22 //
23 #define EFI_DRIVER_CONFIGURATION_PROTOCOL_GUID \
24 { \
25 0x107a772b, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
26 }
27
28 //
29 // Global ID for the Driver Configuration Protocol defined in UEFI 2.0
30 //
31 #define UEFI_DRIVER_CONFIGURATION_PROTOCOL_GUID \
32 { \
33 0xbfd7dc1d, 0x24f1, 0x40d9, {0x82, 0xe7, 0x2e, 0x09, 0xbb, 0x6b, 0x4e, 0xbe } \
34 }
35
36 typedef struct _EFI_DRIVER_CONFIGURATION_PROTOCOL EFI_DRIVER_CONFIGURATION_PROTOCOL;
37
38 typedef enum {
39 EfiDriverConfigurationActionNone = 0,
40 EfiDriverConfigurationActionStopController = 1,
41 EfiDriverConfigurationActionRestartController = 2,
42 EfiDriverConfigurationActionRestartPlatform = 3,
43 EfiDriverConfigurationActionMaximum
44 } EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED;
45
46 #define EFI_DRIVER_CONFIGURATION_SAFE_DEFAULTS 0x00000000
47 #define EFI_DRIVER_CONFIGURATION_MANUFACTURING_DEFAULTS 0x00000001
48 #define EFI_DRIVER_CONFIGURATION_CUSTOM_DEFAULTS 0x00000002
49 #define EFI_DRIVER_CONFIGURATION_PERORMANCE_DEFAULTS 0x00000003
50
51 /**
52 Allows the user to set controller specific options for a controller that a
53 driver is currently managing.
54
55 @param This A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.
56 @param ControllerHandle The handle of the controller to set options on.
57 @param ChildHandle The handle of the child controller to set options on. This
58 is an optional parameter that may be NULL. It will be NULL
59 for device drivers, and for a bus drivers that wish to set
60 options for the bus controller. It will not be NULL for a
61 bus driver that wishes to set options for one of its child
62 controllers.
63 @param Language A pointer to a three character ISO 639-2 language identifier.
64 This is the language of the user interface that should be
65 presented to the user, and it must match one of the languages
66 specified in SupportedLanguages. The number of languages
67 supported by a driver is up to the driver writer.
68 @param ActionRequired A pointer to the action that the calling agent is required
69 to perform when this function returns. See "Related
70 Definitions" for a list of the actions that the calling
71 agent is required to perform prior to accessing
72 ControllerHandle again.
73
74 @retval EFI_SUCCESS The driver specified by This successfully set the
75 configuration options for the controller specified
76 by ControllerHandle..
77 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
78 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
79 @retval EFI_INVALID_PARAMETER ActionRequired is NULL.
80 @retval EFI_UNSUPPORTED The driver specified by This does not support setting
81 configuration options for the controller specified by
82 ControllerHandle and ChildHandle.
83 @retval EFI_UNSUPPORTED The driver specified by This does not support the
84 language specified by Language.
85 @retval EFI_DEVICE_ERROR A device error occurred while attempt to set the
86 configuration options for the controller specified
87 by ControllerHandle and ChildHandle.
88 @retval EFI_OUT_RESOURCES There are not enough resources available to set the
89 configuration options for the controller specified
90 by ControllerHandle and ChildHandle.
91
92 **/
93 typedef
94 EFI_STATUS
95 (EFIAPI *EFI_DRIVER_CONFIGURATION_SET_OPTIONS) (
96 IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
97 IN EFI_HANDLE ControllerHandle,
98 IN EFI_HANDLE ChildHandle OPTIONAL,
99 IN CHAR8 *Language,
100 OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired
101 );
102
103 /**
104 Tests to see if a controller's current configuration options are valid.
105
106 @param This A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance.
107 @param ControllerHandle The handle of the controller to test if it's current
108 configuration options are valid.
109 @param ChildHandle The handle of the child controller to test if it's current
110 configuration options are valid. This is an optional
111 parameter that may be NULL. It will be NULL for device
112 drivers. It will also be NULL for a bus drivers that wish
113 to test the configuration options for the bus controller.
114 It will not be NULL for a bus driver that wishes to test
115 configuration options for one of its child controllers.
116
117 @retval EFI_SUCCESS The controller specified by ControllerHandle and
118 ChildHandle that is being managed by the driver
119 specified by This has a valid set of configuration
120 options.
121 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
122 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
123 @retval EFI_UNSUPPORTED The driver specified by This is not currently
124 managing the controller specified by ControllerHandle
125 and ChildHandle.
126 @retval EFI_DEVICE_ERROR The controller specified by ControllerHandle and
127 ChildHandle that is being managed by the driver
128 specified by This has an invalid set of configuration
129 options.
130
131 **/
132 typedef
133 EFI_STATUS
134 (EFIAPI *EFI_DRIVER_CONFIGURATION_OPTIONS_VALID) (
135 IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
136 IN EFI_HANDLE ControllerHandle,
137 IN EFI_HANDLE ChildHandle OPTIONAL
138 );
139
140 /**
141 Forces a driver to set the default configuration options for a controller.
142
143 @param This A pointer to the EFI_DRIVER_CONFIGURATION_ PROTOCOL instance.
144 @param ControllerHandle The handle of the controller to force default configuration options on.
145 @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 a 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.
146 @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.
147 @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.1for a list of the actions that the calling agent is required to perform prior to accessing ControllerHandle again.
148
149 @retval EFI_SUCCESS The driver specified by This successfully forced the default configuration options on the controller specified by ControllerHandle and ChildHandle.
150 @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
151 @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
152 @retval EFI_INVALID_PARAMETER ActionRequired is NULL.
153 @retval EFI_UNSUPPORTED The driver specified by This does not support forcing the default configuration options on the controller specified by ControllerHandle and ChildHandle.
154 @retval EFI_UNSUPPORTED The driver specified by This does not support the configuration type specified by DefaultType.
155 @retval EFI_DEVICE_ERROR A device error occurred while attempt to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.
156 @retval EFI_OUT_RESOURCES There are not enough resources available to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.
157
158 **/
159 typedef
160 EFI_STATUS
161 (EFIAPI *EFI_DRIVER_CONFIGURATION_FORCE_DEFAULTS) (
162 IN EFI_DRIVER_CONFIGURATION_PROTOCOL *This,
163 IN EFI_HANDLE ControllerHandle,
164 IN EFI_HANDLE ChildHandle OPTIONAL,
165 IN UINT32 DefaultType,
166 OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED *ActionRequired
167 );
168
169
170 //
171 //
172 struct _EFI_DRIVER_CONFIGURATION_PROTOCOL {
173 EFI_DRIVER_CONFIGURATION_SET_OPTIONS SetOptions;
174 EFI_DRIVER_CONFIGURATION_OPTIONS_VALID OptionsValid;
175 EFI_DRIVER_CONFIGURATION_FORCE_DEFAULTS ForceDefaults;
176 CHAR8 *SupportedLanguages;
177 };
178
179 /**
180 Interface structure for the Driver Configuration Protocol.
181
182 @par Protocol Description:
183 Used to set configuration options for a controller that an EFI Driver is managing.
184
185 @param SetOptions Allows the use to set drivers specific configuration
186 options for a controller that the driver is currently managing.
187
188 @param OptionsValid Tests to see if a controller's current configuration
189 options are valid.
190
191 @param ForceDefaults Forces a driver to set the default configuration options
192 for a controller.
193
194 @param SupportedLanguages A Null-terminated ASCII string that contains one or more
195 ISO 639-2 language codes. This is the list of language
196 codes that this protocol supports.
197
198 **/
199
200 extern EFI_GUID gEfiDriverConfigurationProtocolGuid;
201 extern EFI_GUID gUefiDriverConfigurationProtocolGuid;
202
203 #endif