]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Library / BootMaintenanceManagerUiLib / BootMaintenanceManager.h
index 24526e1096757ffbc945086856a2376c97a76be2..e8288b53ad258c3e89ea1710bae94b2f2b36c543 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Header file for boot maintenance module.\r
 \r
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2018, 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
@@ -28,6 +28,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/SimpleFileSystem.h>\r
 #include <Protocol/SerialIo.h>\r
 #include <Protocol/DevicePathToText.h>\r
+#include <Protocol/FormBrowserEx2.h>\r
 \r
 #include <Library/PrintLib.h>\r
 #include <Library/DebugLib.h>\r
@@ -41,6 +42,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/UefiHiiServicesLib.h>\r
 #include <Library/UefiBootManagerLib.h>\r
 #include <Library/FileExplorerLib.h>\r
+#include "BootMaintenanceManagerCustomizedUi.h"\r
 \r
 #pragma pack(1)\r
 \r
@@ -268,24 +270,15 @@ typedef struct {
 \r
 typedef struct {\r
   BOOLEAN                   IsBootNext;\r
-  BOOLEAN                   LoadOptionModified;\r
   BOOLEAN                   Deleted;\r
 \r
   BOOLEAN                   IsLegacy;\r
-  BOOLEAN                   IsActive;\r
-  BOOLEAN                   ForceReconnect;\r
-  UINTN                     OptionalDataSize;\r
-\r
-  UINTN                     LoadOptionSize;\r
-  UINT8                     *LoadOption;\r
 \r
   UINT32                    Attributes;\r
   UINT16                    FilePathListLength;\r
   UINT16                    *Description;\r
   EFI_DEVICE_PATH_PROTOCOL  *FilePathList;\r
   UINT8                     *OptionalData;\r
-\r
-  UINT16                    BbsIndex;\r
 } BM_LOAD_CONTEXT;\r
 \r
 typedef struct {\r
@@ -340,7 +333,7 @@ typedef struct {
 } BM_MENU_ENTRY;\r
 \r
 typedef struct {\r
-  \r
+\r
   UINTN                          Signature;\r
 \r
   EFI_HII_HANDLE                 BmmHiiHandle;\r
@@ -362,7 +355,7 @@ typedef struct {
   //\r
   // BMM main formset callback data.\r
   //\r
-  \r
+\r
   EFI_FORM_ID                    BmmCurrentPageId;\r
   EFI_FORM_ID                    BmmPreviousPageId;\r
   BOOLEAN                        BmmAskSaveOrNot;\r
@@ -410,7 +403,7 @@ BOpt_GetBootOptions (
 \r
   @return EFI_SUCESS The functin completes successfully.\r
   @retval EFI_OUT_OF_RESOURCES Not enough memory to compete the operation.\r
-  \r
+\r
 \r
 **/\r
 EFI_STATUS\r
@@ -512,12 +505,12 @@ BOpt_GetMenuEntry (
   );\r
 \r
 /**\r
-  Get option number according to Boot#### and BootOrder variable. \r
+  Get option number according to Boot#### and BootOrder variable.\r
   The value is saved as #### + 1.\r
 \r
   @param CallbackData    The BMM context data.\r
 **/\r
-VOID  \r
+VOID\r
 GetBootOrder (\r
   IN  BMM_CALLBACK_DATA    *CallbackData\r
   );\r
@@ -526,9 +519,9 @@ GetBootOrder (
   Get driver option order from globalc DriverOptionMenu.\r
 \r
   @param CallbackData    The BMM context data.\r
-  \r
+\r
 **/\r
-VOID  \r
+VOID\r
 GetDriverOrder (\r
   IN  BMM_CALLBACK_DATA    *CallbackData\r
   );\r
@@ -603,11 +596,11 @@ ChangeVariableDevicePath (
 \r
 /**\r
   Update the multi-instance device path of Terminal Device based on\r
-  the global TerminalMenu. If ChangeTernimal is TRUE, the terminal \r
+  the global TerminalMenu. If ChangeTernimal is TRUE, the terminal\r
   device path in the Terminal Device in TerminalMenu is also updated.\r
 \r
   @param DevicePath      The multi-instance device path.\r
-  @param ChangeTerminal  TRUE, then device path in the Terminal Device \r
+  @param ChangeTerminal  TRUE, then device path in the Terminal Device\r
                          in TerminalMenu is also updated; FALSE, no update.\r
 \r
   @return EFI_SUCCESS    The function completes successfully.\r
@@ -623,8 +616,8 @@ ChangeTerminalDevicePath (
 // Variable operation by menu selection\r
 //\r
 /**\r
-  This function create a currently loaded Boot Option from \r
-  the BMM. It then appends this Boot Option to the end of \r
+  This function create a currently loaded Boot Option from\r
+  the BMM. It then appends this Boot Option to the end of\r
   the "BootOrder" list. It also append this Boot Opotion to the end\r
   of BootOptionMenu.\r
 \r
@@ -641,12 +634,10 @@ Var_UpdateBootOption (
 \r
 /**\r
   Delete Boot Option that represent a Deleted state in BootOptionMenu.\r
-  After deleting this boot option, call Var_ChangeBootOrder to\r
-  make sure BootOrder is in valid state.\r
 \r
-  @retval EFI_SUCCESS   If all boot load option EFI Variables corresponding to  \r
+  @retval EFI_SUCCESS   If all boot load option EFI Variables corresponding to\r
                         BM_LOAD_CONTEXT marked for deletion is deleted\r
-  @return Others        If failed to update the "BootOrder" variable after deletion. \r
+  @return Others        If failed to update the "BootOrder" variable after deletion.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -655,23 +646,8 @@ Var_DelBootOption (
   );\r
 \r
 /**\r
-  After any operation on Boot####, there will be a discrepancy in BootOrder.\r
-  Since some are missing but in BootOrder, while some are present but are\r
-  not reflected by BootOrder. Then a function rebuild BootOrder from\r
-  scratch by content from BootOptionMenu is needed.\r
-\r
-  @retval  EFI_SUCCESS  The boot order is updated successfully.\r
-  @return  other than EFI_SUCCESS if failed to change the "BootOrder" EFI Variable.\r
-\r
-**/\r
-EFI_STATUS\r
-Var_ChangeBootOrder (\r
-  VOID\r
-  );\r
-\r
-/**\r
-  This function create a currently loaded Drive Option from \r
-  the BMM. It then appends this Driver Option to the end of \r
+  This function create a currently loaded Drive Option from\r
+  the BMM. It then appends this Driver Option to the end of\r
   the "DriverOrder" list. It append this Driver Opotion to the end\r
   of DriverOptionMenu.\r
 \r
@@ -695,9 +671,7 @@ Var_UpdateDriverOption (
   );\r
 \r
 /**\r
-  Delete Load Option that represent a Deleted state in BootOptionMenu.\r
-  After deleting this Driver option, call Var_ChangeDriverOrder to\r
-  make sure DriverOrder is in valid state.\r
+  Delete Load Option that represent a Deleted state in DriverOptionMenu.\r
 \r
   @retval EFI_SUCCESS Load Option is successfully updated.\r
   @return Other value than EFI_SUCCESS if failed to update "Driver Order" EFI\r
@@ -709,22 +683,6 @@ Var_DelDriverOption (
   VOID\r
   );\r
 \r
-/**\r
-  After any operation on Driver####, there will be a discrepancy in\r
-  DriverOrder. Since some are missing but in DriverOrder, while some\r
-  are present but are not reflected by DriverOrder. Then a function\r
-  rebuild DriverOrder from scratch by content from DriverOptionMenu is\r
-  needed.\r
-\r
-  @retval  EFI_SUCCESS  The driver order is updated successfully.\r
-  @return  other than EFI_SUCCESS if failed to set the "DriverOrder" EFI Variable.\r
-\r
-**/\r
-EFI_STATUS\r
-Var_ChangeDriverOrder (\r
-  VOID\r
-  );\r
-\r
 /**\r
   This function delete and build multi-instance device path ConIn\r
   console device.\r
@@ -761,11 +719,11 @@ Var_UpdateErrorOutOption (
 \r
 /**\r
   This function delete and build Out of Band console device.\r
-  \r
+\r
   @param   MenuIndex   Menu index which user select in the terminal menu list.\r
-  \r
+\r
   @retval EFI_SUCCESS    The function complete successfully.\r
-  @return The EFI variable can not be saved. See gRT->SetVariable for detail return information.  \r
+  @return The EFI variable can not be saved. See gRT->SetVariable for detail return information.\r
 **/\r
 EFI_STATUS\r
 Var_UpdateOutOfBandOption (\r
@@ -773,17 +731,7 @@ Var_UpdateOutOfBandOption (
   );\r
 \r
 /**\r
-  Update the device path of "ConOut", "ConIn" and "ErrOut" based on the new BaudRate, Data Bits, \r
-  parity and stop Bits set.\r
-\r
-**/\r
-VOID\r
-Var_UpdateAllConsoleOption (\r
-  VOID\r
-  );\r
-\r
-/**\r
-  This function update the "BootNext" EFI Variable. If there is no "BootNex" specified in BMM, \r
+  This function update the "BootNext" EFI Variable. If there is no "BootNex" specified in BMM,\r
   this EFI Variable is deleted.\r
   It also update the BMM context data specified the "BootNext" value.\r
 \r
@@ -799,7 +747,7 @@ Var_UpdateBootNext (
   );\r
 \r
 /**\r
-  This function update the "BootOrder" EFI Variable based on BMM Formset's NV map. It then refresh \r
+  This function update the "BootOrder" EFI Variable based on BMM Formset's NV map. It then refresh\r
   BootOptionMenu with the new "BootOrder" list.\r
 \r
   @param CallbackData           The BMM context data.\r
@@ -868,7 +816,7 @@ RefreshUpdateData (
 \r
 /**\r
   Clean up the dynamic opcode at label and form specified by\r
-  both LabelId. \r
+  both LabelId.\r
 \r
   @param LabelId         It is both the Form ID and Label ID for\r
                          opcode deletion.\r
@@ -936,26 +884,6 @@ UpdatePageBody (
   IN BMM_CALLBACK_DATA                *CallbackData\r
   );\r
 \r
-/**\r
-  Create the dynamic page to allow user to set the "BootNext" vaule.\r
-\r
-  @param CallbackData    The BMM context data.\r
-**/\r
-VOID\r
-UpdateBootNextPage (\r
-  IN BMM_CALLBACK_DATA                *CallbackData\r
-  );\r
-\r
-/**\r
-  Create the dynamic page to allow user to set the "TimeOut" vaule.\r
-\r
-  @param CallbackData    The BMM context data.\r
-**/\r
-VOID\r
-UpdateTimeOutPage (\r
-  IN BMM_CALLBACK_DATA                *CallbackData\r
-  );\r
-\r
 /**\r
   Create the dynamic page which allows user to set the property such as Baud Rate, Data Bits,\r
   Parity, Stop Bits, Terminal Type.\r
@@ -1009,7 +937,7 @@ UpdateOptionPage(
 \r
   @param VarName            A Null-terminated Unicode string that is\r
                             the name of the vendor's variable.\r
-                         \r
+\r
   @param VarGuid            A unique identifier for the vendor.\r
 \r
   @retval  EFI_SUCCESS           The variable was found and removed\r
@@ -1041,7 +969,7 @@ EfiDevicePathInstanceCount (
   );\r
 \r
 /**\r
-  Get a string from the Data Hub record based on \r
+  Get a string from the Data Hub record based on\r
   a device path.\r
 \r
   @param DevPath         The device Path.\r
@@ -1087,6 +1015,18 @@ DiscardChangeHandler (
   IN  BMM_FAKE_NV_DATA                *CurrentFakeNVMap\r
   );\r
 \r
+\r
+/**\r
+  This function is to clean some useless data before submit changes.\r
+\r
+  @param Private            The BMM context data.\r
+\r
+**/\r
+VOID\r
+CleanUselessBeforeSubmit (\r
+  IN  BMM_CALLBACK_DATA               *Private\r
+  );\r
+\r
 /**\r
   Dispatch the display to the next page based on NewPageId.\r
 \r
@@ -1125,8 +1065,8 @@ InitBootMaintenance(
 \r
   @param CallbackData    The BMM context data.\r
 \r
-**/  \r
-VOID  \r
+**/\r
+VOID\r
 GetConsoleInCheck (\r
   IN  BMM_CALLBACK_DATA    *CallbackData\r
   );\r
@@ -1151,7 +1091,7 @@ GetConsoleOutCheck (
 \r
   @param CallbackData    The BMM context data.\r
 \r
-**/        \r
+**/\r
 VOID\r
 GetConsoleErrCheck (\r
   IN  BMM_CALLBACK_DATA    *CallbackData\r
@@ -1172,17 +1112,16 @@ GetTerminalAttribute (
 \r
 /**\r
   This function will change video resolution and text mode\r
-  according to defined setup mode or defined boot mode  \r
+  according to defined setup mode or defined boot mode\r
 \r
-  @param  IsSetupMode   Indicate mode is changed to setup mode or boot mode. \r
+  @param  IsSetupMode   Indicate mode is changed to setup mode or boot mode.\r
 \r
   @retval  EFI_SUCCESS  Mode is changed successfully.\r
   @retval  Others             Mode failed to be changed.\r
 \r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
-BmmBdsSetConsoleMode (\r
+BmmSetConsoleMode (\r
   BOOLEAN  IsSetupMode\r
   );\r
 \r
@@ -1256,7 +1195,7 @@ BootMaintExtractConfig (
 \r
   @param[in]  This                Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
   @param[in]  Configuration       A null-terminated Unicode string in\r
-                                  <ConfigString> format.   \r
+                                  <ConfigString> format.\r
   @param[out] Progress            A pointer to a string filled in with the\r
                                   offset of the most recent '&' before the\r
                                   first failing name / value pair (or the\r
@@ -1266,7 +1205,7 @@ BootMaintExtractConfig (
                                   successful.\r
 \r
   @retval EFI_SUCCESS             The results have been distributed or are\r
-                                  awaiting distribution.  \r
+                                  awaiting distribution.\r
   @retval EFI_OUT_OF_RESOURCES    Not enough memory to store the\r
                                   parts of the results that must be\r
                                   stored awaiting possible future\r
@@ -1323,7 +1262,8 @@ BootMaintCallback (
   @retval FALSE  Not exit caller function.\r
 \r
 **/\r
-BOOLEAN \r
+BOOLEAN\r
+EFIAPI\r
 CreateBootOptionFromFile (\r
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath\r
   );\r
@@ -1336,7 +1276,8 @@ CreateBootOptionFromFile (
   @retval TRUE   Exit caller function.\r
   @retval FALSE  Not exit caller function.\r
 **/\r
-BOOLEAN \r
+BOOLEAN\r
+EFIAPI\r
 CreateDriverOptionFromFile (\r
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath\r
   );\r
@@ -1348,9 +1289,10 @@ CreateDriverOptionFromFile (
 \r
   @retval TRUE   Exit caller function.\r
   @retval FALSE  Not exit caller function.\r
-  \r
+\r
 **/\r
-BOOLEAN \r
+BOOLEAN\r
+EFIAPI\r
 BootFromFile (\r
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath\r
   );\r