summaryrefslogtreecommitdiff
path: root/edk2/IntelFrameworkModulePkg/Universal/BdsDxe
diff options
context:
space:
mode:
Diffstat (limited to 'edk2/IntelFrameworkModulePkg/Universal/BdsDxe')
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bm.vfr16
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c167
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c50
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h1
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c12
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c5
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c2
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c53
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManagerVfr.h1
-rw-r--r--edk2/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c47
10 files changed, 164 insertions, 190 deletions
diff --git a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bm.vfr b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bm.vfr
index fd14a7714..afbbfdddf 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bm.vfr
+++ b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Bm.vfr
@@ -55,7 +55,7 @@ formset
subtitle text = STRING_TOKEN(STR_NULL_STRING);
- goto FORM_CON_MAIN_ID,
+ goto FORM_BOOT_FROM_FILE_ID,
prompt = STRING_TOKEN(STR_BOOT_FROM_FILE),
help = STRING_TOKEN(STR_BOOT_FROM_FILE_HELP),
flags = INTERACTIVE,
@@ -154,13 +154,6 @@ formset
key = FORM_DRV_CHG_ID;
endform;
- form formid = FORM_BOOT_ADD_ID,
- title = STRING_TOKEN(STR_FORM_BOOT_ADD_TITLE);
-
- label FORM_BOOT_ADD_ID;
- label LABEL_END;
- endform;
-
form formid = FORM_BOOT_DEL_ID,
title = STRING_TOKEN(STR_FORM_BOOT_DEL_TITLE);
@@ -298,13 +291,6 @@ formset
label LABEL_END;
endform;
- form formid = FORM_DRV_ADD_FILE_ID,
- title = STRING_TOKEN(STR_FORM_DRV_ADD_FILE_TITLE);
-
- label FORM_DRV_ADD_FILE_ID;
- label LABEL_END;
- endform;
-
form formid = FORM_DRV_ADD_HANDLE_ID,
title = STRING_TOKEN(STR_FORM_DRV_ADD_HANDLE_TITLE);
diff --git a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
index 4c8e3c8a4..1186c0cb1 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
+++ b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.c
@@ -280,92 +280,71 @@ BootMaintCallback (
UINTN Pos;
UINTN Bit;
UINT16 NewValuePos;
+ UINT16 Index3;
UINT16 Index2;
UINT16 Index;
UINT8 *OldLegacyDev;
UINT8 *NewLegacyDev;
UINT8 *DisMap;
- EFI_FORM_ID FormId;
- Status = EFI_SUCCESS;
+ if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
+ //
+ // All other action return unsupported.
+ //
+ return EFI_UNSUPPORTED;
+ }
+
+ Status = EFI_SUCCESS;
+ OldValue = 0;
+ NewValue = 0;
+ Number = 0;
+ OldLegacyDev = NULL;
+ NewLegacyDev = NULL;
+ NewValuePos = 0;
+ DisMap = NULL;
+
+ Private = BMM_CALLBACK_DATA_FROM_THIS (This);
+ //
+ // Retrive uncommitted data from Form Browser
+ //
+ CurrentFakeNVMap = &Private->BmmFakeNvData;
+ HiiGetBrowserData (&gBootMaintFormSetGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *) CurrentFakeNVMap);
if (Action == EFI_BROWSER_ACTION_CHANGING) {
- if ((Value == NULL) || (ActionRequest == NULL)) {
+ if (Value == NULL) {
return EFI_INVALID_PARAMETER;
}
-
- OldValue = 0;
- NewValue = 0;
- Number = 0;
- OldLegacyDev = NULL;
- NewLegacyDev = NULL;
- NewValuePos = 0;
- DisMap = NULL;
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
-
- Private = BMM_CALLBACK_DATA_FROM_THIS (This);
+
UpdatePageId (Private, QuestionId);
//
- // Retrive uncommitted data from Form Browser
- //
- CurrentFakeNVMap = &Private->BmmFakeNvData;
- HiiGetBrowserData (&gBootMaintFormSetGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *) CurrentFakeNVMap);
-
- //
// need to be subtituded.
//
// Update Select FD/HD/CD/NET/BEV Order Form
//
- if (FORM_SET_FD_ORDER_ID == Private->BmmPreviousPageId ||
- FORM_SET_HD_ORDER_ID == Private->BmmPreviousPageId ||
- FORM_SET_CD_ORDER_ID == Private->BmmPreviousPageId ||
- FORM_SET_NET_ORDER_ID == Private->BmmPreviousPageId ||
- FORM_SET_BEV_ORDER_ID == Private->BmmPreviousPageId ||
- ((FORM_BOOT_SETUP_ID == Private->BmmPreviousPageId) &&
- (QuestionId >= LEGACY_FD_QUESTION_ID) &&
- (QuestionId < (LEGACY_BEV_QUESTION_ID + 100)) )
- ) {
+ if ((QuestionId >= LEGACY_FD_QUESTION_ID) && (QuestionId < LEGACY_BEV_QUESTION_ID + MAX_MENU_NUMBER)) {
DisMap = Private->BmmOldFakeNVData.DisableMap;
- FormId = Private->BmmPreviousPageId;
- if (FormId == FORM_BOOT_SETUP_ID) {
- FormId = Private->BmmCurrentPageId;
- }
-
- switch (FormId) {
- case FORM_SET_FD_ORDER_ID:
+ if (QuestionId >= LEGACY_FD_QUESTION_ID && QuestionId < LEGACY_FD_QUESTION_ID + MAX_MENU_NUMBER) {
Number = (UINT16) LegacyFDMenu.MenuNumber;
OldLegacyDev = Private->BmmOldFakeNVData.LegacyFD;
NewLegacyDev = CurrentFakeNVMap->LegacyFD;
- break;
-
- case FORM_SET_HD_ORDER_ID:
+ } else if (QuestionId >= LEGACY_HD_QUESTION_ID && QuestionId < LEGACY_HD_QUESTION_ID + MAX_MENU_NUMBER) {
Number = (UINT16) LegacyHDMenu.MenuNumber;
OldLegacyDev = Private->BmmOldFakeNVData.LegacyHD;
NewLegacyDev = CurrentFakeNVMap->LegacyHD;
- break;
-
- case FORM_SET_CD_ORDER_ID:
+ } else if (QuestionId >= LEGACY_CD_QUESTION_ID && QuestionId < LEGACY_CD_QUESTION_ID + MAX_MENU_NUMBER) {
Number = (UINT16) LegacyCDMenu.MenuNumber;
OldLegacyDev = Private->BmmOldFakeNVData.LegacyCD;
NewLegacyDev = CurrentFakeNVMap->LegacyCD;
- break;
-
- case FORM_SET_NET_ORDER_ID:
+ } else if (QuestionId >= LEGACY_NET_QUESTION_ID && QuestionId < LEGACY_NET_QUESTION_ID + MAX_MENU_NUMBER) {
Number = (UINT16) LegacyNETMenu.MenuNumber;
OldLegacyDev = Private->BmmOldFakeNVData.LegacyNET;
NewLegacyDev = CurrentFakeNVMap->LegacyNET;
- break;
-
- case FORM_SET_BEV_ORDER_ID:
+ } else if (QuestionId >= LEGACY_BEV_QUESTION_ID && QuestionId < LEGACY_BEV_QUESTION_ID + MAX_MENU_NUMBER) {
Number = (UINT16) LegacyBEVMenu.MenuNumber;
OldLegacyDev = Private->BmmOldFakeNVData.LegacyBEV;
NewLegacyDev = CurrentFakeNVMap->LegacyBEV;
- break;
-
- default:
- break;
}
//
// First, find the different position
@@ -450,6 +429,7 @@ BootMaintCallback (
// To prevent DISABLE appears in the middle of the list
// we should perform a re-ordering
//
+ Index3 = Index;
Index = 0;
while (Index < Number) {
if (0xFF != NewLegacyDev[Index]) {
@@ -480,6 +460,11 @@ BootMaintCallback (
NewLegacyDev,
Number
);
+
+ //
+ // Return correct question value.
+ //
+ Value->u8 = NewLegacyDev[Index3];
}
}
@@ -488,29 +473,14 @@ BootMaintCallback (
switch (QuestionId) {
case KEY_VALUE_BOOT_FROM_FILE:
Private->FeCurrentState = FileExplorerStateBootFromFile;
-
- //
- // Exit Bmm main formset to send File Explorer formset.
- //
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
break;
case FORM_BOOT_ADD_ID:
Private->FeCurrentState = FileExplorerStateAddBootOption;
-
- //
- // Exit Bmm main formset to send File Explorer formset.
- //
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
break;
case FORM_DRV_ADD_FILE_ID:
Private->FeCurrentState = FileExplorerStateAddDriverOptionState;
-
- //
- // Exit Bmm main formset to send File Explorer formset.
- //
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
break;
case FORM_DRV_ADD_HANDLE_ID:
@@ -543,10 +513,6 @@ BootMaintCallback (
UpdateTimeOutPage (Private);
break;
- case FORM_RESET:
- gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
- return EFI_UNSUPPORTED;
-
case FORM_CON_IN_ID:
case FORM_CON_OUT_ID:
case FORM_CON_ERR_ID:
@@ -572,25 +538,6 @@ BootMaintCallback (
UpdateSetLegacyDeviceOrderPage (QuestionId, Private);
break;
- case KEY_VALUE_SAVE_AND_EXIT:
- case KEY_VALUE_NO_SAVE_AND_EXIT:
-
- if (QuestionId == KEY_VALUE_SAVE_AND_EXIT) {
- Status = ApplyChangeHandler (Private, CurrentFakeNVMap, Private->BmmPreviousPageId);
- if (EFI_ERROR (Status)) {
- return Status;
- }
- } else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT) {
- DiscardChangeHandler (Private, CurrentFakeNVMap);
- }
-
- //
- // Tell browser not to ask for confirmation of changes,
- // since we have already applied or discarded.
- //
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
- break;
-
default:
break;
}
@@ -616,18 +563,44 @@ BootMaintCallback (
UpdateDriverAddHandleDescPage (Private);
}
}
+ } else if (Action == EFI_BROWSER_ACTION_CHANGED) {
+ if ((Value == NULL) || (ActionRequest == NULL)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ switch (QuestionId) {
+ case KEY_VALUE_SAVE_AND_EXIT:
+ case KEY_VALUE_NO_SAVE_AND_EXIT:
+ if (QuestionId == KEY_VALUE_SAVE_AND_EXIT) {
+ Status = ApplyChangeHandler (Private, CurrentFakeNVMap, Private->BmmPreviousPageId);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ } else if (QuestionId == KEY_VALUE_NO_SAVE_AND_EXIT) {
+ DiscardChangeHandler (Private, CurrentFakeNVMap);
+ }
- //
- // Pass changed uncommitted data back to Form Browser
- //
- Status = HiiSetBrowserData (&gBootMaintFormSetGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *) CurrentFakeNVMap, NULL);
- return Status;
+ //
+ // Tell browser not to ask for confirmation of changes,
+ // since we have already applied or discarded.
+ //
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_SUBMIT_EXIT;
+ break;
+
+ case FORM_RESET:
+ gRT->ResetSystem (EfiResetCold, EFI_SUCCESS, 0, NULL);
+ return EFI_UNSUPPORTED;
+
+ default:
+ break;
+ }
}
//
- // All other action return unsupported.
+ // Pass changed uncommitted data back to Form Browser
//
- return EFI_UNSUPPORTED;
+ HiiSetBrowserData (&gBootMaintFormSetGuid, mBootMaintStorageName, sizeof (BMM_FAKE_NV_DATA), (UINT8 *) CurrentFakeNVMap, NULL);
+ return EFI_SUCCESS;
}
/**
diff --git a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c
index b77e909ad..733632b9f 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c
+++ b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c
@@ -253,21 +253,27 @@ FileExplorerCallback (
FILE_EXPLORER_NV_DATA *NvRamMap;
EFI_STATUS Status;
- if (Action == EFI_BROWSER_ACTION_CHANGING) {
- if ((Value == NULL) || (ActionRequest == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- Status = EFI_SUCCESS;
- Private = FE_CALLBACK_DATA_FROM_THIS (This);
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
-
+ if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
//
- // Retrieve uncommitted data from Form Browser
+ // All other action return unsupported.
//
- NvRamMap = &Private->FeFakeNvData;
- HiiGetBrowserData (&gFileExploreFormSetGuid, mFileExplorerStorageName, sizeof (FILE_EXPLORER_NV_DATA), (UINT8 *) NvRamMap);
+ return EFI_UNSUPPORTED;
+ }
+
+ Status = EFI_SUCCESS;
+ Private = FE_CALLBACK_DATA_FROM_THIS (This);
+ //
+ // Retrieve uncommitted data from Form Browser
+ //
+ NvRamMap = &Private->FeFakeNvData;
+ HiiGetBrowserData (&gFileExploreFormSetGuid, mFileExplorerStorageName, sizeof (FILE_EXPLORER_NV_DATA), (UINT8 *) NvRamMap);
+
+ if (Action == EFI_BROWSER_ACTION_CHANGED) {
+ if ((Value == NULL) || (ActionRequest == NULL)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
if (QuestionId == KEY_VALUE_SAVE_AND_EXIT_BOOT || QuestionId == KEY_VALUE_SAVE_AND_EXIT_DRIVER) {
//
// Apply changes and exit formset
@@ -309,16 +315,16 @@ FileExplorerCallback (
// Exit File Explorer formset
//
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
- } else {
- if (UpdateFileExplorer (Private, QuestionId)) {
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
- }
}
-
- return Status;
+ } else if (Action == EFI_BROWSER_ACTION_CHANGING) {
+ if (Value == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ if (QuestionId >= FILE_OPTION_OFFSET) {
+ UpdateFileExplorer (Private, QuestionId);
+ }
}
- //
- // All other action return unsupported.
- //
- return EFI_UNSUPPORTED;
+
+ return Status;
}
diff --git a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h
index 1087db847..f0049a304 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h
+++ b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FormGuid.h
@@ -49,6 +49,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define FORM_BOOT_ADD_DESCRIPTION_ID 0x101F
#define FORM_DRIVER_ADD_FILE_DESCRIPTION_ID 0x1020
#define FORM_CON_MODE_ID 0x1021
+#define FORM_BOOT_FROM_FILE_ID 0x1022
#define MAXIMUM_FORM_ID 0x10FF
diff --git a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
index f77b9f82e..7d4f33d40 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
+++ b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
@@ -99,26 +99,26 @@ UpdatePageEnd (
0
);
- HiiCreateGotoOpCode (
+ HiiCreateActionOpCode (
mStartOpCodeHandle,
- FORM_MAIN_ID,
+ KEY_VALUE_SAVE_AND_EXIT,
STRING_TOKEN (STR_SAVE_AND_EXIT),
STRING_TOKEN (STR_NULL_STRING),
EFI_IFR_FLAG_CALLBACK,
- KEY_VALUE_SAVE_AND_EXIT
+ 0
);
}
//
// Ensure user can return to the main page.
//
- HiiCreateGotoOpCode (
+ HiiCreateActionOpCode (
mStartOpCodeHandle,
- FORM_MAIN_ID,
+ KEY_VALUE_NO_SAVE_AND_EXIT,
STRING_TOKEN (STR_NO_SAVE_AND_EXIT),
STRING_TOKEN (STR_NULL_STRING),
EFI_IFR_FLAG_CALLBACK,
- KEY_VALUE_NO_SAVE_AND_EXIT
+ 0
);
HiiUpdateForm (
diff --git a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
index ac7e61496..c4b83ba0f 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
+++ b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
@@ -673,14 +673,13 @@ Var_UpdateDriverOption (
&gEfiGlobalVariableGuid,
&DriverOrderListSize
);
- ASSERT (DriverOrderList != NULL);
NewDriverOrderList = AllocateZeroPool (DriverOrderListSize + sizeof (UINT16));
ASSERT (NewDriverOrderList != NULL);
- CopyMem (NewDriverOrderList, DriverOrderList, DriverOrderListSize);
- NewDriverOrderList[DriverOrderListSize / sizeof (UINT16)] = Index;
if (DriverOrderList != NULL) {
+ CopyMem (NewDriverOrderList, DriverOrderList, DriverOrderListSize);
EfiLibDeleteVariable (L"DriverOrder", &gEfiGlobalVariableGuid);
}
+ NewDriverOrderList[DriverOrderListSize / sizeof (UINT16)] = Index;
Status = gRT->SetVariable (
L"DriverOrder",
diff --git a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c
index 0a7561b18..f86d55594 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c
+++ b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/BootMngr/BootManager.c
@@ -95,7 +95,7 @@ BootManagerCallback (
LIST_ENTRY *Link;
UINT16 KeyCount;
- if (Action == EFI_BROWSER_ACTION_CHANGING) {
+ if (Action == EFI_BROWSER_ACTION_CHANGED) {
if ((Value == NULL) || (ActionRequest == NULL)) {
return EFI_INVALID_PARAMETER;
}
diff --git a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c
index d0bf76466..6cb9d6b7a 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c
+++ b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManager.c
@@ -133,35 +133,30 @@ DeviceManagerCallback (
{
UINTN CurIndex;
- if (Action == EFI_BROWSER_ACTION_CHANGING) {
- if ((Value == NULL) || (ActionRequest == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- gCallbackKey = QuestionId;
- if ((QuestionId < MAX_KEY_SECTION_LEN + NETWORK_DEVICE_LIST_KEY_OFFSET) && (QuestionId >= NETWORK_DEVICE_LIST_KEY_OFFSET)) {
- //
- // If user select the mac address, need to record mac address string to support next form show.
- //
- for (CurIndex = 0; CurIndex < mMacDeviceList.CurListLen; CurIndex ++) {
- if (mMacDeviceList.NodeList[CurIndex].QuestionId == QuestionId) {
- mSelectedMacAddrString = HiiGetString (gDeviceManagerPrivate.HiiHandle, mMacDeviceList.NodeList[CurIndex].PromptId, NULL);
- }
- }
- }
-
+ if (Action != EFI_BROWSER_ACTION_CHANGING) {
//
- // Request to exit SendForm(), so as to switch to selected form
+ // All other action return unsupported.
//
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
+ return EFI_UNSUPPORTED;
+ }
- return EFI_SUCCESS;
+ if (Value == NULL) {
+ return EFI_INVALID_PARAMETER;
}
- //
- // All other action return unsupported.
- //
- return EFI_UNSUPPORTED;
+ gCallbackKey = QuestionId;
+ if ((QuestionId < MAX_KEY_SECTION_LEN + NETWORK_DEVICE_LIST_KEY_OFFSET) && (QuestionId >= NETWORK_DEVICE_LIST_KEY_OFFSET)) {
+ //
+ // If user select the mac address, need to record mac address string to support next form show.
+ //
+ for (CurIndex = 0; CurIndex < mMacDeviceList.CurListLen; CurIndex ++) {
+ if (mMacDeviceList.NodeList[CurIndex].QuestionId == QuestionId) {
+ mSelectedMacAddrString = HiiGetString (gDeviceManagerPrivate.HiiHandle, mMacDeviceList.NodeList[CurIndex].PromptId, NULL);
+ }
+ }
+ }
+
+ return EFI_SUCCESS;
}
/**
@@ -873,7 +868,7 @@ CallDeviceManager (
AddNetworkMenu = TRUE;
HiiCreateGotoOpCode (
StartOpCodeHandle,
- DEVICE_MANAGER_FORM_ID,
+ INVALID_FORM_ID,
STRING_TOKEN (STR_FORM_NETWORK_DEVICE_LIST_TITLE),
STRING_TOKEN (STR_FORM_NETWORK_DEVICE_LIST_HELP),
EFI_IFR_FLAG_CALLBACK,
@@ -887,7 +882,7 @@ CallDeviceManager (
while (AddItemCount > 0) {
HiiCreateGotoOpCode (
StartOpCodeHandle,
- NETWORK_DEVICE_LIST_FORM_ID,
+ INVALID_FORM_ID,
mMacDeviceList.NodeList[mMacDeviceList.CurListLen - AddItemCount].PromptId,
STRING_TOKEN (STR_NETWORK_DEVICE_HELP),
EFI_IFR_FLAG_CALLBACK,
@@ -901,7 +896,7 @@ CallDeviceManager (
//
HiiCreateGotoOpCode (
StartOpCodeHandle,
- NETWORK_DEVICE_FORM_ID,
+ INVALID_FORM_ID,
Token,
TokenHelp,
EFI_IFR_FLAG_CALLBACK,
@@ -916,7 +911,7 @@ CallDeviceManager (
if (mNextShowFormId == DEVICE_MANAGER_FORM_ID) {
HiiCreateGotoOpCode (
StartOpCodeHandle,
- DEVICE_MANAGER_FORM_ID,
+ INVALID_FORM_ID,
Token,
TokenHelp,
EFI_IFR_FLAG_CALLBACK,
@@ -1097,7 +1092,7 @@ DriverHealthCallback (
OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
)
{
- if (Action == EFI_BROWSER_ACTION_CHANGING) {
+ if (Action == EFI_BROWSER_ACTION_CHANGED) {
if ((Value == NULL) || (ActionRequest == NULL)) {
return EFI_INVALID_PARAMETER;
}
diff --git a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManagerVfr.h b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManagerVfr.h
index 96e2c0a2c..b6b086600 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManagerVfr.h
+++ b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/DeviceMngr/DeviceManagerVfr.h
@@ -31,6 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define LABEL_VBIOS 0x0040
+#define INVALID_FORM_ID 0x0FFF
#define DEVICE_MANAGER_FORM_ID 0x1000
#define NETWORK_DEVICE_LIST_FORM_ID 0x1001
#define NETWORK_DEVICE_FORM_ID 0x1002
diff --git a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
index 8a8286a70..efecf7bec 100644
--- a/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
+++ b/edk2/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
@@ -175,23 +175,26 @@ FrontPageCallback (
CHAR8 *PlatformSupportedLanguages;
CHAR8 *BestLanguage;
- if (Action == EFI_BROWSER_ACTION_CHANGING) {
+ if (Action != EFI_BROWSER_ACTION_CHANGING && Action != EFI_BROWSER_ACTION_CHANGED) {
+ //
+ // All other action return unsupported.
+ //
+ return EFI_UNSUPPORTED;
+ }
+
+ gCallbackKey = QuestionId;
+
+ if (Action == EFI_BROWSER_ACTION_CHANGED) {
if ((Value == NULL) || (ActionRequest == NULL)) {
return EFI_INVALID_PARAMETER;
}
- gCallbackKey = QuestionId;
-
- //
- // The first 4 entries in the Front Page are to be GUARANTEED to remain constant so IHV's can
- // describe to their customers in documentation how to find their setup information (namely
- // under the device manager and specific buckets)
- //
switch (QuestionId) {
case FRONT_PAGE_KEY_CONTINUE:
//
// This is the continue - clear the screen and return an error to get out of FrontPage loop
//
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
break;
case FRONT_PAGE_KEY_LANGUAGE:
@@ -250,11 +253,27 @@ FrontPageCallback (
ASSERT (FALSE);
}
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
+
FreePool (PlatformSupportedLanguages);
FreePool (Lang);
FreePool (LanguageString);
break;
+ default:
+ break;
+ }
+ } else if (Action == EFI_BROWSER_ACTION_CHANGING) {
+ if (Value == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // The first 4 entries in the Front Page are to be GUARANTEED to remain constant so IHV's can
+ // describe to their customers in documentation how to find their setup information (namely
+ // under the device manager and specific buckets)
+ //
+ switch (QuestionId) {
case FRONT_PAGE_KEY_BOOT_MANAGER:
//
// Boot Manager
@@ -277,16 +296,9 @@ FrontPageCallback (
gCallbackKey = 0;
break;
}
-
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
-
- return EFI_SUCCESS;
}
- //
- // All other action return unsupported.
- //
- return EFI_UNSUPPORTED;
+ return EFI_SUCCESS;
}
/**
@@ -1181,6 +1193,7 @@ PlatformBdsEnterFrontPage (
BootLogo->SetBootLogo (BootLogo, NULL, 0, 0, 0, 0);
}
+ Status = EFI_SUCCESS;
do {
//
// Set proper video resolution and text mode for setup
@@ -1195,7 +1208,7 @@ PlatformBdsEnterFrontPage (
UpdateFrontPageStrings ();
gCallbackKey = 0;
- Status = CallFrontPage ();
+ CallFrontPage ();
//
// If gCallbackKey is greater than 1 and less or equal to 5,