X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FVlanConfigDxe%2FVlanConfigImpl.c;fp=MdeModulePkg%2FUniversal%2FNetwork%2FVlanConfigDxe%2FVlanConfigImpl.c;h=dfcf7a3d9c2c316834bf64d09cb7a231f2831aac;hb=083f7c69c171ffe2474748c5b78e913623cfd051;hp=871199e7b96ed22d1d6ef63a2f3866e779ddbe99;hpb=4fdb97fa6eecb7a7750c54fd402996cf2354ef88;p=mirror_edk2.git 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.
+Copyright (c) 2009 - 2011, 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 @@ -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; }