1 /** @file
2   EFI Driver Configuration Protocol
3 
4   Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
5   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 **/
14 
15 #ifndef __EFI_DRIVER_CONFIGURATION_H__
16 #define __EFI_DRIVER_CONFIGURATION_H__
17 
18 #include <Protocol/DriverConfiguration2.h>
19 
20 ///
21 /// Global ID for the Driver Configuration Protocol defined in EFI 1.1
22 ///
23 #define EFI_DRIVER_CONFIGURATION_PROTOCOL_GUID \
24   { \
25     0x107a772b, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
26   }
27 
28 typedef struct _EFI_DRIVER_CONFIGURATION_PROTOCOL  EFI_DRIVER_CONFIGURATION_PROTOCOL;
29 
30 /**
31   Allows the user to set controller specific options for a controller that a
32   driver is currently managing.
33 
34   @param  This             A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance.
35   @param  ControllerHandle The handle of the controller to set options on.
36   @param  ChildHandle      The handle of the child controller to set options on.  This
37                            is an optional parameter that may be NULL.  It will be NULL
38                            for device drivers, and for bus drivers that wish to set
39                            options for the bus controller.  It will not be NULL for a
40                            bus driver that wishes to set options for one of its child
41                            controllers.
42   @param  Language         A pointer to a three character ISO 639-2 language identifier.
43                            This is the language of the user interface that should be
44                            presented to the user, and it must match one of the languages
45                            specified in SupportedLanguages.  The number of languages
46                            supported by a driver is up to the driver writer.
47   @param  ActionRequired   A pointer to the action that the calling agent is required
48                            to perform when this function returns.  See "Related
49                            Definitions" for a list of the actions that the calling
50                            agent is required to perform prior to accessing
51                            ControllerHandle again.
52 
53   @retval EFI_SUCCESS           The driver specified by This successfully set the
54                                 configuration options for the controller specified
55                                 by ControllerHandle..
56   @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
57   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
58   @retval EFI_INVALID_PARAMETER ActionRequired is NULL.
59   @retval EFI_UNSUPPORTED       The driver specified by This does not support setting
60                                 configuration options for the controller specified by
61                                 ControllerHandle and ChildHandle.
62   @retval EFI_UNSUPPORTED       The driver specified by This does not support the
63                                 language specified by Language.
64   @retval EFI_DEVICE_ERROR      A device error occurred while attempt to set the
65                                 configuration options for the controller specified
66                                 by ControllerHandle and ChildHandle.
67   @retval EFI_OUT_RESOURCES     There are not enough resources available to set the
68                                 configuration options for the controller specified
69                                 by ControllerHandle and ChildHandle.
70 
71 **/
72 typedef
73 EFI_STATUS
74 (EFIAPI *EFI_DRIVER_CONFIGURATION_SET_OPTIONS)(
75   IN EFI_DRIVER_CONFIGURATION_PROTOCOL                        *This,
76   IN  EFI_HANDLE                                              ControllerHandle,
77   IN  EFI_HANDLE                                              ChildHandle  OPTIONAL,
78   IN  CHAR8                                                   *Language,
79   OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED                *ActionRequired
80   );
81 
82 /**
83   Tests to see if a controller's current configuration options are valid.
84 
85   @param  This             A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance.
86   @param  ControllerHandle The handle of the controller to test if it's current
87                            configuration options are valid.
88   @param  ChildHandle      The handle of the child controller to test if it's current
89                            configuration options are valid.  This is an optional
90                            parameter that may be NULL.  It will be NULL for device
91                            drivers.  It will also be NULL for bus drivers that wish
92                            to test the configuration options for the bus controller.
93                            It will not be NULL for a bus driver that wishes to test
94                            configuration options for one of its child controllers.
95 
96   @retval EFI_SUCCESS           The controller specified by ControllerHandle and
97                                 ChildHandle that is being managed by the driver
98                                 specified by This has a valid set of  configuration
99                                 options.
100   @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
101   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
102   @retval EFI_UNSUPPORTED       The driver specified by This is not currently
103                                 managing the controller specified by ControllerHandle
104                                 and ChildHandle.
105   @retval EFI_DEVICE_ERROR      The controller specified by ControllerHandle and
106                                 ChildHandle that is being managed by the driver
107                                 specified by This has an invalid set of configuration
108                                 options.
109 
110 **/
111 typedef
112 EFI_STATUS
113 (EFIAPI *EFI_DRIVER_CONFIGURATION_OPTIONS_VALID)(
114   IN EFI_DRIVER_CONFIGURATION_PROTOCOL                        *This,
115   IN  EFI_HANDLE                                              ControllerHandle,
116   IN  EFI_HANDLE                                              ChildHandle  OPTIONAL
117   );
118 
119 /**
120   Forces a driver to set the default configuration options for a controller.
121 
122   @param  This             A pointer to the EFI_DRIVER_CONFIGURATION_PROTOCOL instance.
123   @param  ControllerHandle The handle of the controller to force default configuration options on.
124   @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.
125   @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.
126   @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.
127 
128   @retval EFI_SUCCESS           The driver specified by This successfully forced the default configuration options on the controller specified by ControllerHandle and ChildHandle.
129   @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
130   @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.
131   @retval EFI_INVALID_PARAMETER ActionRequired is NULL.
132   @retval EFI_UNSUPPORTED       The driver specified by This does not support forcing the default configuration options on the controller specified by ControllerHandle and ChildHandle.
133   @retval EFI_UNSUPPORTED       The driver specified by This does not support the configuration type specified by DefaultType.
134   @retval EFI_DEVICE_ERROR      A device error occurred while attempt to force the default configuration options on the controller specified by  ControllerHandle and ChildHandle.
135   @retval EFI_OUT_RESOURCES     There are not enough resources available to force the default configuration options on the controller specified by ControllerHandle and ChildHandle.
136 
137 **/
138 typedef
139 EFI_STATUS
140 (EFIAPI *EFI_DRIVER_CONFIGURATION_FORCE_DEFAULTS)(
141   IN EFI_DRIVER_CONFIGURATION_PROTOCOL                        *This,
142   IN  EFI_HANDLE                                              ControllerHandle,
143   IN  EFI_HANDLE                                              ChildHandle  OPTIONAL,
144   IN  UINT32                                                  DefaultType,
145   OUT EFI_DRIVER_CONFIGURATION_ACTION_REQUIRED                *ActionRequired
146   );
147 
148 
149 ///
150 /// Used to set configuration options for a controller that an EFI Driver is managing.
151 ///
152 struct _EFI_DRIVER_CONFIGURATION_PROTOCOL {
153   EFI_DRIVER_CONFIGURATION_SET_OPTIONS    SetOptions;
154   EFI_DRIVER_CONFIGURATION_OPTIONS_VALID  OptionsValid;
155   EFI_DRIVER_CONFIGURATION_FORCE_DEFAULTS ForceDefaults;
156   ///
157   /// A Null-terminated ASCII string that contains one or more
158   /// ISO 639-2 language codes.  This is the list of language
159   /// codes that this protocol supports.
160   ///
161   CHAR8                                   *SupportedLanguages;
162 };
163 
164 
165 extern EFI_GUID gEfiDriverConfigurationProtocolGuid;
166 
167 #endif
168