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