Update to NOT to use EFI_BROWSER_ACTION_FORM_OPEN in Callback function thus able to function properly in UEFI2.1 platform.

Signed-off-by: tye
Reviewed-by: lgao4
Reviewed-by: xdu2

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12197 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
tye1 2011-08-24 10:53:54 +00:00
parent 83f1f16a83
commit 9ea13d7900
4 changed files with 23 additions and 17 deletions

View File

@ -1,7 +1,7 @@
///** @file
// VLAN configuration formset.
//
// Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
// 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
@ -26,6 +26,17 @@ formset
name = VlanNvData,
guid = VLAN_CONFIG_PRIVATE_GUID;
form formid = VLAN_HEAD_FORM_ID,
title = STRING_TOKEN(STR_VLAN_FORM_TITLE);
goto VLAN_CONFIGURATION_FORM_ID,
prompt = STRING_TOKEN (STR_GET_CURRENT_SETTING),
help = STRING_TOKEN (STR_GET_CURRENT_SETTING_HELP),
flags = INTERACTIVE,
key = VLAN_UPDATE_QUESTION_ID;
endform;
form formid = VLAN_CONFIGURATION_FORM_ID,
title = STRING_TOKEN(STR_VLAN_FORM_TITLE);

View File

@ -236,21 +236,7 @@ VlanCallback (
PrivateData = VLAN_CONFIG_PRIVATE_DATA_FROM_THIS (This);
if (Action == EFI_BROWSER_ACTION_FORM_OPEN) {
if (QuestionId == VLAN_ADD_QUESTION_ID) {
//
// Update current VLAN list into Form when Form is opened.
// This will be done only in FORM_OPEN CallBack of question with VLAN_ADD_QUESTION_ID.
//
VlanUpdateForm (PrivateData);
}
return EFI_SUCCESS;
}
if (Action == EFI_BROWSER_ACTION_FORM_CLOSE) {
//
// Do nothing for UEFI FORM_CLOSE action
//
if ((Action == EFI_BROWSER_ACTION_FORM_OPEN) || (Action == EFI_BROWSER_ACTION_FORM_CLOSE)) {
return EFI_SUCCESS;
}
@ -319,6 +305,13 @@ VlanCallback (
ZeroMem (Configuration->VlanList, MAX_VLAN_NUMBER);
break;
case VLAN_UPDATE_QUESTION_ID:
//
// Update current VLAN list into Form.
//
VlanUpdateForm (PrivateData);
break;
default:
break;
}

View File

@ -1,7 +1,7 @@
/** @file
Header file for NV data structure definition.
Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
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
@ -26,9 +26,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define VLAN_CONFIGURATION_VARSTORE_ID 0x0001
#define VLAN_CONFIGURATION_FORM_ID 0x0001
#define VLAN_HEAD_FORM_ID 0x0002
#define VLAN_ADD_QUESTION_ID 0x1000
#define VLAN_REMOVE_QUESTION_ID 0x2000
#define VLAN_UPDATE_QUESTION_ID 0x3000
#define LABEL_VLAN_LIST 0x0001
#define LABEL_END 0xffff