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