summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/VlanConfigDxe
diff options
context:
space:
mode:
authorydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-05-20 02:48:59 +0000
committerydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524>2011-05-20 02:48:59 +0000
commit083f7c69c171ffe2474748c5b78e913623cfd051 (patch)
treebf9f61f5743d51328654c11a6f0e75bc8642a3b0 /MdeModulePkg/Universal/Network/VlanConfigDxe
parent4fdb97fa6eecb7a7750c54fd402996cf2354ef88 (diff)
downloadedk2-platforms-083f7c69c171ffe2474748c5b78e913623cfd051.tar.xz
Refine some call back function to return EFI_UNSUPPORTED for all unsupported call back type.
Signed-off-by: ydong10 Reviewed-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11686 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/VlanConfigDxe')
-rw-r--r--MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c119
1 files changed, 63 insertions, 56 deletions
diff --git a/MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c b/MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c
index 871199e7b9..dfcf7a3d9c 100644
--- a/MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c
+++ b/MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c
@@ -1,7 +1,7 @@
/** @file
HII Config Access protocol implementation of VLAN configuration module.
-Copyright (c) 2009 - 2010, 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
@@ -254,77 +254,84 @@ VlanCallback (
return EFI_SUCCESS;
}
- //
- // Get Browser data
- //
- Configuration = AllocateZeroPool (sizeof (VLAN_CONFIGURATION));
- ASSERT (Configuration != NULL);
- HiiGetBrowserData (&mVlanFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration);
-
- VlanConfig = PrivateData->VlanConfig;
-
- switch (QuestionId) {
- case VLAN_ADD_QUESTION_ID:
+ if (Action == EFI_BROWSER_ACTION_CHANGING) {
//
- // Add a VLAN
+ // Get Browser data
//
- VlanConfig->Set (VlanConfig, Configuration->VlanId, Configuration->Priority);
- VlanUpdateForm (PrivateData);
+ Configuration = AllocateZeroPool (sizeof (VLAN_CONFIGURATION));
+ ASSERT (Configuration != NULL);
+ HiiGetBrowserData (&mVlanFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration);
- //
- // Connect the newly created VLAN device
- //
- VlanHandle = NetLibGetVlanHandle (PrivateData->ControllerHandle, Configuration->VlanId);
- if (VlanHandle == NULL) {
+ VlanConfig = PrivateData->VlanConfig;
+
+ switch (QuestionId) {
+ case VLAN_ADD_QUESTION_ID:
//
- // There may be no child handle created for VLAN ID 0, connect the parent handle
+ // Add a VLAN
//
- VlanHandle = PrivateData->ControllerHandle;
- }
- gBS->ConnectController (VlanHandle, NULL, NULL, TRUE);
-
- //
- // Clear UI data
- //
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
- Configuration->VlanId = 0;
- Configuration->Priority = 0;
- break;
+ VlanConfig->Set (VlanConfig, Configuration->VlanId, Configuration->Priority);
+ VlanUpdateForm (PrivateData);
- case VLAN_REMOVE_QUESTION_ID:
- //
- // Remove VLAN
- //
- ASSERT (PrivateData->NumberOfVlan <= MAX_VLAN_NUMBER);
- for (Index = 0; Index < PrivateData->NumberOfVlan; Index++) {
- if (Configuration->VlanList[Index] != 0) {
+ //
+ // Connect the newly created VLAN device
+ //
+ VlanHandle = NetLibGetVlanHandle (PrivateData->ControllerHandle, Configuration->VlanId);
+ if (VlanHandle == NULL) {
//
- // Checkbox is selected, need remove this VLAN
+ // There may be no child handle created for VLAN ID 0, connect the parent handle
//
- VlanConfig->Remove (VlanConfig, PrivateData->VlanId[Index]);
+ VlanHandle = PrivateData->ControllerHandle;
}
- }
+ gBS->ConnectController (VlanHandle, NULL, NULL, TRUE);
- VlanUpdateForm (PrivateData);
- if (PrivateData->NumberOfVlan == 0) {
//
- // No VLAN device now, connect the physical NIC handle.
- // Note: PrivateData->NumberOfVlan has been updated by VlanUpdateForm()
+ // Clear UI data
//
- gBS->ConnectController (PrivateData->ControllerHandle, NULL, NULL, TRUE);
- }
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
+ Configuration->VlanId = 0;
+ Configuration->Priority = 0;
+ break;
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
- ZeroMem (Configuration->VlanList, MAX_VLAN_NUMBER);
- break;
+ case VLAN_REMOVE_QUESTION_ID:
+ //
+ // Remove VLAN
+ //
+ ASSERT (PrivateData->NumberOfVlan <= MAX_VLAN_NUMBER);
+ for (Index = 0; Index < PrivateData->NumberOfVlan; Index++) {
+ if (Configuration->VlanList[Index] != 0) {
+ //
+ // Checkbox is selected, need remove this VLAN
+ //
+ VlanConfig->Remove (VlanConfig, PrivateData->VlanId[Index]);
+ }
+ }
- default:
- break;
+ VlanUpdateForm (PrivateData);
+ if (PrivateData->NumberOfVlan == 0) {
+ //
+ // No VLAN device now, connect the physical NIC handle.
+ // Note: PrivateData->NumberOfVlan has been updated by VlanUpdateForm()
+ //
+ gBS->ConnectController (PrivateData->ControllerHandle, NULL, NULL, TRUE);
+ }
+
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
+ ZeroMem (Configuration->VlanList, MAX_VLAN_NUMBER);
+ break;
+
+ default:
+ break;
+ }
+
+ HiiSetBrowserData (&mVlanFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration, NULL);
+ FreePool (Configuration);
+ return EFI_SUCCESS;
}
- HiiSetBrowserData (&mVlanFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration, NULL);
- FreePool (Configuration);
- return EFI_SUCCESS;
+ //
+ // All other action return unsupported.
+ //
+ return EFI_UNSUPPORTED;
}