]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/HiiConfigAccess.h
8b435f72f1aa4d1e1f35635c8d4db2706d7d3ed7
[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
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 If a NULL is passed in for the Request field,
62 all of the settings being abstracted by this function
63 will be returned in the Results field. In addition,
64 if a ConfigHdr is passed in with no request elements,
65 all of the settings being abstracted for that particular
66 ConfigHdr reference will be returned in the Results Field.
67
68 @param Progress On return, points to a character in the
69 Request string. Points to the string's null
70 terminator if request was successful. Points
71 to the most recent "&" before the first
72 failing name / value pair (or the beginning
73 of the string if the failure is in the first
74 name / value pair) if the request was not
75 successful.
76
77 @param Results A null-terminated Unicode string in
78 <MultiConfigAltResp> format which has all values
79 filled in for the names in the Request string.
80 String to be allocated by the called function.
81
82 @retval EFI_SUCCESS The Results string is filled with the
83 values corresponding to all requested
84 names.
85
86 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
87 parts of the results that must be
88 stored awaiting possible future
89 protocols.
90
91 @retval EFI_NOT_FOUND Routing data doesn't match any
92 known driver. Progress set to the
93 first character in the routing header.
94 Note: There is no requirement that the
95 driver validate the routing data. It
96 must skip the <ConfigHdr> in order to
97 process the names.
98
99 @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set
100 to most recent "&" before the
101 error or the beginning of the
102 string.
103
104 @retval EFI_INVALID_PARAMETER Unknown name. Progress points
105 to the & before the name in
106 question.
107
108 **/
109 typedef
110 EFI_STATUS
111 (EFIAPI * EFI_HII_ACCESS_EXTRACT_CONFIG)(
112 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
113 IN CONST EFI_STRING Request,
114 OUT EFI_STRING *Progress,
115 OUT EFI_STRING *Results
116 );
117
118
119 /**
120
121 This function applies changes in a driver's configuration.
122 Input is a Configuration, which has the routing data for this
123 driver followed by name / value configuration pairs. The driver
124 must apply those pairs to its configurable storage. If the
125 driver's configuration is stored in a linear block of data
126 and the driver's name / value pairs are in <BlockConfig>
127 format, it may use the ConfigToBlock helper function (above) to
128 simplify the job.
129
130 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
131
132 @param Configuration A null-terminated Unicode string in
133 <ConfigString> format.
134
135 @param Progress A pointer to a string filled in with the
136 offset of the most recent '&' before the
137 first failing name / value pair (or the
138 beginn ing of the string if the failure
139 is in the first name / value pair) or
140 the terminating NULL if all was
141 successful.
142
143 @retval EFI_SUCCESS The results have been distributed or are
144 awaiting distribution.
145
146 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
147 parts of the results that must be
148 stored awaiting possible future
149 protocols.
150
151 @retval EFI_INVALID_PARAMETERS Passing in a NULL for the
152 Results parameter would result
153 in this type of error.
154
155 @retval EFI_NOT_FOUND Target for the specified routing data
156 was not found
157
158 **/
159 typedef
160 EFI_STATUS
161 (EFIAPI * EFI_HII_ACCESS_ROUTE_CONFIG)(
162 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
163 IN CONST EFI_STRING Configuration,
164 OUT EFI_STRING *Progress
165 );
166
167 /**
168
169 This function is called to provide results data to the driver.
170 This data consists of a unique key that is used to identify
171 which data is either being passed back or being asked for.
172
173 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
174 @param Action Specifies the type of action taken by the browser.
175 @param QuestionId A unique value which is sent to the original
176 exporting driver so that it can identify the type
177 of data to expect. The format of the data tends to
178 vary based on the opcode that generated the callback.
179 @param Type The type of value for the question.
180 @param Value A pointer to the data being sent to the original
181 exporting driver.
182 @param ActionRequest On return, points to the action requested by the
183 callback function.
184
185 @retval EFI_SUCCESS The callback successfully handled the action.
186 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
187 variable and its data.
188 @retval EFI_DEVICE_ERROR The variable could not be saved.
189 @retval EFI_UNSUPPORTED The specified Action is not supported by the
190 callback.
191 **/
192 typedef
193 EFI_STATUS
194 (EFIAPI *EFI_HII_ACCESS_FORM_CALLBACK)(
195 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
196 IN EFI_BROWSER_ACTION Action,
197 IN EFI_QUESTION_ID QuestionId,
198 IN UINT8 Type,
199 IN OUT EFI_IFR_TYPE_VALUE *Value,
200 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
201 )
202 ;
203
204 ///
205 /// This protocol provides a callable interface between the HII and
206 /// drivers. Only drivers which provide IFR data to HII are required
207 /// to publish this protocol.
208 ///
209 struct _EFI_HII_CONFIG_ACCESS_PROTOCOL {
210 EFI_HII_ACCESS_EXTRACT_CONFIG ExtractConfig;
211 EFI_HII_ACCESS_ROUTE_CONFIG RouteConfig;
212 EFI_HII_ACCESS_FORM_CALLBACK Callback;
213 } ;
214
215 extern EFI_GUID gEfiHiiConfigAccessProtocolGuid;
216
217 #endif
218
219