X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=NetworkPkg%2FApplication%2FVConfig%2FVConfig.c;fp=NetworkPkg%2FApplication%2FVConfig%2FVConfig.c;h=d00a041f492837bd6ea5877457b10299570b0ecf;hp=ba1720705c0e711e4e9576fa717aff09443beecb;hb=be6cd654eb27370bfa127dd387846ad983f4ef72;hpb=fa848a4048943251fc057fe8d6c5a82e01d2ffb6
diff --git a/NetworkPkg/Application/VConfig/VConfig.c b/NetworkPkg/Application/VConfig/VConfig.c
index ba1720705c..d00a041f49 100644
--- a/NetworkPkg/Application/VConfig/VConfig.c
+++ b/NetworkPkg/Application/VConfig/VConfig.c
@@ -1,7 +1,7 @@
/** @file
Shell application for VLAN configuration.
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2016, 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
@@ -23,8 +23,14 @@
#include
#include
#include
+#include
#include
+//
+// String token ID of VConfig command help message text.
+//
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringVConfigHelpTokenId = STRING_TOKEN (STR_VCONFIG_HELP);
+
#define INVALID_NIC_INDEX 0xffff
#define INVALID_VLAN_ID 0xffff
@@ -608,13 +614,39 @@ VlanConfigMain (
{
LIST_ENTRY *List;
CONST CHAR16 *Str;
+ EFI_HII_PACKAGE_LIST_HEADER *PackageList;
+ EFI_STATUS Status;
mImageHandle = ImageHandle;
+
+ //
+ // Retrieve HII package list from ImageHandle
+ //
+ Status = gBS->OpenProtocol (
+ ImageHandle,
+ &gEfiHiiPackageListProtocolGuid,
+ (VOID **) &PackageList,
+ ImageHandle,
+ NULL,
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
//
- // Register our string package to HII database.
+ // Publish HII package list to HII Database.
//
- mHiiHandle = HiiAddPackages (&gEfiCallerIdGuid, ImageHandle, VConfigStrings, NULL);
+ Status = gHiiDatabase->NewPackageList (
+ gHiiDatabase,
+ PackageList,
+ NULL,
+ &mHiiHandle
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
if (mHiiHandle == NULL) {
return EFI_SUCCESS;
}
@@ -626,11 +658,6 @@ VlanConfigMain (
goto Exit;
}
- if (ShellCommandLineGetFlag (List, L"-?")) {
- ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_VCONFIG_HELP), mHiiHandle);
- goto Exit;
- }
-
if (ShellCommandLineGetFlag (List, L"-l")) {
Str = ShellCommandLineGetValue (List, L"-l");
DisplayVlan ((CHAR16 *) Str);