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