/** @file\r
HII Config Access protocol implementation of VLAN configuration module.\r
\r
-Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions\r
of the BSD License which accompanies this distribution. The full\r
return EFI_SUCCESS;\r
}\r
\r
- //\r
- // Get Browser data\r
- //\r
- Configuration = AllocateZeroPool (sizeof (VLAN_CONFIGURATION));\r
- ASSERT (Configuration != NULL);\r
- HiiGetBrowserData (&mVlanFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration);\r
-\r
- VlanConfig = PrivateData->VlanConfig;\r
-\r
- switch (QuestionId) {\r
- case VLAN_ADD_QUESTION_ID:\r
+ if (Action == EFI_BROWSER_ACTION_CHANGING) {\r
//\r
- // Add a VLAN\r
+ // Get Browser data\r
//\r
- VlanConfig->Set (VlanConfig, Configuration->VlanId, Configuration->Priority);\r
- VlanUpdateForm (PrivateData);\r
+ Configuration = AllocateZeroPool (sizeof (VLAN_CONFIGURATION));\r
+ ASSERT (Configuration != NULL);\r
+ HiiGetBrowserData (&mVlanFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration);\r
\r
- //\r
- // Connect the newly created VLAN device\r
- //\r
- VlanHandle = NetLibGetVlanHandle (PrivateData->ControllerHandle, Configuration->VlanId);\r
- if (VlanHandle == NULL) {\r
+ VlanConfig = PrivateData->VlanConfig;\r
+\r
+ switch (QuestionId) {\r
+ case VLAN_ADD_QUESTION_ID:\r
//\r
- // There may be no child handle created for VLAN ID 0, connect the parent handle\r
+ // Add a VLAN\r
//\r
- VlanHandle = PrivateData->ControllerHandle;\r
- }\r
- gBS->ConnectController (VlanHandle, NULL, NULL, TRUE);\r
-\r
- //\r
- // Clear UI data\r
- //\r
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;\r
- Configuration->VlanId = 0;\r
- Configuration->Priority = 0;\r
- break;\r
+ VlanConfig->Set (VlanConfig, Configuration->VlanId, Configuration->Priority);\r
+ VlanUpdateForm (PrivateData);\r
\r
- case VLAN_REMOVE_QUESTION_ID:\r
- //\r
- // Remove VLAN\r
- //\r
- ASSERT (PrivateData->NumberOfVlan <= MAX_VLAN_NUMBER);\r
- for (Index = 0; Index < PrivateData->NumberOfVlan; Index++) {\r
- if (Configuration->VlanList[Index] != 0) {\r
+ //\r
+ // Connect the newly created VLAN device\r
+ //\r
+ VlanHandle = NetLibGetVlanHandle (PrivateData->ControllerHandle, Configuration->VlanId);\r
+ if (VlanHandle == NULL) {\r
//\r
- // Checkbox is selected, need remove this VLAN\r
+ // There may be no child handle created for VLAN ID 0, connect the parent handle\r
//\r
- VlanConfig->Remove (VlanConfig, PrivateData->VlanId[Index]);\r
+ VlanHandle = PrivateData->ControllerHandle;\r
}\r
- }\r
+ gBS->ConnectController (VlanHandle, NULL, NULL, TRUE);\r
\r
- VlanUpdateForm (PrivateData);\r
- if (PrivateData->NumberOfVlan == 0) {\r
//\r
- // No VLAN device now, connect the physical NIC handle.\r
- // Note: PrivateData->NumberOfVlan has been updated by VlanUpdateForm()\r
+ // Clear UI data\r
//\r
- gBS->ConnectController (PrivateData->ControllerHandle, NULL, NULL, TRUE);\r
- }\r
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;\r
+ Configuration->VlanId = 0;\r
+ Configuration->Priority = 0;\r
+ break;\r
\r
- *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;\r
- ZeroMem (Configuration->VlanList, MAX_VLAN_NUMBER);\r
- break;\r
+ case VLAN_REMOVE_QUESTION_ID:\r
+ //\r
+ // Remove VLAN\r
+ //\r
+ ASSERT (PrivateData->NumberOfVlan <= MAX_VLAN_NUMBER);\r
+ for (Index = 0; Index < PrivateData->NumberOfVlan; Index++) {\r
+ if (Configuration->VlanList[Index] != 0) {\r
+ //\r
+ // Checkbox is selected, need remove this VLAN\r
+ //\r
+ VlanConfig->Remove (VlanConfig, PrivateData->VlanId[Index]);\r
+ }\r
+ }\r
\r
- default:\r
- break;\r
+ VlanUpdateForm (PrivateData);\r
+ if (PrivateData->NumberOfVlan == 0) {\r
+ //\r
+ // No VLAN device now, connect the physical NIC handle.\r
+ // Note: PrivateData->NumberOfVlan has been updated by VlanUpdateForm()\r
+ //\r
+ gBS->ConnectController (PrivateData->ControllerHandle, NULL, NULL, TRUE);\r
+ }\r
+\r
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;\r
+ ZeroMem (Configuration->VlanList, MAX_VLAN_NUMBER);\r
+ break;\r
+\r
+ default:\r
+ break;\r
+ }\r
+\r
+ HiiSetBrowserData (&mVlanFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration, NULL);\r
+ FreePool (Configuration);\r
+ return EFI_SUCCESS;\r
}\r
\r
- HiiSetBrowserData (&mVlanFormSetGuid, mVlanStorageName, sizeof (VLAN_CONFIGURATION), (UINT8 *) Configuration, NULL);\r
- FreePool (Configuration);\r
- return EFI_SUCCESS;\r
+ //\r
+ // All other action return unsupported.\r
+ //\r
+ return EFI_UNSUPPORTED;\r
}\r
\r
\r