iPXE
HiiConfigAccess.h
Go to the documentation of this file.
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 - 2018, Intel Corporation. All rights reserved.<BR>
9 SPDX-License-Identifier: BSD-2-Clause-Patent
10 
11  @par Revision Reference:
12  This Protocol was introduced in UEFI Specification 2.1.
13 
14 **/
15 
16 #ifndef __EFI_HII_CONFIG_ACCESS_H__
17 #define __EFI_HII_CONFIG_ACCESS_H__
18 
19 FILE_LICENCE ( BSD2_PATENT );
20 FILE_SECBOOT ( PERMITTED );
21 
23 
24 #define EFI_HII_CONFIG_ACCESS_PROTOCOL_GUID \
25  { 0x330d4706, 0xf2a0, 0x4e4f, { 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } }
26 
28 
30 
31 #define EFI_BROWSER_ACTION_CHANGING 0
32 #define EFI_BROWSER_ACTION_CHANGED 1
33 #define EFI_BROWSER_ACTION_RETRIEVE 2
34 #define EFI_BROWSER_ACTION_FORM_OPEN 3
35 #define EFI_BROWSER_ACTION_FORM_CLOSE 4
36 #define EFI_BROWSER_ACTION_SUBMITTED 5
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 A configuration element matching
98  the routing data is not found.
99  Progress set to the first character
100  in the routing header.
101 
102  @retval EFI_INVALID_PARAMETER Illegal syntax. Progress set
103  to most recent "&" before the
104  error or the beginning of the
105  string.
106 
107  @retval EFI_INVALID_PARAMETER Unknown name. Progress points
108  to the "&" before the name in
109  question.
110 
111  @retval EFI_INVALID_PARAMETER If Results or Progress is NULL.
112 
113  @retval EFI_ACCESS_DENIED The action violated a system policy.
114 
115  @retval EFI_DEVICE_ERROR Failed to extract the current configuration
116  for one or more named elements.
117 
118 **/
119 typedef
123  IN CONST EFI_STRING Request,
124  OUT EFI_STRING *Progress,
125  OUT EFI_STRING *Results
126  );
127 
128 /**
129 
130  This function applies changes in a driver's configuration.
131  Input is a Configuration, which has the routing data for this
132  driver followed by name / value configuration pairs. The driver
133  must apply those pairs to its configurable storage. If the
134  driver's configuration is stored in a linear block of data
135  and the driver's name / value pairs are in <BlockConfig>
136  format, it may use the ConfigToBlock helper function (above) to
137  simplify the job.
138 
139  @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
140 
141  @param Configuration A null-terminated Unicode string in
142  <ConfigString> format.
143 
144  @param Progress A pointer to a string filled in with the
145  offset of the most recent '&' before the
146  first failing name / value pair (or the
147  beginn ing of the string if the failure
148  is in the first name / value pair) or
149  the terminating NULL if all was
150  successful.
151 
152  @retval EFI_SUCCESS The results have been distributed or are
153  awaiting distribution.
154 
155  @retval EFI_OUT_OF_RESOURCES Not enough memory to store the
156  parts of the results that must be
157  stored awaiting possible future
158  protocols.
159 
160  @retval EFI_INVALID_PARAMETERS Passing in a NULL for the
161  Results parameter would result
162  in this type of error.
163 
164  @retval EFI_NOT_FOUND Target for the specified routing data
165  was not found
166 
167 **/
168 typedef
172  IN CONST EFI_STRING Configuration,
173  OUT EFI_STRING *Progress
174  );
175 
176 /**
177 
178  This function is called to provide results data to the driver.
179  This data consists of a unique key that is used to identify
180  which data is either being passed back or being asked for.
181 
182  @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
183  @param Action Specifies the type of action taken by the browser.
184  @param QuestionId A unique value which is sent to the original
185  exporting driver so that it can identify the type
186  of data to expect. The format of the data tends to
187  vary based on the opcode that generated the callback.
188  @param Type The type of value for the question.
189  @param Value A pointer to the data being sent to the original
190  exporting driver.
191  @param ActionRequest On return, points to the action requested by the
192  callback function.
193 
194  @retval EFI_SUCCESS The callback successfully handled the action.
195  @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the
196  variable and its data.
197  @retval EFI_DEVICE_ERROR The variable could not be saved.
198  @retval EFI_UNSUPPORTED The specified Action is not supported by the
199  callback.
200 **/
201 typedef
205  IN EFI_BROWSER_ACTION Action,
206  IN EFI_QUESTION_ID QuestionId,
207  IN UINT8 Type,
208  IN OUT EFI_IFR_TYPE_VALUE *Value,
209  OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
210  )
211 ;
212 
213 ///
214 /// This protocol provides a callable interface between the HII and
215 /// drivers. Only drivers which provide IFR data to HII are required
216 /// to publish this protocol.
217 ///
222 };
223 
225 
226 #endif
EFI_STATUS(EFIAPI * EFI_HII_ACCESS_EXTRACT_CONFIG)(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Request, OUT EFI_STRING *Progress, OUT EFI_STRING *Results)
This function allows the caller to request the current configuration for one or more named elements.
UINT8 Type
Definition: Acpi10.h:137
128 bit buffer containing a unique identifier value.
Definition: Base.h:216
FILE_SECBOOT(PERMITTED)
EFI_HII_ACCESS_EXTRACT_CONFIG ExtractConfig
CHAR16 * EFI_STRING
FILE_LICENCE(BSD2_PATENT)
unsigned char UINT8
EFI_HII_ACCESS_ROUTE_CONFIG RouteConfig
UINTN EFI_BROWSER_ACTION_REQUEST
Definition: FormBrowser2.h:50
This protocol provides a callable interface between the HII and drivers.
#define OUT
Definition: mlx_utils.h:29
#define EFIAPI
UINT64 UINTN
Unsigned value of native width.
EFI_STATUS(EFIAPI * EFI_HII_ACCESS_FORM_CALLBACK)(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN EFI_BROWSER_ACTION Action, IN EFI_QUESTION_ID QuestionId, IN UINT8 Type, IN OUT EFI_IFR_TYPE_VALUE *Value, OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest)
This function is called to provide results data to the driver.
#define IN
Definition: mlx_utils.h:28
#define CONST
Datum is read-only.
Definition: Base.h:262
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:32
EFI_HII_ACCESS_FORM_CALLBACK Callback
EFI_GUID gEfiHiiConfigAccessProtocolGuid
UINT16 EFI_QUESTION_ID
EFI_STATUS(EFIAPI * EFI_HII_ACCESS_ROUTE_CONFIG)(IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, IN CONST EFI_STRING Configuration, OUT EFI_STRING *Progress)
This function applies changes in a driver's configuration.
This protocol is defined in UEFI spec.
UINTN EFI_BROWSER_ACTION