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