]>
Commit | Line | Data |
---|---|---|
2c40a813 | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2007, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | HiiConfigRouting.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | EFI_HII_CONFIG_ROUTING_PROTOCOL as defined in UEFI 2.1 spec.\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | #ifndef __EFI_HII_CONFIG_ROUTING_H__\r | |
23 | #define __EFI_HII_CONFIG_ROUTING_H__\r | |
24 | \r | |
25 | #include "EfiHii.h"\r | |
26 | \r | |
27 | #define EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \\r | |
28 | { \\r | |
29 | 0x587e72d7, 0xcc50, 0x4f79, 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f \\r | |
30 | }\r | |
31 | \r | |
32 | //\r | |
33 | // Forward reference for pure ANSI compatability\r | |
34 | //\r | |
35 | EFI_FORWARD_DECLARATION (EFI_HII_CONFIG_ROUTING_PROTOCOL);\r | |
36 | \r | |
37 | typedef\r | |
38 | EFI_STATUS\r | |
39 | (EFIAPI *EFI_HII_EXTRACT_CONFIG) (\r | |
40 | IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r | |
41 | IN CONST EFI_STRING Request,\r | |
42 | OUT EFI_STRING *Progress,\r | |
43 | OUT EFI_STRING *Results\r | |
44 | )\r | |
45 | /*++\r | |
46 | \r | |
47 | Routine Description:\r | |
48 | This function allows a caller to extract the current configuration \r | |
49 | for one or more named elements from one or more drivers.\r | |
50 | \r | |
51 | Arguments: \r | |
52 | This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance.\r | |
53 | Request - A null-terminated Unicode string in <MultiConfigRequest> format.\r | |
54 | Progress - On return, points to a character in the Request string. Points to the string's null \r | |
55 | terminator if request was successful. Points to the most recent '&' before the first \r | |
56 | failing name / value pair (or the beginning of the string if the failure is in the first\r | |
57 | name / value pair) if the request was not successful.\r | |
58 | Results - Null-terminated Unicode string in <MultiConfigAltResp> format which has all \r | |
59 | values filled in for the names in the Request string. String to be allocated by the called\r | |
60 | function. \r | |
61 | \r | |
62 | Returns: \r | |
63 | EFI_SUCCESS - The Results string is filled with the values\r | |
64 | corresponding to all requested names. \r | |
65 | EFI_OUT_OF_RESOURCES - Not enough memory to store the parts of the results\r | |
66 | that must be stored awaiting possible future \r | |
67 | protocols. \r | |
68 | EFI_NOT_FOUND - Routing data doesn't match any known driver. \r | |
69 | Progress set to the 'G' in "GUID" of the routing \r | |
70 | header that doesn't match. Note: There is no \r | |
71 | requirement that all routing data be validated before\r | |
72 | any configuration extraction. \r | |
73 | EFI_INVALID_PARAMETER - For example, passing in a NULL for the Request \r | |
74 | parameter would result in this type of error. The\r | |
75 | Progress parameter is set to NULL. \r | |
76 | \r | |
77 | EFI_INVALID_PARAMETER - Illegal syntax. Progress set to most recent & before\r | |
78 | the error or the beginning of the string. \r | |
79 | \r | |
80 | EFI_INVALID_PARAMETER - Unknown name. Progress points to the & before\r | |
81 | the name in question. \r | |
82 | \r | |
83 | --*/ \r | |
84 | ;\r | |
85 | \r | |
86 | typedef\r | |
87 | EFI_STATUS \r | |
88 | (EFIAPI *EFI_HII_EXPORT_CONFIG) (\r | |
89 | IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r | |
90 | OUT EFI_STRING *Results\r | |
91 | )\r | |
92 | /*++\r | |
93 | \r | |
94 | Routine Description:\r | |
95 | This function allows the caller to request the current configuration for the \r | |
96 | entirety of the current HII database and returns the data in a null-terminated Unicode string. \r | |
97 | \r | |
98 | Arguments: \r | |
99 | This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. \r | |
100 | Results - Null-terminated Unicode string in <MultiConfigAltResp> format which has all \r | |
101 | values filled in for the names in the Request string. String to be allocated by the called\r | |
102 | function. De-allocation is up to the caller. \r | |
103 | \r | |
104 | Returns: \r | |
105 | EFI_SUCCESS - The Results string is filled with the values\r | |
106 | corresponding to all requested names. \r | |
107 | EFI_OUT_OF_RESOURCES - Not enough memory to store the parts of the results\r | |
108 | that must be stored awaiting possible future \r | |
109 | protocols. \r | |
110 | EFI_INVALID_PARAMETER - For example, passing in a NULL for the Results\r | |
111 | parameter would result in this type of error. \r | |
112 | \r | |
113 | --*/ \r | |
114 | ; \r | |
115 | \r | |
116 | typedef\r | |
117 | EFI_STATUS\r | |
118 | (EFIAPI *EFI_HII_ROUTE_CONFIG) (\r | |
119 | IN EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r | |
120 | IN CONST EFI_STRING Configuration,\r | |
121 | OUT EFI_STRING *Progress\r | |
122 | )\r | |
123 | /*++\r | |
124 | \r | |
125 | Routine Description:\r | |
126 | This function processes the results of processing forms and routes it to the \r | |
127 | appropriate handlers or storage.\r | |
128 | \r | |
129 | Arguments: \r | |
130 | This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. \r | |
131 | Configuration - A null-terminated Unicode string in <MulltiConfigResp> format.\r | |
132 | Progress - A pointer to a string filled in with the offset of the most recent "&" before the first\r | |
133 | failing name / value pair (or the beginning of the string if the failure is in the first \r | |
134 | name / value pair) or the terminating NULL if all was successful. \r | |
135 | \r | |
136 | Returns: \r | |
137 | EFI_SUCCESS - The results have been distributed or are awaiting\r | |
138 | distribution. \r | |
139 | EFI_OUT_OF_RESOURCES - Not enough memory to store the parts of the results\r | |
140 | that must be stored awaiting possible future \r | |
141 | protocols. \r | |
142 | EFI_INVALID_PARAMETER - Passing in a NULL for the Configuration\r | |
143 | parameter would result in this type of error. \r | |
144 | EFI_NOT_FOUND - Target for the specified routing data was not found. \r | |
145 | \r | |
146 | --*/ \r | |
147 | ; \r | |
148 | \r | |
149 | \r | |
150 | typedef\r | |
151 | EFI_STATUS \r | |
152 | (EFIAPI *EFI_HII_BLOCK_TO_CONFIG) (\r | |
153 | IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r | |
154 | IN CONST EFI_STRING ConfigRequest,\r | |
155 | IN CONST UINT8 *Block,\r | |
156 | IN CONST UINTN BlockSize,\r | |
157 | OUT EFI_STRING *Config,\r | |
158 | OUT EFI_STRING *Progress\r | |
159 | )\r | |
160 | /*++\r | |
161 | \r | |
162 | Routine Description:\r | |
163 | This helper function is to be called by drivers to map configuration data stored\r | |
164 | in byte array ("block") formats such as UEFI Variables into current configuration strings.\r | |
165 | \r | |
166 | Arguments: \r | |
167 | This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. \r | |
168 | ConfigRequest - A null-terminated Unicode string in <ConfigRequest> format.\r | |
169 | Block - Array of bytes defining the block's configuration.\r | |
170 | BlockSize - Length in bytes of Block.\r | |
171 | Config - Filled-in configuration string. String allocated by the function. \r | |
172 | Returned only if call is successful. \r | |
173 | Progress - A pointer to a string filled in with the offset of the most recent "&" before the first\r | |
174 | failing name / value pair (or the beginning of the string if the failure is in the first \r | |
175 | name / value pair) or the terminating NULL if all was successful. \r | |
176 | \r | |
177 | Returns: \r | |
178 | EFI_SUCCESS - The request succeeded. Progress points to the null\r | |
179 | terminator at the end of the ConfigRequest \r | |
180 | string. \r | |
181 | EFI_OUT_OF_RESOURCES - Not enough memory to allocate Config. \r | |
182 | Progress points to the first character of\r | |
183 | ConfigRequest. \r | |
184 | EFI_INVALID_PARAMETER - Passing in a NULL for the ConfigRequest or \r | |
185 | Block parameter would result in this type of \r | |
186 | error. Progress points to the first character of\r | |
187 | ConfigRequest. \r | |
188 | EFI_NOT_FOUND - Target for the specified routing data was not found.\r | |
189 | Progress points to the "G" in "GUID" of the \r | |
190 | errant routing data. \r | |
191 | EFI_DEVICE_ERROR - Block not large enough. Progress undefined.\r | |
192 | EFI_INVALID_PARAMETER - Encountered non <BlockName> formatted string. \r | |
193 | Block is left updated and Progress points at the "&"\r | |
194 | preceding the first non-<BlockName>. \r | |
195 | \r | |
196 | --*/ \r | |
197 | ;\r | |
198 | \r | |
199 | typedef\r | |
200 | EFI_STATUS \r | |
201 | (EFIAPI *EFI_HII_CONFIG_TO_BLOCK) (\r | |
202 | IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This,\r | |
203 | IN CONST EFI_STRING ConfigResp,\r | |
204 | IN OUT UINT8 *Block,\r | |
205 | IN OUT UINTN *BlockSize,\r | |
206 | OUT EFI_STRING *Progress\r | |
207 | )\r | |
208 | /*++\r | |
209 | \r | |
210 | Routine Description:\r | |
211 | This helper function is to be called by drivers to map configuration strings \r | |
212 | to configurations stored in byte array ("block") formats such as UEFI Variables.\r | |
213 | \r | |
214 | Arguments: \r | |
215 | This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. \r | |
216 | ConfigResp - A null-terminated Unicode string in <ConfigResp> format.\r | |
217 | Block - A possibly null array of bytes representing the current block. \r | |
218 | Only bytes referenced in the ConfigResp string in the block are modified. \r | |
219 | If this parameter is null or if the *BlockSize parameter is (on input) \r | |
220 | shorter than required by the Configuration string, only the BlockSize \r | |
221 | parameter is updated and an appropriate status (see below) is returned. \r | |
222 | \r | |
223 | BlockSize - The length of the Block in units of UINT8. On input, this is the size of the Block.\r | |
224 | On output, if successful, contains the index of the last modified byte in the Block.\r | |
225 | \r | |
226 | Progress - On return, points to an element of the ConfigResp string filled in with the offset of \r | |
227 | the most recent "&" before the first failing name / value pair (or the beginning of the \r | |
228 | string if the failure is in the first name / value pair) or the terminating NULL if all was\r | |
229 | successful. \r | |
230 | Returns: \r | |
231 | EFI_SUCCESS - The request succeeded. Progress points to the null\r | |
232 | terminator at the end of the ConfigResp\r | |
233 | string. \r | |
234 | EFI_OUT_OF_RESOURCES - Not enough memory to allocate Config. \r | |
235 | Progress points to the first character of\r | |
236 | ConfigResp. \r | |
237 | EFI_INVALID_PARAMETER - Passing in a NULL for the ConfigResp or \r | |
238 | Block parameter would result in this type of error.\r | |
239 | Progress points to the first character of \r | |
240 | ConfigResp. \r | |
241 | EFI_NOT_FOUND - Target for the specified routing data was not found.\r | |
242 | Progress points to the "G" in "GUID" of the \r | |
243 | errant routing data. \r | |
244 | EFI_INVALID_PARAMETER - Encountered non <BlockName> formatted name / \r | |
245 | value pair. Block is left updated and \r | |
246 | Progress points at the "&" preceding the first\r | |
247 | non-<BlockName>. \r | |
248 | \r | |
249 | --*/ \r | |
250 | ;\r | |
251 | \r | |
252 | typedef\r | |
253 | EFI_STATUS \r | |
254 | (EFIAPI * EFI_HII_GET_ALT_CFG) (\r | |
255 | IN CONST EFI_HII_CONFIG_ROUTING_PROTOCOL *This, \r | |
256 | IN CONST EFI_STRING Configuration, \r | |
257 | IN CONST EFI_GUID *Guid, \r | |
258 | IN CONST EFI_STRING Name, \r | |
259 | IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, \r | |
260 | IN CONST UINT16 *AltCfgId,\r | |
261 | OUT EFI_STRING *AltCfgResp \r | |
262 | )\r | |
263 | /*++\r | |
264 | \r | |
265 | Routine Description:\r | |
266 | This helper function is to be called by drivers to extract portions of \r | |
267 | a larger configuration string.\r | |
268 | \r | |
269 | Arguments: \r | |
270 | This - A pointer to the EFI_HII_CONFIG_ROUTING_PROTOCOL instance. \r | |
271 | Configuration - A null-terminated Unicode string in <MultiConfigAltResp> format.\r | |
272 | Guid - A pointer to the GUID value to search for in the \r | |
273 | routing portion of the ConfigResp string when retrieving \r | |
274 | the requested data. If Guid is NULL, then all GUID \r | |
275 | values will be searched for.\r | |
276 | Name - A pointer to the NAME value to search for in the \r | |
277 | routing portion of the ConfigResp string when retrieving \r | |
278 | the requested data. If Name is NULL, then all Name \r | |
279 | values will be searched for. \r | |
280 | DevicePath - A pointer to the PATH value to search for in the \r | |
281 | routing portion of the ConfigResp string when retrieving \r | |
282 | the requested data. If DevicePath is NULL, then all \r | |
283 | DevicePath values will be searched for. \r | |
284 | AltCfgId - A pointer to the ALTCFG value to search for in the \r | |
285 | routing portion of the ConfigResp string when retrieving \r | |
286 | the requested data. If this parameter is NULL, \r | |
287 | then the current setting will be retrieved.\r | |
288 | AltCfgResp - A pointer to a buffer which will be allocated by the \r | |
289 | function which contains the retrieved string as requested. \r | |
290 | This buffer is only allocated if the call was successful. \r | |
291 | \r | |
292 | Returns: \r | |
293 | EFI_SUCCESS - The request succeeded. The requested data was extracted \r | |
294 | and placed in the newly allocated AltCfgResp buffer.\r | |
295 | EFI_OUT_OF_RESOURCES - Not enough memory to allocate AltCfgResp. \r | |
296 | EFI_INVALID_PARAMETER - Any parameter is invalid.\r | |
297 | EFI_NOT_FOUND - Target for the specified routing data was not found.\r | |
298 | \r | |
299 | --*/ \r | |
300 | ;\r | |
301 | \r | |
302 | \r | |
e5bce275 | 303 | struct _EFI_HII_CONFIG_ROUTING_PROTOCOL {\r |
2c40a813 | 304 | EFI_HII_EXTRACT_CONFIG ExtractConfig;\r |
305 | EFI_HII_EXPORT_CONFIG ExportConfig;\r | |
306 | EFI_HII_ROUTE_CONFIG RouteConfig;\r | |
307 | EFI_HII_BLOCK_TO_CONFIG BlockToConfig;\r | |
308 | EFI_HII_CONFIG_TO_BLOCK ConfigToBlock;\r | |
309 | EFI_HII_GET_ALT_CFG GetAltConfig;\r | |
e5bce275 | 310 | };\r |
2c40a813 | 311 | \r |
312 | extern EFI_GUID gEfiHiiConfigRoutingProtocolGuid;\r | |
313 | \r | |
314 | #endif\r |