X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=MdeModulePkg%2FUniversal%2FSetupBrowserDxe%2FSetup.h;h=f1accdf841daf1f0108c3a4155c984068e6ec8b8;hb=0a18956d54cfe70b736b029c62ce53f29b903745;hp=d21a6cd9c73f4c459ee3a58dbf69999e09ee6a10;hpb=7da62bc02d70f11d6294efc71ccebb65199655d0;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h index d21a6cd9c7..f1accdf841 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h @@ -1,7 +1,7 @@ /** @file Private MACRO, structure and function definitions for Setup Browser module. -Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -32,10 +32,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #include #include #include +#include #include #include @@ -88,7 +90,7 @@ typedef struct { // Produced protocol // EFI_FORM_BROWSER2_PROTOCOL FormBrowser2; - EFI_FORM_BROWSER_EXTENSION_PROTOCOL FormBrowserEx; + EDKII_FORM_BROWSER_EXTENSION_PROTOCOL FormBrowserEx; EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL FormBrowserEx2; @@ -150,7 +152,6 @@ typedef struct { UINT32 Attributes; // For EFI_IFR_VARSTORE_EFI: EFI Variable attribute - CHAR16 *ConfigHdr; // CHAR16 *ConfigRequest; // = + // includes all fields which is used by current form sets. UINTN SpareStrLen; // Spare length of ConfigRequest string buffer @@ -164,16 +165,25 @@ typedef struct { UINTN Signature; LIST_ENTRY Link; + LIST_ENTRY SaveFailLink; + UINT16 VarStoreId; BROWSER_STORAGE *BrowserStorage; + CHAR16 *ConfigHdr; // + CHAR16 *ConfigRequest; // = + + CHAR16 *ConfigAltResp; // Alt config response string for this ConfigRequest. + BOOLEAN HasCallAltCfg; // Flag to show whether browser has call ExtractConfig to get Altcfg string. UINTN ElementCount; // Number of in the UINTN SpareStrLen; // Spare length of ConfigRequest string buffer + CHAR16 *RestoreConfigRequest; // When submit formset fail, the element need to be restored + CHAR16 *SyncConfigRequest; // When submit formset fail, the element need to be synced } FORMSET_STORAGE; #define FORMSET_STORAGE_FROM_LINK(a) CR (a, FORMSET_STORAGE, Link, FORMSET_STORAGE_SIGNATURE) +#define FORMSET_STORAGE_FROM_SAVE_FAIL_LINK(a) CR (a, FORMSET_STORAGE, SaveFailLink, FORMSET_STORAGE_SIGNATURE) typedef union { EFI_STRING_ID VarName; @@ -373,13 +383,19 @@ typedef struct { UINTN Signature; LIST_ENTRY Link; + LIST_ENTRY SaveFailLink; + CHAR16 *ConfigRequest; // = + + CHAR16 *ConfigAltResp; // Alt config response string for this ConfigRequest. UINTN ElementCount; // Number of in the UINTN SpareStrLen; + CHAR16 *RestoreConfigRequest; // When submit form fail, the element need to be restored + CHAR16 *SyncConfigRequest; // When submit form fail, the element need to be synced BROWSER_STORAGE *Storage; } FORM_BROWSER_CONFIG_REQUEST; #define FORM_BROWSER_CONFIG_REQUEST_FROM_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, Link, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE) +#define FORM_BROWSER_CONFIG_REQUEST_FROM_SAVE_FAIL_LINK(a) CR (a, FORM_BROWSER_CONFIG_REQUEST, SaveFailLink, FORM_BROWSER_CONFIG_REQUEST_SIGNATURE) #define FORM_BROWSER_FORM_SIGNATURE SIGNATURE_32 ('F', 'F', 'R', 'M') #define STANDARD_MAP_FORM_TYPE 0x01 @@ -396,7 +412,9 @@ typedef struct { BOOLEAN ModalForm; // Whether this is a modal form. BOOLEAN Locked; // Whether this form is locked. + EFI_GUID RefreshGuid; // Form refresh event guid. + LIST_ENTRY FormViewListHead; // List of type FORMID_INFO is Browser View Form History List. LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION) LIST_ENTRY StatementListHead; // List of Statements and Questions (FORM_BROWSER_STATEMENT) LIST_ENTRY ConfigRequestHead; // List of configreques for all storage. @@ -422,6 +440,8 @@ typedef struct { typedef struct { UINTN Signature; LIST_ENTRY Link; + LIST_ENTRY SaveFailLink; + EFI_HII_HANDLE HiiHandle; // unique id for formset. EFI_HANDLE DriverHandle; EFI_HII_CONFIG_ACCESS_PROTOCOL *ConfigAccess; @@ -439,18 +459,24 @@ typedef struct { UINT16 Class; // Tiano extended Class code UINT16 SubClass; // Tiano extended Subclass code EFI_IMAGE_ID ImageId; + EFI_IFR_OP_HEADER *OpCode; //mainly for formset op to get ClassGuid FORM_BROWSER_STATEMENT *StatementBuffer; // Buffer for all Statements and Questions EXPRESSION_OPCODE *ExpressionBuffer; // Buffer for all Expression OpCode + FORM_BROWSER_FORM *SaveFailForm; // The form which failed to save. + FORM_BROWSER_STATEMENT *SaveFailStatement; // The Statement which failed to save. LIST_ENTRY StatementListOSF; // Statement list out side of the form. LIST_ENTRY StorageListHead; // Storage list (FORMSET_STORAGE) + LIST_ENTRY SaveFailStorageListHead; // Storage list for the save fail storage. LIST_ENTRY DefaultStoreListHead; // DefaultStore list (FORMSET_DEFAULTSTORE) LIST_ENTRY FormListHead; // Form list (FORM_BROWSER_FORM) LIST_ENTRY ExpressionListHead; // List of Expressions (FORM_EXPRESSION) } FORM_BROWSER_FORMSET; #define FORM_BROWSER_FORMSET_FROM_LINK(a) CR (a, FORM_BROWSER_FORMSET, Link, FORM_BROWSER_FORMSET_SIGNATURE) +#define FORM_BROWSER_FORMSET_FROM_SAVE_FAIL_LINK(a) CR (a, FORM_BROWSER_FORMSET, SaveFailLink, FORM_BROWSER_FORMSET_SIGNATURE) + typedef struct { LIST_ENTRY Link; EFI_EVENT RefreshEvent; @@ -508,14 +534,20 @@ typedef struct { // // Globals defined in Setup.c // + BOOLEAN FlagReconnect; + BOOLEAN CallbackReconnect; BOOLEAN ResetRequired; BOOLEAN ExitRequired; EFI_HII_HANDLE HiiHandle; EFI_GUID FormSetGuid; EFI_FORM_ID FormId; UI_MENU_SELECTION *Selection; - - LIST_ENTRY FormHistoryList; + FORM_BROWSER_FORMSET *SystemLevelFormSet; + EFI_QUESTION_ID CurFakeQestId; + BOOLEAN HiiPackageListUpdated; + BOOLEAN FinishRetrieveCall; + LIST_ENTRY FormHistoryList; + LIST_ENTRY FormSetList; } BROWSER_CONTEXT; #define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE) @@ -534,9 +566,10 @@ typedef enum { // Get/set question value from/to. // typedef enum { - GetSetValueWithEditBuffer, // Get/Set question value from/to editbuffer in the storage. + GetSetValueWithEditBuffer = 0, // Get/Set question value from/to editbuffer in the storage. GetSetValueWithBuffer, // Get/Set question value from/to buffer in the storage. GetSetValueWithHiiDriver, // Get/Set question value from/to hii driver. + GetSetValueWithBothBuffer, // Compare the editbuffer with buffer for this question, not use the question value. GetSetValueWithMax // Invalid value. } GET_SET_QUESTION_VALUE_WITH; @@ -545,6 +578,8 @@ extern EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting; extern EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *mPathFromText; extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL *mFormDisplay; +extern BOOLEAN gCallbackReconnect; +extern BOOLEAN gFlagReconnect; extern BOOLEAN gResetRequired; extern BOOLEAN gExitRequired; extern LIST_ENTRY gBrowserFormSetList; @@ -558,9 +593,10 @@ extern SETUP_DRIVER_PRIVATE_DATA mPrivateData; // extern CHAR16 *gEmptyString; -extern EFI_GUID gZeroGuid; - extern UI_MENU_SELECTION *gCurrentSelection; +extern BOOLEAN mHiiPackageListUpdated; +extern UINT16 mCurFakeQestId; +extern BOOLEAN mFinishRetrieveCall; // // Global Procedure Defines @@ -900,6 +936,7 @@ InitializeFormSet ( @param RetrieveValueFirst Whether call the retrieve call back to get the initial value before get default value. + @param SkipGetAltCfg Whether skip the get altcfg string process. @retval EFI_SUCCESS The function completed successfully. @retval EFI_UNSUPPORTED Unsupport SettingScope. @@ -913,7 +950,8 @@ ExtractDefault ( IN BROWSER_SETTING_SCOPE SettingScope, IN BROWSER_GET_DEFAULT_VALUE GetDefaultValueScope, IN BROWSER_STORAGE *Storage, - IN BOOLEAN RetrieveValueFirst + IN BOOLEAN RetrieveValueFirst, + IN BOOLEAN SkipGetAltCfg ); /** @@ -1184,8 +1222,8 @@ IsNvUpdateRequiredForFormSet ( @param Action The action request. @param SkipSaveOrDiscard Whether skip save or discard action. - @retval EFI_SUCCESS The call back function excutes successfully. - @return Other value if the call back function failed to excute. + @retval EFI_SUCCESS The call back function executes successfully. + @return Other value if the call back function failed to execute. **/ EFI_STATUS ProcessCallBackFunction ( @@ -1207,8 +1245,8 @@ ProcessCallBackFunction ( @param Statement The Question which need to call. @param FormSet The formset this question belong to. - @retval EFI_SUCCESS The call back function excutes successfully. - @return Other value if the call back function failed to excute. + @retval EFI_SUCCESS The call back function executes successfully. + @return Other value if the call back function failed to execute. **/ EFI_STATUS ProcessRetrieveForQuestion ( @@ -1281,6 +1319,7 @@ SetScope ( @retval EFI_INVALID_PARAMETER KeyData is NULL. @retval EFI_NOT_FOUND KeyData is not found to be unregistered. @retval EFI_UNSUPPORTED Key represents a printable character. It is conflicted with Browser. + @retval EFI_ALREADY_STARTED Key already been registered for one hot key. **/ EFI_STATUS EFIAPI @@ -1515,12 +1554,44 @@ UiFreeMenuList ( Find parent menu for current menu. @param CurrentMenu Current Menu + @param SettingLevel Whether find parent menu in Form Level or Formset level. + In form level, just find the parent menu; + In formset level, find the parent menu which has different + formset guid value. @retval The parent menu for current menu. **/ FORM_ENTRY_INFO * UiFindParentMenu ( - IN FORM_ENTRY_INFO *CurrentMenu + IN FORM_ENTRY_INFO *CurrentMenu, + IN BROWSER_SETTING_SCOPE SettingLevel + ); + +/** + Validate the HiiHandle. + + @param HiiHandle The input HiiHandle which need to validate. + + @retval TRUE The handle is validate. + @retval FALSE The handle is invalidate. + +**/ +BOOLEAN +ValidateHiiHandle ( + EFI_HII_HANDLE HiiHandle + ); + +/** + Copy current Menu list to the new menu list. + + @param NewMenuListHead New create Menu list. + @param CurrentMenuListHead Current Menu list. + +**/ +VOID +UiCopyMenuList ( + OUT LIST_ENTRY *NewMenuListHead, + IN LIST_ENTRY *CurrentMenuListHead ); /** @@ -1713,13 +1784,15 @@ ValueChangedValidation ( Pop up the error info. @param BrowserStatus The input browser status. + @param HiiHandle The HiiHandle for this error opcode. @param OpCode The opcode use to get the erro info and timeout value. @param ErrorString Error string used by BROWSER_NO_SUBMIT_IF. **/ -VOID +UINT32 PopupErrorMessage ( IN UINT32 BrowserStatus, + IN EFI_HII_HANDLE HiiHandle, IN EFI_IFR_OP_HEADER *OpCode, OPTIONAL IN CHAR16 *ErrorString ); @@ -1741,4 +1814,64 @@ IsTrue ( IN EFI_HII_VALUE *Result ); +/** + Get Formset_storage base on the input varstoreid info. + + @param FormSet Pointer of the current FormSet. + @param VarStoreId Varstore ID info. + + @return Pointer to a FORMSET_STORAGE data structure. + +**/ +FORMSET_STORAGE * +GetFstStgFromVarId ( + IN FORM_BROWSER_FORMSET *FormSet, + IN EFI_VARSTORE_ID VarStoreId + ); + +/** + Get Formset_storage base on the input browser storage. + + More than one formsets may share the same browser storage, + this function just get the first formset storage which + share the browser storage. + + @param Storage browser storage info. + + @return Pointer to a FORMSET_STORAGE data structure. + + +**/ +FORMSET_STORAGE * +GetFstStgFromBrsStg ( + IN BROWSER_STORAGE *Storage + ); + +/** + Reconnect the controller. + + @param DriverHandle The controller handle which need to be reconnect. + + @retval TRUE do the reconnect behavior success. + @retval FALSE do the reconnect behavior failed. + +**/ +BOOLEAN +ReconnectController ( + IN EFI_HANDLE DriverHandle + ); + +/** + Converts the unicode character of the string from uppercase to lowercase. + This is a internal function. + + @param ConfigString String to be converted + +**/ +VOID +EFIAPI +HiiToLower ( + IN EFI_STRING ConfigString + ); + #endif