/** @file\r
Private MACRO, structure and function definitions for Setup Browser module.\r
\r
-Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
\r
**/\r
// Produced protocol\r
//\r
EFI_FORM_BROWSER2_PROTOCOL FormBrowser2;\r
- EFI_FORM_BROWSER_EXTENSION_PROTOCOL FormBrowserEx;\r
+ EDKII_FORM_BROWSER_EXTENSION_PROTOCOL FormBrowserEx;\r
\r
EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL FormBrowserEx2;\r
\r
BOOLEAN HasCallAltCfg; // Flag to show whether browser has call ExtractConfig to get Altcfg string.\r
UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest>\r
UINTN SpareStrLen; // Spare length of ConfigRequest string buffer\r
+ CHAR16 *RestoreConfigRequest; // When submit formset fail, the element need to be restored\r
+ CHAR16 *SyncConfigRequest; // When submit formset fail, the element need to be synced\r
} FORMSET_STORAGE;\r
\r
#define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE)\r
typedef struct {\r
UINTN Signature;\r
LIST_ENTRY Link;\r
- \r
+\r
EFI_IFR_ONE_OF_OPTION *OpCode; // OneOfOption Data\r
\r
EFI_STRING_ID Text;\r
\r
typedef enum {\r
ExpressFalse = 0,\r
- ExpressGrayOut, \r
+ ExpressGrayOut,\r
ExpressSuppress,\r
ExpressDisable\r
} EXPRESS_RESULT;\r
\r
typedef enum {\r
ExpressNone = 0,\r
- ExpressForm, \r
+ ExpressForm,\r
ExpressStatement,\r
ExpressOption\r
} EXPRESS_LEVEL;\r
BROWSER_STORAGE *Storage;\r
VAR_STORE_INFO VarStoreInfo;\r
UINT16 StorageWidth;\r
+ UINT16 BitStorageWidth;\r
+ UINT16 BitVarOffset;\r
UINT8 QuestionFlags;\r
+ BOOLEAN QuestionReferToBitField;// Whether the question is stored in a bit field.\r
CHAR16 *VariableName; // Name/Value or EFI Variable name\r
CHAR16 *BlockName; // Buffer storage block name: "OFFSET=...WIDTH=..."\r
\r
\r
CHAR16 *ConfigRequest; // <ConfigRequest> = <ConfigHdr> + <RequestElement>\r
CHAR16 *ConfigAltResp; // Alt config response string for this ConfigRequest.\r
- UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest> \r
+ UINTN ElementCount; // Number of <RequestElement> in the <ConfigRequest>\r
UINTN SpareStrLen;\r
+ CHAR16 *RestoreConfigRequest; // When submit form fail, the element need to be restored\r
+ CHAR16 *SyncConfigRequest; // When submit form fail, the element need to be synced\r
\r
BROWSER_STORAGE *Storage;\r
} FORM_BROWSER_CONFIG_REQUEST;\r
EFI_GUID FormSetGuid;\r
EFI_FORM_ID FormId;\r
UI_MENU_SELECTION *Selection;\r
-\r
- LIST_ENTRY FormHistoryList;\r
+ FORM_BROWSER_FORMSET *SystemLevelFormSet;\r
+ EFI_QUESTION_ID CurFakeQestId;\r
+ BOOLEAN HiiPackageListUpdated;\r
+ BOOLEAN FinishRetrieveCall;\r
+ LIST_ENTRY FormHistoryList;\r
+ LIST_ENTRY FormSetList;\r
} BROWSER_CONTEXT;\r
\r
#define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)\r
\r
extern BOOLEAN gCallbackReconnect;\r
extern BOOLEAN gFlagReconnect;\r
-extern BOOLEAN gResetRequired;\r
+extern BOOLEAN gResetRequiredFormLevel;\r
+extern BOOLEAN gResetRequiredSystemLevel;\r
extern BOOLEAN gExitRequired;\r
extern LIST_ENTRY gBrowserFormSetList;\r
extern LIST_ENTRY gBrowserHotKeyList;\r
extern CHAR16 *gEmptyString;\r
\r
extern UI_MENU_SELECTION *gCurrentSelection;\r
+extern BOOLEAN mHiiPackageListUpdated;\r
+extern UINT16 mCurFakeQestId;\r
+extern BOOLEAN mFinishRetrieveCall;\r
\r
//\r
// Global Procedure Defines\r
@param SettingScope Setting Scope for Default action.\r
\r
**/\r
-VOID \r
+VOID\r
UpdateStatementStatus (\r
IN FORM_BROWSER_FORMSET *FormSet,\r
- IN FORM_BROWSER_FORM *Form, \r
+ IN FORM_BROWSER_FORM *Form,\r
IN BROWSER_SETTING_SCOPE SettingScope\r
);\r
\r
InitializeFormSet (\r
IN EFI_HII_HANDLE Handle,\r
IN OUT EFI_GUID *FormSetGuid,\r
- OUT FORM_BROWSER_FORMSET *FormSet \r
+ OUT FORM_BROWSER_FORMSET *FormSet\r
);\r
\r
/**\r
Reset Questions to their initial value or default value in a Form, Formset or System.\r
\r
- GetDefaultValueScope parameter decides which questions will reset \r
+ GetDefaultValueScope parameter decides which questions will reset\r
to its default value.\r
\r
@param FormSet FormSet data structure.\r
/**\r
Initialize Question's Edit copy from Storage.\r
\r
- @param Selection Selection contains the information about \r
+ @param Selection Selection contains the information about\r
the Selection, form and formset to be displayed.\r
Selection action may be updated in retrieve callback.\r
If Selection is NULL, only initialize Question value.\r
/**\r
Initialize Question's Edit copy from Storage for the whole Formset.\r
\r
- @param Selection Selection contains the information about \r
+ @param Selection Selection contains the information about\r
the Selection, form and formset to be displayed.\r
Selection action may be updated in retrieve callback.\r
If Selection is NULL, only initialize Question value.\r
);\r
\r
/**\r
- Save globals used by previous call to SendForm(). SendForm() may be called from \r
+ Save globals used by previous call to SendForm(). SendForm() may be called from\r
HiiConfigAccess.Callback(), this will cause SendForm() be reentried.\r
So, save globals of previous call to SendForm() and restore them upon exit.\r
\r
about the Selection, form and formset to be displayed.\r
On output, Selection return the screen item that is selected\r
by user.\r
- @param SettingLevel Input Settting level, if it is FormLevel, just exit current form. \r
+ @param SettingLevel Input Settting level, if it is FormLevel, just exit current form.\r
else, we need to exit current formset.\r
- \r
+\r
@retval TRUE Exit current form.\r
@retval FALSE User press ESC and keep in current form.\r
**/\r
@param Action The action request.\r
@param SkipSaveOrDiscard Whether skip save or discard action.\r
\r
- @retval EFI_SUCCESS The call back function excutes successfully.\r
- @return Other value if the call back function failed to excute. \r
+ @retval EFI_SUCCESS The call back function executes successfully.\r
+ @return Other value if the call back function failed to execute.\r
**/\r
-EFI_STATUS \r
+EFI_STATUS\r
ProcessCallBackFunction (\r
IN OUT UI_MENU_SELECTION *Selection,\r
IN FORM_BROWSER_FORMSET *FormSet,\r
IN EFI_BROWSER_ACTION Action,\r
IN BOOLEAN SkipSaveOrDiscard\r
);\r
- \r
+\r
/**\r
Call the retrieve type call back function for one question to get the initialize data.\r
- \r
- This function only used when in the initialize stage, because in this stage, the \r
+\r
+ This function only used when in the initialize stage, because in this stage, the\r
Selection->Form is not ready. For other case, use the ProcessCallBackFunction instead.\r
\r
@param ConfigAccess The config access protocol produced by the hii driver.\r
@param Statement The Question which need to call.\r
@param FormSet The formset this question belong to.\r
\r
- @retval EFI_SUCCESS The call back function excutes successfully.\r
- @return Other value if the call back function failed to excute. \r
+ @retval EFI_SUCCESS The call back function executes successfully.\r
+ @return Other value if the call back function failed to execute.\r
**/\r
-EFI_STATUS \r
+EFI_STATUS\r
ProcessRetrieveForQuestion (\r
IN EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess,\r
IN FORM_BROWSER_STATEMENT *Statement,\r
\r
/**\r
Find the matched FormSet context in the backup maintain list based on HiiHandle.\r
- \r
+\r
@param Handle The Hii Handle.\r
- \r
+\r
@return the found FormSet context. If no found, NULL will return.\r
\r
**/\r
-FORM_BROWSER_FORMSET * \r
+FORM_BROWSER_FORMSET *\r
GetFormSetFromHiiHandle (\r
EFI_HII_HANDLE Handle\r
);\r
\r
/**\r
Check whether the input HII handle is the FormSet that is being used.\r
- \r
+\r
@param Handle The Hii Handle.\r
- \r
+\r
@retval TRUE HII handle is being used.\r
@retval FALSE HII handle is not being used.\r
\r
All hot keys have the same scope. The mixed hot keys with the different level are not supported.\r
If no scope is set, the default scope will be FormSet level.\r
After all registered hot keys are removed, previous Scope can reset to another level.\r
- \r
- @param[in] Scope Scope level to be set. \r
- \r
+\r
+ @param[in] Scope Scope level to be set.\r
+\r
@retval EFI_SUCCESS Scope is set correctly.\r
- @retval EFI_INVALID_PARAMETER Scope is not the valid value specified in BROWSER_SETTING_SCOPE. \r
+ @retval EFI_INVALID_PARAMETER Scope is not the valid value specified in BROWSER_SETTING_SCOPE.\r
@retval EFI_UNSPPORTED Scope level is different from current one that the registered hot keys have.\r
\r
**/\r
Only support hot key that is not printable character (control key, function key, etc.).\r
If the action value is zero, the hot key will be unregistered if it has been registered.\r
If the same hot key has been registered, the new action and help string will override the previous ones.\r
- \r
+\r
@param[in] KeyData A pointer to a buffer that describes the keystroke\r
- information for the hot key. Its type is EFI_INPUT_KEY to \r
+ information for the hot key. Its type is EFI_INPUT_KEY to\r
be supported by all ConsoleIn devices.\r
- @param[in] Action Action value that describes what action will be trigged when the hot key is pressed. \r
+ @param[in] Action Action value that describes what action will be trigged when the hot key is pressed.\r
@param[in] DefaultId Specifies the type of defaults to retrieve, which is only for DEFAULT action.\r
@param[in] HelpString Help string that describes the hot key information.\r
Its value may be NULL for the unregistered hot key.\r
- \r
+\r
@retval EFI_SUCCESS Hot key is registered or unregistered.\r
@retval EFI_INVALID_PARAMETER KeyData is NULL.\r
@retval EFI_NOT_FOUND KeyData is not found to be unregistered.\r
@retval EFI_UNSUPPORTED Key represents a printable character. It is conflicted with Browser.\r
+ @retval EFI_ALREADY_STARTED Key already been registered for one hot key.\r
**/\r
EFI_STATUS\r
EFIAPI\r
);\r
\r
/**\r
- Register Exit handler function. \r
- When more than one handler function is registered, the latter one will override the previous one. \r
- When NULL handler is specified, the previous Exit handler will be unregistered. \r
- \r
- @param[in] Handler Pointer to handler function. \r
+ Register Exit handler function.\r
+ When more than one handler function is registered, the latter one will override the previous one.\r
+ When NULL handler is specified, the previous Exit handler will be unregistered.\r
+\r
+ @param[in] Handler Pointer to handler function.\r
\r
**/\r
VOID\r
);\r
\r
/**\r
- \r
- Check whether the browser data has been modified. \r
+\r
+ Check whether the browser data has been modified.\r
\r
@retval TRUE Browser data is changed.\r
@retval FALSE No browser data is changed.\r
\r
**/\r
-BOOLEAN \r
+BOOLEAN\r
EFIAPI\r
IsBrowserDataModified (\r
VOID\r
);\r
\r
/**\r
- \r
- Execute the action requested by the Action parameter. \r
+\r
+ Execute the action requested by the Action parameter.\r
\r
@param[in] Action Execute the request action.\r
@param[in] DefaultId The default Id info when need to load default value.\r
@retval EFI_INVALID_PARAMETER The input action value is invalid.\r
\r
**/\r
-EFI_STATUS \r
+EFI_STATUS\r
EFIAPI\r
ExecuteAction (\r
IN UINT32 Action,\r
\r
/**\r
Find the registered HotKey based on KeyData.\r
- \r
+\r
@param[in] KeyData A pointer to a buffer that describes the keystroke\r
information for the hot key.\r
\r
GetBrowserStatement (\r
IN FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement\r
);\r
- \r
+\r
/**\r
Password may be stored as encrypted by Configuration Driver. When change a\r
password, user will be challenged with old password. To validate user input old\r
SetupBrowser (\r
IN OUT UI_MENU_SELECTION *Selection\r
);\r
- \r
+\r
/**\r
Free up the resource allocated for all strings required\r
by Setup Browser.\r
**/\r
FORM_ENTRY_INFO *\r
UiFindMenuList (\r
- IN EFI_HII_HANDLE HiiHandle, \r
+ IN EFI_HII_HANDLE HiiHandle,\r
IN EFI_GUID *FormSetGuid,\r
IN UINT16 FormId\r
);\r
\r
@param CurrentMenu Current Menu\r
@param SettingLevel Whether find parent menu in Form Level or Formset level.\r
- In form level, just find the parent menu; \r
+ In form level, just find the parent menu;\r
In formset level, find the parent menu which has different\r
formset guid value.\r
\r
IN FORM_ENTRY_INFO *CurrentMenu,\r
IN BROWSER_SETTING_SCOPE SettingLevel\r
);\r
- \r
+\r
/**\r
Validate the HiiHandle.\r
\r
\r
/**\r
Copy current Menu list to the new menu list.\r
- \r
+\r
@param NewMenuListHead New create Menu list.\r
@param CurrentMenuListHead Current Menu list.\r
\r
\r
/**\r
Compare two Hii value.\r
- \r
+\r
@param Value1 Expression value to compare on left-hand.\r
@param Value2 Expression value to compare on right-hand.\r
@param Result Return value after compare.\r
return Positive value if Value1 is greater than Value2.\r
retval Negative value if Value1 is less than Value2.\r
@param HiiHandle Only required for string compare.\r
- \r
+\r
@retval other Could not perform compare on two values.\r
@retval EFI_SUCCESS Compare the value success.\r
- \r
+\r
**/\r
EFI_STATUS\r
CompareHiiValue (\r
);\r
\r
/**\r
- Perform Password check. \r
+ Perform Password check.\r
Passwork may be encrypted by driver that requires the specific check.\r
- \r
+\r
@param Form Form where Password Statement is in.\r
@param Statement Password statement\r
@param PasswordString Password string to be checked. It may be NULL.\r
NULL means to restore password.\r
"" string can be used to checked whether old password does exist.\r
- \r
+\r
@return Status Status of Password check.\r
**/\r
EFI_STATUS\r
GetBrowserStatement (\r
IN FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement\r
);\r
- \r
+\r
/**\r
\r
Initialize the Display form structure data.\r
@retval FALSE All elements covered by current used elements.\r
\r
**/\r
-BOOLEAN \r
+BOOLEAN\r
ConfigRequestAdjust (\r
IN BROWSER_STORAGE *Storage,\r
IN CHAR16 *Request,\r
);\r
\r
/**\r
- Perform question check. \r
- \r
+ Perform question check.\r
+\r
If one question has more than one check, process form high priority to low.\r
\r
@param FormSet FormSet data structure.\r
@param Storage browser storage info.\r
\r
@return Pointer to a FORMSET_STORAGE data structure.\r
- \r
+\r
\r
**/\r
FORMSET_STORAGE *\r
\r
@retval TRUE do the reconnect behavior success.\r
@retval FALSE do the reconnect behavior failed.\r
- \r
+\r
**/\r
BOOLEAN\r
ReconnectController (\r