a0e4be53afbfa9645afa415cbad27252c904eb70
[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 #error "UEFI 2.1 HII is not fully implemented for now, Please don't include this file now."
23
24 #define EFI_HII_CONFIGURATION_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 /**
30
31 This function allows the caller to request the current
32 configuration for one or more named elements. The resulting
33 string is in <ConfigAltResp> format. Any and all alternative
34 configuration strings shall also be appended to the end of the
35 current configuration string. If they are, they must appear
36 after the current configuration. They must contain the same
37 routing (GUID, NAME, PATH) as the current configuration string.
38 They must have an additional description indicating the type of
39 alternative configuration the string represents,
40 "ALTCFG=<StringToken>". That <StringToken> (when
41 converted from Hex UNICODE to binary) is a reference to a
42 string in the associated string pack.
43
44 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
45
46 @param Request A null-terminated Unicode string in
47 <ConfigRequest> format. Note that this
48 includes the routing information as well as
49 the configurable name / value pairs. It is
50 invalid for this string to be in
51 <MultiConfigRequest> format.
52
53 @param Progress On return, points to a character in the
54 Request string. Points to the string's null
55 terminator if request was successful. Points
56 to the most recent "&" before the first
57 failing name / value pair (or the beginning
58 of the string if the failure is in the first
59 name / value pair) if the request was not
60 successful
61
62 @param Results A null-terminated Unicode string in
63 <ConfigAltResp> format which has all values
64 filled in for the names in the Request string.
65 String to be allocated by the called function.
66
67 @retval EFI_SUCCESS The Results string is filled with the
68 values corresponding to all requested
69 names.
70
71 @retval EFI_OUT_OF_MEMORY Not enough memory to store the
72 parts of the results that must be
73 stored awaiting possible future
74 protocols.
75
76 @retval EFI_INVALID_PARAMETER For example, passing in a NULL
77 for the Request parameter
78 would result in this type of
79 error. In this case, the
80 Progress parameter would be
81 set to NULL.
82
83 @retval EFI_NOT_FOUND Routing data doesn't match any
84 known driver. Progress set to the
85 first character in the routing header.
86 Note: There is no requirement that the
87 driver validate the routing data. It
88 must skip the <ConfigHdr> in order to
89 process the names.
90
91 @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set
92 to most recent & before the
93 error or the beginning of the
94 string.
95
96 @retval EFI_INVALID_PARAMETER Unknown name. Progress points
97 to the & before the name in
98 question.
99
100 **/
101 typedef
102 EFI_STATUS
103 (EFIAPI * EFI_HII_ACCESS_EXTRACT_CONFIG ) (
104 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
105 IN CONST EFI_STRING Request,
106 OUT EFI_STRING *Progress,
107 OUT EFI_STRING *Results
108 );
109
110
111 /**
112
113 This function applies changes in a driver's configuration.
114 Input is a Configuration, which has the routing data for this
115 driver followed by name / value configuration pairs. The driver
116 must apply those pairs to its configurable storage. If the
117 driver's configuration is stored in a linear block of data
118 and the driver????s name / value pairs are in <BlockConfig>
119 format, it may use the ConfigToBlock helper function (above) to
120 simplify the job.
121
122 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
123
124 @param Configuration A null-terminated Unicode string in
125 <ConfigString> format. Progress a
126 pointer to a string filled in with the
127 offset of the most recent '&' before the
128 first failing name / value pair (or the
129 beginn ing of the string if the failure
130 is in the first name / value pair) or
131 the terminating NULL if all was
132 successful.
133
134 @retval EFI_SUCCESS The results have been distributed or are
135 awaiting distribution.
136
137 @retval EFI_OUT_OF_MEMORY Not enough memory to store the
138 parts of the results that must be
139 stored awaiting possible future
140 protocols.
141
142 @retval EFI_INVALID_PARAMETERS Passing in a NULL for the
143 Results parameter would result
144 in this type of error.
145
146 @retval EFI_NOT_FOUND Target for the specified routing data
147 was not found
148
149 **/
150 typedef
151 EFI_STATUS
152 (EFIAPI * EFI_HII_ACCESS_ROUTE_CONFIG ) (
153 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
154 IN CONST EFI_STRING Configuration,
155 OUT EFI_STRING *Progress
156 );
157
158 /**
159
160 This function is called to provide results data to the driver.
161 This data consists of a unique key that is used to identify
162 which data is either being passed back or being asked for.
163
164 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
165
166 @param KeyValue A unique value which is sent to the original
167 exporting driver so that it can identify the
168 type of data to expect. The format of the
169 data tends to vary based on the opcode that
170 generated the callback.
171
172 @param Data A pointer to the data being sent to the original
173 exporting driver. The format of the data should
174 be the same as that of the question invoking the
175 callback and will be known to the recipient.
176
177 @retval EFI_SUCCESS The firmware has successfully stored the
178 variable and its data as defined by the
179 Attributes.
180
181 @retval EFI_INVALID_PARAMETER An invalid combination of
182 Attributes bits was supplied,
183 or the DataSize exceeds the
184 maximum allowed.
185
186 @retval EFI_OUT_OF_RESOURCES Not enough storage is available
187 to hold the variable and its
188 data.
189
190 @retval EFI_DEVICE_ERROR The variable could not be saved due
191 to a hardware failure.
192
193
194 **/
195 typedef
196 EFI_STATUS
197 (EFIAPI *EFI_FORM_CALLBACK) (
198 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
199 IN CONST UINT16 KeyValue,
200 IN CONST VOID *Data
201 );
202 /**
203
204 This protocol provides a callable interface between the HII and
205 drivers. Only drivers which provide IFR data to HII are required
206 to publish this protocol.
207
208 @param ExtractConfig This function breaks apart the UNICODE
209 request strings routing them to the
210 appropriate drivers. This function is
211 analogous to the similarly named
212 function in the HII Routing Protocol.
213
214 @param RouteConfig This function breaks apart the UNICODE
215 results strings and returns configuration
216 information as specified by the request.
217
218 @param Callback This function is called from the
219 configuration browser to communicate certain
220 activities that were initiated by a user.
221
222
223 **/
224 struct _EFI_HII_CONFIG_ACCESS_PROTOCOL {
225 EFI_HII_ACCESS_ROUTE_CONFIG ExtractConfig;
226 EFI_HII_ACCESS_EXTRACT_CONFIG RouteConfig;
227 EFI_FORM_CALLBACK Callback;
228 } ;
229
230 extern EFI_GUID gEfiHiiConfigAccessProtocolGuid;
231
232 #endif
233