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.
8 Copyright (c) 2006 - 2013, 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.
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.
20 #ifndef __EFI_HII_CONFIG_ACCESS_H__
21 #define __EFI_HII_CONFIG_ACCESS_H__
23 FILE_LICENCE ( BSD3 );
25 #include <ipxe/efi/Protocol/FormBrowser2.h>
27 #define EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID \
28 { 0x330d4706, 0xf2a0, 0x4e4f, { 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } }
30 typedef struct _EFI_HII_CONFIG_ACCESS_PROTOCOL EFI_HII_CONFIG_ACCESS_PROTOCOL;
32 typedef UINTN EFI_BROWSER_ACTION;
34 #define EFI_BROWSER_ACTION_CHANGING 0
35 #define EFI_BROWSER_ACTION_CHANGED 1
36 #define EFI_BROWSER_ACTION_RETRIEVE 2
37 #define EFI_BROWSER_ACTION_FORM_OPEN 3
38 #define EFI_BROWSER_ACTION_FORM_CLOSE 4
39 #define EFI_BROWSER_ACTION_DEFAULT_STANDARD 0x1000
40 #define EFI_BROWSER_ACTION_DEFAULT_MANUFACTURING 0x1001
41 #define EFI_BROWSER_ACTION_DEFAULT_SAFE 0x1002
42 #define EFI_BROWSER_ACTION_DEFAULT_PLATFORM 0x2000
43 #define EFI_BROWSER_ACTION_DEFAULT_HARDWARE 0x3000
44 #define EFI_BROWSER_ACTION_DEFAULT_FIRMWARE 0x4000
48 This function allows the caller to request the current
49 configuration for one or more named elements. The resulting
50 string is in <ConfigAltResp> format. Any and all alternative
51 configuration strings shall also be appended to the end of the
52 current configuration string. If they are, they must appear
53 after the current configuration. They must contain the same
54 routing (GUID, NAME, PATH) as the current configuration string.
55 They must have an additional description indicating the type of
56 alternative configuration the string represents,
57 "ALTCFG=<StringToken>". That <StringToken> (when
58 converted from Hex UNICODE to binary) is a reference to a
59 string in the associated string pack.
61 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
63 @param Request A null-terminated Unicode string in
64 <ConfigRequest> format. Note that this
65 includes the routing information as well as
66 the configurable name / value pairs. It is
67 invalid for this string to be in
68 <MultiConfigRequest> format.
69 If a NULL is passed in for the Request field,
70 all of the settings being abstracted by this function
71 will be returned in the Results field. In addition,
72 if a ConfigHdr is passed in with no request elements,
73 all of the settings being abstracted for that particular
74 ConfigHdr reference will be returned in the Results Field.
76 @param Progress On return, points to a character in the
77 Request string. Points to the string's null
78 terminator if request was successful. Points
79 to the most recent "&" before the first
80 failing name / value pair (or the beginning
81 of the string if the failure is in the first
82 name / value pair) if the request was not
85 @param Results A null-terminated Unicode string in
86 <MultiConfigAltResp> format which has all values
87 filled in for the names in the Request string.
88 String to be allocated by the called function.
90 @retval EFI_SUCCESS The Results string is filled with the
91 values corresponding to all requested
94 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
95 parts of the results that must be
96 stored awaiting possible future
99 @retval EFI_NOT_FOUND A configuration element matching
100 the routing data is not found.
101 Progress set to the first character
102 in the routing header.
104 @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set
105 to most recent "&" before the
106 error or the beginning of the
109 @retval EFI_INVALID_PARAMETER Unknown name. Progress points
110 to the & before the name in
116 (EFIAPI * EFI_HII_ACCESS_EXTRACT_CONFIG)(
117 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
118 IN CONST EFI_STRING Request,
119 OUT EFI_STRING *Progress,
120 OUT EFI_STRING *Results
126 This function applies changes in a driver's configuration.
127 Input is a Configuration, which has the routing data for this
128 driver followed by name / value configuration pairs. The driver
129 must apply those pairs to its configurable storage. If the
130 driver's configuration is stored in a linear block of data
131 and the driver's name / value pairs are in <BlockConfig>
132 format, it may use the ConfigToBlock helper function (above) to
135 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
137 @param Configuration A null-terminated Unicode string in
138 <ConfigString> format.
140 @param Progress A pointer to a string filled in with the
141 offset of the most recent '&' before the
142 first failing name / value pair (or the
143 beginn ing of the string if the failure
144 is in the first name / value pair) or
145 the terminating NULL if all was
148 @retval EFI_SUCCESS The results have been distributed or are
149 awaiting distribution.
151 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
152 parts of the results that must be
153 stored awaiting possible future
156 @retval EFI_INVALID_PARAMETERS Passing in a NULL for the
157 Results parameter would result
158 in this type of error.
160 @retval EFI_NOT_FOUND Target for the specified routing data
166 (EFIAPI * EFI_HII_ACCESS_ROUTE_CONFIG)(
167 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
168 IN CONST EFI_STRING Configuration,
169 OUT EFI_STRING *Progress
174 This function is called to provide results data to the driver.
175 This data consists of a unique key that is used to identify
176 which data is either being passed back or being asked for.
178 @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
179 @param Action Specifies the type of action taken by the browser.
180 @param QuestionId A unique value which is sent to the original
181 exporting driver so that it can identify the type
182 of data to expect. The format of the data tends to
183 vary based on the opcode that generated the callback.
184 @param Type The type of value for the question.
185 @param Value A pointer to the data being sent to the original
187 @param ActionRequest On return, points to the action requested by the
190 @retval EFI_SUCCESS The callback successfully handled the action.
191 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
192 variable and its data.
193 @retval EFI_DEVICE_ERROR The variable could not be saved.
194 @retval EFI_UNSUPPORTED The specified Action is not supported by the
199 (EFIAPI *EFI_HII_ACCESS_FORM_CALLBACK)(
200 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
201 IN EFI_BROWSER_ACTION Action,
202 IN EFI_QUESTION_ID QuestionId,
204 IN OUT EFI_IFR_TYPE_VALUE *Value,
205 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
210 /// This protocol provides a callable interface between the HII and
211 /// drivers. Only drivers which provide IFR data to HII are required
212 /// to publish this protocol.
214 struct _EFI_HII_CONFIG_ACCESS_PROTOCOL {
215 EFI_HII_ACCESS_EXTRACT_CONFIG ExtractConfig;
216 EFI_HII_ACCESS_ROUTE_CONFIG RouteConfig;
217 EFI_HII_ACCESS_FORM_CALLBACK Callback;
220 extern EFI_GUID gEfiHiiConfigAccessProtocolGuid;