2 Private MACRO, structure and function definitions for Setup Browser module.
4 Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
22 #include <Protocol/SimpleTextOut.h>
23 #include <Protocol/SimpleTextIn.h>
24 #include <Protocol/FormBrowser2.h>
25 #include <Protocol/FormBrowserEx2.h>
26 #include <Protocol/DisplayProtocol.h>
27 #include <Protocol/DevicePath.h>
28 #include <Protocol/UnicodeCollation.h>
29 #include <Protocol/HiiConfigAccess.h>
30 #include <Protocol/HiiConfigRouting.h>
31 #include <Protocol/HiiDatabase.h>
32 #include <Protocol/HiiString.h>
33 #include <Protocol/UserManager.h>
34 #include <Protocol/DevicePathFromText.h>
35 #include <Protocol/RegularExpressionProtocol.h>
37 #include <Guid/MdeModuleHii.h>
38 #include <Guid/HiiPlatformSetupFormset.h>
39 #include <Guid/HiiFormMapMethodGuid.h>
40 #include <Guid/ZeroGuid.h>
42 #include <Library/PrintLib.h>
43 #include <Library/DebugLib.h>
44 #include <Library/BaseMemoryLib.h>
45 #include <Library/UefiRuntimeServicesTableLib.h>
46 #include <Library/UefiDriverEntryPoint.h>
47 #include <Library/UefiBootServicesTableLib.h>
48 #include <Library/BaseLib.h>
49 #include <Library/MemoryAllocationLib.h>
50 #include <Library/HiiLib.h>
51 #include <Library/PcdLib.h>
52 #include <Library/DevicePathLib.h>
53 #include <Library/UefiLib.h>
57 // This is the generated header file which includes whatever needs to be exported (strings + IFR)
60 #define UI_ACTION_NONE 0
61 #define UI_ACTION_REFRESH_FORM 1
62 #define UI_ACTION_REFRESH_FORMSET 2
63 #define UI_ACTION_EXIT 3
69 #define ONE_SECOND 10000000
71 // Incremental string lenght of ConfigRequest
73 #define CONFIG_REQUEST_STRING_INCREMENTAL 1024
76 // Incremental size of stack for expression
78 #define EXPRESSION_STACK_SIZE_INCREMENT 0x100
80 #define EFI_IFR_SPECIFICATION_VERSION (UINT16) (((EFI_SYSTEM_TABLE_REVISION >> 16) << 8) | (((EFI_SYSTEM_TABLE_REVISION & 0xFFFF) / 10) << 4) | ((EFI_SYSTEM_TABLE_REVISION & 0xFFFF) % 10))
83 #define SETUP_DRIVER_SIGNATURE SIGNATURE_32 ('F', 'B', 'D', 'V')
92 EFI_FORM_BROWSER2_PROTOCOL FormBrowser2
;
93 EFI_FORM_BROWSER_EXTENSION_PROTOCOL FormBrowserEx
;
95 EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL FormBrowserEx2
;
97 } SETUP_DRIVER_PRIVATE_DATA
;
100 // IFR relative definition
102 #define EFI_HII_EXPRESSION_INCONSISTENT_IF 0
103 #define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1
104 #define EFI_HII_EXPRESSION_GRAY_OUT_IF 2
105 #define EFI_HII_EXPRESSION_SUPPRESS_IF 3
106 #define EFI_HII_EXPRESSION_DISABLE_IF 4
107 #define EFI_HII_EXPRESSION_VALUE 5
108 #define EFI_HII_EXPRESSION_RULE 6
109 #define EFI_HII_EXPRESSION_READ 7
110 #define EFI_HII_EXPRESSION_WRITE 8
111 #define EFI_HII_EXPRESSION_WARNING_IF 9
113 #define EFI_HII_VARSTORE_BUFFER 0
114 #define EFI_HII_VARSTORE_NAME_VALUE 1
115 #define EFI_HII_VARSTORE_EFI_VARIABLE 2 // EFI Varstore type follow UEFI spec before 2.3.1.
116 #define EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER 3 // EFI varstore type follow UEFI spec 2.3.1 and later.
118 #define FORM_INCONSISTENT_VALIDATION 0
119 #define FORM_NO_SUBMIT_VALIDATION 1
121 #define NAME_VALUE_NODE_SIGNATURE SIGNATURE_32 ('N', 'V', 'S', 'T')
131 #define NAME_VALUE_NODE_FROM_LINK(a) CR (a, NAME_VALUE_NODE, Link, NAME_VALUE_NODE_SIGNATURE)
133 #define BROWSER_STORAGE_SIGNATURE SIGNATURE_32 ('B', 'S', 'T', 'G')
139 UINT8 Type
; // Storage type
141 BOOLEAN Initialized
; // Whether this varstore is initialized, efi varstore not used.
143 EFI_HII_HANDLE HiiHandle
; // HiiHandle for this varstore, efi varstore not used.
146 CHAR16
*Name
; // For EFI_IFR_VARSTORE
149 UINT8
*EditBuffer
; // Edit copy for Buffer Storage
151 LIST_ENTRY NameValueListHead
; // List of NAME_VALUE_NODE
153 UINT32 Attributes
; // For EFI_IFR_VARSTORE_EFI: EFI Variable attribute
155 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
156 // <RequestElement> includes all fields which is used by current form sets.
157 UINTN SpareStrLen
; // Spare length of ConfigRequest string buffer
160 #define BROWSER_STORAGE_FROM_LINK(a) CR (a, BROWSER_STORAGE, Link, BROWSER_STORAGE_SIGNATURE)
162 #define FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'G')
168 LIST_ENTRY SaveFailLink
;
172 BROWSER_STORAGE
*BrowserStorage
;
174 CHAR16
*ConfigHdr
; // <ConfigHdr>
176 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
177 CHAR16
*ConfigAltResp
; // Alt config response string for this ConfigRequest.
178 BOOLEAN HasCallAltCfg
; // Flag to show whether browser has call ExtractConfig to get Altcfg string.
179 UINTN ElementCount
; // Number of <RequestElement> in the <ConfigRequest>
180 UINTN SpareStrLen
; // Spare length of ConfigRequest string buffer
183 #define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)
184 #define FORMSET_STORAGE_FROM_SAVE_FAIL_LINK(a) CR (a, FORMSET_STORAGE, SaveFailLink, FORMSET_STORAGE_SIGNATURE)
187 EFI_STRING_ID VarName
;
191 #define EXPRESSION_OPCODE_SIGNATURE SIGNATURE_32 ('E', 'X', 'O', 'P')
199 UINT8 Format
; // For EFI_IFR_TO_STRING, EFI_IFR_FIND
200 UINT8 Flags
; // For EFI_IFR_SPAN
201 UINT8 RuleId
; // For EFI_IFR_RULE_REF
203 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
205 EFI_QUESTION_ID QuestionId
; // For EFI_IFR_EQ_ID_ID, EFI_IFR_EQ_ID_VAL_LIST, EFI_IFR_QUESTION_REF1
206 EFI_QUESTION_ID QuestionId2
;
208 UINT16 ListLength
; // For EFI_IFR_EQ_ID_VAL_LIST
211 EFI_STRING_ID DevicePath
; // For EFI_IFR_QUESTION_REF3_2, EFI_IFR_QUESTION_REF3_3
214 BROWSER_STORAGE
*VarStorage
; // For EFI_IFR_SET, EFI_IFR_GET
215 VAR_STORE_INFO VarStoreInfo
;// For EFI_IFR_SET, EFI_IFR_GET
216 UINT8 ValueType
; // For EFI_IFR_SET, EFI_IFR_GET
217 UINT8 ValueWidth
; // For EFI_IFR_SET, EFI_IFR_GET
218 CHAR16
*ValueName
; // For EFI_IFR_SET, EFI_IFR_GET
219 LIST_ENTRY MapExpressionList
; // nested expressions inside of Map opcode.
222 #define EXPRESSION_OPCODE_FROM_LINK(a) CR (a, EXPRESSION_OPCODE, Link, EXPRESSION_OPCODE_SIGNATURE)
224 #define FORM_EXPRESSION_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'P')
230 UINT8 Type
; // Type for this expression
232 UINT8 RuleId
; // For EFI_IFR_RULE only
233 EFI_STRING_ID Error
; // For EFI_IFR_NO_SUBMIT_IF, EFI_IFR_INCONSISTENT_IF only
235 EFI_HII_VALUE Result
; // Expression evaluation result
237 UINT8 TimeOut
; // For EFI_IFR_WARNING_IF
238 EFI_IFR_OP_HEADER
*OpCode
; // Save the opcode buffer.
240 LIST_ENTRY OpCodeListHead
; // OpCodes consist of this expression (EXPRESSION_OPCODE)
243 #define FORM_EXPRESSION_FROM_LINK(a) CR (a, FORM_EXPRESSION, Link, FORM_EXPRESSION_SIGNATURE)
245 #define FORM_EXPRESSION_LIST_SIGNATURE SIGNATURE_32 ('F', 'E', 'X', 'R')
250 FORM_EXPRESSION
*Expression
[1]; // Array[Count] of expressions
251 } FORM_EXPRESSION_LIST
;
253 #define QUESTION_DEFAULT_SIGNATURE SIGNATURE_32 ('Q', 'D', 'F', 'T')
260 EFI_HII_VALUE Value
; // Default value
262 FORM_EXPRESSION
*ValueExpression
; // Not-NULL indicates default value is provided by EFI_IFR_VALUE
265 #define QUESTION_DEFAULT_FROM_LINK(a) CR (a, QUESTION_DEFAULT, Link, QUESTION_DEFAULT_SIGNATURE)
267 #define QUESTION_OPTION_SIGNATURE SIGNATURE_32 ('Q', 'O', 'P', 'T')
273 EFI_IFR_ONE_OF_OPTION
*OpCode
; // OneOfOption Data
278 EFI_IMAGE_ID ImageId
;
280 FORM_EXPRESSION_LIST
*SuppressExpression
; // Non-NULL indicates nested inside of SuppressIf
283 #define QUESTION_OPTION_FROM_LINK(a) CR (a, QUESTION_OPTION, Link, QUESTION_OPTION_SIGNATURE)
299 typedef struct _FORM_BROWSER_STATEMENT FORM_BROWSER_STATEMENT
;
301 #define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')
303 struct _FORM_BROWSER_STATEMENT
{
307 UINT8 Operand
; // The operand (first byte) of this Statement or Question
308 EFI_IFR_OP_HEADER
*OpCode
;
313 EFI_STRING_ID Prompt
;
315 EFI_STRING_ID TextTwo
; // For EFI_IFR_TEXT
318 // Fake Question Id, used for statement not has true QuestionId.
320 EFI_QUESTION_ID FakeQuestionId
;
325 EFI_QUESTION_ID QuestionId
; // The value of zero is reserved
326 EFI_VARSTORE_ID VarStoreId
; // A value of zero indicates no variable storage
327 BROWSER_STORAGE
*Storage
;
328 VAR_STORE_INFO VarStoreInfo
;
331 CHAR16
*VariableName
; // Name/Value or EFI Variable name
332 CHAR16
*BlockName
; // Buffer storage block name: "OFFSET=...WIDTH=..."
334 EFI_HII_VALUE HiiValue
; // Edit copy for checkbox, numberic, oneof
335 UINT8
*BufferValue
; // Edit copy for string, password, orderedlist
336 UINT8 ValueType
; // Data type for orderedlist value array
339 // OpCode specific members
341 UINT8 Flags
; // for EFI_IFR_CHECKBOX, EFI_IFR_DATE, EFI_IFR_NUMERIC, EFI_IFR_ONE_OF,
342 // EFI_IFR_ORDERED_LIST, EFI_IFR_STRING,EFI_IFR_SUBTITLE,EFI_IFR_TIME, EFI_IFR_BANNER
343 UINT8 MaxContainers
; // for EFI_IFR_ORDERED_LIST
345 UINT16 BannerLineNumber
; // for EFI_IFR_BANNER, 1-based line number
346 EFI_STRING_ID QuestionConfig
; // for EFI_IFR_ACTION, if 0 then no configuration string will be processed
348 UINT64 Minimum
; // for EFI_IFR_ONE_OF/EFI_IFR_NUMERIC, it's Min/Max value
349 UINT64 Maximum
; // for EFI_IFR_STRING/EFI_IFR_PASSWORD, it's Min/Max length
352 EFI_DEFAULT_ID DefaultId
; // for EFI_IFR_RESET_BUTTON
353 EFI_GUID RefreshGuid
; // for EFI_IFR_REFRESH_ID
354 BOOLEAN Locked
; // Whether this statement is locked.
355 BOOLEAN ValueChanged
; // Whether this statement's value is changed.
357 // Get from IFR parsing
359 FORM_EXPRESSION
*ValueExpression
; // nested EFI_IFR_VALUE, provide Question value and indicate Question is ReadOnly
360 LIST_ENTRY DefaultListHead
; // nested EFI_IFR_DEFAULT list (QUESTION_DEFAULT), provide default values
361 LIST_ENTRY OptionListHead
; // nested EFI_IFR_ONE_OF_OPTION list (QUESTION_OPTION)
363 EFI_IMAGE_ID ImageId
; // nested EFI_IFR_IMAGE
364 UINT8 RefreshInterval
; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh
366 FORM_BROWSER_STATEMENT
*ParentStatement
;
368 LIST_ENTRY InconsistentListHead
;// nested inconsistent expression list (FORM_EXPRESSION)
369 LIST_ENTRY NoSubmitListHead
; // nested nosubmit expression list (FORM_EXPRESSION)
370 LIST_ENTRY WarningListHead
; // nested warning expression list (FORM_EXPRESSION)
371 FORM_EXPRESSION_LIST
*Expression
; // nesting inside of GrayOutIf/DisableIf/SuppressIf
373 FORM_EXPRESSION
*ReadExpression
; // nested EFI_IFR_READ, provide this question value by read expression.
374 FORM_EXPRESSION
*WriteExpression
; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.
377 #define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)
379 #define FORM_BROWSER_CONFIG_REQUEST_SIGNATURE SIGNATURE_32 ('F', 'C', 'R', 'S')
384 LIST_ENTRY SaveFailLink
;
386 CHAR16
*ConfigRequest
; // <ConfigRequest> = <ConfigHdr> + <RequestElement>
387 CHAR16
*ConfigAltResp
; // Alt config response string for this ConfigRequest.
388 UINTN ElementCount
; // Number of <RequestElement> in the <ConfigRequest>
391 BROWSER_STORAGE
*Storage
;
392 } FORM_BROWSER_CONFIG_REQUEST
;
393 #define FORM_BROWSER_CONFIG_REQUEST_FROM_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, Link, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)
394 #define FORM_BROWSER_CONFIG_REQUEST_FROM_SAVE_FAIL_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, SaveFailLink, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE)
396 #define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M')
397 #define STANDARD_MAP_FORM_TYPE 0x01
403 UINT16 FormId
; // FormId of normal form or formmap form.
404 EFI_STRING_ID FormTitle
; // FormTile of normal form, or FormMapMethod title of formmap form.
405 UINT16 FormType
; // Specific form type for the different form.
407 EFI_IMAGE_ID ImageId
;
409 BOOLEAN ModalForm
; // Whether this is a modal form.
410 BOOLEAN Locked
; // Whether this form is locked.
411 EFI_GUID RefreshGuid
; // Form refresh event guid.
413 LIST_ENTRY FormViewListHead
; // List of type FORMID_INFO is Browser View Form History List.
414 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
415 LIST_ENTRY StatementListHead
; // List of Statements and Questions (FORM_BROWSER_STATEMENT)
416 LIST_ENTRY ConfigRequestHead
; // List of configreques for all storage.
417 FORM_EXPRESSION_LIST
*SuppressExpression
; // nesting inside of SuppressIf
420 #define FORM_BROWSER_FORM_FROM_LINK(a) CR (a, FORM_BROWSER_FORM, Link, FORM_BROWSER_FORM_SIGNATURE)
422 #define FORMSET_DEFAULTSTORE_SIGNATURE SIGNATURE_32 ('F', 'D', 'F', 'S')
429 EFI_STRING_ID DefaultName
;
430 } FORMSET_DEFAULTSTORE
;
432 #define FORMSET_DEFAULTSTORE_FROM_LINK(a) CR (a, FORMSET_DEFAULTSTORE, Link, FORMSET_DEFAULTSTORE_SIGNATURE)
434 #define FORM_BROWSER_FORMSET_SIGNATURE SIGNATURE_32 ('F', 'B', 'F', 'S')
439 LIST_ENTRY SaveFailLink
;
441 EFI_HII_HANDLE HiiHandle
; // unique id for formset.
442 EFI_HANDLE DriverHandle
;
443 EFI_HII_CONFIG_ACCESS_PROTOCOL
*ConfigAccess
;
444 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
446 UINTN IfrBinaryLength
;
447 UINT8
*IfrBinaryData
;
449 BOOLEAN QuestionInited
; // Have finished question initilization?
451 EFI_STRING_ID FormSetTitle
;
453 UINT8 NumberOfClassGuid
;
454 EFI_GUID ClassGuid
[3]; // Up to three ClassGuid
455 UINT16 Class
; // Tiano extended Class code
456 UINT16 SubClass
; // Tiano extended Subclass code
457 EFI_IMAGE_ID ImageId
;
458 EFI_IFR_OP_HEADER
*OpCode
; //mainly for formset op to get ClassGuid
460 FORM_BROWSER_STATEMENT
*StatementBuffer
; // Buffer for all Statements and Questions
461 EXPRESSION_OPCODE
*ExpressionBuffer
; // Buffer for all Expression OpCode
462 FORM_BROWSER_FORM
*SaveFailForm
; // The form which failed to save.
463 FORM_BROWSER_STATEMENT
*SaveFailStatement
; // The Statement which failed to save.
465 LIST_ENTRY StatementListOSF
; // Statement list out side of the form.
466 LIST_ENTRY StorageListHead
; // Storage list (FORMSET_STORAGE)
467 LIST_ENTRY SaveFailStorageListHead
; // Storage list for the save fail storage.
468 LIST_ENTRY DefaultStoreListHead
; // DefaultStore list (FORMSET_DEFAULTSTORE)
469 LIST_ENTRY FormListHead
; // Form list (FORM_BROWSER_FORM)
470 LIST_ENTRY ExpressionListHead
; // List of Expressions (FORM_EXPRESSION)
471 } FORM_BROWSER_FORMSET
;
472 #define FORM_BROWSER_FORMSET_FROM_LINK(a) CR (a, FORM_BROWSER_FORMSET, Link, FORM_BROWSER_FORMSET_SIGNATURE)
474 #define FORM_BROWSER_FORMSET_FROM_SAVE_FAIL_LINK(a) CR (a, FORM_BROWSER_FORMSET, SaveFailLink, FORM_BROWSER_FORMSET_SIGNATURE)
478 EFI_EVENT RefreshEvent
;
479 } FORM_BROWSER_REFRESH_EVENT_NODE
;
481 #define FORM_BROWSER_REFRESH_EVENT_FROM_LINK(a) BASE_CR (a, FORM_BROWSER_REFRESH_EVENT_NODE, Link)
485 EFI_HII_HANDLE Handle
;
488 // Target formset/form/Question information
490 EFI_GUID FormSetGuid
;
493 UINTN Sequence
; // used for time/date only.
502 // Ation for Browser to taken:
503 // UI_ACTION_NONE - navigation inside a form
504 // UI_ACTION_REFRESH_FORM - re-evaluate expressions and repaint form
505 // UI_ACTION_REFRESH_FORMSET - re-parse formset IFR binary
510 // Current selected fomset/form/Question
512 FORM_BROWSER_FORMSET
*FormSet
;
513 FORM_BROWSER_FORM
*Form
;
514 FORM_BROWSER_STATEMENT
*Statement
;
517 // Whether the Form is editable
519 BOOLEAN FormEditable
;
521 FORM_ENTRY_INFO
*CurrentMenu
;
524 #define BROWSER_CONTEXT_SIGNATURE SIGNATURE_32 ('B', 'C', 'T', 'X')
531 // Globals defined in Setup.c
533 BOOLEAN FlagReconnect
;
534 BOOLEAN CallbackReconnect
;
535 BOOLEAN ResetRequired
;
536 BOOLEAN ExitRequired
;
537 EFI_HII_HANDLE HiiHandle
;
538 EFI_GUID FormSetGuid
;
540 UI_MENU_SELECTION
*Selection
;
541 FORM_BROWSER_FORMSET
*SystemLevelFormSet
;
542 EFI_QUESTION_ID CurFakeQestId
;
543 BOOLEAN HiiPackageListUpdated
;
544 BOOLEAN FinishRetrieveCall
;
545 LIST_ENTRY FormHistoryList
;
546 LIST_ENTRY FormSetList
;
549 #define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)
552 // Scope for get defaut value. It may be GetDefaultForNoStorage, GetDefaultForStorage or GetDefaultForAll.
555 GetDefaultForNoStorage
, // Get default value for question which not has storage.
556 GetDefaultForStorage
, // Get default value for question which has storage.
557 GetDefaultForAll
, // Get default value for all questions.
558 GetDefaultForMax
// Invalid value.
559 } BROWSER_GET_DEFAULT_VALUE
;
562 // Get/set question value from/to.
565 GetSetValueWithEditBuffer
= 0, // Get/Set question value from/to editbuffer in the storage.
566 GetSetValueWithBuffer
, // Get/Set question value from/to buffer in the storage.
567 GetSetValueWithHiiDriver
, // Get/Set question value from/to hii driver.
568 GetSetValueWithBothBuffer
, // Compare the editbuffer with buffer for this question, not use the question value.
569 GetSetValueWithMax
// Invalid value.
570 } GET_SET_QUESTION_VALUE_WITH
;
572 extern EFI_HII_DATABASE_PROTOCOL
*mHiiDatabase
;
573 extern EFI_HII_CONFIG_ROUTING_PROTOCOL
*mHiiConfigRouting
;
574 extern EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL
*mPathFromText
;
575 extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL
*mFormDisplay
;
577 extern BOOLEAN gCallbackReconnect
;
578 extern BOOLEAN gFlagReconnect
;
579 extern BOOLEAN gResetRequired
;
580 extern BOOLEAN gExitRequired
;
581 extern LIST_ENTRY gBrowserFormSetList
;
582 extern LIST_ENTRY gBrowserHotKeyList
;
583 extern BROWSER_SETTING_SCOPE gBrowserSettingScope
;
584 extern EXIT_HANDLER ExitHandlerFunction
;
585 extern EFI_HII_HANDLE mCurrentHiiHandle
;
586 extern SETUP_DRIVER_PRIVATE_DATA mPrivateData
;
588 // Browser Global Strings
590 extern CHAR16
*gEmptyString
;
592 extern UI_MENU_SELECTION
*gCurrentSelection
;
593 extern BOOLEAN mHiiPackageListUpdated
;
594 extern UINT16 mCurFakeQestId
;
595 extern BOOLEAN mFinishRetrieveCall
;
598 // Global Procedure Defines
600 #include "Expression.h"
603 Initialize the HII String Token to the correct values.
607 InitializeBrowserStrings (
612 Parse opcodes in the formset IFR binary.
614 @param FormSet Pointer of the FormSet data structure.
616 @retval EFI_SUCCESS Opcode parse success.
617 @retval Other Opcode parse fail.
622 IN FORM_BROWSER_FORMSET
*FormSet
626 Free resources allocated for a FormSet.
628 @param FormSet Pointer of the FormSet
633 IN OUT FORM_BROWSER_FORMSET
*FormSet
638 Create a new string in HII Package List.
640 @param String The String to be added
641 @param HiiHandle The package list in the HII database to insert the
644 @return The output string.
650 IN EFI_HII_HANDLE HiiHandle
654 Delete a string from HII Package List.
656 @param StringId Id of the string in HII database.
657 @param HiiHandle The HII package list handle.
659 @retval EFI_SUCCESS The string was deleted successfully.
664 IN EFI_STRING_ID StringId
,
665 IN EFI_HII_HANDLE HiiHandle
669 Get the string based on the StringId and HII Package List Handle.
671 @param Token The String's ID.
672 @param HiiHandle The package list in the HII database to search for
673 the specified string.
675 @return The output string.
680 IN EFI_STRING_ID Token
,
681 IN EFI_HII_HANDLE HiiHandle
685 Get Value for given Name from a NameValue Storage.
687 @param Storage The NameValue Storage.
688 @param Name The Name.
689 @param Value The retured Value.
690 @param GetValueFrom Where to get source value, from EditValue or Value.
692 @retval EFI_SUCCESS Value found for given Name.
693 @retval EFI_NOT_FOUND No such Name found in NameValue storage.
698 IN BROWSER_STORAGE
*Storage
,
700 IN OUT CHAR16
**Value
,
701 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom
705 Set Value of given Name in a NameValue Storage.
707 @param Storage The NameValue Storage.
708 @param Name The Name.
709 @param Value The Value to set.
710 @param SetValueTo Whether update editValue or Value.
711 @param ReturnNode The node use the input name.
713 @retval EFI_SUCCESS Value found for given Name.
714 @retval EFI_NOT_FOUND No such Name found in NameValue storage.
719 IN BROWSER_STORAGE
*Storage
,
722 IN GET_SET_QUESTION_VALUE_WITH SetValueTo
,
723 OUT NAME_VALUE_NODE
**ReturnNode
727 Validate whether this question's value has changed.
729 @param FormSet FormSet data structure.
730 @param Form Form data structure.
731 @param Question Question to be initialized.
732 @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.
734 @retval TRUE Question's value has changed.
735 @retval FALSE Question's value has not changed
739 IsQuestionValueChanged (
740 IN FORM_BROWSER_FORMSET
*FormSet
,
741 IN FORM_BROWSER_FORM
*Form
,
742 IN OUT FORM_BROWSER_STATEMENT
*Question
,
743 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom
747 Validate the FormSet. If the formset is not validate, remove it from the list.
749 @param FormSet The input FormSet which need to validate.
751 @retval TRUE The handle is validate.
752 @retval FALSE The handle is invalidate.
757 FORM_BROWSER_FORMSET
*FormSet
761 Update the ValueChanged status for questions.
763 @param FormSet FormSet data structure.
764 @param Form Form data structure.
765 @param SettingScope Setting Scope for Default action.
769 UpdateStatementStatus (
770 IN FORM_BROWSER_FORMSET
*FormSet
,
771 IN FORM_BROWSER_FORM
*Form
,
772 IN BROWSER_SETTING_SCOPE SettingScope
776 Get Question's current Value.
778 @param FormSet FormSet data structure.
779 @param Form Form data structure.
780 @param Question Question to be initialized.
781 @param GetValueFrom Where to get value, may from editbuffer, buffer or hii driver.
783 @retval EFI_SUCCESS The function completed successfully.
788 IN FORM_BROWSER_FORMSET
*FormSet
,
789 IN FORM_BROWSER_FORM
*Form
,
790 IN OUT FORM_BROWSER_STATEMENT
*Question
,
791 IN GET_SET_QUESTION_VALUE_WITH GetValueFrom
795 Save Question Value to edit copy(cached) or Storage(uncached).
797 @param FormSet FormSet data structure.
798 @param Form Form data structure.
799 @param Question Pointer to the Question.
800 @param SetValueTo Update the question value to editbuffer , buffer or hii driver.
802 @retval EFI_SUCCESS The function completed successfully.
807 IN FORM_BROWSER_FORMSET
*FormSet
,
808 IN FORM_BROWSER_FORM
*Form
,
809 IN OUT FORM_BROWSER_STATEMENT
*Question
,
810 IN GET_SET_QUESTION_VALUE_WITH SetValueTo
814 Perform inconsistent check for a Form.
816 @param FormSet FormSet data structure.
817 @param Form Form data structure.
818 @param Question The Question to be validated.
819 @param Type Validation type: InConsistent or NoSubmit
821 @retval EFI_SUCCESS Form validation pass.
822 @retval other Form validation failed.
827 IN FORM_BROWSER_FORMSET
*FormSet
,
828 IN FORM_BROWSER_FORM
*Form
,
829 IN FORM_BROWSER_STATEMENT
*Question
,
835 Discard data based on the input setting scope (Form, FormSet or System).
837 @param FormSet FormSet data structure.
838 @param Form Form data structure.
839 @param SettingScope Setting Scope for Discard action.
841 @retval EFI_SUCCESS The function completed successfully.
842 @retval EFI_UNSUPPORTED Unsupport SettingScope.
847 IN FORM_BROWSER_FORMSET
*FormSet
,
848 IN FORM_BROWSER_FORM
*Form
,
849 IN BROWSER_SETTING_SCOPE SettingScope
853 Submit data based on the input Setting level (Form, FormSet or System).
855 @param FormSet FormSet data structure.
856 @param Form Form data structure.
857 @param SettingScope Setting Scope for Submit action.
859 @retval EFI_SUCCESS The function completed successfully.
860 @retval EFI_UNSUPPORTED Unsupport SettingScope.
865 IN FORM_BROWSER_FORMSET
*FormSet
,
866 IN FORM_BROWSER_FORM
*Form
,
867 IN BROWSER_SETTING_SCOPE SettingScope
871 Reset Question to its default value.
873 @param FormSet The form set.
874 @param Form The form.
875 @param Question The question.
876 @param DefaultId The Class of the default.
878 @retval EFI_SUCCESS Question is reset to default value.
883 IN FORM_BROWSER_FORMSET
*FormSet
,
884 IN FORM_BROWSER_FORM
*Form
,
885 IN FORM_BROWSER_STATEMENT
*Question
,
890 Get current setting of Questions.
892 @param FormSet FormSet data structure.
896 InitializeCurrentSetting (
897 IN OUT FORM_BROWSER_FORMSET
*FormSet
901 Initialize the internal data structure of a FormSet.
903 @param Handle PackageList Handle
904 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
905 GUID), take the first FormSet found in package
907 @param FormSet FormSet data structure.
909 @retval EFI_SUCCESS The function completed successfully.
910 @retval EFI_NOT_FOUND The specified FormSet could not be found.
915 IN EFI_HII_HANDLE Handle
,
916 IN OUT EFI_GUID
*FormSetGuid
,
917 OUT FORM_BROWSER_FORMSET
*FormSet
921 Reset Questions to their initial value or default value in a Form, Formset or System.
923 GetDefaultValueScope parameter decides which questions will reset
924 to its default value.
926 @param FormSet FormSet data structure.
927 @param Form Form data structure.
928 @param DefaultId The Class of the default.
929 @param SettingScope Setting Scope for Default action.
930 @param GetDefaultValueScope Get default value scope.
931 @param Storage Get default value only for this storage.
932 @param RetrieveValueFirst Whether call the retrieve call back to
933 get the initial value before get default
935 @param SkipGetAltCfg Whether skip the get altcfg string process.
937 @retval EFI_SUCCESS The function completed successfully.
938 @retval EFI_UNSUPPORTED Unsupport SettingScope.
943 IN FORM_BROWSER_FORMSET
*FormSet
,
944 IN FORM_BROWSER_FORM
*Form
,
946 IN BROWSER_SETTING_SCOPE SettingScope
,
947 IN BROWSER_GET_DEFAULT_VALUE GetDefaultValueScope
,
948 IN BROWSER_STORAGE
*Storage
,
949 IN BOOLEAN RetrieveValueFirst
,
950 IN BOOLEAN SkipGetAltCfg
954 Initialize Question's Edit copy from Storage.
956 @param Selection Selection contains the information about
957 the Selection, form and formset to be displayed.
958 Selection action may be updated in retrieve callback.
959 If Selection is NULL, only initialize Question value.
960 @param FormSet FormSet data structure.
961 @param Form Form data structure.
963 @retval EFI_SUCCESS The function completed successfully.
968 IN OUT UI_MENU_SELECTION
*Selection
,
969 IN FORM_BROWSER_FORMSET
*FormSet
,
970 IN FORM_BROWSER_FORM
*Form
974 Initialize Question's Edit copy from Storage for the whole Formset.
976 @param Selection Selection contains the information about
977 the Selection, form and formset to be displayed.
978 Selection action may be updated in retrieve callback.
979 If Selection is NULL, only initialize Question value.
980 @param FormSet FormSet data structure.
982 @retval EFI_SUCCESS The function completed successfully.
987 IN OUT UI_MENU_SELECTION
*Selection
,
988 IN FORM_BROWSER_FORMSET
*FormSet
992 Convert setting of Buffer Storage or NameValue Storage to <ConfigResp>.
994 @param Storage The Storage to be conveted.
995 @param ConfigResp The returned <ConfigResp>.
996 @param ConfigRequest The ConfigRequest string.
997 @param GetEditBuf Get the data from editbuffer or buffer.
999 @retval EFI_SUCCESS Convert success.
1000 @retval EFI_INVALID_PARAMETER Incorrect storage type.
1004 StorageToConfigResp (
1005 IN BROWSER_STORAGE
*Storage
,
1006 IN CHAR16
**ConfigResp
,
1007 IN CHAR16
*ConfigRequest
,
1008 IN BOOLEAN GetEditBuf
1012 Convert <ConfigResp> to settings in Buffer Storage or NameValue Storage.
1014 @param Storage The Storage to receive the settings.
1015 @param ConfigResp The <ConfigResp> to be converted.
1017 @retval EFI_SUCCESS Convert success.
1018 @retval EFI_INVALID_PARAMETER Incorrect storage type.
1022 ConfigRespToStorage (
1023 IN BROWSER_STORAGE
*Storage
,
1024 IN CHAR16
*ConfigResp
1028 Fill storage's edit copy with settings requested from Configuration Driver.
1030 @param FormSet FormSet data structure.
1031 @param Storage Buffer Storage.
1036 IN FORM_BROWSER_FORMSET
*FormSet
,
1037 IN FORMSET_STORAGE
*Storage
1041 Fetch the Ifr binary data of a FormSet.
1043 @param Handle PackageList Handle
1044 @param FormSetGuid GUID of a formset. If not specified (NULL or zero
1045 GUID), take the first FormSet found in package
1047 @param BinaryLength The length of the FormSet IFR binary.
1048 @param BinaryData The buffer designed to receive the FormSet.
1050 @retval EFI_SUCCESS Buffer filled with the requested FormSet.
1051 BufferLength was updated.
1052 @retval EFI_INVALID_PARAMETER The handle is unknown.
1053 @retval EFI_NOT_FOUND A form or FormSet on the requested handle cannot
1054 be found with the requested FormId.
1059 IN EFI_HII_HANDLE Handle
,
1060 IN OUT EFI_GUID
*FormSetGuid
,
1061 OUT UINTN
*BinaryLength
,
1062 OUT UINT8
**BinaryData
1066 Save globals used by previous call to SendForm(). SendForm() may be called from
1067 HiiConfigAccess.Callback(), this will cause SendForm() be reentried.
1068 So, save globals of previous call to SendForm() and restore them upon exit.
1072 SaveBrowserContext (
1077 Restore globals used by previous call to SendForm().
1081 RestoreBrowserContext (
1086 This is the routine which an external caller uses to direct the browser
1087 where to obtain it's information.
1090 @param This The Form Browser protocol instanse.
1091 @param Handles A pointer to an array of Handles. If HandleCount > 1 we
1092 display a list of the formsets for the handles specified.
1093 @param HandleCount The number of Handles specified in Handle.
1094 @param FormSetGuid This field points to the EFI_GUID which must match the Guid
1095 field in the EFI_IFR_FORM_SET op-code for the specified
1096 forms-based package. If FormSetGuid is NULL, then this
1097 function will display the first found forms package.
1098 @param FormId This field specifies which EFI_IFR_FORM to render as the first
1099 displayable page. If this field has a value of 0x0000, then
1100 the forms browser will render the specified forms in their encoded order.
1101 ScreenDimenions - This allows the browser to be called so that it occupies a
1102 portion of the physical screen instead of dynamically determining the screen dimensions.
1103 ActionRequest - Points to the action recommended by the form.
1104 @param ScreenDimensions Points to recommended form dimensions, including any non-content area, in
1106 @param ActionRequest Points to the action recommended by the form.
1108 @retval EFI_SUCCESS The function completed successfully.
1109 @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
1110 @retval EFI_NOT_FOUND No valid forms could be found to display.
1116 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1117 IN EFI_HII_HANDLE
*Handles
,
1118 IN UINTN HandleCount
,
1119 IN EFI_GUID
*FormSetGuid
, OPTIONAL
1120 IN UINT16 FormId
, OPTIONAL
1121 IN CONST EFI_SCREEN_DESCRIPTOR
*ScreenDimensions
, OPTIONAL
1122 OUT EFI_BROWSER_ACTION_REQUEST
*ActionRequest OPTIONAL
1126 This function is called by a callback handler to retrieve uncommitted state
1127 data from the browser.
1129 @param This A pointer to the EFI_FORM_BROWSER2_PROTOCOL
1131 @param ResultsDataSize A pointer to the size of the buffer associated
1133 @param ResultsData A string returned from an IFR browser or
1134 equivalent. The results string will have no
1135 routing information in them.
1136 @param RetrieveData A BOOLEAN field which allows an agent to retrieve
1137 (if RetrieveData = TRUE) data from the uncommitted
1138 browser state information or set (if RetrieveData
1139 = FALSE) data in the uncommitted browser state
1141 @param VariableGuid An optional field to indicate the target variable
1143 @param VariableName An optional field to indicate the target
1144 human-readable variable name.
1146 @retval EFI_SUCCESS The results have been distributed or are awaiting
1148 @retval EFI_BUFFER_TOO_SMALL The ResultsDataSize specified was too small to
1149 contain the results data.
1155 IN CONST EFI_FORM_BROWSER2_PROTOCOL
*This
,
1156 IN OUT UINTN
*ResultsDataSize
,
1157 IN OUT EFI_STRING ResultsData
,
1158 IN BOOLEAN RetrieveData
,
1159 IN CONST EFI_GUID
*VariableGuid
, OPTIONAL
1160 IN CONST CHAR16
*VariableName OPTIONAL
1164 Find menu which will show next time.
1166 @param Selection On input, Selection tell setup browser the information
1167 about the Selection, form and formset to be displayed.
1168 On output, Selection return the screen item that is selected
1170 @param SettingLevel Input Settting level, if it is FormLevel, just exit current form.
1171 else, we need to exit current formset.
1173 @retval TRUE Exit current form.
1174 @retval FALSE User press ESC and keep in current form.
1178 IN OUT UI_MENU_SELECTION
*Selection
,
1179 IN BROWSER_SETTING_SCOPE SettingLevel
1183 check whether the form need to update the NV.
1185 @param Form Form data structure.
1187 @retval TRUE Need to update the NV.
1188 @retval FALSE No need to update the NV.
1191 IsNvUpdateRequiredForForm (
1192 IN FORM_BROWSER_FORM
*Form
1196 check whether the formset need to update the NV.
1198 @param FormSet FormSet data structure.
1200 @retval TRUE Need to update the NV.
1201 @retval FALSE No need to update the NV.
1204 IsNvUpdateRequiredForFormSet (
1205 IN FORM_BROWSER_FORMSET
*FormSet
1209 Call the call back function for the question and process the return action.
1211 @param Selection On input, Selection tell setup browser the information
1212 about the Selection, form and formset to be displayed.
1213 On output, Selection return the screen item that is selected
1215 @param FormSet The formset this question belong to.
1216 @param Form The form this question belong to.
1217 @param Question The Question which need to call.
1218 @param Action The action request.
1219 @param SkipSaveOrDiscard Whether skip save or discard action.
1221 @retval EFI_SUCCESS The call back function excutes successfully.
1222 @return Other value if the call back function failed to excute.
1225 ProcessCallBackFunction (
1226 IN OUT UI_MENU_SELECTION
*Selection
,
1227 IN FORM_BROWSER_FORMSET
*FormSet
,
1228 IN FORM_BROWSER_FORM
*Form
,
1229 IN FORM_BROWSER_STATEMENT
*Question
,
1230 IN EFI_BROWSER_ACTION Action
,
1231 IN BOOLEAN SkipSaveOrDiscard
1235 Call the retrieve type call back function for one question to get the initialize data.
1237 This function only used when in the initialize stage, because in this stage, the
1238 Selection->Form is not ready. For other case, use the ProcessCallBackFunction instead.
1240 @param ConfigAccess The config access protocol produced by the hii driver.
1241 @param Statement The Question which need to call.
1242 @param FormSet The formset this question belong to.
1244 @retval EFI_SUCCESS The call back function excutes successfully.
1245 @return Other value if the call back function failed to excute.
1248 ProcessRetrieveForQuestion (
1249 IN EFI_HII_CONFIG_ACCESS_PROTOCOL
*ConfigAccess
,
1250 IN FORM_BROWSER_STATEMENT
*Statement
,
1251 IN FORM_BROWSER_FORMSET
*FormSet
1255 Find the matched FormSet context in the backup maintain list based on HiiHandle.
1257 @param Handle The Hii Handle.
1259 @return the found FormSet context. If no found, NULL will return.
1262 FORM_BROWSER_FORMSET
*
1263 GetFormSetFromHiiHandle (
1264 EFI_HII_HANDLE Handle
1268 Check whether the input HII handle is the FormSet that is being used.
1270 @param Handle The Hii Handle.
1272 @retval TRUE HII handle is being used.
1273 @retval FALSE HII handle is not being used.
1277 IsHiiHandleInBrowserContext (
1278 EFI_HII_HANDLE Handle
1282 Configure what scope the hot key will impact.
1283 All hot keys have the same scope. The mixed hot keys with the different level are not supported.
1284 If no scope is set, the default scope will be FormSet level.
1285 After all registered hot keys are removed, previous Scope can reset to another level.
1287 @param[in] Scope Scope level to be set.
1289 @retval EFI_SUCCESS Scope is set correctly.
1290 @retval EFI_INVALID_PARAMETER Scope is not the valid value specified in BROWSER_SETTING_SCOPE.
1291 @retval EFI_UNSPPORTED Scope level is different from current one that the registered hot keys have.
1297 IN BROWSER_SETTING_SCOPE Scope
1301 Register the hot key with its browser action, or unregistered the hot key.
1302 Only support hot key that is not printable character (control key, function key, etc.).
1303 If the action value is zero, the hot key will be unregistered if it has been registered.
1304 If the same hot key has been registered, the new action and help string will override the previous ones.
1306 @param[in] KeyData A pointer to a buffer that describes the keystroke
1307 information for the hot key. Its type is EFI_INPUT_KEY to
1308 be supported by all ConsoleIn devices.
1309 @param[in] Action Action value that describes what action will be trigged when the hot key is pressed.
1310 @param[in] DefaultId Specifies the type of defaults to retrieve, which is only for DEFAULT action.
1311 @param[in] HelpString Help string that describes the hot key information.
1312 Its value may be NULL for the unregistered hot key.
1314 @retval EFI_SUCCESS Hot key is registered or unregistered.
1315 @retval EFI_INVALID_PARAMETER KeyData is NULL.
1316 @retval EFI_NOT_FOUND KeyData is not found to be unregistered.
1317 @retval EFI_UNSUPPORTED Key represents a printable character. It is conflicted with Browser.
1318 @retval EFI_ALREADY_STARTED Key already been registered for one hot key.
1323 IN EFI_INPUT_KEY
*KeyData
,
1325 IN UINT16 DefaultId
,
1326 IN EFI_STRING HelpString OPTIONAL
1330 Register Exit handler function.
1331 When more than one handler function is registered, the latter one will override the previous one.
1332 When NULL handler is specified, the previous Exit handler will be unregistered.
1334 @param[in] Handler Pointer to handler function.
1339 RegiserExitHandler (
1340 IN EXIT_HANDLER Handler
1345 Check whether the browser data has been modified.
1347 @retval TRUE Browser data is changed.
1348 @retval FALSE No browser data is changed.
1353 IsBrowserDataModified (
1359 Execute the action requested by the Action parameter.
1361 @param[in] Action Execute the request action.
1362 @param[in] DefaultId The default Id info when need to load default value.
1364 @retval EFI_SUCCESS Execute the request action succss.
1365 @retval EFI_INVALID_PARAMETER The input action value is invalid.
1376 Create reminder to let user to choose save or discard the changed browser data.
1377 Caller can use it to actively check the changed browser data.
1379 @retval BROWSER_NO_CHANGES No browser data is changed.
1380 @retval BROWSER_SAVE_CHANGES The changed browser data is saved.
1381 @retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
1382 @retval BROWSER_KEEP_CURRENT Browser keep current changes.
1392 Check whether the Reset Required for the browser
1394 @retval TRUE Browser required to reset after exit.
1395 @retval FALSE Browser not need to reset after exit.
1405 Find the registered HotKey based on KeyData.
1407 @param[in] KeyData A pointer to a buffer that describes the keystroke
1408 information for the hot key.
1410 @return The registered HotKey context. If no found, NULL will return.
1413 GetHotKeyFromRegisterList (
1414 IN EFI_INPUT_KEY
*KeyData
1419 Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.
1421 @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.
1423 @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.
1426 FORM_BROWSER_STATEMENT
*
1427 GetBrowserStatement (
1428 IN FORM_DISPLAY_ENGINE_STATEMENT
*DisplayStatement
1432 Password may be stored as encrypted by Configuration Driver. When change a
1433 password, user will be challenged with old password. To validate user input old
1434 password, we will send the clear text to Configuration Driver via Callback().
1435 Configuration driver is responsible to check the passed in password and return
1436 the validation result. If validation pass, state machine in password Callback()
1437 will transit from BROWSER_STATE_VALIDATE_PASSWORD to BROWSER_STATE_SET_PASSWORD.
1438 After user type in new password twice, Callback() will be invoked to send the
1439 new password to Configuration Driver.
1441 @param Selection Pointer to UI_MENU_SELECTION.
1442 @param MenuOption The MenuOption for this password Question.
1443 @param String The clear text of password.
1445 @retval EFI_NOT_AVAILABLE_YET Callback() request to terminate password input.
1446 @return In state of BROWSER_STATE_VALIDATE_PASSWORD:
1447 @retval EFI_SUCCESS Password correct, Browser will prompt for new
1449 @retval EFI_NOT_READY Password incorrect, Browser will show error
1451 @retval Other Browser will do nothing.
1452 @return In state of BROWSER_STATE_SET_PASSWORD:
1453 @retval EFI_SUCCESS Set password success.
1454 @retval Other Set password failed.
1459 IN UI_MENU_SELECTION
*Selection
,
1460 IN FORM_BROWSER_STATEMENT
*Question
,
1465 Display error message for invalid password.
1474 The worker function that send the displays to the screen. On output,
1475 the selection made by user is returned.
1477 @param Selection On input, Selection tell setup browser the information
1478 about the Selection, form and formset to be displayed.
1479 On output, Selection return the screen item that is selected
1482 @retval EFI_SUCCESS The page is displayed successfully.
1483 @return Other value if the page failed to be diplayed.
1488 IN OUT UI_MENU_SELECTION
*Selection
1492 Free up the resource allocated for all strings required
1497 FreeBrowserStrings (
1502 Create a menu with specified formset GUID and form ID, and add it as a child
1503 of the given parent menu.
1505 @param HiiHandle Hii handle related to this formset.
1506 @param FormSetGuid The Formset Guid of menu to be added.
1507 @param FormId The Form ID of menu to be added.
1508 @param QuestionId The question id of this menu to be added.
1510 @return A pointer to the newly added menu or NULL if memory is insufficient.
1515 IN EFI_HII_HANDLE HiiHandle
,
1516 IN EFI_GUID
*FormSetGuid
,
1518 IN UINT16 QuestionId
1522 Search Menu with given FormSetGuid and FormId in all cached menu list.
1524 @param HiiHandle HiiHandle for FormSet.
1525 @param FormSetGuid The Formset GUID of the menu to search.
1526 @param FormId The Form ID of menu to search.
1528 @return A pointer to menu found or NULL if not found.
1533 IN EFI_HII_HANDLE HiiHandle
,
1534 IN EFI_GUID
*FormSetGuid
,
1539 Free Menu list linked list.
1541 @param MenuListHead One Menu list point in the menu list.
1546 LIST_ENTRY
*MenuListHead
1550 Find parent menu for current menu.
1552 @param CurrentMenu Current Menu
1553 @param SettingLevel Whether find parent menu in Form Level or Formset level.
1554 In form level, just find the parent menu;
1555 In formset level, find the parent menu which has different
1558 @retval The parent menu for current menu.
1562 IN FORM_ENTRY_INFO
*CurrentMenu
,
1563 IN BROWSER_SETTING_SCOPE SettingLevel
1567 Validate the HiiHandle.
1569 @param HiiHandle The input HiiHandle which need to validate.
1571 @retval TRUE The handle is validate.
1572 @retval FALSE The handle is invalidate.
1577 EFI_HII_HANDLE HiiHandle
1581 Copy current Menu list to the new menu list.
1583 @param NewMenuListHead New create Menu list.
1584 @param CurrentMenuListHead Current Menu list.
1589 OUT LIST_ENTRY
*NewMenuListHead
,
1590 IN LIST_ENTRY
*CurrentMenuListHead
1594 Search an Option of a Question by its value.
1596 @param Question The Question
1597 @param OptionValue Value for Option to be searched.
1599 @retval Pointer Pointer to the found Option.
1600 @retval NULL Option not found.
1605 IN FORM_BROWSER_STATEMENT
*Question
,
1606 IN EFI_HII_VALUE
*OptionValue
1609 Return data element in an Array by its Index.
1611 @param Array The data array.
1612 @param Type Type of the data in this array.
1613 @param Index Zero based index for data in this array.
1615 @retval Value The data to be returned
1626 Set value of a data element in an Array by its Index.
1628 @param Array The data array.
1629 @param Type Type of the data in this array.
1630 @param Index Zero based index for data in this array.
1631 @param Value The value to be set.
1643 Compare two Hii value.
1645 @param Value1 Expression value to compare on left-hand.
1646 @param Value2 Expression value to compare on right-hand.
1647 @param Result Return value after compare.
1648 retval 0 Two operators equal.
1649 return Positive value if Value1 is greater than Value2.
1650 retval Negative value if Value1 is less than Value2.
1651 @param HiiHandle Only required for string compare.
1653 @retval other Could not perform compare on two values.
1654 @retval EFI_SUCCESS Compare the value success.
1659 IN EFI_HII_VALUE
*Value1
,
1660 IN EFI_HII_VALUE
*Value2
,
1662 IN EFI_HII_HANDLE HiiHandle OPTIONAL
1666 Perform Password check.
1667 Passwork may be encrypted by driver that requires the specific check.
1669 @param Form Form where Password Statement is in.
1670 @param Statement Password statement
1671 @param PasswordString Password string to be checked. It may be NULL.
1672 NULL means to restore password.
1673 "" string can be used to checked whether old password does exist.
1675 @return Status Status of Password check.
1680 IN FORM_DISPLAY_ENGINE_FORM
*Form
,
1681 IN FORM_DISPLAY_ENGINE_STATEMENT
*Statement
,
1682 IN EFI_STRING PasswordString OPTIONAL
1687 Get FORM_BROWSER_STATEMENT from FORM_DISPLAY_ENGINE_STATEMENT based on the OpCode info.
1689 @param DisplayStatement The input FORM_DISPLAY_ENGINE_STATEMENT.
1691 @retval FORM_BROWSER_STATEMENT The return FORM_BROWSER_STATEMENT info.
1694 FORM_BROWSER_STATEMENT
*
1695 GetBrowserStatement (
1696 IN FORM_DISPLAY_ENGINE_STATEMENT
*DisplayStatement
1701 Initialize the Display form structure data.
1705 InitializeDisplayFormData (
1711 Base on the current formset info, clean the ConfigRequest string in browser storage.
1713 @param FormSet Pointer of the FormSet
1717 CleanBrowserStorage (
1718 IN OUT FORM_BROWSER_FORMSET
*FormSet
1722 Find HII Handle in the HII database associated with given Device Path.
1724 If DevicePath is NULL, then ASSERT.
1726 @param DevicePath Device Path associated with the HII package list
1728 @param FormsetGuid The formset guid for this formset.
1730 @retval Handle HII package list Handle associated with the Device
1732 @retval NULL Hii Package list handle is not found.
1736 DevicePathToHiiHandle (
1737 IN EFI_DEVICE_PATH_PROTOCOL
*DevicePath
,
1738 IN EFI_GUID
*FormsetGuid
1742 Adjust the config request info, remove the request elements which already in AllConfigRequest string.
1744 @param Storage Form set Storage.
1745 @param Request The input request string.
1746 @param RespString Whether the input is ConfigRequest or ConfigResp format.
1748 @retval TRUE Has element not covered by current used elements, need to continue to call ExtractConfig
1749 @retval FALSE All elements covered by current used elements.
1753 ConfigRequestAdjust (
1754 IN BROWSER_STORAGE
*Storage
,
1756 IN BOOLEAN RespString
1760 Perform question check.
1762 If one question has more than one check, process form high priority to low.
1764 @param FormSet FormSet data structure.
1765 @param Form Form data structure.
1766 @param Question The Question to be validated.
1768 @retval EFI_SUCCESS Form validation pass.
1769 @retval other Form validation failed.
1773 ValueChangedValidation (
1774 IN FORM_BROWSER_FORMSET
*FormSet
,
1775 IN FORM_BROWSER_FORM
*Form
,
1776 IN FORM_BROWSER_STATEMENT
*Question
1780 Pop up the error info.
1782 @param BrowserStatus The input browser status.
1783 @param HiiHandle The HiiHandle for this error opcode.
1784 @param OpCode The opcode use to get the erro info and timeout value.
1785 @param ErrorString Error string used by BROWSER_NO_SUBMIT_IF.
1790 IN UINT32 BrowserStatus
,
1791 IN EFI_HII_HANDLE HiiHandle
,
1792 IN EFI_IFR_OP_HEADER
*OpCode
, OPTIONAL
1793 IN CHAR16
*ErrorString
1797 Check whether the result is TRUE or FALSE.
1799 For the EFI_HII_VALUE value type is numeric, return TRUE if the
1802 @param Result Input the result data.
1804 @retval TRUE The result is TRUE.
1805 @retval FALSE The result is FALSE.
1810 IN EFI_HII_VALUE
*Result
1814 Get Formset_storage base on the input varstoreid info.
1816 @param FormSet Pointer of the current FormSet.
1817 @param VarStoreId Varstore ID info.
1819 @return Pointer to a FORMSET_STORAGE data structure.
1823 GetFstStgFromVarId (
1824 IN FORM_BROWSER_FORMSET
*FormSet
,
1825 IN EFI_VARSTORE_ID VarStoreId
1829 Get Formset_storage base on the input browser storage.
1831 More than one formsets may share the same browser storage,
1832 this function just get the first formset storage which
1833 share the browser storage.
1835 @param Storage browser storage info.
1837 @return Pointer to a FORMSET_STORAGE data structure.
1842 GetFstStgFromBrsStg (
1843 IN BROWSER_STORAGE
*Storage
1847 Reconnect the controller.
1849 @param DriverHandle The controller handle which need to be reconnect.
1851 @retval TRUE do the reconnect behavior success.
1852 @retval FALSE do the reconnect behavior failed.
1856 ReconnectController (
1857 IN EFI_HANDLE DriverHandle
1861 Converts the unicode character of the string from uppercase to lowercase.
1862 This is a internal function.
1864 @param ConfigString String to be converted
1870 IN EFI_STRING ConfigString