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