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