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