Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / ipxe / src / include / ipxe / efi / 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 - 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.
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 FILE_LICENCE ( BSD3 );
24
25 #include <ipxe/efi/Protocol/FormBrowser2.h>
26
27 #define EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID  \
28   { 0x330d4706, 0xf2a0, 0x4e4f, { 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } }
29
30 typedef struct _EFI_HII_CONFIG_ACCESS_PROTOCOL  EFI_HII_CONFIG_ACCESS_PROTOCOL;
31
32 typedef UINTN EFI_BROWSER_ACTION;
33
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
45
46 /**
47
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.
60
61   @param This       Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
62
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.
75
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
83                     successful.
84
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.
89
90   @retval EFI_SUCCESS             The Results string is filled with the
91                                   values corresponding to all requested
92                                   names.
93
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
97                                   protocols.
98
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.
103
104   @retval EFI_INVALID_PARAMETER   Illegal syntax. Progress set
105                                   to most recent "&" before the
106                                   error or the beginning of the
107                                   string.
108
109   @retval EFI_INVALID_PARAMETER   Unknown name. Progress points
110                                   to the & before the name in
111                                   question.
112
113 **/
114 typedef
115 EFI_STATUS
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
121 );
122
123
124 /**
125
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
133   simplify the job.
134
135   @param This           Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
136
137   @param Configuration  A null-terminated Unicode string in
138                         <ConfigString> format.
139
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
146                         successful.
147
148   @retval EFI_SUCCESS             The results have been distributed or are
149                                   awaiting distribution.
150
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
154                                   protocols.
155
156   @retval EFI_INVALID_PARAMETERS  Passing in a NULL for the
157                                   Results parameter would result
158                                   in this type of error.
159
160   @retval EFI_NOT_FOUND           Target for the specified routing data
161                                   was not found
162
163 **/
164 typedef
165 EFI_STATUS
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
170 );
171
172 /**
173
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.
177
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
186                                  exporting driver.
187   @param  ActionRequest          On return, points to the action requested by the
188                                  callback function.
189
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
195                                  callback.
196 **/
197 typedef
198 EFI_STATUS
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,
203   IN     UINT8                                  Type,
204   IN OUT EFI_IFR_TYPE_VALUE                     *Value,
205   OUT    EFI_BROWSER_ACTION_REQUEST             *ActionRequest
206   )
207   ;
208
209 ///
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.
213 ///
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;
218 } ;
219
220 extern EFI_GUID gEfiHiiConfigAccessProtocolGuid;
221
222 #endif
223
224