]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
MdeModulePkg/EbcDebugger: Add check for invalid 'CommandArg'
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Setup.h
... / ...
CommitLineData
1/** @file\r
2Private MACRO, structure and function definitions for Setup Browser module.\r
3\r
4Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\r
5This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13\r
14**/\r
15\r
16#ifndef _SETUP_H_\r
17#define _SETUP_H_\r
18\r
19\r
20#include <PiDxe.h>\r
21\r
22#include <Protocol/SimpleTextOut.h>\r
23#include <Protocol/SimpleTextIn.h>\r
24#include <Protocol/FormBrowser2.h>\r
25#include <Protocol/FormBrowserEx2.h>\r
26#include <Protocol/DisplayProtocol.h>\r
27#include <Protocol/DevicePath.h>\r
28#include <Protocol/UnicodeCollation.h>\r
29#include <Protocol/HiiConfigAccess.h>\r
30#include <Protocol/HiiConfigRouting.h>\r
31#include <Protocol/HiiDatabase.h>\r
32#include <Protocol/HiiString.h>\r
33#include <Protocol/UserManager.h>\r
34#include <Protocol/DevicePathFromText.h>\r
35#include <Protocol/RegularExpressionProtocol.h>\r
36\r
37#include <Guid/MdeModuleHii.h>\r
38#include <Guid/HiiPlatformSetupFormset.h>\r
39#include <Guid/HiiFormMapMethodGuid.h>\r
40#include <Guid/ZeroGuid.h>\r
41\r
42#include <Library/PrintLib.h>\r
43#include <Library/DebugLib.h>\r
44#include <Library/BaseMemoryLib.h>\r
45#include <Library/UefiRuntimeServicesTableLib.h>\r
46#include <Library/UefiDriverEntryPoint.h>\r
47#include <Library/UefiBootServicesTableLib.h>\r
48#include <Library/BaseLib.h>\r
49#include <Library/MemoryAllocationLib.h>\r
50#include <Library/HiiLib.h>\r
51#include <Library/PcdLib.h>\r
52#include <Library/DevicePathLib.h>\r
53#include <Library/UefiLib.h>\r
54\r
55\r
56//\r
57// This is the generated header file which includes whatever needs to be exported (strings + IFR)\r
58//\r
59\r
60#define UI_ACTION_NONE 0\r
61#define UI_ACTION_REFRESH_FORM 1\r
62#define UI_ACTION_REFRESH_FORMSET 2\r
63#define UI_ACTION_EXIT 3\r
64\r
65//\r
66//\r
67// Time definitions\r
68//\r
69#define ONE_SECOND 10000000\r
70\r
71// Incremental string lenght of ConfigRequest\r
72//\r
73#define CONFIG_REQUEST_STRING_INCREMENTAL 1024\r
74\r
75//\r
76// Incremental size of stack for expression\r
77//\r
78#define EXPRESSION_STACK_SIZE_INCREMENT 0x100\r
79\r
80#define EFI_IFR_SPECIFICATION_VERSION (UINT16) (((EFI_SYSTEM_TABLE_REVISION >> 16) << 8) | (((EFI_SYSTEM_TABLE_REVISION & 0xFFFF) / 10) << 4) | ((EFI_SYSTEM_TABLE_REVISION & 0xFFFF) % 10))\r
81\r
82\r
83#define SETUP_DRIVER_SIGNATURE SIGNATURE_32 ('F', 'B', 'D', 'V')\r
84typedef struct {\r
85 UINT32 Signature;\r
86\r
87 EFI_HANDLE Handle;\r
88\r
89 //\r
90 // Produced protocol\r
91 //\r
92 EFI_FORM_BROWSER2_PROTOCOL FormBrowser2;\r
93 EDKII_FORM_BROWSER_EXTENSION_PROTOCOL FormBrowserEx;\r
94\r
95 EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL FormBrowserEx2;\r
96\r
97} SETUP_DRIVER_PRIVATE_DATA;\r
98\r
99//\r
100// IFR relative definition\r
101//\r
102#define EFI_HII_EXPRESSION_INCONSISTENT_IF 0\r
103#define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1\r
104#define EFI_HII_EXPRESSION_GRAY_OUT_IF 2\r
105#define EFI_HII_EXPRESSION_SUPPRESS_IF 3\r
106#define EFI_HII_EXPRESSION_DISABLE_IF 4\r
107#define EFI_HII_EXPRESSION_VALUE 5\r
108#define EFI_HII_EXPRESSION_RULE 6\r
109#define EFI_HII_EXPRESSION_READ 7\r
110#define EFI_HII_EXPRESSION_WRITE 8\r
111#define EFI_HII_EXPRESSION_WARNING_IF 9\r
112\r
113#define EFI_HII_VARSTORE_BUFFER 0\r
114#define EFI_HII_VARSTORE_NAME_VALUE 1\r
115#define EFI_HII_VARSTORE_EFI_VARIABLE 2 // EFI Varstore type follow UEFI spec before 2.3.1.\r
116#define EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER 3 // EFI varstore type follow UEFI spec 2.3.1 and later.\r
117\r
118#define FORM_INCONSISTENT_VALIDATION 0\r
119#define FORM_NO_SUBMIT_VALIDATION 1\r
120\r
121#define NAME_VALUE_NODE_SIGNATURE SIGNATURE_32 ('N', 'V', 'S', 'T')\r
122\r
123typedef struct {\r
124 UINTN Signature;\r
125 LIST_ENTRY Link;\r
126 CHAR16 *Name;\r
127 CHAR16 *Value;\r
128 CHAR16 *EditValue;\r
129} NAME_VALUE_NODE;\r
130\r
131#define NAME_VALUE_NODE_FROM_LINK(a) CR (a, NAME_VALUE_NODE, Link, NAME_VALUE_NODE_SIGNATURE)\r
132\r
133#define BROWSER_STORAGE_SIGNATURE SIGNATURE_32 ('B', 'S', 'T', 'G')\r
134\r
135typedef struct {\r
136 UINTN Signature;\r
137 LIST_ENTRY Link;\r
138\r
139 UINT8 Type; // Storage type\r
140\r
141 BOOLEAN Initialized; // Whether this varstore is initialized, efi varstore not used.\r
142\r
143 EFI_HII_HANDLE HiiHandle; // HiiHandle for this varstore, efi varstore not used.\r
144 EFI_GUID Guid;\r
145\r
146 CHAR16 *Name; // For EFI_IFR_VARSTORE\r
147 UINT16 Size;\r
148 UINT8 *Buffer;\r
149 UINT8 *EditBuffer; // Edit copy for Buffer Storage\r
150\r
151 LIST_ENTRY NameValueListHead; // List of NAME_VALUE_NODE\r
152\r
153 UINT32 Attributes; // For EFI_IFR_VARSTORE_EFI: EFI Variable attribute\r
154\r
155 CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>\r
156 // <RequestElement> includes all fields which is used by current form sets.\r
157 UINTN SpareStrLen; // Spare length of ConfigRequest string buffer\r
158} BROWSER_STORAGE;\r
159\r
160#define BROWSER_STORAGE_FROM_LINK(a) CR (a, BROWSER_STORAGE, Link, BROWSER_STORAGE_SIGNATURE)\r
161\r
162#define FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'G')\r
163\r
164typedef struct {\r
165 UINTN Signature;\r
166 LIST_ENTRY Link;\r
167\r
168 LIST_ENTRY SaveFailLink;\r
169\r
170 UINT16 VarStoreId;\r
171\r
172 BROWSER_STORAGE *BrowserStorage;\r
173\r
174 CHAR16 *ConfigHdr; // <ConfigHdr>\r
175\r
176 CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>\r
177 CHAR16 *ConfigAltResp; // Alt config response string for this ConfigRequest.\r
178 BOOLEAN HasCallAltCfg; // Flag to show whether browser has call ExtractConfig to get Altcfg string.\r
179 UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest>\r
180 UINTN SpareStrLen; // Spare length of ConfigRequest string buffer\r
181 CHAR16 *RestoreConfigRequest; // When submit formset fail, the element need to be restored\r
182 CHAR16 *SyncConfigRequest; // When submit formset fail, the element need to be synced\r
183} FORMSET_STORAGE;\r
184\r
185#define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)\r
186#define FORMSET_STORAGE_FROM_SAVE_FAIL_LINK(a) CR (a, FORMSET_STORAGE, SaveFailLink, FORMSET_STORAGE_SIGNATURE)\r
187\r
188typedef union {\r
189 EFI_STRING_ID VarName;\r
190 UINT16 VarOffset;\r
191} VAR_STORE_INFO;\r
192\r
193#define EXPRESSION_OPCODE_SIGNATURE SIGNATURE_32 ('E', 'X', 'O', 'P')\r
194\r
195typedef struct {\r
196 UINTN Signature;\r
197 LIST_ENTRY Link;\r
198\r
199 UINT8 Operand;\r
200\r
201 UINT8 Format; // For EFI_IFR_TO_STRING, EFI_IFR_FIND\r
202 UINT8 Flags; // For EFI_IFR_SPAN\r
203 UINT8 RuleId; // For EFI_IFR_RULE_REF\r
204\r
205 EFI_HII_VALUE Value; // For EFI_IFR_EQ_ID_VAL, EFI_IFR_UINT64, EFI_IFR_UINT32, EFI_IFR_UINT16, EFI_IFR_UINT8, EFI_IFR_STRING_REF1\r
206\r
207 EFI_QUESTION_ID QuestionId; // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_VAL_LIST, EFI_IFR_QUESTION_REF1\r
208 EFI_QUESTION_ID QuestionId2;\r
209\r
210 UINT16 ListLength; // For EFI_IFR_EQ_ID_VAL_LIST\r
211 UINT16 *ValueList;\r
212\r
213 EFI_STRING_ID DevicePath; // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3\r
214 EFI_GUID Guid;\r
215\r
216 BROWSER_STORAGE *VarStorage; // For EFI_IFR_SET, EFI_IFR_GET\r
217 VAR_STORE_INFO VarStoreInfo;// For EFI_IFR_SET, EFI_IFR_GET\r
218 UINT8 ValueType; // For EFI_IFR_SET, EFI_IFR_GET\r
219 UINT8 ValueWidth; // For EFI_IFR_SET, EFI_IFR_GET\r
220 CHAR16 *ValueName; // For EFI_IFR_SET, EFI_IFR_GET\r
221 LIST_ENTRY MapExpressionList; // nested expressions inside of Map opcode.\r
222} EXPRESSION_OPCODE;\r
223\r
224#define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)\r
225\r
226#define FORM_EXPRESSION_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'P')\r
227\r
228typedef struct {\r
229 UINTN Signature;\r
230 LIST_ENTRY Link;\r
231\r
232 UINT8 Type; // Type for this expression\r
233\r
234 UINT8 RuleId; // For EFI_IFR_RULE only\r
235 EFI_STRING_ID Error; // For EFI_IFR_NO_SUBMIT_IF, EFI_IFR_INCONSISTENT_IF only\r
236\r
237 EFI_HII_VALUE Result; // Expression evaluation result\r
238\r
239 UINT8 TimeOut; // For EFI_IFR_WARNING_IF\r
240 EFI_IFR_OP_HEADER *OpCode; // Save the opcode buffer.\r
241\r
242 LIST_ENTRY OpCodeListHead; // OpCodes consist of this expression (EXPRESSION_OPCODE)\r
243} FORM_EXPRESSION;\r
244\r
245#define FORM_EXPRESSION_FROM_LINK(a) CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)\r
246\r
247#define FORM_EXPRESSION_LIST_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'R')\r
248\r
249typedef struct {\r
250 UINTN Signature;\r
251 UINTN Count;\r
252 FORM_EXPRESSION *Expression[1]; // Array[Count] of expressions\r
253} FORM_EXPRESSION_LIST;\r
254\r
255#define QUESTION_DEFAULT_SIGNATURE SIGNATURE_32 ('Q', 'D', 'F', 'T')\r
256\r
257typedef struct {\r
258 UINTN Signature;\r
259 LIST_ENTRY Link;\r
260\r
261 UINT16 DefaultId;\r
262 EFI_HII_VALUE Value; // Default value\r
263\r
264 FORM_EXPRESSION *ValueExpression; // Not-NULL indicates default value is provided by EFI_IFR_VALUE\r
265} QUESTION_DEFAULT;\r
266\r
267#define QUESTION_DEFAULT_FROM_LINK(a) CR (a, QUESTION_DEFAULT, Link, QUESTION_DEFAULT_SIGNATURE)\r
268\r
269#define QUESTION_OPTION_SIGNATURE SIGNATURE_32 ('Q', 'O', 'P', 'T')\r
270\r
271typedef struct {\r
272 UINTN Signature;\r
273 LIST_ENTRY Link;\r
274 \r
275 EFI_IFR_ONE_OF_OPTION *OpCode; // OneOfOption Data\r
276\r
277 EFI_STRING_ID Text;\r
278 UINT8 Flags;\r
279 EFI_HII_VALUE Value;\r
280 EFI_IMAGE_ID ImageId;\r
281\r
282 FORM_EXPRESSION_LIST *SuppressExpression; // Non-NULL indicates nested inside of SuppressIf\r
283} QUESTION_OPTION;\r
284\r
285#define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)\r
286\r
287typedef enum {\r
288 ExpressFalse = 0,\r
289 ExpressGrayOut, \r
290 ExpressSuppress,\r
291 ExpressDisable\r
292} EXPRESS_RESULT;\r
293\r
294typedef enum {\r
295 ExpressNone = 0,\r
296 ExpressForm, \r
297 ExpressStatement,\r
298 ExpressOption\r
299} EXPRESS_LEVEL;\r
300\r
301typedef struct _FORM_BROWSER_STATEMENT FORM_BROWSER_STATEMENT;\r
302\r
303#define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')\r
304\r
305struct _FORM_BROWSER_STATEMENT{\r
306 UINTN Signature;\r
307 LIST_ENTRY Link;\r
308\r
309 UINT8 Operand; // The operand (first byte) of this Statement or Question\r
310 EFI_IFR_OP_HEADER *OpCode;\r
311\r
312 //\r
313 // Statement Header\r
314 //\r
315 EFI_STRING_ID Prompt;\r
316 EFI_STRING_ID Help;\r
317 EFI_STRING_ID TextTwo; // For EFI_IFR_TEXT\r
318\r
319 //\r
320 // Fake Question Id, used for statement not has true QuestionId.\r
321 //\r
322 EFI_QUESTION_ID FakeQuestionId;\r
323\r
324 //\r
325 // Question Header\r
326 //\r
327 EFI_QUESTION_ID QuestionId; // The value of zero is reserved\r
328 EFI_VARSTORE_ID VarStoreId; // A value of zero indicates no variable storage\r
329 BROWSER_STORAGE *Storage;\r
330 VAR_STORE_INFO VarStoreInfo;\r
331 UINT16 StorageWidth;\r
332 UINT8 QuestionFlags;\r
333 CHAR16 *VariableName; // Name/Value or EFI Variable name\r
334 CHAR16 *BlockName; // Buffer storage block name: "OFFSET=...WIDTH=..."\r
335\r
336 EFI_HII_VALUE HiiValue; // Edit copy for checkbox, numberic, oneof\r
337 UINT8 *BufferValue; // Edit copy for string, password, orderedlist\r
338 UINT8 ValueType; // Data type for orderedlist value array\r
339\r
340 //\r
341 // OpCode specific members\r
342 //\r
343 UINT8 Flags; // for EFI_IFR_CHECKBOX, EFI_IFR_DATE, EFI_IFR_NUMERIC, EFI_IFR_ONE_OF,\r
344 // EFI_IFR_ORDERED_LIST, EFI_IFR_STRING,EFI_IFR_SUBTITLE,EFI_IFR_TIME, EFI_IFR_BANNER\r
345 UINT8 MaxContainers; // for EFI_IFR_ORDERED_LIST\r
346\r
347 UINT16 BannerLineNumber; // for EFI_IFR_BANNER, 1-based line number\r
348 EFI_STRING_ID QuestionConfig; // for EFI_IFR_ACTION, if 0 then no configuration string will be processed\r
349\r
350 UINT64 Minimum; // for EFI_IFR_ONE_OF/EFI_IFR_NUMERIC, it's Min/Max value\r
351 UINT64 Maximum; // for EFI_IFR_STRING/EFI_IFR_PASSWORD, it's Min/Max length\r
352 UINT64 Step;\r
353\r
354 EFI_DEFAULT_ID DefaultId; // for EFI_IFR_RESET_BUTTON\r
355 EFI_GUID RefreshGuid; // for EFI_IFR_REFRESH_ID\r
356 BOOLEAN Locked; // Whether this statement is locked.\r
357 BOOLEAN ValueChanged; // Whether this statement's value is changed.\r
358 //\r
359 // Get from IFR parsing\r
360 //\r
361 FORM_EXPRESSION *ValueExpression; // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly\r
362 LIST_ENTRY DefaultListHead; // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values\r
363 LIST_ENTRY OptionListHead; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)\r
364\r
365 EFI_IMAGE_ID ImageId; // nested EFI_IFR_IMAGE\r
366 UINT8 RefreshInterval; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh\r
367\r
368 FORM_BROWSER_STATEMENT *ParentStatement;\r
369\r
370 LIST_ENTRY InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION)\r
371 LIST_ENTRY NoSubmitListHead; // nested nosubmit expression list (FORM_EXPRESSION)\r
372 LIST_ENTRY WarningListHead; // nested warning expression list (FORM_EXPRESSION)\r
373 FORM_EXPRESSION_LIST *Expression; // nesting inside of GrayOutIf/DisableIf/SuppressIf\r
374\r
375 FORM_EXPRESSION *ReadExpression; // nested EFI_IFR_READ, provide this question value by read expression.\r
376 FORM_EXPRESSION *WriteExpression; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.\r
377};\r
378\r
379#define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)\r
380\r
381#define FORM_BROWSER_CONFIG_REQUEST_SIGNATURE SIGNATURE_32 ('F', 'C', 'R', 'S')\r
382typedef struct {\r
383 UINTN Signature;\r
384 LIST_ENTRY Link;\r
385\r
386 LIST_ENTRY SaveFailLink;\r
387\r
388 CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>\r
389 CHAR16 *ConfigAltResp; // Alt config response string for this ConfigRequest.\r
390 UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest> \r
391 UINTN SpareStrLen;\r
392 CHAR16 *RestoreConfigRequest; // When submit form fail, the element need to be restored\r
393 CHAR16 *SyncConfigRequest; // When submit form fail, the element need to be synced\r
394\r
395 BROWSER_STORAGE *Storage;\r
396} FORM_BROWSER_CONFIG_REQUEST;\r
397#define FORM_BROWSER_CONFIG_REQUEST_FROM_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, Link, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)\r
398#define FORM_BROWSER_CONFIG_REQUEST_FROM_SAVE_FAIL_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, SaveFailLink, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)\r
399\r
400#define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')\r
401#define STANDARD_MAP_FORM_TYPE 0x01\r
402\r
403typedef struct {\r
404 UINTN Signature;\r
405 LIST_ENTRY Link;\r
406\r
407 UINT16 FormId; // FormId of normal form or formmap form.\r
408 EFI_STRING_ID FormTitle; // FormTile of normal form, or FormMapMethod title of formmap form.\r
409 UINT16 FormType; // Specific form type for the different form.\r
410\r
411 EFI_IMAGE_ID ImageId;\r
412\r
413 BOOLEAN ModalForm; // Whether this is a modal form.\r
414 BOOLEAN Locked; // Whether this form is locked.\r
415 EFI_GUID RefreshGuid; // Form refresh event guid.\r
416\r
417 LIST_ENTRY FormViewListHead; // List of type FORMID_INFO is Browser View Form History List.\r
418 LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)\r
419 LIST_ENTRY StatementListHead; // List of Statements and Questions (FORM_BROWSER_STATEMENT)\r
420 LIST_ENTRY ConfigRequestHead; // List of configreques for all storage.\r
421 FORM_EXPRESSION_LIST *SuppressExpression; // nesting inside of SuppressIf\r
422} FORM_BROWSER_FORM;\r
423\r
424#define FORM_BROWSER_FORM_FROM_LINK(a) CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)\r
425\r
426#define FORMSET_DEFAULTSTORE_SIGNATURE SIGNATURE_32 ('F', 'D', 'F', 'S')\r
427\r
428typedef struct {\r
429 UINTN Signature;\r
430 LIST_ENTRY Link;\r
431\r
432 UINT16 DefaultId;\r
433 EFI_STRING_ID DefaultName;\r
434} FORMSET_DEFAULTSTORE;\r
435\r
436#define FORMSET_DEFAULTSTORE_FROM_LINK(a) CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE)\r
437\r
438#define FORM_BROWSER_FORMSET_SIGNATURE SIGNATURE_32 ('F', 'B', 'F', 'S')\r
439\r
440typedef struct {\r
441 UINTN Signature;\r
442 LIST_ENTRY Link;\r
443 LIST_ENTRY SaveFailLink;\r
444\r
445 EFI_HII_HANDLE HiiHandle; // unique id for formset.\r
446 EFI_HANDLE DriverHandle;\r
447 EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess;\r
448 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
449\r
450 UINTN IfrBinaryLength;\r
451 UINT8 *IfrBinaryData;\r
452\r
453 BOOLEAN QuestionInited; // Have finished question initilization?\r
454 EFI_GUID Guid;\r
455 EFI_STRING_ID FormSetTitle;\r
456 EFI_STRING_ID Help;\r
457 UINT8 NumberOfClassGuid;\r
458 EFI_GUID ClassGuid[3]; // Up to three ClassGuid\r
459 UINT16 Class; // Tiano extended Class code\r
460 UINT16 SubClass; // Tiano extended Subclass code\r
461 EFI_IMAGE_ID ImageId;\r
462 EFI_IFR_OP_HEADER *OpCode; //mainly for formset op to get ClassGuid\r
463\r
464 FORM_BROWSER_STATEMENT *StatementBuffer; // Buffer for all Statements and Questions\r
465 EXPRESSION_OPCODE *ExpressionBuffer; // Buffer for all Expression OpCode\r
466 FORM_BROWSER_FORM *SaveFailForm; // The form which failed to save.\r
467 FORM_BROWSER_STATEMENT *SaveFailStatement; // The Statement which failed to save.\r
468\r
469 LIST_ENTRY StatementListOSF; // Statement list out side of the form.\r
470 LIST_ENTRY StorageListHead; // Storage list (FORMSET_STORAGE)\r
471 LIST_ENTRY SaveFailStorageListHead; // Storage list for the save fail storage.\r
472 LIST_ENTRY DefaultStoreListHead; // DefaultStore list (FORMSET_DEFAULTSTORE)\r
473 LIST_ENTRY FormListHead; // Form list (FORM_BROWSER_FORM)\r
474 LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION)\r
475} FORM_BROWSER_FORMSET;\r
476#define FORM_BROWSER_FORMSET_FROM_LINK(a) CR (a, FORM_BROWSER_FORMSET, Link, FORM_BROWSER_FORMSET_SIGNATURE)\r
477\r
478#define FORM_BROWSER_FORMSET_FROM_SAVE_FAIL_LINK(a) CR (a, FORM_BROWSER_FORMSET, SaveFailLink, FORM_BROWSER_FORMSET_SIGNATURE)\r
479\r
480typedef struct {\r
481 LIST_ENTRY Link;\r
482 EFI_EVENT RefreshEvent;\r
483} FORM_BROWSER_REFRESH_EVENT_NODE;\r
484\r
485#define FORM_BROWSER_REFRESH_EVENT_FROM_LINK(a) BASE_CR (a, FORM_BROWSER_REFRESH_EVENT_NODE, Link)\r
486\r
487\r
488typedef struct {\r
489 EFI_HII_HANDLE Handle;\r
490\r
491 //\r
492 // Target formset/form/Question information\r
493 //\r
494 EFI_GUID FormSetGuid;\r
495 UINT16 FormId;\r
496 UINT16 QuestionId;\r
497 UINTN Sequence; // used for time/date only.\r
498\r
499 UINTN TopRow;\r
500 UINTN BottomRow;\r
501 UINTN PromptCol;\r
502 UINTN OptionCol;\r
503 UINTN CurrentRow;\r
504\r
505 //\r
506 // Ation for Browser to taken:\r
507 // UI_ACTION_NONE - navigation inside a form\r
508 // UI_ACTION_REFRESH_FORM - re-evaluate expressions and repaint form\r
509 // UI_ACTION_REFRESH_FORMSET - re-parse formset IFR binary\r
510 //\r
511 UINTN Action;\r
512\r
513 //\r
514 // Current selected fomset/form/Question\r
515 //\r
516 FORM_BROWSER_FORMSET *FormSet;\r
517 FORM_BROWSER_FORM *Form;\r
518 FORM_BROWSER_STATEMENT *Statement;\r
519\r
520 //\r
521 // Whether the Form is editable\r
522 //\r
523 BOOLEAN FormEditable;\r
524\r
525 FORM_ENTRY_INFO *CurrentMenu;\r
526} UI_MENU_SELECTION;\r
527\r
528#define BROWSER_CONTEXT_SIGNATURE SIGNATURE_32 ('B', 'C', 'T', 'X')\r
529\r
530typedef struct {\r
531 UINTN Signature;\r
532 LIST_ENTRY Link;\r
533\r
534 //\r
535 // Globals defined in Setup.c\r
536 //\r
537 BOOLEAN FlagReconnect;\r
538 BOOLEAN CallbackReconnect;\r
539 BOOLEAN ResetRequired;\r
540 BOOLEAN ExitRequired;\r
541 EFI_HII_HANDLE HiiHandle;\r
542 EFI_GUID FormSetGuid;\r
543 EFI_FORM_ID FormId;\r
544 UI_MENU_SELECTION *Selection;\r
545 FORM_BROWSER_FORMSET *SystemLevelFormSet;\r
546 EFI_QUESTION_ID CurFakeQestId;\r
547 BOOLEAN HiiPackageListUpdated;\r
548 BOOLEAN FinishRetrieveCall;\r
549 LIST_ENTRY FormHistoryList;\r
550 LIST_ENTRY FormSetList;\r
551} BROWSER_CONTEXT;\r
552\r
553#define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)\r
554\r
555//\r
556// Scope for get defaut value. It may be GetDefaultForNoStorage, GetDefaultForStorage or GetDefaultForAll.\r
557//\r
558typedef enum {\r
559 GetDefaultForNoStorage, // Get default value for question which not has storage.\r
560 GetDefaultForStorage, // Get default value for question which has storage.\r
561 GetDefaultForAll, // Get default value for all questions.\r
562 GetDefaultForMax // Invalid value.\r
563} BROWSER_GET_DEFAULT_VALUE;\r
564\r
565//\r
566// Get/set question value from/to.\r
567//\r
568typedef enum {\r
569 GetSetValueWithEditBuffer = 0, // Get/Set question value from/to editbuffer in the storage.\r
570 GetSetValueWithBuffer, // Get/Set question value from/to buffer in the storage.\r
571 GetSetValueWithHiiDriver, // Get/Set question value from/to hii driver.\r
572 GetSetValueWithBothBuffer, // Compare the editbuffer with buffer for this question, not use the question value.\r
573 GetSetValueWithMax // Invalid value.\r
574} GET_SET_QUESTION_VALUE_WITH;\r
575\r
576extern EFI_HII_DATABASE_PROTOCOL *mHiiDatabase;\r
577extern EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting;\r
578extern EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *mPathFromText;\r
579extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL *mFormDisplay;\r
580\r
581extern BOOLEAN gCallbackReconnect;\r
582extern BOOLEAN gFlagReconnect;\r
583extern BOOLEAN gResetRequired;\r
584extern BOOLEAN gExitRequired;\r
585extern LIST_ENTRY gBrowserFormSetList;\r
586extern LIST_ENTRY gBrowserHotKeyList;\r
587extern BROWSER_SETTING_SCOPE gBrowserSettingScope;\r
588extern EXIT_HANDLER ExitHandlerFunction;\r
589extern EFI_HII_HANDLE mCurrentHiiHandle;\r
590extern SETUP_DRIVER_PRIVATE_DATA mPrivateData;\r
591//\r
592// Browser Global Strings\r
593//\r
594extern CHAR16 *gEmptyString;\r
595\r
596extern UI_MENU_SELECTION *gCurrentSelection;\r
597extern BOOLEAN mHiiPackageListUpdated;\r
598extern UINT16 mCurFakeQestId;\r
599extern BOOLEAN mFinishRetrieveCall;\r
600\r
601//\r
602// Global Procedure Defines\r
603//\r
604#include "Expression.h"\r
605\r
606/**\r
607 Initialize the HII String Token to the correct values.\r
608\r
609**/\r
610VOID\r
611InitializeBrowserStrings (\r
612 VOID\r
613 );\r
614\r
615/**\r
616 Parse opcodes in the formset IFR binary.\r
617\r
618 @param FormSet Pointer of the FormSet data structure.\r
619\r
620 @retval EFI_SUCCESS Opcode parse success.\r
621 @retval Other Opcode parse fail.\r
622\r
623**/\r
624EFI_STATUS\r
625ParseOpCodes (\r
626 IN FORM_BROWSER_FORMSET *FormSet\r
627 );\r
628\r
629/**\r
630 Free resources allocated for a FormSet.\r
631\r
632 @param FormSet Pointer of the FormSet\r
633\r
634**/\r
635VOID\r
636DestroyFormSet (\r
637 IN OUT FORM_BROWSER_FORMSET *FormSet\r
638 );\r
639\r
640\r
641/**\r
642 Create a new string in HII Package List.\r
643\r
644 @param String The String to be added\r
645 @param HiiHandle The package list in the HII database to insert the\r
646 specified string.\r
647\r
648 @return The output string.\r
649\r
650**/\r
651EFI_STRING_ID\r
652NewString (\r
653 IN CHAR16 *String,\r
654 IN EFI_HII_HANDLE HiiHandle\r
655 );\r
656\r
657/**\r
658 Delete a string from HII Package List.\r
659\r
660 @param StringId Id of the string in HII database.\r
661 @param HiiHandle The HII package list handle.\r
662\r
663 @retval EFI_SUCCESS The string was deleted successfully.\r
664\r
665**/\r
666EFI_STATUS\r
667DeleteString (\r
668 IN EFI_STRING_ID StringId,\r
669 IN EFI_HII_HANDLE HiiHandle\r
670 );\r
671\r
672/**\r
673 Get the string based on the StringId and HII Package List Handle.\r
674\r
675 @param Token The String's ID.\r
676 @param HiiHandle The package list in the HII database to search for\r
677 the specified string.\r
678\r
679 @return The output string.\r
680\r
681**/\r
682CHAR16 *\r
683GetToken (\r
684 IN EFI_STRING_ID Token,\r
685 IN EFI_HII_HANDLE HiiHandle\r
686 );\r
687\r
688/**\r
689 Get Value for given Name from a NameValue Storage.\r
690\r
691 @param Storage The NameValue Storage.\r
692 @param Name The Name.\r
693 @param Value The retured Value.\r
694 @param GetValueFrom Where to get source value, from EditValue or Value.\r
695\r
696 @retval EFI_SUCCESS Value found for given Name.\r
697 @retval EFI_NOT_FOUND No such Name found in NameValue storage.\r
698\r
699**/\r
700EFI_STATUS\r
701GetValueByName (\r
702 IN BROWSER_STORAGE *Storage,\r
703 IN CHAR16 *Name,\r
704 IN OUT CHAR16 **Value,\r
705 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom\r
706 );\r
707\r
708/**\r
709 Set Value of given Name in a NameValue Storage.\r
710\r
711 @param Storage The NameValue Storage.\r
712 @param Name The Name.\r
713 @param Value The Value to set.\r
714 @param SetValueTo Whether update editValue or Value.\r
715 @param ReturnNode The node use the input name.\r
716\r
717 @retval EFI_SUCCESS Value found for given Name.\r
718 @retval EFI_NOT_FOUND No such Name found in NameValue storage.\r
719\r
720**/\r
721EFI_STATUS\r
722SetValueByName (\r
723 IN BROWSER_STORAGE *Storage,\r
724 IN CHAR16 *Name,\r
725 IN CHAR16 *Value,\r
726 IN GET_SET_QUESTION_VALUE_WITH SetValueTo,\r
727 OUT NAME_VALUE_NODE **ReturnNode\r
728 );\r
729\r
730/**\r
731 Validate whether this question's value has changed.\r
732\r
733 @param FormSet FormSet data structure.\r
734 @param Form Form data structure.\r
735 @param Question Question to be initialized.\r
736 @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.\r
737\r
738 @retval TRUE Question's value has changed.\r
739 @retval FALSE Question's value has not changed\r
740\r
741**/\r
742BOOLEAN\r
743IsQuestionValueChanged (\r
744 IN FORM_BROWSER_FORMSET *FormSet,\r
745 IN FORM_BROWSER_FORM *Form,\r
746 IN OUT FORM_BROWSER_STATEMENT *Question,\r
747 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom\r
748 );\r
749\r
750/**\r
751 Validate the FormSet. If the formset is not validate, remove it from the list.\r
752\r
753 @param FormSet The input FormSet which need to validate.\r
754\r
755 @retval TRUE The handle is validate.\r
756 @retval FALSE The handle is invalidate.\r
757\r
758**/\r
759BOOLEAN\r
760ValidateFormSet (\r
761 FORM_BROWSER_FORMSET *FormSet\r
762 );\r
763\r
764/**\r
765 Update the ValueChanged status for questions.\r
766\r
767 @param FormSet FormSet data structure.\r
768 @param Form Form data structure.\r
769 @param SettingScope Setting Scope for Default action.\r
770\r
771**/\r
772VOID \r
773UpdateStatementStatus (\r
774 IN FORM_BROWSER_FORMSET *FormSet,\r
775 IN FORM_BROWSER_FORM *Form, \r
776 IN BROWSER_SETTING_SCOPE SettingScope\r
777 );\r
778\r
779/**\r
780 Get Question's current Value.\r
781\r
782 @param FormSet FormSet data structure.\r
783 @param Form Form data structure.\r
784 @param Question Question to be initialized.\r
785 @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.\r
786\r
787 @retval EFI_SUCCESS The function completed successfully.\r
788\r
789**/\r
790EFI_STATUS\r
791GetQuestionValue (\r
792 IN FORM_BROWSER_FORMSET *FormSet,\r
793 IN FORM_BROWSER_FORM *Form,\r
794 IN OUT FORM_BROWSER_STATEMENT *Question,\r
795 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom\r
796 );\r
797\r
798/**\r
799 Save Question Value to edit copy(cached) or Storage(uncached).\r
800\r
801 @param FormSet FormSet data structure.\r
802 @param Form Form data structure.\r
803 @param Question Pointer to the Question.\r
804 @param SetValueTo Update the question value to editbuffer , buffer or hii driver.\r
805\r
806 @retval EFI_SUCCESS The function completed successfully.\r
807\r
808**/\r
809EFI_STATUS\r
810SetQuestionValue (\r
811 IN FORM_BROWSER_FORMSET *FormSet,\r
812 IN FORM_BROWSER_FORM *Form,\r
813 IN OUT FORM_BROWSER_STATEMENT *Question,\r
814 IN GET_SET_QUESTION_VALUE_WITH SetValueTo\r
815 );\r
816\r
817/**\r
818 Perform inconsistent check for a Form.\r
819\r
820 @param FormSet FormSet data structure.\r
821 @param Form Form data structure.\r
822 @param Question The Question to be validated.\r
823 @param Type Validation type: InConsistent or NoSubmit\r
824\r
825 @retval EFI_SUCCESS Form validation pass.\r
826 @retval other Form validation failed.\r
827\r
828**/\r
829EFI_STATUS\r
830ValidateQuestion (\r
831 IN FORM_BROWSER_FORMSET *FormSet,\r
832 IN FORM_BROWSER_FORM *Form,\r
833 IN FORM_BROWSER_STATEMENT *Question,\r
834 IN UINTN Type\r
835 );\r
836\r
837\r
838/**\r
839 Discard data based on the input setting scope (Form, FormSet or System).\r
840\r
841 @param FormSet FormSet data structure.\r
842 @param Form Form data structure.\r
843 @param SettingScope Setting Scope for Discard action.\r
844\r
845 @retval EFI_SUCCESS The function completed successfully.\r
846 @retval EFI_UNSUPPORTED Unsupport SettingScope.\r
847\r
848**/\r
849EFI_STATUS\r
850DiscardForm (\r
851 IN FORM_BROWSER_FORMSET *FormSet,\r
852 IN FORM_BROWSER_FORM *Form,\r
853 IN BROWSER_SETTING_SCOPE SettingScope\r
854 );\r
855\r
856/**\r
857 Submit data based on the input Setting level (Form, FormSet or System).\r
858\r
859 @param FormSet FormSet data structure.\r
860 @param Form Form data structure.\r
861 @param SettingScope Setting Scope for Submit action.\r
862\r
863 @retval EFI_SUCCESS The function completed successfully.\r
864 @retval EFI_UNSUPPORTED Unsupport SettingScope.\r
865\r
866**/\r
867EFI_STATUS\r
868SubmitForm (\r
869 IN FORM_BROWSER_FORMSET *FormSet,\r
870 IN FORM_BROWSER_FORM *Form,\r
871 IN BROWSER_SETTING_SCOPE SettingScope\r
872 );\r
873\r
874/**\r
875 Reset Question to its default value.\r
876\r
877 @param FormSet The form set.\r
878 @param Form The form.\r
879 @param Question The question.\r
880 @param DefaultId The Class of the default.\r
881\r
882 @retval EFI_SUCCESS Question is reset to default value.\r
883\r
884**/\r
885EFI_STATUS\r
886GetQuestionDefault (\r
887 IN FORM_BROWSER_FORMSET *FormSet,\r
888 IN FORM_BROWSER_FORM *Form,\r
889 IN FORM_BROWSER_STATEMENT *Question,\r
890 IN UINT16 DefaultId\r
891 );\r
892\r
893/**\r
894 Get current setting of Questions.\r
895\r
896 @param FormSet FormSet data structure.\r
897\r
898**/\r
899VOID\r
900InitializeCurrentSetting (\r
901 IN OUT FORM_BROWSER_FORMSET *FormSet\r
902 );\r
903\r
904/**\r
905 Initialize the internal data structure of a FormSet.\r
906\r
907 @param Handle PackageList Handle\r
908 @param FormSetGuid GUID of a formset. If not specified (NULL or zero\r
909 GUID), take the first FormSet found in package\r
910 list.\r
911 @param FormSet FormSet data structure.\r
912\r
913 @retval EFI_SUCCESS The function completed successfully.\r
914 @retval EFI_NOT_FOUND The specified FormSet could not be found.\r
915\r
916**/\r
917EFI_STATUS\r
918InitializeFormSet (\r
919 IN EFI_HII_HANDLE Handle,\r
920 IN OUT EFI_GUID *FormSetGuid,\r
921 OUT FORM_BROWSER_FORMSET *FormSet \r
922 );\r
923\r
924/**\r
925 Reset Questions to their initial value or default value in a Form, Formset or System.\r
926\r
927 GetDefaultValueScope parameter decides which questions will reset \r
928 to its default value.\r
929\r
930 @param FormSet FormSet data structure.\r
931 @param Form Form data structure.\r
932 @param DefaultId The Class of the default.\r
933 @param SettingScope Setting Scope for Default action.\r
934 @param GetDefaultValueScope Get default value scope.\r
935 @param Storage Get default value only for this storage.\r
936 @param RetrieveValueFirst Whether call the retrieve call back to\r
937 get the initial value before get default\r
938 value.\r
939 @param SkipGetAltCfg Whether skip the get altcfg string process.\r
940\r
941 @retval EFI_SUCCESS The function completed successfully.\r
942 @retval EFI_UNSUPPORTED Unsupport SettingScope.\r
943\r
944**/\r
945EFI_STATUS\r
946ExtractDefault (\r
947 IN FORM_BROWSER_FORMSET *FormSet,\r
948 IN FORM_BROWSER_FORM *Form,\r
949 IN UINT16 DefaultId,\r
950 IN BROWSER_SETTING_SCOPE SettingScope,\r
951 IN BROWSER_GET_DEFAULT_VALUE GetDefaultValueScope,\r
952 IN BROWSER_STORAGE *Storage,\r
953 IN BOOLEAN RetrieveValueFirst,\r
954 IN BOOLEAN SkipGetAltCfg\r
955 );\r
956\r
957/**\r
958 Initialize Question's Edit copy from Storage.\r
959\r
960 @param Selection Selection contains the information about \r
961 the Selection, form and formset to be displayed.\r
962 Selection action may be updated in retrieve callback.\r
963 If Selection is NULL, only initialize Question value.\r
964 @param FormSet FormSet data structure.\r
965 @param Form Form data structure.\r
966\r
967 @retval EFI_SUCCESS The function completed successfully.\r
968\r
969**/\r
970EFI_STATUS\r
971LoadFormConfig (\r
972 IN OUT UI_MENU_SELECTION *Selection,\r
973 IN FORM_BROWSER_FORMSET *FormSet,\r
974 IN FORM_BROWSER_FORM *Form\r
975 );\r
976\r
977/**\r
978 Initialize Question's Edit copy from Storage for the whole Formset.\r
979\r
980 @param Selection Selection contains the information about \r
981 the Selection, form and formset to be displayed.\r
982 Selection action may be updated in retrieve callback.\r
983 If Selection is NULL, only initialize Question value.\r
984 @param FormSet FormSet data structure.\r
985\r
986 @retval EFI_SUCCESS The function completed successfully.\r
987\r
988**/\r
989EFI_STATUS\r
990LoadFormSetConfig (\r
991 IN OUT UI_MENU_SELECTION *Selection,\r
992 IN FORM_BROWSER_FORMSET *FormSet\r
993 );\r
994\r
995/**\r
996 Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.\r
997\r
998 @param Storage The Storage to be conveted.\r
999 @param ConfigResp The returned <ConfigResp>.\r
1000 @param ConfigRequest The ConfigRequest string.\r
1001 @param GetEditBuf Get the data from editbuffer or buffer.\r
1002\r
1003 @retval EFI_SUCCESS Convert success.\r
1004 @retval EFI_INVALID_PARAMETER Incorrect storage type.\r
1005\r
1006**/\r
1007EFI_STATUS\r
1008StorageToConfigResp (\r
1009 IN BROWSER_STORAGE *Storage,\r
1010 IN CHAR16 **ConfigResp,\r
1011 IN CHAR16 *ConfigRequest,\r
1012 IN BOOLEAN GetEditBuf\r
1013 );\r
1014\r
1015/**\r
1016 Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.\r
1017\r
1018 @param Storage The Storage to receive the settings.\r
1019 @param ConfigResp The <ConfigResp> to be converted.\r
1020\r
1021 @retval EFI_SUCCESS Convert success.\r
1022 @retval EFI_INVALID_PARAMETER Incorrect storage type.\r
1023\r
1024**/\r
1025EFI_STATUS\r
1026ConfigRespToStorage (\r
1027 IN BROWSER_STORAGE *Storage,\r
1028 IN CHAR16 *ConfigResp\r
1029 );\r
1030\r
1031/**\r
1032 Fill storage's edit copy with settings requested from Configuration Driver.\r
1033\r
1034 @param FormSet FormSet data structure.\r
1035 @param Storage Buffer Storage.\r
1036\r
1037**/\r
1038VOID\r
1039LoadStorage (\r
1040 IN FORM_BROWSER_FORMSET *FormSet,\r
1041 IN FORMSET_STORAGE *Storage\r
1042 );\r
1043\r
1044/**\r
1045 Fetch the Ifr binary data of a FormSet.\r
1046\r
1047 @param Handle PackageList Handle\r
1048 @param FormSetGuid GUID of a formset. If not specified (NULL or zero\r
1049 GUID), take the first FormSet found in package\r
1050 list.\r
1051 @param BinaryLength The length of the FormSet IFR binary.\r
1052 @param BinaryData The buffer designed to receive the FormSet.\r
1053\r
1054 @retval EFI_SUCCESS Buffer filled with the requested FormSet.\r
1055 BufferLength was updated.\r
1056 @retval EFI_INVALID_PARAMETER The handle is unknown.\r
1057 @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot\r
1058 be found with the requested FormId.\r
1059\r
1060**/\r
1061EFI_STATUS\r
1062GetIfrBinaryData (\r
1063 IN EFI_HII_HANDLE Handle,\r
1064 IN OUT EFI_GUID *FormSetGuid,\r
1065 OUT UINTN *BinaryLength,\r
1066 OUT UINT8 **BinaryData\r
1067 );\r
1068\r
1069/**\r
1070 Save globals used by previous call to SendForm(). SendForm() may be called from \r
1071 HiiConfigAccess.Callback(), this will cause SendForm() be reentried.\r
1072 So, save globals of previous call to SendForm() and restore them upon exit.\r
1073\r
1074**/\r
1075VOID\r
1076SaveBrowserContext (\r
1077 VOID\r
1078 );\r
1079\r
1080/**\r
1081 Restore globals used by previous call to SendForm().\r
1082\r
1083**/\r
1084VOID\r
1085RestoreBrowserContext (\r
1086 VOID\r
1087 );\r
1088\r
1089/**\r
1090 This is the routine which an external caller uses to direct the browser\r
1091 where to obtain it's information.\r
1092\r
1093\r
1094 @param This The Form Browser protocol instanse.\r
1095 @param Handles A pointer to an array of Handles. If HandleCount > 1 we\r
1096 display a list of the formsets for the handles specified.\r
1097 @param HandleCount The number of Handles specified in Handle.\r
1098 @param FormSetGuid This field points to the EFI_GUID which must match the Guid\r
1099 field in the EFI_IFR_FORM_SET op-code for the specified\r
1100 forms-based package. If FormSetGuid is NULL, then this\r
1101 function will display the first found forms package.\r
1102 @param FormId This field specifies which EFI_IFR_FORM to render as the first\r
1103 displayable page. If this field has a value of 0x0000, then\r
1104 the forms browser will render the specified forms in their encoded order.\r
1105 ScreenDimenions - This allows the browser to be called so that it occupies a\r
1106 portion of the physical screen instead of dynamically determining the screen dimensions.\r
1107 ActionRequest - Points to the action recommended by the form.\r
1108 @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in\r
1109 characters.\r
1110 @param ActionRequest Points to the action recommended by the form.\r
1111\r
1112 @retval EFI_SUCCESS The function completed successfully.\r
1113 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.\r
1114 @retval EFI_NOT_FOUND No valid forms could be found to display.\r
1115\r
1116**/\r
1117EFI_STATUS\r
1118EFIAPI\r
1119SendForm (\r
1120 IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,\r
1121 IN EFI_HII_HANDLE *Handles,\r
1122 IN UINTN HandleCount,\r
1123 IN EFI_GUID *FormSetGuid, OPTIONAL\r
1124 IN UINT16 FormId, OPTIONAL\r
1125 IN CONST EFI_SCREEN_DESCRIPTOR *ScreenDimensions, OPTIONAL\r
1126 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest OPTIONAL\r
1127 );\r
1128\r
1129/**\r
1130 This function is called by a callback handler to retrieve uncommitted state\r
1131 data from the browser.\r
1132\r
1133 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL\r
1134 instance.\r
1135 @param ResultsDataSize A pointer to the size of the buffer associated\r
1136 with ResultsData.\r
1137 @param ResultsData A string returned from an IFR browser or\r
1138 equivalent. The results string will have no\r
1139 routing information in them.\r
1140 @param RetrieveData A BOOLEAN field which allows an agent to retrieve\r
1141 (if RetrieveData = TRUE) data from the uncommitted\r
1142 browser state information or set (if RetrieveData\r
1143 = FALSE) data in the uncommitted browser state\r
1144 information.\r
1145 @param VariableGuid An optional field to indicate the target variable\r
1146 GUID name to use.\r
1147 @param VariableName An optional field to indicate the target\r
1148 human-readable variable name.\r
1149\r
1150 @retval EFI_SUCCESS The results have been distributed or are awaiting\r
1151 distribution.\r
1152 @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to\r
1153 contain the results data.\r
1154\r
1155**/\r
1156EFI_STATUS\r
1157EFIAPI\r
1158BrowserCallback (\r
1159 IN CONST EFI_FORM_BROWSER2_PROTOCOL *This,\r
1160 IN OUT UINTN *ResultsDataSize,\r
1161 IN OUT EFI_STRING ResultsData,\r
1162 IN BOOLEAN RetrieveData,\r
1163 IN CONST EFI_GUID *VariableGuid, OPTIONAL\r
1164 IN CONST CHAR16 *VariableName OPTIONAL\r
1165 );\r
1166\r
1167/**\r
1168 Find menu which will show next time.\r
1169\r
1170 @param Selection On input, Selection tell setup browser the information\r
1171 about the Selection, form and formset to be displayed.\r
1172 On output, Selection return the screen item that is selected\r
1173 by user.\r
1174 @param SettingLevel Input Settting level, if it is FormLevel, just exit current form. \r
1175 else, we need to exit current formset.\r
1176 \r
1177 @retval TRUE Exit current form.\r
1178 @retval FALSE User press ESC and keep in current form.\r
1179**/\r
1180BOOLEAN\r
1181FindNextMenu (\r
1182 IN OUT UI_MENU_SELECTION *Selection,\r
1183 IN BROWSER_SETTING_SCOPE SettingLevel\r
1184 );\r
1185\r
1186/**\r
1187 check whether the form need to update the NV.\r
1188\r
1189 @param Form Form data structure.\r
1190\r
1191 @retval TRUE Need to update the NV.\r
1192 @retval FALSE No need to update the NV.\r
1193**/\r
1194BOOLEAN\r
1195IsNvUpdateRequiredForForm (\r
1196 IN FORM_BROWSER_FORM *Form\r
1197 );\r
1198\r
1199/**\r
1200 check whether the formset need to update the NV.\r
1201\r
1202 @param FormSet FormSet data structure.\r
1203\r
1204 @retval TRUE Need to update the NV.\r
1205 @retval FALSE No need to update the NV.\r
1206**/\r
1207BOOLEAN\r
1208IsNvUpdateRequiredForFormSet (\r
1209 IN FORM_BROWSER_FORMSET *FormSet\r
1210 );\r
1211\r
1212/**\r
1213 Call the call back function for the question and process the return action.\r
1214\r
1215 @param Selection On input, Selection tell setup browser the information\r
1216 about the Selection, form and formset to be displayed.\r
1217 On output, Selection return the screen item that is selected\r
1218 by user.\r
1219 @param FormSet The formset this question belong to.\r
1220 @param Form The form this question belong to.\r
1221 @param Question The Question which need to call.\r
1222 @param Action The action request.\r
1223 @param SkipSaveOrDiscard Whether skip save or discard action.\r
1224\r
1225 @retval EFI_SUCCESS The call back function executes successfully.\r
1226 @return Other value if the call back function failed to execute.\r
1227**/\r
1228EFI_STATUS \r
1229ProcessCallBackFunction (\r
1230 IN OUT UI_MENU_SELECTION *Selection,\r
1231 IN FORM_BROWSER_FORMSET *FormSet,\r
1232 IN FORM_BROWSER_FORM *Form,\r
1233 IN FORM_BROWSER_STATEMENT *Question,\r
1234 IN EFI_BROWSER_ACTION Action,\r
1235 IN BOOLEAN SkipSaveOrDiscard\r
1236 );\r
1237 \r
1238/**\r
1239 Call the retrieve type call back function for one question to get the initialize data.\r
1240 \r
1241 This function only used when in the initialize stage, because in this stage, the \r
1242 Selection->Form is not ready. For other case, use the ProcessCallBackFunction instead.\r
1243\r
1244 @param ConfigAccess The config access protocol produced by the hii driver.\r
1245 @param Statement The Question which need to call.\r
1246 @param FormSet The formset this question belong to.\r
1247\r
1248 @retval EFI_SUCCESS The call back function executes successfully.\r
1249 @return Other value if the call back function failed to execute.\r
1250**/\r
1251EFI_STATUS \r
1252ProcessRetrieveForQuestion (\r
1253 IN EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess,\r
1254 IN FORM_BROWSER_STATEMENT *Statement,\r
1255 IN FORM_BROWSER_FORMSET *FormSet\r
1256 );\r
1257\r
1258/**\r
1259 Find the matched FormSet context in the backup maintain list based on HiiHandle.\r
1260 \r
1261 @param Handle The Hii Handle.\r
1262 \r
1263 @return the found FormSet context. If no found, NULL will return.\r
1264\r
1265**/\r
1266FORM_BROWSER_FORMSET * \r
1267GetFormSetFromHiiHandle (\r
1268 EFI_HII_HANDLE Handle\r
1269 );\r
1270\r
1271/**\r
1272 Check whether the input HII handle is the FormSet that is being used.\r
1273 \r
1274 @param Handle The Hii Handle.\r
1275 \r
1276 @retval TRUE HII handle is being used.\r
1277 @retval FALSE HII handle is not being used.\r
1278\r
1279**/\r
1280BOOLEAN\r
1281IsHiiHandleInBrowserContext (\r
1282 EFI_HII_HANDLE Handle\r
1283 );\r
1284\r
1285/**\r
1286 Configure what scope the hot key will impact.\r
1287 All hot keys have the same scope. The mixed hot keys with the different level are not supported.\r
1288 If no scope is set, the default scope will be FormSet level.\r
1289 After all registered hot keys are removed, previous Scope can reset to another level.\r
1290 \r
1291 @param[in] Scope Scope level to be set. \r
1292 \r
1293 @retval EFI_SUCCESS Scope is set correctly.\r
1294 @retval EFI_INVALID_PARAMETER Scope is not the valid value specified in BROWSER_SETTING_SCOPE. \r
1295 @retval EFI_UNSPPORTED Scope level is different from current one that the registered hot keys have.\r
1296\r
1297**/\r
1298EFI_STATUS\r
1299EFIAPI\r
1300SetScope (\r
1301 IN BROWSER_SETTING_SCOPE Scope\r
1302 );\r
1303\r
1304/**\r
1305 Register the hot key with its browser action, or unregistered the hot key.\r
1306 Only support hot key that is not printable character (control key, function key, etc.).\r
1307 If the action value is zero, the hot key will be unregistered if it has been registered.\r
1308 If the same hot key has been registered, the new action and help string will override the previous ones.\r
1309 \r
1310 @param[in] KeyData A pointer to a buffer that describes the keystroke\r
1311 information for the hot key. Its type is EFI_INPUT_KEY to \r
1312 be supported by all ConsoleIn devices.\r
1313 @param[in] Action Action value that describes what action will be trigged when the hot key is pressed. \r
1314 @param[in] DefaultId Specifies the type of defaults to retrieve, which is only for DEFAULT action.\r
1315 @param[in] HelpString Help string that describes the hot key information.\r
1316 Its value may be NULL for the unregistered hot key.\r
1317 \r
1318 @retval EFI_SUCCESS Hot key is registered or unregistered.\r
1319 @retval EFI_INVALID_PARAMETER KeyData is NULL.\r
1320 @retval EFI_NOT_FOUND KeyData is not found to be unregistered.\r
1321 @retval EFI_UNSUPPORTED Key represents a printable character. It is conflicted with Browser.\r
1322 @retval EFI_ALREADY_STARTED Key already been registered for one hot key.\r
1323**/\r
1324EFI_STATUS\r
1325EFIAPI\r
1326RegisterHotKey (\r
1327 IN EFI_INPUT_KEY *KeyData,\r
1328 IN UINT32 Action,\r
1329 IN UINT16 DefaultId,\r
1330 IN EFI_STRING HelpString OPTIONAL\r
1331 );\r
1332\r
1333/**\r
1334 Register Exit handler function. \r
1335 When more than one handler function is registered, the latter one will override the previous one. \r
1336 When NULL handler is specified, the previous Exit handler will be unregistered. \r
1337 \r
1338 @param[in] Handler Pointer to handler function. \r
1339\r
1340**/\r
1341VOID\r
1342EFIAPI\r
1343RegiserExitHandler (\r
1344 IN EXIT_HANDLER Handler\r
1345 );\r
1346\r
1347/**\r
1348 \r
1349 Check whether the browser data has been modified. \r
1350\r
1351 @retval TRUE Browser data is changed.\r
1352 @retval FALSE No browser data is changed.\r
1353\r
1354**/\r
1355BOOLEAN \r
1356EFIAPI\r
1357IsBrowserDataModified (\r
1358 VOID\r
1359 );\r
1360\r
1361/**\r
1362 \r
1363 Execute the action requested by the Action parameter. \r
1364\r
1365 @param[in] Action Execute the request action.\r
1366 @param[in] DefaultId The default Id info when need to load default value.\r
1367\r
1368 @retval EFI_SUCCESS Execute the request action succss.\r
1369 @retval EFI_INVALID_PARAMETER The input action value is invalid.\r
1370\r
1371**/\r
1372EFI_STATUS \r
1373EFIAPI\r
1374ExecuteAction (\r
1375 IN UINT32 Action,\r
1376 IN UINT16 DefaultId\r
1377 );\r
1378\r
1379/**\r
1380 Create reminder to let user to choose save or discard the changed browser data.\r
1381 Caller can use it to actively check the changed browser data.\r
1382\r
1383 @retval BROWSER_NO_CHANGES No browser data is changed.\r
1384 @retval BROWSER_SAVE_CHANGES The changed browser data is saved.\r
1385 @retval BROWSER_DISCARD_CHANGES The changed browser data is discard.\r
1386 @retval BROWSER_KEEP_CURRENT Browser keep current changes.\r
1387\r
1388**/\r
1389UINT32\r
1390EFIAPI\r
1391SaveReminder (\r
1392 VOID\r
1393 );\r
1394\r
1395/**\r
1396 Check whether the Reset Required for the browser\r
1397\r
1398 @retval TRUE Browser required to reset after exit.\r
1399 @retval FALSE Browser not need to reset after exit.\r
1400\r
1401**/\r
1402BOOLEAN\r
1403EFIAPI\r
1404IsResetRequired (\r
1405 VOID\r
1406 );\r
1407\r
1408/**\r
1409 Find the registered HotKey based on KeyData.\r
1410 \r
1411 @param[in] KeyData A pointer to a buffer that describes the keystroke\r
1412 information for the hot key.\r
1413\r
1414 @return The registered HotKey context. If no found, NULL will return.\r
1415**/\r
1416BROWSER_HOT_KEY *\r
1417GetHotKeyFromRegisterList (\r
1418 IN EFI_INPUT_KEY *KeyData\r
1419 );\r
1420\r
1421/**\r
1422\r
1423 Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.\r
1424\r
1425 @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.\r
1426\r
1427 @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.\r
1428\r
1429**/\r
1430FORM_BROWSER_STATEMENT *\r
1431GetBrowserStatement (\r
1432 IN FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement\r
1433 );\r
1434 \r
1435/**\r
1436 Password may be stored as encrypted by Configuration Driver. When change a\r
1437 password, user will be challenged with old password. To validate user input old\r
1438 password, we will send the clear text to Configuration Driver via Callback().\r
1439 Configuration driver is responsible to check the passed in password and return\r
1440 the validation result. If validation pass, state machine in password Callback()\r
1441 will transit from BROWSER_STATE_VALIDATE_PASSWORD to BROWSER_STATE_SET_PASSWORD.\r
1442 After user type in new password twice, Callback() will be invoked to send the\r
1443 new password to Configuration Driver.\r
1444\r
1445 @param Selection Pointer to UI_MENU_SELECTION.\r
1446 @param MenuOption The MenuOption for this password Question.\r
1447 @param String The clear text of password.\r
1448\r
1449 @retval EFI_NOT_AVAILABLE_YET Callback() request to terminate password input.\r
1450 @return In state of BROWSER_STATE_VALIDATE_PASSWORD:\r
1451 @retval EFI_SUCCESS Password correct, Browser will prompt for new\r
1452 password.\r
1453 @retval EFI_NOT_READY Password incorrect, Browser will show error\r
1454 message.\r
1455 @retval Other Browser will do nothing.\r
1456 @return In state of BROWSER_STATE_SET_PASSWORD:\r
1457 @retval EFI_SUCCESS Set password success.\r
1458 @retval Other Set password failed.\r
1459\r
1460**/\r
1461EFI_STATUS\r
1462PasswordCallback (\r
1463 IN UI_MENU_SELECTION *Selection,\r
1464 IN FORM_BROWSER_STATEMENT *Question,\r
1465 IN CHAR16 *String\r
1466 );\r
1467\r
1468/**\r
1469 Display error message for invalid password.\r
1470\r
1471**/\r
1472VOID\r
1473PasswordInvalid (\r
1474 VOID\r
1475 );\r
1476\r
1477/**\r
1478 The worker function that send the displays to the screen. On output,\r
1479 the selection made by user is returned.\r
1480\r
1481 @param Selection On input, Selection tell setup browser the information\r
1482 about the Selection, form and formset to be displayed.\r
1483 On output, Selection return the screen item that is selected\r
1484 by user.\r
1485\r
1486 @retval EFI_SUCCESS The page is displayed successfully.\r
1487 @return Other value if the page failed to be diplayed.\r
1488\r
1489**/\r
1490EFI_STATUS\r
1491SetupBrowser (\r
1492 IN OUT UI_MENU_SELECTION *Selection\r
1493 );\r
1494 \r
1495/**\r
1496 Free up the resource allocated for all strings required\r
1497 by Setup Browser.\r
1498\r
1499**/\r
1500VOID\r
1501FreeBrowserStrings (\r
1502 VOID\r
1503 );\r
1504\r
1505/**\r
1506 Create a menu with specified formset GUID and form ID, and add it as a child\r
1507 of the given parent menu.\r
1508\r
1509 @param HiiHandle Hii handle related to this formset.\r
1510 @param FormSetGuid The Formset Guid of menu to be added.\r
1511 @param FormId The Form ID of menu to be added.\r
1512 @param QuestionId The question id of this menu to be added.\r
1513\r
1514 @return A pointer to the newly added menu or NULL if memory is insufficient.\r
1515\r
1516**/\r
1517FORM_ENTRY_INFO *\r
1518UiAddMenuList (\r
1519 IN EFI_HII_HANDLE HiiHandle,\r
1520 IN EFI_GUID *FormSetGuid,\r
1521 IN UINT16 FormId,\r
1522 IN UINT16 QuestionId\r
1523 );\r
1524\r
1525/**\r
1526 Search Menu with given FormSetGuid and FormId in all cached menu list.\r
1527\r
1528 @param HiiHandle HiiHandle for FormSet.\r
1529 @param FormSetGuid The Formset GUID of the menu to search.\r
1530 @param FormId The Form ID of menu to search.\r
1531\r
1532 @return A pointer to menu found or NULL if not found.\r
1533\r
1534**/\r
1535FORM_ENTRY_INFO *\r
1536UiFindMenuList (\r
1537 IN EFI_HII_HANDLE HiiHandle, \r
1538 IN EFI_GUID *FormSetGuid,\r
1539 IN UINT16 FormId\r
1540 );\r
1541\r
1542/**\r
1543 Free Menu list linked list.\r
1544\r
1545 @param MenuListHead One Menu list point in the menu list.\r
1546\r
1547**/\r
1548VOID\r
1549UiFreeMenuList (\r
1550 LIST_ENTRY *MenuListHead\r
1551 );\r
1552\r
1553/**\r
1554 Find parent menu for current menu.\r
1555\r
1556 @param CurrentMenu Current Menu\r
1557 @param SettingLevel Whether find parent menu in Form Level or Formset level.\r
1558 In form level, just find the parent menu; \r
1559 In formset level, find the parent menu which has different\r
1560 formset guid value.\r
1561\r
1562 @retval The parent menu for current menu.\r
1563**/\r
1564FORM_ENTRY_INFO *\r
1565UiFindParentMenu (\r
1566 IN FORM_ENTRY_INFO *CurrentMenu,\r
1567 IN BROWSER_SETTING_SCOPE SettingLevel\r
1568 );\r
1569 \r
1570/**\r
1571 Validate the HiiHandle.\r
1572\r
1573 @param HiiHandle The input HiiHandle which need to validate.\r
1574\r
1575 @retval TRUE The handle is validate.\r
1576 @retval FALSE The handle is invalidate.\r
1577\r
1578**/\r
1579BOOLEAN\r
1580ValidateHiiHandle (\r
1581 EFI_HII_HANDLE HiiHandle\r
1582 );\r
1583\r
1584/**\r
1585 Copy current Menu list to the new menu list.\r
1586 \r
1587 @param NewMenuListHead New create Menu list.\r
1588 @param CurrentMenuListHead Current Menu list.\r
1589\r
1590**/\r
1591VOID\r
1592UiCopyMenuList (\r
1593 OUT LIST_ENTRY *NewMenuListHead,\r
1594 IN LIST_ENTRY *CurrentMenuListHead\r
1595 );\r
1596\r
1597/**\r
1598 Search an Option of a Question by its value.\r
1599\r
1600 @param Question The Question\r
1601 @param OptionValue Value for Option to be searched.\r
1602\r
1603 @retval Pointer Pointer to the found Option.\r
1604 @retval NULL Option not found.\r
1605\r
1606**/\r
1607QUESTION_OPTION *\r
1608ValueToOption (\r
1609 IN FORM_BROWSER_STATEMENT *Question,\r
1610 IN EFI_HII_VALUE *OptionValue\r
1611 );\r
1612/**\r
1613 Return data element in an Array by its Index.\r
1614\r
1615 @param Array The data array.\r
1616 @param Type Type of the data in this array.\r
1617 @param Index Zero based index for data in this array.\r
1618\r
1619 @retval Value The data to be returned\r
1620\r
1621**/\r
1622UINT64\r
1623GetArrayData (\r
1624 IN VOID *Array,\r
1625 IN UINT8 Type,\r
1626 IN UINTN Index\r
1627 );\r
1628\r
1629/**\r
1630 Set value of a data element in an Array by its Index.\r
1631\r
1632 @param Array The data array.\r
1633 @param Type Type of the data in this array.\r
1634 @param Index Zero based index for data in this array.\r
1635 @param Value The value to be set.\r
1636\r
1637**/\r
1638VOID\r
1639SetArrayData (\r
1640 IN VOID *Array,\r
1641 IN UINT8 Type,\r
1642 IN UINTN Index,\r
1643 IN UINT64 Value\r
1644 );\r
1645\r
1646/**\r
1647 Compare two Hii value.\r
1648 \r
1649 @param Value1 Expression value to compare on left-hand.\r
1650 @param Value2 Expression value to compare on right-hand.\r
1651 @param Result Return value after compare.\r
1652 retval 0 Two operators equal.\r
1653 return Positive value if Value1 is greater than Value2.\r
1654 retval Negative value if Value1 is less than Value2.\r
1655 @param HiiHandle Only required for string compare.\r
1656 \r
1657 @retval other Could not perform compare on two values.\r
1658 @retval EFI_SUCCESS Compare the value success.\r
1659 \r
1660**/\r
1661EFI_STATUS\r
1662CompareHiiValue (\r
1663 IN EFI_HII_VALUE *Value1,\r
1664 IN EFI_HII_VALUE *Value2,\r
1665 OUT INTN *Result,\r
1666 IN EFI_HII_HANDLE HiiHandle OPTIONAL\r
1667 );\r
1668\r
1669/**\r
1670 Perform Password check. \r
1671 Passwork may be encrypted by driver that requires the specific check.\r
1672 \r
1673 @param Form Form where Password Statement is in.\r
1674 @param Statement Password statement\r
1675 @param PasswordString Password string to be checked. It may be NULL.\r
1676 NULL means to restore password.\r
1677 "" string can be used to checked whether old password does exist.\r
1678 \r
1679 @return Status Status of Password check.\r
1680**/\r
1681EFI_STATUS\r
1682EFIAPI\r
1683PasswordCheck (\r
1684 IN FORM_DISPLAY_ENGINE_FORM *Form,\r
1685 IN FORM_DISPLAY_ENGINE_STATEMENT *Statement,\r
1686 IN EFI_STRING PasswordString OPTIONAL\r
1687 );\r
1688\r
1689/**\r
1690\r
1691 Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.\r
1692\r
1693 @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.\r
1694\r
1695 @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.\r
1696\r
1697**/\r
1698FORM_BROWSER_STATEMENT *\r
1699GetBrowserStatement (\r
1700 IN FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement\r
1701 );\r
1702 \r
1703/**\r
1704\r
1705 Initialize the Display form structure data.\r
1706\r
1707**/\r
1708VOID\r
1709InitializeDisplayFormData (\r
1710 VOID\r
1711 );\r
1712\r
1713\r
1714/**\r
1715 Base on the current formset info, clean the ConfigRequest string in browser storage.\r
1716\r
1717 @param FormSet Pointer of the FormSet\r
1718\r
1719**/\r
1720VOID\r
1721CleanBrowserStorage (\r
1722 IN OUT FORM_BROWSER_FORMSET *FormSet\r
1723 );\r
1724\r
1725/**\r
1726 Find HII Handle in the HII database associated with given Device Path.\r
1727\r
1728 If DevicePath is NULL, then ASSERT.\r
1729\r
1730 @param DevicePath Device Path associated with the HII package list\r
1731 handle.\r
1732 @param FormsetGuid The formset guid for this formset.\r
1733\r
1734 @retval Handle HII package list Handle associated with the Device\r
1735 Path.\r
1736 @retval NULL Hii Package list handle is not found.\r
1737\r
1738**/\r
1739EFI_HII_HANDLE\r
1740DevicePathToHiiHandle (\r
1741 IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
1742 IN EFI_GUID *FormsetGuid\r
1743 );\r
1744\r
1745/**\r
1746 Adjust the config request info, remove the request elements which already in AllConfigRequest string.\r
1747\r
1748 @param Storage Form set Storage.\r
1749 @param Request The input request string.\r
1750 @param RespString Whether the input is ConfigRequest or ConfigResp format.\r
1751\r
1752 @retval TRUE Has element not covered by current used elements, need to continue to call ExtractConfig\r
1753 @retval FALSE All elements covered by current used elements.\r
1754\r
1755**/\r
1756BOOLEAN \r
1757ConfigRequestAdjust (\r
1758 IN BROWSER_STORAGE *Storage,\r
1759 IN CHAR16 *Request,\r
1760 IN BOOLEAN RespString\r
1761 );\r
1762\r
1763/**\r
1764 Perform question check. \r
1765 \r
1766 If one question has more than one check, process form high priority to low.\r
1767\r
1768 @param FormSet FormSet data structure.\r
1769 @param Form Form data structure.\r
1770 @param Question The Question to be validated.\r
1771\r
1772 @retval EFI_SUCCESS Form validation pass.\r
1773 @retval other Form validation failed.\r
1774\r
1775**/\r
1776EFI_STATUS\r
1777ValueChangedValidation (\r
1778 IN FORM_BROWSER_FORMSET *FormSet,\r
1779 IN FORM_BROWSER_FORM *Form,\r
1780 IN FORM_BROWSER_STATEMENT *Question\r
1781 );\r
1782\r
1783/**\r
1784 Pop up the error info.\r
1785\r
1786 @param BrowserStatus The input browser status.\r
1787 @param HiiHandle The HiiHandle for this error opcode.\r
1788 @param OpCode The opcode use to get the erro info and timeout value.\r
1789 @param ErrorString Error string used by BROWSER_NO_SUBMIT_IF.\r
1790\r
1791**/\r
1792UINT32\r
1793PopupErrorMessage (\r
1794 IN UINT32 BrowserStatus,\r
1795 IN EFI_HII_HANDLE HiiHandle,\r
1796 IN EFI_IFR_OP_HEADER *OpCode, OPTIONAL\r
1797 IN CHAR16 *ErrorString\r
1798 );\r
1799\r
1800/**\r
1801 Check whether the result is TRUE or FALSE.\r
1802\r
1803 For the EFI_HII_VALUE value type is numeric, return TRUE if the\r
1804 value is not 0.\r
1805\r
1806 @param Result Input the result data.\r
1807\r
1808 @retval TRUE The result is TRUE.\r
1809 @retval FALSE The result is FALSE.\r
1810\r
1811**/\r
1812BOOLEAN\r
1813IsTrue (\r
1814 IN EFI_HII_VALUE *Result\r
1815 );\r
1816\r
1817/**\r
1818 Get Formset_storage base on the input varstoreid info.\r
1819\r
1820 @param FormSet Pointer of the current FormSet.\r
1821 @param VarStoreId Varstore ID info.\r
1822\r
1823 @return Pointer to a FORMSET_STORAGE data structure.\r
1824\r
1825**/\r
1826FORMSET_STORAGE *\r
1827GetFstStgFromVarId (\r
1828 IN FORM_BROWSER_FORMSET *FormSet,\r
1829 IN EFI_VARSTORE_ID VarStoreId\r
1830 );\r
1831\r
1832/**\r
1833 Get Formset_storage base on the input browser storage.\r
1834\r
1835 More than one formsets may share the same browser storage,\r
1836 this function just get the first formset storage which\r
1837 share the browser storage.\r
1838\r
1839 @param Storage browser storage info.\r
1840\r
1841 @return Pointer to a FORMSET_STORAGE data structure.\r
1842 \r
1843\r
1844**/\r
1845FORMSET_STORAGE *\r
1846GetFstStgFromBrsStg (\r
1847 IN BROWSER_STORAGE *Storage\r
1848 );\r
1849\r
1850/**\r
1851 Reconnect the controller.\r
1852\r
1853 @param DriverHandle The controller handle which need to be reconnect.\r
1854\r
1855 @retval TRUE do the reconnect behavior success.\r
1856 @retval FALSE do the reconnect behavior failed.\r
1857 \r
1858**/\r
1859BOOLEAN\r
1860ReconnectController (\r
1861 IN EFI_HANDLE DriverHandle\r
1862 );\r
1863\r
1864/**\r
1865 Converts the unicode character of the string from uppercase to lowercase.\r
1866 This is a internal function.\r
1867\r
1868 @param ConfigString String to be converted\r
1869\r
1870**/\r
1871VOID\r
1872EFIAPI\r
1873HiiToLower (\r
1874 IN EFI_STRING ConfigString\r
1875 );\r
1876\r
1877#endif\r