2 Private MACRO, structure and function definitions for Setup Browser module.
4 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
16 #include <Protocol/SimpleTextOut.h>
17 #include <Protocol/SimpleTextIn.h>
18 #include <Protocol/FormBrowser2.h>
19 #include <Protocol/FormBrowserEx2.h>
20 #include <Protocol/DisplayProtocol.h>
21 #include <Protocol/DevicePath.h>
22 #include <Protocol/UnicodeCollation.h>
23 #include <Protocol/HiiConfigAccess.h>
24 #include <Protocol/HiiConfigRouting.h>
25 #include <Protocol/HiiDatabase.h>
26 #include <Protocol/HiiString.h>
27 #include <Protocol/UserManager.h>
28 #include <Protocol/DevicePathFromText.h>
29 #include <Protocol/RegularExpressionProtocol.h>
31 #include <Guid/MdeModuleHii.h>
32 #include <Guid/HiiPlatformSetupFormset.h>
33 #include <Guid/HiiFormMapMethodGuid.h>
34 #include <Guid/ZeroGuid.h>
36 #include <Library/PrintLib.h>
37 #include <Library/DebugLib.h>
38 #include <Library/BaseMemoryLib.h>
39 #include <Library/UefiRuntimeServicesTableLib.h>
40 #include <Library/UefiDriverEntryPoint.h>
41 #include <Library/UefiBootServicesTableLib.h>
42 #include <Library/BaseLib.h>
43 #include <Library/MemoryAllocationLib.h>
44 #include <Library/HiiLib.h>
45 #include <Library/PcdLib.h>
46 #include <Library/DevicePathLib.h>
47 #include <Library/UefiLib.h>
51 // This is the generated header file which includes whatever needs to be exported (strings + IFR)
54 #define UI_ACTION_NONE 0
55 #define UI_ACTION_REFRESH_FORM 1
56 #define UI_ACTION_REFRESH_FORMSET 2
57 #define UI_ACTION_EXIT 3
63 #define ONE_SECOND 10000000
65 // Incremental string lenght of ConfigRequest
67 #define CONFIG_REQUEST_STRING_INCREMENTAL 1024
70 // Incremental size of stack for expression
72 #define EXPRESSION_STACK_SIZE_INCREMENT 0x100
74 #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))
77 #define SETUP_DRIVER_SIGNATURE SIGNATURE_32 ('F', 'B', 'D', 'V')
86 EFI_FORM_BROWSER2_PROTOCOL FormBrowser2
;
87 EDKII_FORM_BROWSER_EXTENSION_PROTOCOL FormBrowserEx
;
89 EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL FormBrowserEx2
;
91 } SETUP_DRIVER_PRIVATE_DATA
;
94 // IFR relative definition
96 #define EFI_HII_EXPRESSION_INCONSISTENT_IF 0
97 #define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1
98 #define EFI_HII_EXPRESSION_GRAY_OUT_IF 2
99 #define EFI_HII_EXPRESSION_SUPPRESS_IF 3
100 #define EFI_HII_EXPRESSION_DISABLE_IF 4
101 #define EFI_HII_EXPRESSION_VALUE 5
102 #define EFI_HII_EXPRESSION_RULE 6
103 #define EFI_HII_EXPRESSION_READ 7
104 #define EFI_HII_EXPRESSION_WRITE 8
105 #define EFI_HII_EXPRESSION_WARNING_IF 9
107 #define EFI_HII_VARSTORE_BUFFER 0
108 #define EFI_HII_VARSTORE_NAME_VALUE 1
109 #define EFI_HII_VARSTORE_EFI_VARIABLE 2 // EFI Varstore type follow UEFI spec before 2.3.1.
110 #define EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER 3 // EFI varstore type follow UEFI spec 2.3.1 and later.
112 #define FORM_INCONSISTENT_VALIDATION 0
113 #define FORM_NO_SUBMIT_VALIDATION 1
115 #define NAME_VALUE_NODE_SIGNATURE SIGNATURE_32 ('N', 'V', 'S', 'T')
125 #define NAME_VALUE_NODE_FROM_LINK(a) CR (a, NAME_VALUE_NODE, Link, NAME_VALUE_NODE_SIGNATURE)
127 #define BROWSER_STORAGE_SIGNATURE SIGNATURE_32 ('B', 'S', 'T', 'G')
133 UINT8 Type
; // Storage type
135 BOOLEAN Initialized
; // Whether this varstore is initialized, efi varstore not used.
137 EFI_HII_HANDLE HiiHandle
; // HiiHandle for this varstore, efi varstore not used.
140 CHAR16
*Name
; // For EFI_IFR_VARSTORE
143 UINT8
*EditBuffer
; // Edit copy for Buffer Storage
145 LIST_ENTRY NameValueListHead
; // List of NAME_VALUE_NODE
147 UINT32 Attributes
; // For EFI_IFR_VARSTORE_EFI: EFI Variable attribute
149 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
150 // <RequestElement> includes all fields which is used by current form sets.
151 UINTN SpareStrLen
; // Spare length of ConfigRequest string buffer
154 #define BROWSER_STORAGE_FROM_LINK(a) CR (a, BROWSER_STORAGE, Link, BROWSER_STORAGE_SIGNATURE)
156 #define FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'G')
162 LIST_ENTRY SaveFailLink
;
166 BROWSER_STORAGE
*BrowserStorage
;
168 CHAR16
*ConfigHdr
; // <ConfigHdr>
170 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
171 CHAR16
*ConfigAltResp
; // Alt config response string for this ConfigRequest.
172 BOOLEAN HasCallAltCfg
; // Flag to show whether browser has call ExtractConfig to get Altcfg string.
173 UINTN ElementCount
; // Number of <RequestElement> in the <ConfigRequest>
174 UINTN SpareStrLen
; // Spare length of ConfigRequest string buffer
175 CHAR16
*RestoreConfigRequest
; // When submit formset fail, the element need to be restored
176 CHAR16
*SyncConfigRequest
; // When submit formset fail, the element need to be synced
179 #define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)
180 #define FORMSET_STORAGE_FROM_SAVE_FAIL_LINK(a) CR (a, FORMSET_STORAGE, SaveFailLink, FORMSET_STORAGE_SIGNATURE)
183 EFI_STRING_ID VarName
;
187 #define EXPRESSION_OPCODE_SIGNATURE SIGNATURE_32 ('E', 'X', 'O', 'P')
195 UINT8 Format
; // For EFI_IFR_TO_STRING, EFI_IFR_FIND
196 UINT8 Flags
; // For EFI_IFR_SPAN
197 UINT8 RuleId
; // For EFI_IFR_RULE_REF
199 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
201 EFI_QUESTION_ID QuestionId
; // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_VAL_LIST, EFI_IFR_QUESTION_REF1
202 EFI_QUESTION_ID QuestionId2
;
204 UINT16 ListLength
; // For EFI_IFR_EQ_ID_VAL_LIST
207 EFI_STRING_ID DevicePath
; // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3
210 BROWSER_STORAGE
*VarStorage
; // For EFI_IFR_SET, EFI_IFR_GET
211 VAR_STORE_INFO VarStoreInfo
;// For EFI_IFR_SET, EFI_IFR_GET
212 UINT8 ValueType
; // For EFI_IFR_SET, EFI_IFR_GET
213 UINT8 ValueWidth
; // For EFI_IFR_SET, EFI_IFR_GET
214 CHAR16
*ValueName
; // For EFI_IFR_SET, EFI_IFR_GET
215 LIST_ENTRY MapExpressionList
; // nested expressions inside of Map opcode.
218 #define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)
220 #define FORM_EXPRESSION_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'P')
226 UINT8 Type
; // Type for this expression
228 UINT8 RuleId
; // For EFI_IFR_RULE only
229 EFI_STRING_ID Error
; // For EFI_IFR_NO_SUBMIT_IF, EFI_IFR_INCONSISTENT_IF only
231 EFI_HII_VALUE Result
; // Expression evaluation result
233 UINT8 TimeOut
; // For EFI_IFR_WARNING_IF
234 EFI_IFR_OP_HEADER
*OpCode
; // Save the opcode buffer.
236 LIST_ENTRY OpCodeListHead
; // OpCodes consist of this expression (EXPRESSION_OPCODE)
239 #define FORM_EXPRESSION_FROM_LINK(a) CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)
241 #define FORM_EXPRESSION_LIST_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'R')
246 FORM_EXPRESSION
*Expression
[1]; // Array[Count] of expressions
247 } FORM_EXPRESSION_LIST
;
249 #define QUESTION_DEFAULT_SIGNATURE SIGNATURE_32 ('Q', 'D', 'F', 'T')
256 EFI_HII_VALUE Value
; // Default value
258 FORM_EXPRESSION
*ValueExpression
; // Not-NULL indicates default value is provided by EFI_IFR_VALUE
261 #define QUESTION_DEFAULT_FROM_LINK(a) CR (a, QUESTION_DEFAULT, Link, QUESTION_DEFAULT_SIGNATURE)
263 #define QUESTION_OPTION_SIGNATURE SIGNATURE_32 ('Q', 'O', 'P', 'T')
269 EFI_IFR_ONE_OF_OPTION
*OpCode
; // OneOfOption Data
274 EFI_IMAGE_ID ImageId
;
276 FORM_EXPRESSION_LIST
*SuppressExpression
; // Non-NULL indicates nested inside of SuppressIf
279 #define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)
295 typedef struct _FORM_BROWSER_STATEMENT FORM_BROWSER_STATEMENT
;
297 #define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')
299 struct _FORM_BROWSER_STATEMENT
{
303 UINT8 Operand
; // The operand (first byte) of this Statement or Question
304 EFI_IFR_OP_HEADER
*OpCode
;
309 EFI_STRING_ID Prompt
;
311 EFI_STRING_ID TextTwo
; // For EFI_IFR_TEXT
314 // Fake Question Id, used for statement not has true QuestionId.
316 EFI_QUESTION_ID FakeQuestionId
;
321 EFI_QUESTION_ID QuestionId
; // The value of zero is reserved
322 EFI_VARSTORE_ID VarStoreId
; // A value of zero indicates no variable storage
323 BROWSER_STORAGE
*Storage
;
324 VAR_STORE_INFO VarStoreInfo
;
326 UINT16 BitStorageWidth
;
329 BOOLEAN QuestionReferToBitField
;// Whether the question is stored in a bit field.
330 CHAR16
*VariableName
; // Name/Value or EFI Variable name
331 CHAR16
*BlockName
; // Buffer storage block name: "OFFSET=...WIDTH=..."
333 EFI_HII_VALUE HiiValue
; // Edit copy for checkbox, numberic, oneof
334 UINT8
*BufferValue
; // Edit copy for string, password, orderedlist
335 UINT8 ValueType
; // Data type for orderedlist value array
338 // OpCode specific members
340 UINT8 Flags
; // for EFI_IFR_CHECKBOX, EFI_IFR_DATE, EFI_IFR_NUMERIC, EFI_IFR_ONE_OF,
341 // EFI_IFR_ORDERED_LIST, EFI_IFR_STRING,EFI_IFR_SUBTITLE,EFI_IFR_TIME, EFI_IFR_BANNER
342 UINT8 MaxContainers
; // for EFI_IFR_ORDERED_LIST
344 UINT16 BannerLineNumber
; // for EFI_IFR_BANNER, 1-based line number
345 EFI_STRING_ID QuestionConfig
; // for EFI_IFR_ACTION, if 0 then no configuration string will be processed
347 UINT64 Minimum
; // for EFI_IFR_ONE_OF/EFI_IFR_NUMERIC, it's Min/Max value
348 UINT64 Maximum
; // for EFI_IFR_STRING/EFI_IFR_PASSWORD, it's Min/Max length
351 EFI_DEFAULT_ID DefaultId
; // for EFI_IFR_RESET_BUTTON
352 EFI_GUID RefreshGuid
; // for EFI_IFR_REFRESH_ID
353 BOOLEAN Locked
; // Whether this statement is locked.
354 BOOLEAN ValueChanged
; // Whether this statement's value is changed.
356 // Get from IFR parsing
358 FORM_EXPRESSION
*ValueExpression
; // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly
359 LIST_ENTRY DefaultListHead
; // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values
360 LIST_ENTRY OptionListHead
; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)
362 EFI_IMAGE_ID ImageId
; // nested EFI_IFR_IMAGE
363 UINT8 RefreshInterval
; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh
365 FORM_BROWSER_STATEMENT
*ParentStatement
;
367 LIST_ENTRY InconsistentListHead
;// nested inconsistent expression list (FORM_EXPRESSION)
368 LIST_ENTRY NoSubmitListHead
; // nested nosubmit expression list (FORM_EXPRESSION)
369 LIST_ENTRY WarningListHead
; // nested warning expression list (FORM_EXPRESSION)
370 FORM_EXPRESSION_LIST
*Expression
; // nesting inside of GrayOutIf/DisableIf/SuppressIf
372 FORM_EXPRESSION
*ReadExpression
; // nested EFI_IFR_READ, provide this question value by read expression.
373 FORM_EXPRESSION
*WriteExpression
; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.
376 #define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)
378 #define FORM_BROWSER_CONFIG_REQUEST_SIGNATURE SIGNATURE_32 ('F', 'C', 'R', 'S')
383 LIST_ENTRY SaveFailLink
;
385 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
386 CHAR16
*ConfigAltResp
; // Alt config response string for this ConfigRequest.
387 UINTN ElementCount
; // Number of <RequestElement> in the <ConfigRequest>
389 CHAR16
*RestoreConfigRequest
; // When submit form fail, the element need to be restored
390 CHAR16
*SyncConfigRequest
; // When submit form fail, the element need to be synced
392 BROWSER_STORAGE
*Storage
;
393 } FORM_BROWSER_CONFIG_REQUEST
;
394 #define FORM_BROWSER_CONFIG_REQUEST_FROM_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, Link, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)
395 #define FORM_BROWSER_CONFIG_REQUEST_FROM_SAVE_FAIL_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, SaveFailLink, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)
397 #define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')
398 #define STANDARD_MAP_FORM_TYPE 0x01
404 UINT16 FormId
; // FormId of normal form or formmap form.
405 EFI_STRING_ID FormTitle
; // FormTile of normal form, or FormMapMethod title of formmap form.
406 UINT16 FormType
; // Specific form type for the different form.
408 EFI_IMAGE_ID ImageId
;
410 BOOLEAN ModalForm
; // Whether this is a modal form.
411 BOOLEAN Locked
; // Whether this form is locked.
412 EFI_GUID RefreshGuid
; // Form refresh event guid.
414 LIST_ENTRY FormViewListHead
; // List of type FORMID_INFO is Browser View Form History List.
415 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
416 LIST_ENTRY StatementListHead
; // List of Statements and Questions (FORM_BROWSER_STATEMENT)
417 LIST_ENTRY ConfigRequestHead
; // List of configreques for all storage.
418 FORM_EXPRESSION_LIST
*SuppressExpression
; // nesting inside of SuppressIf
421 #define FORM_BROWSER_FORM_FROM_LINK(a) CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)
423 #define FORMSET_DEFAULTSTORE_SIGNATURE SIGNATURE_32 ('F', 'D', 'F', 'S')
430 EFI_STRING_ID DefaultName
;
431 } FORMSET_DEFAULTSTORE
;
433 #define FORMSET_DEFAULTSTORE_FROM_LINK(a) CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE)
435 #define FORM_BROWSER_FORMSET_SIGNATURE SIGNATURE_32 ('F', 'B', 'F', 'S')
440 LIST_ENTRY SaveFailLink
;
442 EFI_HII_HANDLE HiiHandle
; // unique id for formset.
443 EFI_HANDLE DriverHandle
;
444 EFI_HII_CONFIG_ACCESS_PROTOCOL
*ConfigAccess
;
445 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
447 UINTN IfrBinaryLength
;
448 UINT8
*IfrBinaryData
;
450 BOOLEAN QuestionInited
; // Have finished question initilization?
452 EFI_STRING_ID FormSetTitle
;
454 UINT8 NumberOfClassGuid
;
455 EFI_GUID ClassGuid
[3]; // Up to three ClassGuid
456 UINT16 Class
; // Tiano extended Class code
457 UINT16 SubClass
; // Tiano extended Subclass code
458 EFI_IMAGE_ID ImageId
;
459 EFI_IFR_OP_HEADER
*OpCode
; //mainly for formset op to get ClassGuid
461 FORM_BROWSER_STATEMENT
*StatementBuffer
; // Buffer for all Statements and Questions
462 EXPRESSION_OPCODE
*ExpressionBuffer
; // Buffer for all Expression OpCode
463 FORM_BROWSER_FORM
*SaveFailForm
; // The form which failed to save.
464 FORM_BROWSER_STATEMENT
*SaveFailStatement
; // The Statement which failed to save.
466 LIST_ENTRY StatementListOSF
; // Statement list out side of the form.
467 LIST_ENTRY StorageListHead
; // Storage list (FORMSET_STORAGE)
468 LIST_ENTRY SaveFailStorageListHead
; // Storage list for the save fail storage.
469 LIST_ENTRY DefaultStoreListHead
; // DefaultStore list (FORMSET_DEFAULTSTORE)
470 LIST_ENTRY FormListHead
; // Form list (FORM_BROWSER_FORM)
471 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
472 } FORM_BROWSER_FORMSET
;
473 #define FORM_BROWSER_FORMSET_FROM_LINK(a) CR (a, FORM_BROWSER_FORMSET, Link, FORM_BROWSER_FORMSET_SIGNATURE)
475 #define FORM_BROWSER_FORMSET_FROM_SAVE_FAIL_LINK(a) CR (a, FORM_BROWSER_FORMSET, SaveFailLink, FORM_BROWSER_FORMSET_SIGNATURE)
479 EFI_EVENT RefreshEvent
;
480 } FORM_BROWSER_REFRESH_EVENT_NODE
;
482 #define FORM_BROWSER_REFRESH_EVENT_FROM_LINK(a) BASE_CR (a, FORM_BROWSER_REFRESH_EVENT_NODE, Link)
486 EFI_HII_HANDLE Handle
;
489 // Target formset/form/Question information
491 EFI_GUID FormSetGuid
;
494 UINTN Sequence
; // used for time/date only.
503 // Ation for Browser to taken:
504 // UI_ACTION_NONE - navigation inside a form
505 // UI_ACTION_REFRESH_FORM - re-evaluate expressions and repaint form
506 // UI_ACTION_REFRESH_FORMSET - re-parse formset IFR binary
511 // Current selected fomset/form/Question
513 FORM_BROWSER_FORMSET
*FormSet
;
514 FORM_BROWSER_FORM
*Form
;
515 FORM_BROWSER_STATEMENT
*Statement
;
518 // Whether the Form is editable
520 BOOLEAN FormEditable
;
522 FORM_ENTRY_INFO
*CurrentMenu
;
525 #define BROWSER_CONTEXT_SIGNATURE SIGNATURE_32 ('B', 'C', 'T', 'X')
532 // Globals defined in Setup.c
534 BOOLEAN FlagReconnect
;
535 BOOLEAN CallbackReconnect
;
536 BOOLEAN ResetRequired
;
537 BOOLEAN ExitRequired
;
538 EFI_HII_HANDLE HiiHandle
;
539 EFI_GUID FormSetGuid
;
541 UI_MENU_SELECTION
*Selection
;
542 FORM_BROWSER_FORMSET
*SystemLevelFormSet
;
543 EFI_QUESTION_ID CurFakeQestId
;
544 BOOLEAN HiiPackageListUpdated
;
545 BOOLEAN FinishRetrieveCall
;
546 LIST_ENTRY FormHistoryList
;
547 LIST_ENTRY FormSetList
;
550 #define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)
553 // Scope for get defaut value. It may be GetDefaultForNoStorage, GetDefaultForStorage or GetDefaultForAll.
556 GetDefaultForNoStorage
, // Get default value for question which not has storage.
557 GetDefaultForStorage
, // Get default value for question which has storage.
558 GetDefaultForAll
, // Get default value for all questions.
559 GetDefaultForMax
// Invalid value.
560 } BROWSER_GET_DEFAULT_VALUE
;
563 // Get/set question value from/to.
566 GetSetValueWithEditBuffer
= 0, // Get/Set question value from/to editbuffer in the storage.
567 GetSetValueWithBuffer
, // Get/Set question value from/to buffer in the storage.
568 GetSetValueWithHiiDriver
, // Get/Set question value from/to hii driver.
569 GetSetValueWithBothBuffer
, // Compare the editbuffer with buffer for this question, not use the question value.
570 GetSetValueWithMax
// Invalid value.
571 } GET_SET_QUESTION_VALUE_WITH
;
573 extern EFI_HII_DATABASE_PROTOCOL
*mHiiDatabase
;
574 extern EFI_HII_CONFIG_ROUTING_PROTOCOL
*mHiiConfigRouting
;
575 extern EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL
*mPathFromText
;
576 extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL
*mFormDisplay
;
578 extern BOOLEAN gCallbackReconnect
;
579 extern BOOLEAN gFlagReconnect
;
580 extern BOOLEAN gResetRequiredFormLevel
;
581 extern BOOLEAN gResetRequiredSystemLevel
;
582 extern BOOLEAN gExitRequired
;
583 extern LIST_ENTRY gBrowserFormSetList
;
584 extern LIST_ENTRY gBrowserHotKeyList
;
585 extern BROWSER_SETTING_SCOPE gBrowserSettingScope
;
586 extern EXIT_HANDLER ExitHandlerFunction
;
587 extern EFI_HII_HANDLE mCurrentHiiHandle
;
588 extern SETUP_DRIVER_PRIVATE_DATA mPrivateData
;
590 // Browser Global Strings
592 extern CHAR16
*gEmptyString
;
594 extern UI_MENU_SELECTION
*gCurrentSelection
;
595 extern BOOLEAN mHiiPackageListUpdated
;
596 extern UINT16 mCurFakeQestId
;
597 extern BOOLEAN mFinishRetrieveCall
;
600 // Global Procedure Defines
602 #include "Expression.h"
605 Initialize the HII String Token to the correct values.
609 InitializeBrowserStrings (
614 Parse opcodes in the formset IFR binary.
616 @param FormSet Pointer of the FormSet data structure.
618 @retval EFI_SUCCESS Opcode parse success.
619 @retval Other Opcode parse fail.
624 IN FORM_BROWSER_FORMSET
*FormSet
628 Free resources allocated for a FormSet.
630 @param FormSet Pointer of the FormSet
635 IN OUT FORM_BROWSER_FORMSET
*FormSet
640 Create a new string in HII Package List.
642 @param String The String to be added
643 @param HiiHandle The package list in the HII database to insert the
646 @return The output string.
652 IN EFI_HII_HANDLE HiiHandle
656 Delete a string from HII Package List.
658 @param StringId Id of the string in HII database.
659 @param HiiHandle The HII package list handle.
661 @retval EFI_SUCCESS The string was deleted successfully.
666 IN EFI_STRING_ID StringId
,
667 IN EFI_HII_HANDLE HiiHandle
671 Get the string based on the StringId and HII Package List Handle.
673 @param Token The String's ID.
674 @param HiiHandle The package list in the HII database to search for
675 the specified string.
677 @return The output string.
682 IN EFI_STRING_ID Token
,
683 IN EFI_HII_HANDLE HiiHandle
687 Get Value for given Name from a NameValue Storage.
689 @param Storage The NameValue Storage.
690 @param Name The Name.
691 @param Value The retured Value.
692 @param GetValueFrom Where to get source value, from EditValue or Value.
694 @retval EFI_SUCCESS Value found for given Name.
695 @retval EFI_NOT_FOUND No such Name found in NameValue storage.
700 IN BROWSER_STORAGE
*Storage
,
702 IN OUT CHAR16
**Value
,
703 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom
707 Set Value of given Name in a NameValue Storage.
709 @param Storage The NameValue Storage.
710 @param Name The Name.
711 @param Value The Value to set.
712 @param SetValueTo Whether update editValue or Value.
713 @param ReturnNode The node use the input name.
715 @retval EFI_SUCCESS Value found for given Name.
716 @retval EFI_NOT_FOUND No such Name found in NameValue storage.
721 IN BROWSER_STORAGE
*Storage
,
724 IN GET_SET_QUESTION_VALUE_WITH SetValueTo
,
725 OUT NAME_VALUE_NODE
**ReturnNode
729 Validate whether this question's value has changed.
731 @param FormSet FormSet data structure.
732 @param Form Form data structure.
733 @param Question Question to be initialized.
734 @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.
736 @retval TRUE Question's value has changed.
737 @retval FALSE Question's value has not changed
741 IsQuestionValueChanged (
742 IN FORM_BROWSER_FORMSET
*FormSet
,
743 IN FORM_BROWSER_FORM
*Form
,
744 IN OUT FORM_BROWSER_STATEMENT
*Question
,
745 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom
749 Validate the FormSet. If the formset is not validate, remove it from the list.
751 @param FormSet The input FormSet which need to validate.
753 @retval TRUE The handle is validate.
754 @retval FALSE The handle is invalidate.
759 FORM_BROWSER_FORMSET
*FormSet
763 Update the ValueChanged status for questions.
765 @param FormSet FormSet data structure.
766 @param Form Form data structure.
767 @param SettingScope Setting Scope for Default action.
771 UpdateStatementStatus (
772 IN FORM_BROWSER_FORMSET
*FormSet
,
773 IN FORM_BROWSER_FORM
*Form
,
774 IN BROWSER_SETTING_SCOPE SettingScope
778 Get Question's current Value.
780 @param FormSet FormSet data structure.
781 @param Form Form data structure.
782 @param Question Question to be initialized.
783 @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.
785 @retval EFI_SUCCESS The function completed successfully.
790 IN FORM_BROWSER_FORMSET
*FormSet
,
791 IN FORM_BROWSER_FORM
*Form
,
792 IN OUT FORM_BROWSER_STATEMENT
*Question
,
793 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom
797 Save Question Value to edit copy(cached) or Storage(uncached).
799 @param FormSet FormSet data structure.
800 @param Form Form data structure.
801 @param Question Pointer to the Question.
802 @param SetValueTo Update the question value to editbuffer , buffer or hii driver.
804 @retval EFI_SUCCESS The function completed successfully.
809 IN FORM_BROWSER_FORMSET
*FormSet
,
810 IN FORM_BROWSER_FORM
*Form
,
811 IN OUT FORM_BROWSER_STATEMENT
*Question
,
812 IN GET_SET_QUESTION_VALUE_WITH SetValueTo
816 Perform inconsistent check for a Form.
818 @param FormSet FormSet data structure.
819 @param Form Form data structure.
820 @param Question The Question to be validated.
821 @param Type Validation type: InConsistent or NoSubmit
823 @retval EFI_SUCCESS Form validation pass.
824 @retval other Form validation failed.
829 IN FORM_BROWSER_FORMSET
*FormSet
,
830 IN FORM_BROWSER_FORM
*Form
,
831 IN FORM_BROWSER_STATEMENT
*Question
,
837 Discard data based on the input setting scope (Form, FormSet or System).
839 @param FormSet FormSet data structure.
840 @param Form Form data structure.
841 @param SettingScope Setting Scope for Discard action.
843 @retval EFI_SUCCESS The function completed successfully.
844 @retval EFI_UNSUPPORTED Unsupport SettingScope.
849 IN FORM_BROWSER_FORMSET
*FormSet
,
850 IN FORM_BROWSER_FORM
*Form
,
851 IN BROWSER_SETTING_SCOPE SettingScope
855 Submit data based on the input Setting level (Form, FormSet or System).
857 @param FormSet FormSet data structure.
858 @param Form Form data structure.
859 @param SettingScope Setting Scope for Submit action.
861 @retval EFI_SUCCESS The function completed successfully.
862 @retval EFI_UNSUPPORTED Unsupport SettingScope.
867 IN FORM_BROWSER_FORMSET
*FormSet
,
868 IN FORM_BROWSER_FORM
*Form
,
869 IN BROWSER_SETTING_SCOPE SettingScope
873 Reset Question to its default value.
875 @param FormSet The form set.
876 @param Form The form.
877 @param Question The question.
878 @param DefaultId The Class of the default.
880 @retval EFI_SUCCESS Question is reset to default value.
885 IN FORM_BROWSER_FORMSET
*FormSet
,
886 IN FORM_BROWSER_FORM
*Form
,
887 IN FORM_BROWSER_STATEMENT
*Question
,
892 Get current setting of Questions.
894 @param FormSet FormSet data structure.
898 InitializeCurrentSetting (
899 IN OUT FORM_BROWSER_FORMSET
*FormSet
903 Initialize the internal data structure of a FormSet.
905 @param Handle PackageList Handle
906 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
907 GUID), take the first FormSet found in package
909 @param FormSet FormSet data structure.
911 @retval EFI_SUCCESS The function completed successfully.
912 @retval EFI_NOT_FOUND The specified FormSet could not be found.
917 IN EFI_HII_HANDLE Handle
,
918 IN OUT EFI_GUID
*FormSetGuid
,
919 OUT FORM_BROWSER_FORMSET
*FormSet
923 Reset Questions to their initial value or default value in a Form, Formset or System.
925 GetDefaultValueScope parameter decides which questions will reset
926 to its default value.
928 @param FormSet FormSet data structure.
929 @param Form Form data structure.
930 @param DefaultId The Class of the default.
931 @param SettingScope Setting Scope for Default action.
932 @param GetDefaultValueScope Get default value scope.
933 @param Storage Get default value only for this storage.
934 @param RetrieveValueFirst Whether call the retrieve call back to
935 get the initial value before get default
937 @param SkipGetAltCfg Whether skip the get altcfg string process.
939 @retval EFI_SUCCESS The function completed successfully.
940 @retval EFI_UNSUPPORTED Unsupport SettingScope.
945 IN FORM_BROWSER_FORMSET
*FormSet
,
946 IN FORM_BROWSER_FORM
*Form
,
948 IN BROWSER_SETTING_SCOPE SettingScope
,
949 IN BROWSER_GET_DEFAULT_VALUE GetDefaultValueScope
,
950 IN BROWSER_STORAGE
*Storage
,
951 IN BOOLEAN RetrieveValueFirst
,
952 IN BOOLEAN SkipGetAltCfg
956 Initialize Question's Edit copy from Storage.
958 @param Selection Selection contains the information about
959 the Selection, form and formset to be displayed.
960 Selection action may be updated in retrieve callback.
961 If Selection is NULL, only initialize Question value.
962 @param FormSet FormSet data structure.
963 @param Form Form data structure.
965 @retval EFI_SUCCESS The function completed successfully.
970 IN OUT UI_MENU_SELECTION
*Selection
,
971 IN FORM_BROWSER_FORMSET
*FormSet
,
972 IN FORM_BROWSER_FORM
*Form
976 Initialize Question's Edit copy from Storage for the whole Formset.
978 @param Selection Selection contains the information about
979 the Selection, form and formset to be displayed.
980 Selection action may be updated in retrieve callback.
981 If Selection is NULL, only initialize Question value.
982 @param FormSet FormSet data structure.
984 @retval EFI_SUCCESS The function completed successfully.
989 IN OUT UI_MENU_SELECTION
*Selection
,
990 IN FORM_BROWSER_FORMSET
*FormSet
994 Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.
996 @param Storage The Storage to be conveted.
997 @param ConfigResp The returned <ConfigResp>.
998 @param ConfigRequest The ConfigRequest string.
999 @param GetEditBuf Get the data from editbuffer or buffer.
1001 @retval EFI_SUCCESS Convert success.
1002 @retval EFI_INVALID_PARAMETER Incorrect storage type.
1006 StorageToConfigResp (
1007 IN BROWSER_STORAGE
*Storage
,
1008 IN CHAR16
**ConfigResp
,
1009 IN CHAR16
*ConfigRequest
,
1010 IN BOOLEAN GetEditBuf
1014 Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.
1016 @param Storage The Storage to receive the settings.
1017 @param ConfigResp The <ConfigResp> to be converted.
1019 @retval EFI_SUCCESS Convert success.
1020 @retval EFI_INVALID_PARAMETER Incorrect storage type.
1024 ConfigRespToStorage (
1025 IN BROWSER_STORAGE
*Storage
,
1026 IN CHAR16
*ConfigResp
1030 Fill storage's edit copy with settings requested from Configuration Driver.
1032 @param FormSet FormSet data structure.
1033 @param Storage Buffer Storage.
1038 IN FORM_BROWSER_FORMSET
*FormSet
,
1039 IN FORMSET_STORAGE
*Storage
1043 Fetch the Ifr binary data of a FormSet.
1045 @param Handle PackageList Handle
1046 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
1047 GUID), take the first FormSet found in package
1049 @param BinaryLength The length of the FormSet IFR binary.
1050 @param BinaryData The buffer designed to receive the FormSet.
1052 @retval EFI_SUCCESS Buffer filled with the requested FormSet.
1053 BufferLength was updated.
1054 @retval EFI_INVALID_PARAMETER The handle is unknown.
1055 @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot
1056 be found with the requested FormId.
1061 IN EFI_HII_HANDLE Handle
,
1062 IN OUT EFI_GUID
*FormSetGuid
,
1063 OUT UINTN
*BinaryLength
,
1064 OUT UINT8
**BinaryData
1068 Save globals used by previous call to SendForm(). SendForm() may be called from
1069 HiiConfigAccess.Callback(), this will cause SendForm() be reentried.
1070 So, save globals of previous call to SendForm() and restore them upon exit.
1074 SaveBrowserContext (
1079 Restore globals used by previous call to SendForm().
1083 RestoreBrowserContext (
1088 This is the routine which an external caller uses to direct the browser
1089 where to obtain it's information.
1092 @param This The Form Browser protocol instanse.
1093 @param Handles A pointer to an array of Handles. If HandleCount > 1 we
1094 display a list of the formsets for the handles specified.
1095 @param HandleCount The number of Handles specified in Handle.
1096 @param FormSetGuid This field points to the EFI_GUID which must match the Guid
1097 field in the EFI_IFR_FORM_SET op-code for the specified
1098 forms-based package. If FormSetGuid is NULL, then this
1099 function will display the first found forms package.
1100 @param FormId This field specifies which EFI_IFR_FORM to render as the first
1101 displayable page. If this field has a value of 0x0000, then
1102 the forms browser will render the specified forms in their encoded order.
1103 ScreenDimenions - This allows the browser to be called so that it occupies a
1104 portion of the physical screen instead of dynamically determining the screen dimensions.
1105 ActionRequest - Points to the action recommended by the form.
1106 @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in
1108 @param ActionRequest Points to the action recommended by the form.
1110 @retval EFI_SUCCESS The function completed successfully.
1111 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
1112 @retval EFI_NOT_FOUND No valid forms could be found to display.
1118 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1119 IN EFI_HII_HANDLE
*Handles
,
1120 IN UINTN HandleCount
,
1121 IN EFI_GUID
*FormSetGuid
, OPTIONAL
1122 IN UINT16 FormId
, OPTIONAL
1123 IN CONST EFI_SCREEN_DESCRIPTOR
*ScreenDimensions
, OPTIONAL
1124 OUT EFI_BROWSER_ACTION_REQUEST
*ActionRequest OPTIONAL
1128 This function is called by a callback handler to retrieve uncommitted state
1129 data from the browser.
1131 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL
1133 @param ResultsDataSize A pointer to the size of the buffer associated
1135 @param ResultsData A string returned from an IFR browser or
1136 equivalent. The results string will have no
1137 routing information in them.
1138 @param RetrieveData A BOOLEAN field which allows an agent to retrieve
1139 (if RetrieveData = TRUE) data from the uncommitted
1140 browser state information or set (if RetrieveData
1141 = FALSE) data in the uncommitted browser state
1143 @param VariableGuid An optional field to indicate the target variable
1145 @param VariableName An optional field to indicate the target
1146 human-readable variable name.
1148 @retval EFI_SUCCESS The results have been distributed or are awaiting
1150 @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to
1151 contain the results data.
1157 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1158 IN OUT UINTN
*ResultsDataSize
,
1159 IN OUT EFI_STRING ResultsData
,
1160 IN BOOLEAN RetrieveData
,
1161 IN CONST EFI_GUID
*VariableGuid
, OPTIONAL
1162 IN CONST CHAR16
*VariableName OPTIONAL
1166 Find menu which will show next time.
1168 @param Selection On input, Selection tell setup browser the information
1169 about the Selection, form and formset to be displayed.
1170 On output, Selection return the screen item that is selected
1172 @param SettingLevel Input Settting level, if it is FormLevel, just exit current form.
1173 else, we need to exit current formset.
1175 @retval TRUE Exit current form.
1176 @retval FALSE User press ESC and keep in current form.
1180 IN OUT UI_MENU_SELECTION
*Selection
,
1181 IN BROWSER_SETTING_SCOPE SettingLevel
1185 check whether the form need to update the NV.
1187 @param Form Form data structure.
1189 @retval TRUE Need to update the NV.
1190 @retval FALSE No need to update the NV.
1193 IsNvUpdateRequiredForForm (
1194 IN FORM_BROWSER_FORM
*Form
1198 check whether the formset need to update the NV.
1200 @param FormSet FormSet data structure.
1202 @retval TRUE Need to update the NV.
1203 @retval FALSE No need to update the NV.
1206 IsNvUpdateRequiredForFormSet (
1207 IN FORM_BROWSER_FORMSET
*FormSet
1211 Call the call back function for the question and process the return action.
1213 @param Selection On input, Selection tell setup browser the information
1214 about the Selection, form and formset to be displayed.
1215 On output, Selection return the screen item that is selected
1217 @param FormSet The formset this question belong to.
1218 @param Form The form this question belong to.
1219 @param Question The Question which need to call.
1220 @param Action The action request.
1221 @param SkipSaveOrDiscard Whether skip save or discard action.
1223 @retval EFI_SUCCESS The call back function executes successfully.
1224 @return Other value if the call back function failed to execute.
1227 ProcessCallBackFunction (
1228 IN OUT UI_MENU_SELECTION
*Selection
,
1229 IN FORM_BROWSER_FORMSET
*FormSet
,
1230 IN FORM_BROWSER_FORM
*Form
,
1231 IN FORM_BROWSER_STATEMENT
*Question
,
1232 IN EFI_BROWSER_ACTION Action
,
1233 IN BOOLEAN SkipSaveOrDiscard
1237 Call the retrieve type call back function for one question to get the initialize data.
1239 This function only used when in the initialize stage, because in this stage, the
1240 Selection->Form is not ready. For other case, use the ProcessCallBackFunction instead.
1242 @param ConfigAccess The config access protocol produced by the hii driver.
1243 @param Statement The Question which need to call.
1244 @param FormSet The formset this question belong to.
1246 @retval EFI_SUCCESS The call back function executes successfully.
1247 @return Other value if the call back function failed to execute.
1250 ProcessRetrieveForQuestion (
1251 IN EFI_HII_CONFIG_ACCESS_PROTOCOL
*ConfigAccess
,
1252 IN FORM_BROWSER_STATEMENT
*Statement
,
1253 IN FORM_BROWSER_FORMSET
*FormSet
1257 Find the matched FormSet context in the backup maintain list based on HiiHandle.
1259 @param Handle The Hii Handle.
1261 @return the found FormSet context. If no found, NULL will return.
1264 FORM_BROWSER_FORMSET
*
1265 GetFormSetFromHiiHandle (
1266 EFI_HII_HANDLE Handle
1270 Check whether the input HII handle is the FormSet that is being used.
1272 @param Handle The Hii Handle.
1274 @retval TRUE HII handle is being used.
1275 @retval FALSE HII handle is not being used.
1279 IsHiiHandleInBrowserContext (
1280 EFI_HII_HANDLE Handle
1284 Configure what scope the hot key will impact.
1285 All hot keys have the same scope. The mixed hot keys with the different level are not supported.
1286 If no scope is set, the default scope will be FormSet level.
1287 After all registered hot keys are removed, previous Scope can reset to another level.
1289 @param[in] Scope Scope level to be set.
1291 @retval EFI_SUCCESS Scope is set correctly.
1292 @retval EFI_INVALID_PARAMETER Scope is not the valid value specified in BROWSER_SETTING_SCOPE.
1293 @retval EFI_UNSPPORTED Scope level is different from current one that the registered hot keys have.
1299 IN BROWSER_SETTING_SCOPE Scope
1303 Register the hot key with its browser action, or unregistered the hot key.
1304 Only support hot key that is not printable character (control key, function key, etc.).
1305 If the action value is zero, the hot key will be unregistered if it has been registered.
1306 If the same hot key has been registered, the new action and help string will override the previous ones.
1308 @param[in] KeyData A pointer to a buffer that describes the keystroke
1309 information for the hot key. Its type is EFI_INPUT_KEY to
1310 be supported by all ConsoleIn devices.
1311 @param[in] Action Action value that describes what action will be trigged when the hot key is pressed.
1312 @param[in] DefaultId Specifies the type of defaults to retrieve, which is only for DEFAULT action.
1313 @param[in] HelpString Help string that describes the hot key information.
1314 Its value may be NULL for the unregistered hot key.
1316 @retval EFI_SUCCESS Hot key is registered or unregistered.
1317 @retval EFI_INVALID_PARAMETER KeyData is NULL.
1318 @retval EFI_NOT_FOUND KeyData is not found to be unregistered.
1319 @retval EFI_UNSUPPORTED Key represents a printable character. It is conflicted with Browser.
1320 @retval EFI_ALREADY_STARTED Key already been registered for one hot key.
1325 IN EFI_INPUT_KEY
*KeyData
,
1327 IN UINT16 DefaultId
,
1328 IN EFI_STRING HelpString OPTIONAL
1332 Register Exit handler function.
1333 When more than one handler function is registered, the latter one will override the previous one.
1334 When NULL handler is specified, the previous Exit handler will be unregistered.
1336 @param[in] Handler Pointer to handler function.
1341 RegiserExitHandler (
1342 IN EXIT_HANDLER Handler
1347 Check whether the browser data has been modified.
1349 @retval TRUE Browser data is changed.
1350 @retval FALSE No browser data is changed.
1355 IsBrowserDataModified (
1361 Execute the action requested by the Action parameter.
1363 @param[in] Action Execute the request action.
1364 @param[in] DefaultId The default Id info when need to load default value.
1366 @retval EFI_SUCCESS Execute the request action succss.
1367 @retval EFI_INVALID_PARAMETER The input action value is invalid.
1378 Create reminder to let user to choose save or discard the changed browser data.
1379 Caller can use it to actively check the changed browser data.
1381 @retval BROWSER_NO_CHANGES No browser data is changed.
1382 @retval BROWSER_SAVE_CHANGES The changed browser data is saved.
1383 @retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
1384 @retval BROWSER_KEEP_CURRENT Browser keep current changes.
1394 Check whether the Reset Required for the browser
1396 @retval TRUE Browser required to reset after exit.
1397 @retval FALSE Browser not need to reset after exit.
1407 Find the registered HotKey based on KeyData.
1409 @param[in] KeyData A pointer to a buffer that describes the keystroke
1410 information for the hot key.
1412 @return The registered HotKey context. If no found, NULL will return.
1415 GetHotKeyFromRegisterList (
1416 IN EFI_INPUT_KEY
*KeyData
1421 Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.
1423 @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.
1425 @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.
1428 FORM_BROWSER_STATEMENT
*
1429 GetBrowserStatement (
1430 IN FORM_DISPLAY_ENGINE_STATEMENT
*DisplayStatement
1434 Password may be stored as encrypted by Configuration Driver. When change a
1435 password, user will be challenged with old password. To validate user input old
1436 password, we will send the clear text to Configuration Driver via Callback().
1437 Configuration driver is responsible to check the passed in password and return
1438 the validation result. If validation pass, state machine in password Callback()
1439 will transit from BROWSER_STATE_VALIDATE_PASSWORD to BROWSER_STATE_SET_PASSWORD.
1440 After user type in new password twice, Callback() will be invoked to send the
1441 new password to Configuration Driver.
1443 @param Selection Pointer to UI_MENU_SELECTION.
1444 @param MenuOption The MenuOption for this password Question.
1445 @param String The clear text of password.
1447 @retval EFI_NOT_AVAILABLE_YET Callback() request to terminate password input.
1448 @return In state of BROWSER_STATE_VALIDATE_PASSWORD:
1449 @retval EFI_SUCCESS Password correct, Browser will prompt for new
1451 @retval EFI_NOT_READY Password incorrect, Browser will show error
1453 @retval Other Browser will do nothing.
1454 @return In state of BROWSER_STATE_SET_PASSWORD:
1455 @retval EFI_SUCCESS Set password success.
1456 @retval Other Set password failed.
1461 IN UI_MENU_SELECTION
*Selection
,
1462 IN FORM_BROWSER_STATEMENT
*Question
,
1467 Display error message for invalid password.
1476 The worker function that send the displays to the screen. On output,
1477 the selection made by user is returned.
1479 @param Selection On input, Selection tell setup browser the information
1480 about the Selection, form and formset to be displayed.
1481 On output, Selection return the screen item that is selected
1484 @retval EFI_SUCCESS The page is displayed successfully.
1485 @return Other value if the page failed to be diplayed.
1490 IN OUT UI_MENU_SELECTION
*Selection
1494 Free up the resource allocated for all strings required
1499 FreeBrowserStrings (
1504 Create a menu with specified formset GUID and form ID, and add it as a child
1505 of the given parent menu.
1507 @param HiiHandle Hii handle related to this formset.
1508 @param FormSetGuid The Formset Guid of menu to be added.
1509 @param FormId The Form ID of menu to be added.
1510 @param QuestionId The question id of this menu to be added.
1512 @return A pointer to the newly added menu or NULL if memory is insufficient.
1517 IN EFI_HII_HANDLE HiiHandle
,
1518 IN EFI_GUID
*FormSetGuid
,
1520 IN UINT16 QuestionId
1524 Search Menu with given FormSetGuid and FormId in all cached menu list.
1526 @param HiiHandle HiiHandle for FormSet.
1527 @param FormSetGuid The Formset GUID of the menu to search.
1528 @param FormId The Form ID of menu to search.
1530 @return A pointer to menu found or NULL if not found.
1535 IN EFI_HII_HANDLE HiiHandle
,
1536 IN EFI_GUID
*FormSetGuid
,
1541 Free Menu list linked list.
1543 @param MenuListHead One Menu list point in the menu list.
1548 LIST_ENTRY
*MenuListHead
1552 Find parent menu for current menu.
1554 @param CurrentMenu Current Menu
1555 @param SettingLevel Whether find parent menu in Form Level or Formset level.
1556 In form level, just find the parent menu;
1557 In formset level, find the parent menu which has different
1560 @retval The parent menu for current menu.
1564 IN FORM_ENTRY_INFO
*CurrentMenu
,
1565 IN BROWSER_SETTING_SCOPE SettingLevel
1569 Validate the HiiHandle.
1571 @param HiiHandle The input HiiHandle which need to validate.
1573 @retval TRUE The handle is validate.
1574 @retval FALSE The handle is invalidate.
1579 EFI_HII_HANDLE HiiHandle
1583 Copy current Menu list to the new menu list.
1585 @param NewMenuListHead New create Menu list.
1586 @param CurrentMenuListHead Current Menu list.
1591 OUT LIST_ENTRY
*NewMenuListHead
,
1592 IN LIST_ENTRY
*CurrentMenuListHead
1596 Search an Option of a Question by its value.
1598 @param Question The Question
1599 @param OptionValue Value for Option to be searched.
1601 @retval Pointer Pointer to the found Option.
1602 @retval NULL Option not found.
1607 IN FORM_BROWSER_STATEMENT
*Question
,
1608 IN EFI_HII_VALUE
*OptionValue
1611 Return data element in an Array by its Index.
1613 @param Array The data array.
1614 @param Type Type of the data in this array.
1615 @param Index Zero based index for data in this array.
1617 @retval Value The data to be returned
1628 Set value of a data element in an Array by its Index.
1630 @param Array The data array.
1631 @param Type Type of the data in this array.
1632 @param Index Zero based index for data in this array.
1633 @param Value The value to be set.
1645 Compare two Hii value.
1647 @param Value1 Expression value to compare on left-hand.
1648 @param Value2 Expression value to compare on right-hand.
1649 @param Result Return value after compare.
1650 retval 0 Two operators equal.
1651 return Positive value if Value1 is greater than Value2.
1652 retval Negative value if Value1 is less than Value2.
1653 @param HiiHandle Only required for string compare.
1655 @retval other Could not perform compare on two values.
1656 @retval EFI_SUCCESS Compare the value success.
1661 IN EFI_HII_VALUE
*Value1
,
1662 IN EFI_HII_VALUE
*Value2
,
1664 IN EFI_HII_HANDLE HiiHandle OPTIONAL
1668 Perform Password check.
1669 Passwork may be encrypted by driver that requires the specific check.
1671 @param Form Form where Password Statement is in.
1672 @param Statement Password statement
1673 @param PasswordString Password string to be checked. It may be NULL.
1674 NULL means to restore password.
1675 "" string can be used to checked whether old password does exist.
1677 @return Status Status of Password check.
1682 IN FORM_DISPLAY_ENGINE_FORM
*Form
,
1683 IN FORM_DISPLAY_ENGINE_STATEMENT
*Statement
,
1684 IN EFI_STRING PasswordString OPTIONAL
1689 Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.
1691 @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.
1693 @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.
1696 FORM_BROWSER_STATEMENT
*
1697 GetBrowserStatement (
1698 IN FORM_DISPLAY_ENGINE_STATEMENT
*DisplayStatement
1703 Initialize the Display form structure data.
1707 InitializeDisplayFormData (
1713 Base on the current formset info, clean the ConfigRequest string in browser storage.
1715 @param FormSet Pointer of the FormSet
1719 CleanBrowserStorage (
1720 IN OUT FORM_BROWSER_FORMSET
*FormSet
1724 Find HII Handle in the HII database associated with given Device Path.
1726 If DevicePath is NULL, then ASSERT.
1728 @param DevicePath Device Path associated with the HII package list
1730 @param FormsetGuid The formset guid for this formset.
1732 @retval Handle HII package list Handle associated with the Device
1734 @retval NULL Hii Package list handle is not found.
1738 DevicePathToHiiHandle (
1739 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
1740 IN EFI_GUID
*FormsetGuid
1744 Adjust the config request info, remove the request elements which already in AllConfigRequest string.
1746 @param Storage Form set Storage.
1747 @param Request The input request string.
1748 @param RespString Whether the input is ConfigRequest or ConfigResp format.
1750 @retval TRUE Has element not covered by current used elements, need to continue to call ExtractConfig
1751 @retval FALSE All elements covered by current used elements.
1755 ConfigRequestAdjust (
1756 IN BROWSER_STORAGE
*Storage
,
1758 IN BOOLEAN RespString
1762 Perform question check.
1764 If one question has more than one check, process form high priority to low.
1766 @param FormSet FormSet data structure.
1767 @param Form Form data structure.
1768 @param Question The Question to be validated.
1770 @retval EFI_SUCCESS Form validation pass.
1771 @retval other Form validation failed.
1775 ValueChangedValidation (
1776 IN FORM_BROWSER_FORMSET
*FormSet
,
1777 IN FORM_BROWSER_FORM
*Form
,
1778 IN FORM_BROWSER_STATEMENT
*Question
1782 Pop up the error info.
1784 @param BrowserStatus The input browser status.
1785 @param HiiHandle The HiiHandle for this error opcode.
1786 @param OpCode The opcode use to get the erro info and timeout value.
1787 @param ErrorString Error string used by BROWSER_NO_SUBMIT_IF.
1792 IN UINT32 BrowserStatus
,
1793 IN EFI_HII_HANDLE HiiHandle
,
1794 IN EFI_IFR_OP_HEADER
*OpCode
, OPTIONAL
1795 IN CHAR16
*ErrorString
1799 Check whether the result is TRUE or FALSE.
1801 For the EFI_HII_VALUE value type is numeric, return TRUE if the
1804 @param Result Input the result data.
1806 @retval TRUE The result is TRUE.
1807 @retval FALSE The result is FALSE.
1812 IN EFI_HII_VALUE
*Result
1816 Get Formset_storage base on the input varstoreid info.
1818 @param FormSet Pointer of the current FormSet.
1819 @param VarStoreId Varstore ID info.
1821 @return Pointer to a FORMSET_STORAGE data structure.
1825 GetFstStgFromVarId (
1826 IN FORM_BROWSER_FORMSET
*FormSet
,
1827 IN EFI_VARSTORE_ID VarStoreId
1831 Get Formset_storage base on the input browser storage.
1833 More than one formsets may share the same browser storage,
1834 this function just get the first formset storage which
1835 share the browser storage.
1837 @param Storage browser storage info.
1839 @return Pointer to a FORMSET_STORAGE data structure.
1844 GetFstStgFromBrsStg (
1845 IN BROWSER_STORAGE
*Storage
1849 Reconnect the controller.
1851 @param DriverHandle The controller handle which need to be reconnect.
1853 @retval TRUE do the reconnect behavior success.
1854 @retval FALSE do the reconnect behavior failed.
1858 ReconnectController (
1859 IN EFI_HANDLE DriverHandle
1863 Converts the unicode character of the string from uppercase to lowercase.
1864 This is a internal function.
1866 @param ConfigString String to be converted
1872 IN EFI_STRING ConfigString