]>
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 | |
9344f092 | 9 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
d1f95000 | 10 | \r |
497a5fb1 SZ |
11 | @par Revision Reference:\r |
12 | This Protocol was introduced in UEFI Specification 2.1.\r | |
13 | \r | |
d1f95000 | 14 | **/\r |
15 | \r | |
d1f95000 | 16 | #ifndef __EFI_HII_CONFIG_ACCESS_H__\r |
17 | #define __EFI_HII_CONFIG_ACCESS_H__\r | |
18 | \r | |
7d582d6b | 19 | #include <Protocol/FormBrowser2.h>\r |
1528fae8 | 20 | \r |
5a1fc221 | 21 | #define EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID \\r |
d1f95000 | 22 | { 0x330d4706, 0xf2a0, 0x4e4f, { 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } }\r |
23 | \r | |
2f88bd3a | 24 | typedef struct _EFI_HII_CONFIG_ACCESS_PROTOCOL EFI_HII_CONFIG_ACCESS_PROTOCOL;\r |
d1f95000 | 25 | \r |
7d582d6b | 26 | typedef UINTN EFI_BROWSER_ACTION;\r |
27 | \r | |
2f88bd3a MK |
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 | |
7d582d6b | 40 | \r |
d1f95000 | 41 | /**\r |
9095d37b | 42 | \r |
d1f95000 | 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 | |
4ca9b6c4 | 56 | @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r |
d1f95000 | 57 | \r |
4ca9b6c4 LG |
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 | |
9095d37b LG |
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 | |
a1e98f78 | 69 | ConfigHdr reference will be returned in the Results Field.\r |
d1f95000 | 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 | |
af2dc6a7 | 78 | successful.\r |
d1f95000 | 79 | \r |
4ca9b6c4 | 80 | @param Results A null-terminated Unicode string in\r |
a1e98f78 | 81 | <MultiConfigAltResp> format which has all values\r |
4ca9b6c4 LG |
82 | filled in for the names in the Request string.\r |
83 | String to be allocated by the called function.\r | |
d1f95000 | 84 | \r |
4ca9b6c4 LG |
85 | @retval EFI_SUCCESS The Results string is filled with the\r |
86 | values corresponding to all requested\r | |
87 | names.\r | |
d1f95000 | 88 | \r |
e1f1fb16 | 89 | @retval EFI_OUT_OF_RESOURCES Not enough memory to store the\r |
4ca9b6c4 LG |
90 | parts of the results that must be\r |
91 | stored awaiting possible future\r | |
92 | protocols.\r | |
d1f95000 | 93 | \r |
9095d37b | 94 | @retval EFI_NOT_FOUND A configuration element matching\r |
53ba4e9e ED |
95 | the routing data is not found.\r |
96 | Progress set to the first character\r | |
97 | in the routing header.\r | |
d1f95000 | 98 | \r |
99 | @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set\r | |
630b4187 | 100 | to most recent "&" before the\r |
d1f95000 | 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 | |
109 | typedef\r | |
110 | EFI_STATUS\r | |
2f88bd3a | 111 | (EFIAPI *EFI_HII_ACCESS_EXTRACT_CONFIG)(\r |
d1f95000 | 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 | |
2f88bd3a | 116 | );\r |
d1f95000 | 117 | \r |
118 | /**\r | |
9095d37b | 119 | \r |
d1f95000 | 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 | |
1cea34d4 | 125 | and the driver's name / value pairs are in <BlockConfig>\r |
d1f95000 | 126 | format, it may use the ConfigToBlock helper function (above) to\r |
127 | simplify the job.\r | |
128 | \r | |
4ca9b6c4 | 129 | @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r |
d1f95000 | 130 | \r |
131 | @param Configuration A null-terminated Unicode string in\r | |
9095d37b LG |
132 | <ConfigString> format.\r |
133 | \r | |
4ca9b6c4 | 134 | @param Progress A pointer to a string filled in with the\r |
d1f95000 | 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 | |
4ca9b6c4 LG |
142 | @retval EFI_SUCCESS The results have been distributed or are\r |
143 | awaiting distribution.\r | |
9095d37b | 144 | \r |
e1f1fb16 | 145 | @retval EFI_OUT_OF_RESOURCES Not enough memory to store the\r |
4ca9b6c4 LG |
146 | parts of the results that must be\r |
147 | stored awaiting possible future\r | |
148 | protocols.\r | |
9095d37b | 149 | \r |
d1f95000 | 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 | |
9095d37b | 153 | \r |
4ca9b6c4 LG |
154 | @retval EFI_NOT_FOUND Target for the specified routing data\r |
155 | was not found\r | |
d1f95000 | 156 | \r |
157 | **/\r | |
158 | typedef\r | |
159 | EFI_STATUS\r | |
2f88bd3a | 160 | (EFIAPI *EFI_HII_ACCESS_ROUTE_CONFIG)(\r |
d1f95000 | 161 | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r |
162 | IN CONST EFI_STRING Configuration,\r | |
163 | OUT EFI_STRING *Progress\r | |
2f88bd3a | 164 | );\r |
d1f95000 | 165 | \r |
166 | /**\r | |
9095d37b | 167 | \r |
d1f95000 | 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 | |
4ca9b6c4 LG |
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 | |
9095d37b | 176 | of data to expect. The format of the data tends to\r |
630b4187 | 177 | vary based on the opcode that generated the callback.\r |
4ca9b6c4 LG |
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 | |
d1f95000 | 190 | **/\r |
191 | typedef\r | |
192 | EFI_STATUS\r | |
8b13229b | 193 | (EFIAPI *EFI_HII_ACCESS_FORM_CALLBACK)(\r |
0cd118f7 LG |
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 | |
5a1fc221 | 200 | )\r |
2f88bd3a | 201 | ;\r |
9095d37b | 202 | \r |
44717a39 | 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 | |
d1f95000 | 208 | struct _EFI_HII_CONFIG_ACCESS_PROTOCOL {\r |
2f88bd3a MK |
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 | |
d1f95000 | 213 | \r |
2f88bd3a | 214 | extern EFI_GUID gEfiHiiConfigAccessProtocolGuid;\r |
d1f95000 | 215 | \r |
216 | #endif\r |