]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/HiiConfigAccess.h
MdePkg: Add the missing spec version information for header files
[mirror_edk2.git] / MdePkg / Include / Protocol / HiiConfigAccess.h
1 /** @file
2
3 The EFI HII results processing protocol invokes this type of protocol
4 when it needs to forward results to a driver's configuration handler.
5 This protocol is published by drivers providing and requesting
6 configuration data from HII. It may only be invoked by HII.
7
8 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
9 This program and the accompanying materials are licensed and made available under
10 the terms and conditions of the BSD License that accompanies this distribution.
11 The full text of the license may be found at
12 http://opensource.org/licenses/bsd-license.php.
13
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16
17 @par Revision Reference:
18 This Protocol was introduced in UEFI Specification 2.1.
19
20 **/
21
22
23 #ifndef __EFI_HII_CONFIG_ACCESS_H__
24 #define __EFI_HII_CONFIG_ACCESS_H__
25
26 #include <Protocol/FormBrowser2.h>
27
28 #define EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID \
29 { 0x330d4706, 0xf2a0, 0x4e4f, { 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } }
30
31 typedef struct _EFI_HII_CONFIG_ACCESS_PROTOCOL EFI_HII_CONFIG_ACCESS_PROTOCOL;
32
33 typedef UINTN EFI_BROWSER_ACTION;
34
35 #define EFI_BROWSER_ACTION_CHANGING 0
36 #define EFI_BROWSER_ACTION_CHANGED 1
37 #define EFI_BROWSER_ACTION_RETRIEVE 2
38 #define EFI_BROWSER_ACTION_FORM_OPEN 3
39 #define EFI_BROWSER_ACTION_FORM_CLOSE 4
40 #define EFI_BROWSER_ACTION_SUBMITTED 5
41 #define EFI_BROWSER_ACTION_DEFAULT_STANDARD 0x1000
42 #define EFI_BROWSER_ACTION_DEFAULT_MANUFACTURING 0x1001
43 #define EFI_BROWSER_ACTION_DEFAULT_SAFE 0x1002
44 #define EFI_BROWSER_ACTION_DEFAULT_PLATFORM 0x2000
45 #define EFI_BROWSER_ACTION_DEFAULT_HARDWARE 0x3000
46 #define EFI_BROWSER_ACTION_DEFAULT_FIRMWARE 0x4000
47
48 /**
49
50 This function allows the caller to request the current
51 configuration for one or more named elements. The resulting
52 string is in <ConfigAltResp> format. Any and all alternative
53 configuration strings shall also be appended to the end of the
54 current configuration string. If they are, they must appear
55 after the current configuration. They must contain the same
56 routing (GUID, NAME, PATH) as the current configuration string.
57 They must have an additional description indicating the type of
58 alternative configuration the string represents,
59 "ALTCFG=<StringToken>". That <StringToken> (when
60 converted from Hex UNICODE to binary) is a reference to a
61 string in the associated string pack.
62
63 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
64
65 @param Request A null-terminated Unicode string in
66 <ConfigRequest> format. Note that this
67 includes the routing information as well as
68 the configurable name / value pairs. It is
69 invalid for this string to be in
70 <MultiConfigRequest> format.
71 If a NULL is passed in for the Request field,
72 all of the settings being abstracted by this function
73 will be returned in the Results field. In addition,
74 if a ConfigHdr is passed in with no request elements,
75 all of the settings being abstracted for that particular
76 ConfigHdr reference will be returned in the Results Field.
77
78 @param Progress On return, points to a character in the
79 Request string. Points to the string's null
80 terminator if request was successful. Points
81 to the most recent "&" before the first
82 failing name / value pair (or the beginning
83 of the string if the failure is in the first
84 name / value pair) if the request was not
85 successful.
86
87 @param Results A null-terminated Unicode string in
88 <MultiConfigAltResp> format which has all values
89 filled in for the names in the Request string.
90 String to be allocated by the called function.
91
92 @retval EFI_SUCCESS The Results string is filled with the
93 values corresponding to all requested
94 names.
95
96 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
97 parts of the results that must be
98 stored awaiting possible future
99 protocols.
100
101 @retval EFI_NOT_FOUND A configuration element matching
102 the routing data is not found.
103 Progress set to the first character
104 in the routing header.
105
106 @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set
107 to most recent "&" before the
108 error or the beginning of the
109 string.
110
111 @retval EFI_INVALID_PARAMETER Unknown name. Progress points
112 to the & before the name in
113 question.
114
115 **/
116 typedef
117 EFI_STATUS
118 (EFIAPI * EFI_HII_ACCESS_EXTRACT_CONFIG)(
119 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
120 IN CONST EFI_STRING Request,
121 OUT EFI_STRING *Progress,
122 OUT EFI_STRING *Results
123 );
124
125
126 /**
127
128 This function applies changes in a driver's configuration.
129 Input is a Configuration, which has the routing data for this
130 driver followed by name / value configuration pairs. The driver
131 must apply those pairs to its configurable storage. If the
132 driver's configuration is stored in a linear block of data
133 and the driver's name / value pairs are in <BlockConfig>
134 format, it may use the ConfigToBlock helper function (above) to
135 simplify the job.
136
137 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
138
139 @param Configuration A null-terminated Unicode string in
140 <ConfigString> format.
141
142 @param Progress A pointer to a string filled in with the
143 offset of the most recent '&' before the
144 first failing name / value pair (or the
145 beginn ing of the string if the failure
146 is in the first name / value pair) or
147 the terminating NULL if all was
148 successful.
149
150 @retval EFI_SUCCESS The results have been distributed or are
151 awaiting distribution.
152
153 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
154 parts of the results that must be
155 stored awaiting possible future
156 protocols.
157
158 @retval EFI_INVALID_PARAMETERS Passing in a NULL for the
159 Results parameter would result
160 in this type of error.
161
162 @retval EFI_NOT_FOUND Target for the specified routing data
163 was not found
164
165 **/
166 typedef
167 EFI_STATUS
168 (EFIAPI * EFI_HII_ACCESS_ROUTE_CONFIG)(
169 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
170 IN CONST EFI_STRING Configuration,
171 OUT EFI_STRING *Progress
172 );
173
174 /**
175
176 This function is called to provide results data to the driver.
177 This data consists of a unique key that is used to identify
178 which data is either being passed back or being asked for.
179
180 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
181 @param Action Specifies the type of action taken by the browser.
182 @param QuestionId A unique value which is sent to the original
183 exporting driver so that it can identify the type
184 of data to expect. The format of the data tends to
185 vary based on the opcode that generated the callback.
186 @param Type The type of value for the question.
187 @param Value A pointer to the data being sent to the original
188 exporting driver.
189 @param ActionRequest On return, points to the action requested by the
190 callback function.
191
192 @retval EFI_SUCCESS The callback successfully handled the action.
193 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
194 variable and its data.
195 @retval EFI_DEVICE_ERROR The variable could not be saved.
196 @retval EFI_UNSUPPORTED The specified Action is not supported by the
197 callback.
198 **/
199 typedef
200 EFI_STATUS
201 (EFIAPI *EFI_HII_ACCESS_FORM_CALLBACK)(
202 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
203 IN EFI_BROWSER_ACTION Action,
204 IN EFI_QUESTION_ID QuestionId,
205 IN UINT8 Type,
206 IN OUT EFI_IFR_TYPE_VALUE *Value,
207 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
208 )
209 ;
210
211 ///
212 /// This protocol provides a callable interface between the HII and
213 /// drivers. Only drivers which provide IFR data to HII are required
214 /// to publish this protocol.
215 ///
216 struct _EFI_HII_CONFIG_ACCESS_PROTOCOL {
217 EFI_HII_ACCESS_EXTRACT_CONFIG ExtractConfig;
218 EFI_HII_ACCESS_ROUTE_CONFIG RouteConfig;
219 EFI_HII_ACCESS_FORM_CALLBACK Callback;
220 } ;
221
222 extern EFI_GUID gEfiHiiConfigAccessProtocolGuid;
223
224 #endif
225
226