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