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