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