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