]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigImpl.c
1. Add EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName() support.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / VlanConfigDxe / VlanConfigImpl.c
index f992cea07b80bc6a742f86d40dbf4543d9e019c3..10fb7fa670b5bb329154af2989ba50cd4a667001 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   HII Config Access protocol implementation of VLAN configuration module.\r
 \r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2012, 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
@@ -489,6 +489,7 @@ InstallVlanConfigForm (
   CHAR16                          *MacString;\r
   EFI_DEVICE_PATH_PROTOCOL        *ChildDevicePath;\r
   EFI_HII_CONFIG_ACCESS_PROTOCOL  *ConfigAccess;\r
+  EFI_VLAN_CONFIG_PROTOCOL        *VlanConfig;\r
 \r
   //\r
   // Create child handle and install HII Config Access Protocol\r
@@ -517,6 +518,22 @@ InstallVlanConfigForm (
   }\r
   PrivateData->DriverHandle = DriverHandle;\r
 \r
+  //\r
+  // Establish the parent-child relationship between the new created\r
+  // child handle and the ControllerHandle.\r
+  //\r
+  Status = gBS->OpenProtocol (\r
+                  PrivateData->ControllerHandle,\r
+                  &gEfiVlanConfigProtocolGuid,\r
+                  (VOID **)&VlanConfig,\r
+                  PrivateData->ImageHandle,\r
+                  PrivateData->DriverHandle,\r
+                  EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER\r
+                  );\r
+  if (EFI_ERROR (Status)) {\r
+    return Status;\r
+  }\r
+\r
   //\r
   // Publish the HII package list\r
   //\r
@@ -593,6 +610,16 @@ UninstallVlanConfigForm (
     PrivateData->HiiHandle = NULL;\r
   }\r
 \r
+  //\r
+  // End the parent-child relationship.\r
+  //\r
+  gBS->CloseProtocol (\r
+         PrivateData->ControllerHandle,\r
+         &gEfiVlanConfigProtocolGuid,\r
+         PrivateData->ImageHandle,\r
+         PrivateData->DriverHandle\r
+         );\r
+\r
   //\r
   // Uninstall HII Config Access Protocol\r
   //\r