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