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
15 #include <Protocol/SimpleTextOut.h>
16 #include <Protocol/SimpleTextIn.h>
17 #include <Protocol/FormBrowser2.h>
18 #include <Protocol/FormBrowserEx2.h>
19 #include <Protocol/DisplayProtocol.h>
20 #include <Protocol/DevicePath.h>
21 #include <Protocol/UnicodeCollation.h>
22 #include <Protocol/HiiConfigAccess.h>
23 #include <Protocol/HiiConfigRouting.h>
24 #include <Protocol/HiiDatabase.h>
25 #include <Protocol/HiiString.h>
26 #include <Protocol/UserManager.h>
27 #include <Protocol/DevicePathFromText.h>
28 #include <Protocol/RegularExpressionProtocol.h>
30 #include <Guid/MdeModuleHii.h>
31 #include <Guid/HiiPlatformSetupFormset.h>
32 #include <Guid/HiiFormMapMethodGuid.h>
33 #include <Guid/ZeroGuid.h>
35 #include <Library/PrintLib.h>
36 #include <Library/DebugLib.h>
37 #include <Library/BaseMemoryLib.h>
38 #include <Library/UefiRuntimeServicesTableLib.h>
39 #include <Library/UefiDriverEntryPoint.h>
40 #include <Library/UefiBootServicesTableLib.h>
41 #include <Library/BaseLib.h>
42 #include <Library/MemoryAllocationLib.h>
43 #include <Library/HiiLib.h>
44 #include <Library/PcdLib.h>
45 #include <Library/DevicePathLib.h>
46 #include <Library/UefiLib.h>
49 // This is the generated header file which includes whatever needs to be exported (strings + IFR)
52 #define UI_ACTION_NONE 0
53 #define UI_ACTION_REFRESH_FORM 1
54 #define UI_ACTION_REFRESH_FORMSET 2
55 #define UI_ACTION_EXIT 3
61 #define ONE_SECOND 10000000
63 // Incremental string lenght of ConfigRequest
65 #define CONFIG_REQUEST_STRING_INCREMENTAL 1024
68 // Incremental size of stack for expression
70 #define EXPRESSION_STACK_SIZE_INCREMENT 0x100
72 #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))
74 #define SETUP_DRIVER_SIGNATURE SIGNATURE_32 ('F', 'B', 'D', 'V')
83 EFI_FORM_BROWSER2_PROTOCOL FormBrowser2
;
84 EDKII_FORM_BROWSER_EXTENSION_PROTOCOL FormBrowserEx
;
86 EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL FormBrowserEx2
;
87 } SETUP_DRIVER_PRIVATE_DATA
;
90 // IFR relative definition
92 #define EFI_HII_EXPRESSION_INCONSISTENT_IF 0
93 #define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1
94 #define EFI_HII_EXPRESSION_GRAY_OUT_IF 2
95 #define EFI_HII_EXPRESSION_SUPPRESS_IF 3
96 #define EFI_HII_EXPRESSION_DISABLE_IF 4
97 #define EFI_HII_EXPRESSION_VALUE 5
98 #define EFI_HII_EXPRESSION_RULE 6
99 #define EFI_HII_EXPRESSION_READ 7
100 #define EFI_HII_EXPRESSION_WRITE 8
101 #define EFI_HII_EXPRESSION_WARNING_IF 9
103 #define EFI_HII_VARSTORE_BUFFER 0
104 #define EFI_HII_VARSTORE_NAME_VALUE 1
105 #define EFI_HII_VARSTORE_EFI_VARIABLE 2 // EFI Varstore type follow UEFI spec before 2.3.1.
106 #define EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER 3 // EFI varstore type follow UEFI spec 2.3.1 and later.
108 #define FORM_INCONSISTENT_VALIDATION 0
109 #define FORM_NO_SUBMIT_VALIDATION 1
111 #define NAME_VALUE_NODE_SIGNATURE SIGNATURE_32 ('N', 'V', 'S', 'T')
121 #define NAME_VALUE_NODE_FROM_LINK(a) CR (a, NAME_VALUE_NODE, Link, NAME_VALUE_NODE_SIGNATURE)
123 #define BROWSER_STORAGE_SIGNATURE SIGNATURE_32 ('B', 'S', 'T', 'G')
129 UINT8 Type
; // Storage type
131 BOOLEAN Initialized
; // Whether this varstore is initialized, efi varstore not used.
133 EFI_HII_HANDLE HiiHandle
; // HiiHandle for this varstore, efi varstore not used.
136 CHAR16
*Name
; // For EFI_IFR_VARSTORE
139 UINT8
*EditBuffer
; // Edit copy for Buffer Storage
141 LIST_ENTRY NameValueListHead
; // List of NAME_VALUE_NODE
143 UINT32 Attributes
; // For EFI_IFR_VARSTORE_EFI: EFI Variable attribute
145 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
146 // <RequestElement> includes all fields which is used by current form sets.
147 UINTN SpareStrLen
; // Spare length of ConfigRequest string buffer
150 #define BROWSER_STORAGE_FROM_LINK(a) CR (a, BROWSER_STORAGE, Link, BROWSER_STORAGE_SIGNATURE)
152 #define FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'G')
158 LIST_ENTRY SaveFailLink
;
162 BROWSER_STORAGE
*BrowserStorage
;
164 CHAR16
*ConfigHdr
; // <ConfigHdr>
166 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
167 CHAR16
*ConfigAltResp
; // Alt config response string for this ConfigRequest.
168 BOOLEAN HasCallAltCfg
; // Flag to show whether browser has call ExtractConfig to get Altcfg string.
169 UINTN ElementCount
; // Number of <RequestElement> in the <ConfigRequest>
170 UINTN SpareStrLen
; // Spare length of ConfigRequest string buffer
171 CHAR16
*RestoreConfigRequest
; // When submit formset fail, the element need to be restored
172 CHAR16
*SyncConfigRequest
; // When submit formset fail, the element need to be synced
175 #define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)
176 #define FORMSET_STORAGE_FROM_SAVE_FAIL_LINK(a) CR (a, FORMSET_STORAGE, SaveFailLink, FORMSET_STORAGE_SIGNATURE)
179 EFI_STRING_ID VarName
;
183 #define EXPRESSION_OPCODE_SIGNATURE SIGNATURE_32 ('E', 'X', 'O', 'P')
191 UINT8 Format
; // For EFI_IFR_TO_STRING, EFI_IFR_FIND
192 UINT8 Flags
; // For EFI_IFR_SPAN
193 UINT8 RuleId
; // For EFI_IFR_RULE_REF
195 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
197 EFI_QUESTION_ID QuestionId
; // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_VAL_LIST, EFI_IFR_QUESTION_REF1
198 EFI_QUESTION_ID QuestionId2
;
200 UINT16 ListLength
; // For EFI_IFR_EQ_ID_VAL_LIST
203 EFI_STRING_ID DevicePath
; // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3
206 BROWSER_STORAGE
*VarStorage
; // For EFI_IFR_SET, EFI_IFR_GET
207 VAR_STORE_INFO VarStoreInfo
; // For EFI_IFR_SET, EFI_IFR_GET
208 UINT8 ValueType
; // For EFI_IFR_SET, EFI_IFR_GET
209 UINT8 ValueWidth
; // For EFI_IFR_SET, EFI_IFR_GET
210 CHAR16
*ValueName
; // For EFI_IFR_SET, EFI_IFR_GET
211 LIST_ENTRY MapExpressionList
; // nested expressions inside of Map opcode.
214 #define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)
216 #define FORM_EXPRESSION_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'P')
222 UINT8 Type
; // Type for this expression
224 UINT8 RuleId
; // For EFI_IFR_RULE only
225 EFI_STRING_ID Error
; // For EFI_IFR_NO_SUBMIT_IF, EFI_IFR_INCONSISTENT_IF only
227 EFI_HII_VALUE Result
; // Expression evaluation result
229 UINT8 TimeOut
; // For EFI_IFR_WARNING_IF
230 EFI_IFR_OP_HEADER
*OpCode
; // Save the opcode buffer.
232 LIST_ENTRY OpCodeListHead
; // OpCodes consist of this expression (EXPRESSION_OPCODE)
235 #define FORM_EXPRESSION_FROM_LINK(a) CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)
237 #define FORM_EXPRESSION_LIST_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'R')
242 FORM_EXPRESSION
*Expression
[1]; // Array[Count] of expressions
243 } FORM_EXPRESSION_LIST
;
245 #define QUESTION_DEFAULT_SIGNATURE SIGNATURE_32 ('Q', 'D', 'F', 'T')
252 EFI_HII_VALUE Value
; // Default value
254 FORM_EXPRESSION
*ValueExpression
; // Not-NULL indicates default value is provided by EFI_IFR_VALUE
257 #define QUESTION_DEFAULT_FROM_LINK(a) CR (a, QUESTION_DEFAULT, Link, QUESTION_DEFAULT_SIGNATURE)
259 #define QUESTION_OPTION_SIGNATURE SIGNATURE_32 ('Q', 'O', 'P', 'T')
265 EFI_IFR_ONE_OF_OPTION
*OpCode
; // OneOfOption Data
270 EFI_IMAGE_ID ImageId
;
272 FORM_EXPRESSION_LIST
*SuppressExpression
; // Non-NULL indicates nested inside of SuppressIf
275 #define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)
291 typedef struct _FORM_BROWSER_STATEMENT FORM_BROWSER_STATEMENT
;
293 #define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')
295 struct _FORM_BROWSER_STATEMENT
{
299 UINT8 Operand
; // The operand (first byte) of this Statement or Question
300 EFI_IFR_OP_HEADER
*OpCode
;
305 EFI_STRING_ID Prompt
;
307 EFI_STRING_ID TextTwo
; // For EFI_IFR_TEXT
310 // Fake Question Id, used for statement not has true QuestionId.
312 EFI_QUESTION_ID FakeQuestionId
;
317 EFI_QUESTION_ID QuestionId
; // The value of zero is reserved
318 EFI_VARSTORE_ID VarStoreId
; // A value of zero indicates no variable storage
319 BROWSER_STORAGE
*Storage
;
320 VAR_STORE_INFO VarStoreInfo
;
322 UINT16 BitStorageWidth
;
325 BOOLEAN QuestionReferToBitField
; // Whether the question is stored in a bit field.
326 CHAR16
*VariableName
; // Name/Value or EFI Variable name
327 CHAR16
*BlockName
; // Buffer storage block name: "OFFSET=...WIDTH=..."
329 EFI_HII_VALUE HiiValue
; // Edit copy for checkbox, numberic, oneof
330 UINT8
*BufferValue
; // Edit copy for string, password, orderedlist
331 UINT8 ValueType
; // Data type for orderedlist value array
334 // OpCode specific members
336 UINT8 Flags
; // for EFI_IFR_CHECKBOX, EFI_IFR_DATE, EFI_IFR_NUMERIC, EFI_IFR_ONE_OF,
337 // EFI_IFR_ORDERED_LIST, EFI_IFR_STRING,EFI_IFR_SUBTITLE,EFI_IFR_TIME, EFI_IFR_BANNER
338 UINT8 MaxContainers
; // for EFI_IFR_ORDERED_LIST
340 UINT16 BannerLineNumber
; // for EFI_IFR_BANNER, 1-based line number
341 EFI_STRING_ID QuestionConfig
; // for EFI_IFR_ACTION, if 0 then no configuration string will be processed
343 UINT64 Minimum
; // for EFI_IFR_ONE_OF/EFI_IFR_NUMERIC, it's Min/Max value
344 UINT64 Maximum
; // for EFI_IFR_STRING/EFI_IFR_PASSWORD, it's Min/Max length
347 EFI_DEFAULT_ID DefaultId
; // for EFI_IFR_RESET_BUTTON
348 EFI_GUID RefreshGuid
; // for EFI_IFR_REFRESH_ID
349 BOOLEAN Locked
; // Whether this statement is locked.
350 BOOLEAN ValueChanged
; // Whether this statement's value is changed.
352 // Get from IFR parsing
354 FORM_EXPRESSION
*ValueExpression
; // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly
355 LIST_ENTRY DefaultListHead
; // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values
356 LIST_ENTRY OptionListHead
; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)
358 EFI_IMAGE_ID ImageId
; // nested EFI_IFR_IMAGE
359 UINT8 RefreshInterval
; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh
361 FORM_BROWSER_STATEMENT
*ParentStatement
;
363 LIST_ENTRY InconsistentListHead
; // nested inconsistent expression list (FORM_EXPRESSION)
364 LIST_ENTRY NoSubmitListHead
; // nested nosubmit expression list (FORM_EXPRESSION)
365 LIST_ENTRY WarningListHead
; // nested warning expression list (FORM_EXPRESSION)
366 FORM_EXPRESSION_LIST
*Expression
; // nesting inside of GrayOutIf/DisableIf/SuppressIf
368 FORM_EXPRESSION
*ReadExpression
; // nested EFI_IFR_READ, provide this question value by read expression.
369 FORM_EXPRESSION
*WriteExpression
; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.
372 #define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)
374 #define FORM_BROWSER_CONFIG_REQUEST_SIGNATURE SIGNATURE_32 ('F', 'C', 'R', 'S')
379 LIST_ENTRY SaveFailLink
;
381 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
382 CHAR16
*ConfigAltResp
; // Alt config response string for this ConfigRequest.
383 UINTN ElementCount
; // Number of <RequestElement> in the <ConfigRequest>
385 CHAR16
*RestoreConfigRequest
; // When submit form fail, the element need to be restored
386 CHAR16
*SyncConfigRequest
; // When submit form fail, the element need to be synced
388 BROWSER_STORAGE
*Storage
;
389 } FORM_BROWSER_CONFIG_REQUEST
;
390 #define FORM_BROWSER_CONFIG_REQUEST_FROM_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, Link, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)
391 #define FORM_BROWSER_CONFIG_REQUEST_FROM_SAVE_FAIL_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, SaveFailLink, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)
393 #define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')
394 #define STANDARD_MAP_FORM_TYPE 0x01
400 UINT16 FormId
; // FormId of normal form or formmap form.
401 EFI_STRING_ID FormTitle
; // FormTile of normal form, or FormMapMethod title of formmap form.
402 UINT16 FormType
; // Specific form type for the different form.
404 EFI_IMAGE_ID ImageId
;
406 BOOLEAN ModalForm
; // Whether this is a modal form.
407 BOOLEAN Locked
; // Whether this form is locked.
408 EFI_GUID RefreshGuid
; // Form refresh event guid.
410 LIST_ENTRY FormViewListHead
; // List of type FORMID_INFO is Browser View Form History List.
411 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
412 LIST_ENTRY StatementListHead
; // List of Statements and Questions (FORM_BROWSER_STATEMENT)
413 LIST_ENTRY ConfigRequestHead
; // List of configreques for all storage.
414 FORM_EXPRESSION_LIST
*SuppressExpression
; // nesting inside of SuppressIf
417 #define FORM_BROWSER_FORM_FROM_LINK(a) CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)
419 #define FORMSET_DEFAULTSTORE_SIGNATURE SIGNATURE_32 ('F', 'D', 'F', 'S')
426 EFI_STRING_ID DefaultName
;
427 } FORMSET_DEFAULTSTORE
;
429 #define FORMSET_DEFAULTSTORE_FROM_LINK(a) CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE)
431 #define FORM_BROWSER_FORMSET_SIGNATURE SIGNATURE_32 ('F', 'B', 'F', 'S')
436 LIST_ENTRY SaveFailLink
;
438 EFI_HII_HANDLE HiiHandle
; // unique id for formset.
439 EFI_HANDLE DriverHandle
;
440 EFI_HII_CONFIG_ACCESS_PROTOCOL
*ConfigAccess
;
441 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
443 UINTN IfrBinaryLength
;
444 UINT8
*IfrBinaryData
;
446 BOOLEAN QuestionInited
; // Have finished question initilization?
448 EFI_STRING_ID FormSetTitle
;
450 UINT8 NumberOfClassGuid
;
451 EFI_GUID ClassGuid
[3]; // Up to three ClassGuid
452 UINT16 Class
; // Tiano extended Class code
453 UINT16 SubClass
; // Tiano extended Subclass code
454 EFI_IMAGE_ID ImageId
;
455 EFI_IFR_OP_HEADER
*OpCode
; // mainly for formset op to get ClassGuid
457 FORM_BROWSER_STATEMENT
*StatementBuffer
; // Buffer for all Statements and Questions
458 EXPRESSION_OPCODE
*ExpressionBuffer
; // Buffer for all Expression OpCode
459 FORM_BROWSER_FORM
*SaveFailForm
; // The form which failed to save.
460 FORM_BROWSER_STATEMENT
*SaveFailStatement
; // The Statement which failed to save.
462 LIST_ENTRY StatementListOSF
; // Statement list out side of the form.
463 LIST_ENTRY StorageListHead
; // Storage list (FORMSET_STORAGE)
464 LIST_ENTRY SaveFailStorageListHead
; // Storage list for the save fail storage.
465 LIST_ENTRY DefaultStoreListHead
; // DefaultStore list (FORMSET_DEFAULTSTORE)
466 LIST_ENTRY FormListHead
; // Form list (FORM_BROWSER_FORM)
467 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
468 } FORM_BROWSER_FORMSET
;
469 #define FORM_BROWSER_FORMSET_FROM_LINK(a) CR (a, FORM_BROWSER_FORMSET, Link, FORM_BROWSER_FORMSET_SIGNATURE)
471 #define FORM_BROWSER_FORMSET_FROM_SAVE_FAIL_LINK(a) CR (a, FORM_BROWSER_FORMSET, SaveFailLink, FORM_BROWSER_FORMSET_SIGNATURE)
475 EFI_EVENT RefreshEvent
;
476 } FORM_BROWSER_REFRESH_EVENT_NODE
;
478 #define FORM_BROWSER_REFRESH_EVENT_FROM_LINK(a) BASE_CR (a, FORM_BROWSER_REFRESH_EVENT_NODE, Link)
481 EFI_HII_HANDLE Handle
;
484 // Target formset/form/Question information
486 EFI_GUID FormSetGuid
;
489 UINTN Sequence
; // used for time/date only.
498 // Ation for Browser to taken:
499 // UI_ACTION_NONE - navigation inside a form
500 // UI_ACTION_REFRESH_FORM - re-evaluate expressions and repaint form
501 // UI_ACTION_REFRESH_FORMSET - re-parse formset IFR binary
506 // Current selected fomset/form/Question
508 FORM_BROWSER_FORMSET
*FormSet
;
509 FORM_BROWSER_FORM
*Form
;
510 FORM_BROWSER_STATEMENT
*Statement
;
513 // Whether the Form is editable
515 BOOLEAN FormEditable
;
517 FORM_ENTRY_INFO
*CurrentMenu
;
520 #define BROWSER_CONTEXT_SIGNATURE SIGNATURE_32 ('B', 'C', 'T', 'X')
527 // Globals defined in Setup.c
529 BOOLEAN FlagReconnect
;
530 BOOLEAN CallbackReconnect
;
531 BOOLEAN ResetRequired
;
532 BOOLEAN ExitRequired
;
533 EFI_HII_HANDLE HiiHandle
;
534 EFI_GUID FormSetGuid
;
536 UI_MENU_SELECTION
*Selection
;
537 FORM_BROWSER_FORMSET
*SystemLevelFormSet
;
538 EFI_QUESTION_ID CurFakeQestId
;
539 BOOLEAN HiiPackageListUpdated
;
540 BOOLEAN FinishRetrieveCall
;
541 LIST_ENTRY FormHistoryList
;
542 LIST_ENTRY FormSetList
;
545 #define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)
548 // Scope for get defaut value. It may be GetDefaultForNoStorage, GetDefaultForStorage or GetDefaultForAll.
551 GetDefaultForNoStorage
, // Get default value for question which not has storage.
552 GetDefaultForStorage
, // Get default value for question which has storage.
553 GetDefaultForAll
, // Get default value for all questions.
554 GetDefaultForMax
// Invalid value.
555 } BROWSER_GET_DEFAULT_VALUE
;
558 // Get/set question value from/to.
561 GetSetValueWithEditBuffer
= 0, // Get/Set question value from/to editbuffer in the storage.
562 GetSetValueWithBuffer
, // Get/Set question value from/to buffer in the storage.
563 GetSetValueWithHiiDriver
, // Get/Set question value from/to hii driver.
564 GetSetValueWithBothBuffer
, // Compare the editbuffer with buffer for this question, not use the question value.
565 GetSetValueWithMax
// Invalid value.
566 } GET_SET_QUESTION_VALUE_WITH
;
568 extern EFI_HII_DATABASE_PROTOCOL
*mHiiDatabase
;
569 extern EFI_HII_CONFIG_ROUTING_PROTOCOL
*mHiiConfigRouting
;
570 extern EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL
*mPathFromText
;
571 extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL
*mFormDisplay
;
573 extern BOOLEAN gCallbackReconnect
;
574 extern BOOLEAN gFlagReconnect
;
575 extern BOOLEAN gResetRequiredFormLevel
;
576 extern BOOLEAN gResetRequiredSystemLevel
;
577 extern BOOLEAN gExitRequired
;
578 extern LIST_ENTRY gBrowserFormSetList
;
579 extern LIST_ENTRY gBrowserHotKeyList
;
580 extern BROWSER_SETTING_SCOPE gBrowserSettingScope
;
581 extern EXIT_HANDLER ExitHandlerFunction
;
582 extern EFI_HII_HANDLE mCurrentHiiHandle
;
583 extern SETUP_DRIVER_PRIVATE_DATA mPrivateData
;
585 // Browser Global Strings
587 extern CHAR16
*gEmptyString
;
589 extern UI_MENU_SELECTION
*gCurrentSelection
;
590 extern BOOLEAN mHiiPackageListUpdated
;
591 extern UINT16 mCurFakeQestId
;
592 extern BOOLEAN mFinishRetrieveCall
;
595 // Global Procedure Defines
597 #include "Expression.h"
600 Initialize the HII String Token to the correct values.
604 InitializeBrowserStrings (
609 Parse opcodes in the formset IFR binary.
611 @param FormSet Pointer of the FormSet data structure.
613 @retval EFI_SUCCESS Opcode parse success.
614 @retval Other Opcode parse fail.
619 IN FORM_BROWSER_FORMSET
*FormSet
623 Free resources allocated for a FormSet.
625 @param FormSet Pointer of the FormSet
630 IN OUT FORM_BROWSER_FORMSET
*FormSet
634 Create a new string in HII Package List.
636 @param String The String to be added
637 @param HiiHandle The package list in the HII database to insert the
640 @return The output string.
646 IN EFI_HII_HANDLE HiiHandle
650 Delete a string from HII Package List.
652 @param StringId Id of the string in HII database.
653 @param HiiHandle The HII package list handle.
655 @retval EFI_SUCCESS The string was deleted successfully.
660 IN EFI_STRING_ID StringId
,
661 IN EFI_HII_HANDLE HiiHandle
665 Get the string based on the StringId and HII Package List Handle.
667 @param Token The String's ID.
668 @param HiiHandle The package list in the HII database to search for
669 the specified string.
671 @return The output string.
676 IN EFI_STRING_ID Token
,
677 IN EFI_HII_HANDLE HiiHandle
681 Get Value for given Name from a NameValue Storage.
683 @param Storage The NameValue Storage.
684 @param Name The Name.
685 @param Value The retured Value.
686 @param GetValueFrom Where to get source value, from EditValue or Value.
688 @retval EFI_SUCCESS Value found for given Name.
689 @retval EFI_NOT_FOUND No such Name found in NameValue storage.
694 IN BROWSER_STORAGE
*Storage
,
696 IN OUT CHAR16
**Value
,
697 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom
701 Set Value of given Name in a NameValue Storage.
703 @param Storage The NameValue Storage.
704 @param Name The Name.
705 @param Value The Value to set.
706 @param SetValueTo Whether update editValue or Value.
707 @param ReturnNode The node use the input name.
709 @retval EFI_SUCCESS Value found for given Name.
710 @retval EFI_NOT_FOUND No such Name found in NameValue storage.
715 IN BROWSER_STORAGE
*Storage
,
718 IN GET_SET_QUESTION_VALUE_WITH SetValueTo
,
719 OUT NAME_VALUE_NODE
**ReturnNode
723 Validate whether this question's value has changed.
725 @param FormSet FormSet data structure.
726 @param Form Form data structure.
727 @param Question Question to be initialized.
728 @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.
730 @retval TRUE Question's value has changed.
731 @retval FALSE Question's value has not changed
735 IsQuestionValueChanged (
736 IN FORM_BROWSER_FORMSET
*FormSet
,
737 IN FORM_BROWSER_FORM
*Form
,
738 IN OUT FORM_BROWSER_STATEMENT
*Question
,
739 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom
743 Validate the FormSet. If the formset is not validate, remove it from the list.
745 @param FormSet The input FormSet which need to validate.
747 @retval TRUE The handle is validate.
748 @retval FALSE The handle is invalidate.
753 FORM_BROWSER_FORMSET
*FormSet
757 Update the ValueChanged status for questions.
759 @param FormSet FormSet data structure.
760 @param Form Form data structure.
761 @param SettingScope Setting Scope for Default action.
765 UpdateStatementStatus (
766 IN FORM_BROWSER_FORMSET
*FormSet
,
767 IN FORM_BROWSER_FORM
*Form
,
768 IN BROWSER_SETTING_SCOPE SettingScope
772 Get Question's current Value.
774 @param FormSet FormSet data structure.
775 @param Form Form data structure.
776 @param Question Question to be initialized.
777 @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.
779 @retval EFI_SUCCESS The function completed successfully.
784 IN FORM_BROWSER_FORMSET
*FormSet
,
785 IN FORM_BROWSER_FORM
*Form
,
786 IN OUT FORM_BROWSER_STATEMENT
*Question
,
787 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom
791 Save Question Value to edit copy(cached) or Storage(uncached).
793 @param FormSet FormSet data structure.
794 @param Form Form data structure.
795 @param Question Pointer to the Question.
796 @param SetValueTo Update the question value to editbuffer , buffer or hii driver.
798 @retval EFI_SUCCESS The function completed successfully.
803 IN FORM_BROWSER_FORMSET
*FormSet
,
804 IN FORM_BROWSER_FORM
*Form
,
805 IN OUT FORM_BROWSER_STATEMENT
*Question
,
806 IN GET_SET_QUESTION_VALUE_WITH SetValueTo
810 Perform inconsistent check for a Form.
812 @param FormSet FormSet data structure.
813 @param Form Form data structure.
814 @param Question The Question to be validated.
815 @param Type Validation type: InConsistent or NoSubmit
817 @retval EFI_SUCCESS Form validation pass.
818 @retval other Form validation failed.
823 IN FORM_BROWSER_FORMSET
*FormSet
,
824 IN FORM_BROWSER_FORM
*Form
,
825 IN FORM_BROWSER_STATEMENT
*Question
,
830 Discard data based on the input setting scope (Form, FormSet or System).
832 @param FormSet FormSet data structure.
833 @param Form Form data structure.
834 @param SettingScope Setting Scope for Discard action.
836 @retval EFI_SUCCESS The function completed successfully.
837 @retval EFI_UNSUPPORTED Unsupport SettingScope.
842 IN FORM_BROWSER_FORMSET
*FormSet
,
843 IN FORM_BROWSER_FORM
*Form
,
844 IN BROWSER_SETTING_SCOPE SettingScope
848 Submit data based on the input Setting level (Form, FormSet or System).
850 @param FormSet FormSet data structure.
851 @param Form Form data structure.
852 @param SettingScope Setting Scope for Submit action.
854 @retval EFI_SUCCESS The function completed successfully.
855 @retval EFI_UNSUPPORTED Unsupport SettingScope.
860 IN FORM_BROWSER_FORMSET
*FormSet
,
861 IN FORM_BROWSER_FORM
*Form
,
862 IN BROWSER_SETTING_SCOPE SettingScope
866 Reset Question to its default value.
868 @param FormSet The form set.
869 @param Form The form.
870 @param Question The question.
871 @param DefaultId The Class of the default.
873 @retval EFI_SUCCESS Question is reset to default value.
878 IN FORM_BROWSER_FORMSET
*FormSet
,
879 IN FORM_BROWSER_FORM
*Form
,
880 IN FORM_BROWSER_STATEMENT
*Question
,
885 Get current setting of Questions.
887 @param FormSet FormSet data structure.
891 InitializeCurrentSetting (
892 IN OUT FORM_BROWSER_FORMSET
*FormSet
896 Initialize the internal data structure of a FormSet.
898 @param Handle PackageList Handle
899 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
900 GUID), take the first FormSet found in package
902 @param FormSet FormSet data structure.
904 @retval EFI_SUCCESS The function completed successfully.
905 @retval EFI_NOT_FOUND The specified FormSet could not be found.
910 IN EFI_HII_HANDLE Handle
,
911 IN OUT EFI_GUID
*FormSetGuid
,
912 OUT FORM_BROWSER_FORMSET
*FormSet
916 Reset Questions to their initial value or default value in a Form, Formset or System.
918 GetDefaultValueScope parameter decides which questions will reset
919 to its default value.
921 @param FormSet FormSet data structure.
922 @param Form Form data structure.
923 @param DefaultId The Class of the default.
924 @param SettingScope Setting Scope for Default action.
925 @param GetDefaultValueScope Get default value scope.
926 @param Storage Get default value only for this storage.
927 @param RetrieveValueFirst Whether call the retrieve call back to
928 get the initial value before get default
930 @param SkipGetAltCfg Whether skip the get altcfg string process.
932 @retval EFI_SUCCESS The function completed successfully.
933 @retval EFI_UNSUPPORTED Unsupport SettingScope.
938 IN FORM_BROWSER_FORMSET
*FormSet
,
939 IN FORM_BROWSER_FORM
*Form
,
941 IN BROWSER_SETTING_SCOPE SettingScope
,
942 IN BROWSER_GET_DEFAULT_VALUE GetDefaultValueScope
,
943 IN BROWSER_STORAGE
*Storage
,
944 IN BOOLEAN RetrieveValueFirst
,
945 IN BOOLEAN SkipGetAltCfg
949 Initialize Question's Edit copy from Storage.
951 @param Selection Selection contains the information about
952 the Selection, form and formset to be displayed.
953 Selection action may be updated in retrieve callback.
954 If Selection is NULL, only initialize Question value.
955 @param FormSet FormSet data structure.
956 @param Form Form data structure.
958 @retval EFI_SUCCESS The function completed successfully.
963 IN OUT UI_MENU_SELECTION
*Selection
,
964 IN FORM_BROWSER_FORMSET
*FormSet
,
965 IN FORM_BROWSER_FORM
*Form
969 Initialize Question's Edit copy from Storage for the whole Formset.
971 @param Selection Selection contains the information about
972 the Selection, form and formset to be displayed.
973 Selection action may be updated in retrieve callback.
974 If Selection is NULL, only initialize Question value.
975 @param FormSet FormSet data structure.
977 @retval EFI_SUCCESS The function completed successfully.
982 IN OUT UI_MENU_SELECTION
*Selection
,
983 IN FORM_BROWSER_FORMSET
*FormSet
987 Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.
989 @param Storage The Storage to be conveted.
990 @param ConfigResp The returned <ConfigResp>.
991 @param ConfigRequest The ConfigRequest string.
992 @param GetEditBuf Get the data from editbuffer or buffer.
994 @retval EFI_SUCCESS Convert success.
995 @retval EFI_INVALID_PARAMETER Incorrect storage type.
999 StorageToConfigResp (
1000 IN BROWSER_STORAGE
*Storage
,
1001 IN CHAR16
**ConfigResp
,
1002 IN CHAR16
*ConfigRequest
,
1003 IN BOOLEAN GetEditBuf
1007 Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.
1009 @param Storage The Storage to receive the settings.
1010 @param ConfigResp The <ConfigResp> to be converted.
1012 @retval EFI_SUCCESS Convert success.
1013 @retval EFI_INVALID_PARAMETER Incorrect storage type.
1017 ConfigRespToStorage (
1018 IN BROWSER_STORAGE
*Storage
,
1019 IN CHAR16
*ConfigResp
1023 Fill storage's edit copy with settings requested from Configuration Driver.
1025 @param FormSet FormSet data structure.
1026 @param Storage Buffer Storage.
1031 IN FORM_BROWSER_FORMSET
*FormSet
,
1032 IN FORMSET_STORAGE
*Storage
1036 Fetch the Ifr binary data of a FormSet.
1038 @param Handle PackageList Handle
1039 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
1040 GUID), take the first FormSet found in package
1042 @param BinaryLength The length of the FormSet IFR binary.
1043 @param BinaryData The buffer designed to receive the FormSet.
1045 @retval EFI_SUCCESS Buffer filled with the requested FormSet.
1046 BufferLength was updated.
1047 @retval EFI_INVALID_PARAMETER The handle is unknown.
1048 @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot
1049 be found with the requested FormId.
1054 IN EFI_HII_HANDLE Handle
,
1055 IN OUT EFI_GUID
*FormSetGuid
,
1056 OUT UINTN
*BinaryLength
,
1057 OUT UINT8
**BinaryData
1061 Save globals used by previous call to SendForm(). SendForm() may be called from
1062 HiiConfigAccess.Callback(), this will cause SendForm() be reentried.
1063 So, save globals of previous call to SendForm() and restore them upon exit.
1067 SaveBrowserContext (
1072 Restore globals used by previous call to SendForm().
1076 RestoreBrowserContext (
1081 This is the routine which an external caller uses to direct the browser
1082 where to obtain it's information.
1085 @param This The Form Browser protocol instanse.
1086 @param Handles A pointer to an array of Handles. If HandleCount > 1 we
1087 display a list of the formsets for the handles specified.
1088 @param HandleCount The number of Handles specified in Handle.
1089 @param FormSetGuid This field points to the EFI_GUID which must match the Guid
1090 field in the EFI_IFR_FORM_SET op-code for the specified
1091 forms-based package. If FormSetGuid is NULL, then this
1092 function will display the first found forms package.
1093 @param FormId This field specifies which EFI_IFR_FORM to render as the first
1094 displayable page. If this field has a value of 0x0000, then
1095 the forms browser will render the specified forms in their encoded order.
1096 ScreenDimenions - This allows the browser to be called so that it occupies a
1097 portion of the physical screen instead of dynamically determining the screen dimensions.
1098 ActionRequest - Points to the action recommended by the form.
1099 @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in
1101 @param ActionRequest Points to the action recommended by the form.
1103 @retval EFI_SUCCESS The function completed successfully.
1104 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
1105 @retval EFI_NOT_FOUND No valid forms could be found to display.
1111 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1112 IN EFI_HII_HANDLE
*Handles
,
1113 IN UINTN HandleCount
,
1114 IN EFI_GUID
*FormSetGuid OPTIONAL
,
1115 IN UINT16 FormId OPTIONAL
,
1116 IN CONST EFI_SCREEN_DESCRIPTOR
*ScreenDimensions OPTIONAL
,
1117 OUT EFI_BROWSER_ACTION_REQUEST
*ActionRequest OPTIONAL
1121 This function is called by a callback handler to retrieve uncommitted state
1122 data from the browser.
1124 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL
1126 @param ResultsDataSize A pointer to the size of the buffer associated
1128 @param ResultsData A string returned from an IFR browser or
1129 equivalent. The results string will have no
1130 routing information in them.
1131 @param RetrieveData A BOOLEAN field which allows an agent to retrieve
1132 (if RetrieveData = TRUE) data from the uncommitted
1133 browser state information or set (if RetrieveData
1134 = FALSE) data in the uncommitted browser state
1136 @param VariableGuid An optional field to indicate the target variable
1138 @param VariableName An optional field to indicate the target
1139 human-readable variable name.
1141 @retval EFI_SUCCESS The results have been distributed or are awaiting
1143 @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to
1144 contain the results data.
1150 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1151 IN OUT UINTN
*ResultsDataSize
,
1152 IN OUT EFI_STRING ResultsData
,
1153 IN BOOLEAN RetrieveData
,
1154 IN CONST EFI_GUID
*VariableGuid OPTIONAL
,
1155 IN CONST CHAR16
*VariableName OPTIONAL
1159 Find menu which will show next time.
1161 @param Selection On input, Selection tell setup browser the information
1162 about the Selection, form and formset to be displayed.
1163 On output, Selection return the screen item that is selected
1165 @param SettingLevel Input Settting level, if it is FormLevel, just exit current form.
1166 else, we need to exit current formset.
1168 @retval TRUE Exit current form.
1169 @retval FALSE User press ESC and keep in current form.
1173 IN OUT UI_MENU_SELECTION
*Selection
,
1174 IN BROWSER_SETTING_SCOPE SettingLevel
1178 check whether the form need to update the NV.
1180 @param Form Form data structure.
1182 @retval TRUE Need to update the NV.
1183 @retval FALSE No need to update the NV.
1186 IsNvUpdateRequiredForForm (
1187 IN FORM_BROWSER_FORM
*Form
1191 check whether the formset need to update the NV.
1193 @param FormSet FormSet data structure.
1195 @retval TRUE Need to update the NV.
1196 @retval FALSE No need to update the NV.
1199 IsNvUpdateRequiredForFormSet (
1200 IN FORM_BROWSER_FORMSET
*FormSet
1204 Call the call back function for the question and process the return action.
1206 @param Selection On input, Selection tell setup browser the information
1207 about the Selection, form and formset to be displayed.
1208 On output, Selection return the screen item that is selected
1210 @param FormSet The formset this question belong to.
1211 @param Form The form this question belong to.
1212 @param Question The Question which need to call.
1213 @param Action The action request.
1214 @param SkipSaveOrDiscard Whether skip save or discard action.
1216 @retval EFI_SUCCESS The call back function executes successfully.
1217 @return Other value if the call back function failed to execute.
1220 ProcessCallBackFunction (
1221 IN OUT UI_MENU_SELECTION
*Selection
,
1222 IN FORM_BROWSER_FORMSET
*FormSet
,
1223 IN FORM_BROWSER_FORM
*Form
,
1224 IN FORM_BROWSER_STATEMENT
*Question
,
1225 IN EFI_BROWSER_ACTION Action
,
1226 IN BOOLEAN SkipSaveOrDiscard
1230 Call the retrieve type call back function for one question to get the initialize data.
1232 This function only used when in the initialize stage, because in this stage, the
1233 Selection->Form is not ready. For other case, use the ProcessCallBackFunction instead.
1235 @param ConfigAccess The config access protocol produced by the hii driver.
1236 @param Statement The Question which need to call.
1237 @param FormSet The formset this question belong to.
1239 @retval EFI_SUCCESS The call back function executes successfully.
1240 @return Other value if the call back function failed to execute.
1243 ProcessRetrieveForQuestion (
1244 IN EFI_HII_CONFIG_ACCESS_PROTOCOL
*ConfigAccess
,
1245 IN FORM_BROWSER_STATEMENT
*Statement
,
1246 IN FORM_BROWSER_FORMSET
*FormSet
1250 Find the matched FormSet context in the backup maintain list based on HiiHandle.
1252 @param Handle The Hii Handle.
1254 @return the found FormSet context. If no found, NULL will return.
1257 FORM_BROWSER_FORMSET
*
1258 GetFormSetFromHiiHandle (
1259 EFI_HII_HANDLE Handle
1263 Check whether the input HII handle is the FormSet that is being used.
1265 @param Handle The Hii Handle.
1267 @retval TRUE HII handle is being used.
1268 @retval FALSE HII handle is not being used.
1272 IsHiiHandleInBrowserContext (
1273 EFI_HII_HANDLE Handle
1277 Configure what scope the hot key will impact.
1278 All hot keys have the same scope. The mixed hot keys with the different level are not supported.
1279 If no scope is set, the default scope will be FormSet level.
1280 After all registered hot keys are removed, previous Scope can reset to another level.
1282 @param[in] Scope Scope level to be set.
1284 @retval EFI_SUCCESS Scope is set correctly.
1285 @retval EFI_INVALID_PARAMETER Scope is not the valid value specified in BROWSER_SETTING_SCOPE.
1286 @retval EFI_UNSPPORTED Scope level is different from current one that the registered hot keys have.
1292 IN BROWSER_SETTING_SCOPE Scope
1296 Register the hot key with its browser action, or unregistered the hot key.
1297 Only support hot key that is not printable character (control key, function key, etc.).
1298 If the action value is zero, the hot key will be unregistered if it has been registered.
1299 If the same hot key has been registered, the new action and help string will override the previous ones.
1301 @param[in] KeyData A pointer to a buffer that describes the keystroke
1302 information for the hot key. Its type is EFI_INPUT_KEY to
1303 be supported by all ConsoleIn devices.
1304 @param[in] Action Action value that describes what action will be trigged when the hot key is pressed.
1305 @param[in] DefaultId Specifies the type of defaults to retrieve, which is only for DEFAULT action.
1306 @param[in] HelpString Help string that describes the hot key information.
1307 Its value may be NULL for the unregistered hot key.
1309 @retval EFI_SUCCESS Hot key is registered or unregistered.
1310 @retval EFI_INVALID_PARAMETER KeyData is NULL.
1311 @retval EFI_NOT_FOUND KeyData is not found to be unregistered.
1312 @retval EFI_UNSUPPORTED Key represents a printable character. It is conflicted with Browser.
1313 @retval EFI_ALREADY_STARTED Key already been registered for one hot key.
1318 IN EFI_INPUT_KEY
*KeyData
,
1320 IN UINT16 DefaultId
,
1321 IN EFI_STRING HelpString OPTIONAL
1325 Register Exit handler function.
1326 When more than one handler function is registered, the latter one will override the previous one.
1327 When NULL handler is specified, the previous Exit handler will be unregistered.
1329 @param[in] Handler Pointer to handler function.
1334 RegiserExitHandler (
1335 IN EXIT_HANDLER Handler
1340 Check whether the browser data has been modified.
1342 @retval TRUE Browser data is changed.
1343 @retval FALSE No browser data is changed.
1348 IsBrowserDataModified (
1354 Execute the action requested by the Action parameter.
1356 @param[in] Action Execute the request action.
1357 @param[in] DefaultId The default Id info when need to load default value.
1359 @retval EFI_SUCCESS Execute the request action succss.
1360 @retval EFI_INVALID_PARAMETER The input action value is invalid.
1371 Create reminder to let user to choose save or discard the changed browser data.
1372 Caller can use it to actively check the changed browser data.
1374 @retval BROWSER_NO_CHANGES No browser data is changed.
1375 @retval BROWSER_SAVE_CHANGES The changed browser data is saved.
1376 @retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
1377 @retval BROWSER_KEEP_CURRENT Browser keep current changes.
1387 Check whether the Reset Required for the browser
1389 @retval TRUE Browser required to reset after exit.
1390 @retval FALSE Browser not need to reset after exit.
1400 Find the registered HotKey based on KeyData.
1402 @param[in] KeyData A pointer to a buffer that describes the keystroke
1403 information for the hot key.
1405 @return The registered HotKey context. If no found, NULL will return.
1408 GetHotKeyFromRegisterList (
1409 IN EFI_INPUT_KEY
*KeyData
1414 Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.
1416 @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.
1418 @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.
1421 FORM_BROWSER_STATEMENT
*
1422 GetBrowserStatement (
1423 IN FORM_DISPLAY_ENGINE_STATEMENT
*DisplayStatement
1427 Password may be stored as encrypted by Configuration Driver. When change a
1428 password, user will be challenged with old password. To validate user input old
1429 password, we will send the clear text to Configuration Driver via Callback().
1430 Configuration driver is responsible to check the passed in password and return
1431 the validation result. If validation pass, state machine in password Callback()
1432 will transit from BROWSER_STATE_VALIDATE_PASSWORD to BROWSER_STATE_SET_PASSWORD.
1433 After user type in new password twice, Callback() will be invoked to send the
1434 new password to Configuration Driver.
1436 @param Selection Pointer to UI_MENU_SELECTION.
1437 @param MenuOption The MenuOption for this password Question.
1438 @param String The clear text of password.
1440 @retval EFI_NOT_AVAILABLE_YET Callback() request to terminate password input.
1441 @return In state of BROWSER_STATE_VALIDATE_PASSWORD:
1442 @retval EFI_SUCCESS Password correct, Browser will prompt for new
1444 @retval EFI_NOT_READY Password incorrect, Browser will show error
1446 @retval Other Browser will do nothing.
1447 @return In state of BROWSER_STATE_SET_PASSWORD:
1448 @retval EFI_SUCCESS Set password success.
1449 @retval Other Set password failed.
1454 IN UI_MENU_SELECTION
*Selection
,
1455 IN FORM_BROWSER_STATEMENT
*Question
,
1460 Display error message for invalid password.
1469 The worker function that send the displays to the screen. On output,
1470 the selection made by user is returned.
1472 @param Selection On input, Selection tell setup browser the information
1473 about the Selection, form and formset to be displayed.
1474 On output, Selection return the screen item that is selected
1477 @retval EFI_SUCCESS The page is displayed successfully.
1478 @return Other value if the page failed to be diplayed.
1483 IN OUT UI_MENU_SELECTION
*Selection
1487 Free up the resource allocated for all strings required
1492 FreeBrowserStrings (
1497 Create a menu with specified formset GUID and form ID, and add it as a child
1498 of the given parent menu.
1500 @param HiiHandle Hii handle related to this formset.
1501 @param FormSetGuid The Formset Guid of menu to be added.
1502 @param FormId The Form ID of menu to be added.
1503 @param QuestionId The question id of this menu to be added.
1505 @return A pointer to the newly added menu or NULL if memory is insufficient.
1510 IN EFI_HII_HANDLE HiiHandle
,
1511 IN EFI_GUID
*FormSetGuid
,
1513 IN UINT16 QuestionId
1517 Search Menu with given FormSetGuid and FormId in all cached menu list.
1519 @param HiiHandle HiiHandle for FormSet.
1520 @param FormSetGuid The Formset GUID of the menu to search.
1521 @param FormId The Form ID of menu to search.
1523 @return A pointer to menu found or NULL if not found.
1528 IN EFI_HII_HANDLE HiiHandle
,
1529 IN EFI_GUID
*FormSetGuid
,
1534 Free Menu list linked list.
1536 @param MenuListHead One Menu list point in the menu list.
1541 LIST_ENTRY
*MenuListHead
1545 Find parent menu for current menu.
1547 @param CurrentMenu Current Menu
1548 @param SettingLevel Whether find parent menu in Form Level or Formset level.
1549 In form level, just find the parent menu;
1550 In formset level, find the parent menu which has different
1553 @retval The parent menu for current menu.
1557 IN FORM_ENTRY_INFO
*CurrentMenu
,
1558 IN BROWSER_SETTING_SCOPE SettingLevel
1562 Validate the HiiHandle.
1564 @param HiiHandle The input HiiHandle which need to validate.
1566 @retval TRUE The handle is validate.
1567 @retval FALSE The handle is invalidate.
1572 EFI_HII_HANDLE HiiHandle
1576 Copy current Menu list to the new menu list.
1578 @param NewMenuListHead New create Menu list.
1579 @param CurrentMenuListHead Current Menu list.
1584 OUT LIST_ENTRY
*NewMenuListHead
,
1585 IN LIST_ENTRY
*CurrentMenuListHead
1589 Search an Option of a Question by its value.
1591 @param Question The Question
1592 @param OptionValue Value for Option to be searched.
1594 @retval Pointer Pointer to the found Option.
1595 @retval NULL Option not found.
1600 IN FORM_BROWSER_STATEMENT
*Question
,
1601 IN EFI_HII_VALUE
*OptionValue
1605 Return data element in an Array by its Index.
1607 @param Array The data array.
1608 @param Type Type of the data in this array.
1609 @param Index Zero based index for data in this array.
1611 @retval Value The data to be returned
1622 Set value of a data element in an Array by its Index.
1624 @param Array The data array.
1625 @param Type Type of the data in this array.
1626 @param Index Zero based index for data in this array.
1627 @param Value The value to be set.
1639 Compare two Hii value.
1641 @param Value1 Expression value to compare on left-hand.
1642 @param Value2 Expression value to compare on right-hand.
1643 @param Result Return value after compare.
1644 retval 0 Two operators equal.
1645 return Positive value if Value1 is greater than Value2.
1646 retval Negative value if Value1 is less than Value2.
1647 @param HiiHandle Only required for string compare.
1649 @retval other Could not perform compare on two values.
1650 @retval EFI_SUCCESS Compare the value success.
1655 IN EFI_HII_VALUE
*Value1
,
1656 IN EFI_HII_VALUE
*Value2
,
1658 IN EFI_HII_HANDLE HiiHandle OPTIONAL
1662 Perform Password check.
1663 Passwork may be encrypted by driver that requires the specific check.
1665 @param Form Form where Password Statement is in.
1666 @param Statement Password statement
1667 @param PasswordString Password string to be checked. It may be NULL.
1668 NULL means to restore password.
1669 "" string can be used to checked whether old password does exist.
1671 @return Status Status of Password check.
1676 IN FORM_DISPLAY_ENGINE_FORM
*Form
,
1677 IN FORM_DISPLAY_ENGINE_STATEMENT
*Statement
,
1678 IN EFI_STRING PasswordString OPTIONAL
1683 Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.
1685 @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.
1687 @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.
1690 FORM_BROWSER_STATEMENT
*
1691 GetBrowserStatement (
1692 IN FORM_DISPLAY_ENGINE_STATEMENT
*DisplayStatement
1697 Initialize the Display form structure data.
1701 InitializeDisplayFormData (
1706 Base on the current formset info, clean the ConfigRequest string in browser storage.
1708 @param FormSet Pointer of the FormSet
1712 CleanBrowserStorage (
1713 IN OUT FORM_BROWSER_FORMSET
*FormSet
1717 Find HII Handle in the HII database associated with given Device Path.
1719 If DevicePath is NULL, then ASSERT.
1721 @param DevicePath Device Path associated with the HII package list
1723 @param FormsetGuid The formset guid for this formset.
1725 @retval Handle HII package list Handle associated with the Device
1727 @retval NULL Hii Package list handle is not found.
1731 DevicePathToHiiHandle (
1732 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
1733 IN EFI_GUID
*FormsetGuid
1737 Adjust the config request info, remove the request elements which already in AllConfigRequest string.
1739 @param Storage Form set Storage.
1740 @param Request The input request string.
1741 @param RespString Whether the input is ConfigRequest or ConfigResp format.
1743 @retval TRUE Has element not covered by current used elements, need to continue to call ExtractConfig
1744 @retval FALSE All elements covered by current used elements.
1748 ConfigRequestAdjust (
1749 IN BROWSER_STORAGE
*Storage
,
1751 IN BOOLEAN RespString
1755 Perform question check.
1757 If one question has more than one check, process form high priority to low.
1759 @param FormSet FormSet data structure.
1760 @param Form Form data structure.
1761 @param Question The Question to be validated.
1763 @retval EFI_SUCCESS Form validation pass.
1764 @retval other Form validation failed.
1768 ValueChangedValidation (
1769 IN FORM_BROWSER_FORMSET
*FormSet
,
1770 IN FORM_BROWSER_FORM
*Form
,
1771 IN FORM_BROWSER_STATEMENT
*Question
1775 Pop up the error info.
1777 @param BrowserStatus The input browser status.
1778 @param HiiHandle The HiiHandle for this error opcode.
1779 @param OpCode The opcode use to get the erro info and timeout value.
1780 @param ErrorString Error string used by BROWSER_NO_SUBMIT_IF.
1785 IN UINT32 BrowserStatus
,
1786 IN EFI_HII_HANDLE HiiHandle
,
1787 IN EFI_IFR_OP_HEADER
*OpCode OPTIONAL
,
1788 IN CHAR16
*ErrorString
1792 Check whether the result is TRUE or FALSE.
1794 For the EFI_HII_VALUE value type is numeric, return TRUE if the
1797 @param Result Input the result data.
1799 @retval TRUE The result is TRUE.
1800 @retval FALSE The result is FALSE.
1805 IN EFI_HII_VALUE
*Result
1809 Get Formset_storage base on the input varstoreid info.
1811 @param FormSet Pointer of the current FormSet.
1812 @param VarStoreId Varstore ID info.
1814 @return Pointer to a FORMSET_STORAGE data structure.
1818 GetFstStgFromVarId (
1819 IN FORM_BROWSER_FORMSET
*FormSet
,
1820 IN EFI_VARSTORE_ID VarStoreId
1824 Get Formset_storage base on the input browser storage.
1826 More than one formsets may share the same browser storage,
1827 this function just get the first formset storage which
1828 share the browser storage.
1830 @param Storage browser storage info.
1832 @return Pointer to a FORMSET_STORAGE data structure.
1837 GetFstStgFromBrsStg (
1838 IN BROWSER_STORAGE
*Storage
1842 Reconnect the controller.
1844 @param DriverHandle The controller handle which need to be reconnect.
1846 @retval TRUE do the reconnect behavior success.
1847 @retval FALSE do the reconnect behavior failed.
1851 ReconnectController (
1852 IN EFI_HANDLE DriverHandle
1856 Converts the unicode character of the string from uppercase to lowercase.
1857 This is a internal function.
1859 @param ConfigString String to be converted
1865 IN EFI_STRING ConfigString