Retire Extended HII library class.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8011 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -39,6 +39,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#include <Protocol/DevicePathToText.h>
|
||||
#include <Protocol/DevicePath.h>
|
||||
|
||||
#include <Library/DevicePathLib.h>
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/UefiLib.h>
|
||||
@@ -47,7 +48,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#include <Library/PlatformDriverOverrideLib.h>
|
||||
#include <Library/HiiLib.h>
|
||||
#include <Library/IfrSupportLib.h>
|
||||
#include <Library/ExtendedHiiLib.h>
|
||||
#include <Library/ExtendedIfrSupportLib.h>
|
||||
#include <Library/BaseMemoryLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
@@ -66,6 +66,18 @@ typedef struct {
|
||||
EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;
|
||||
} EFI_CALLBACK_INFO;
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
///
|
||||
/// HII specific Vendor Device Path definition.
|
||||
///
|
||||
typedef struct {
|
||||
VENDOR_DEVICE_PATH VendorDevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL End;
|
||||
} HII_VENDOR_DEVICE_PATH;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
//
|
||||
// uni string and Vfr Binary data.
|
||||
//
|
||||
@@ -92,6 +104,31 @@ UINTN mSelectedDriverImageNum;
|
||||
UINTN mLastSavedDriverImageNum;
|
||||
UINT16 mCurrentPage;
|
||||
|
||||
HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath = {
|
||||
{
|
||||
{
|
||||
HARDWARE_DEVICE_PATH,
|
||||
HW_VENDOR_DP,
|
||||
{
|
||||
(UINT8) (sizeof (VENDOR_DEVICE_PATH)),
|
||||
(UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
|
||||
}
|
||||
},
|
||||
//
|
||||
// {99936717-BF3D-4b04-9787-76CEE324D76F}
|
||||
//
|
||||
{ 0x99936717, 0xbf3d, 0x4b04, { 0x97, 0x87, 0x76, 0xce, 0xe3, 0x24, 0xd7, 0x6f } }
|
||||
},
|
||||
{
|
||||
END_DEVICE_PATH_TYPE,
|
||||
END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
{
|
||||
(UINT8) (END_DEVICE_PATH_LENGTH),
|
||||
(UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
Converting a given device to an unicode string.
|
||||
|
||||
@@ -1276,8 +1313,7 @@ PlatOverMngrInit (
|
||||
EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
|
||||
EFI_HII_PACKAGE_LIST_HEADER *PackageList;
|
||||
EFI_CALLBACK_INFO *CallbackInfo;
|
||||
EFI_HANDLE DriverHandle;
|
||||
EFI_FORM_BROWSER2_PROTOCOL *FormBrowser2;
|
||||
EFI_FORM_BROWSER2_PROTOCOL *FormBrowser2;
|
||||
|
||||
//
|
||||
// There should only be one HII protocol
|
||||
@@ -1314,22 +1350,15 @@ PlatOverMngrInit (
|
||||
CallbackInfo->ConfigAccess.Callback = PlatOverMngrCallback;
|
||||
|
||||
//
|
||||
// Create driver handle used by HII database
|
||||
// Install Device Path Protocol and Config Access protocol to driver handle
|
||||
//
|
||||
Status = HiiLibCreateHiiDriverHandle (&DriverHandle);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Finish;
|
||||
}
|
||||
CallbackInfo->DriverHandle = DriverHandle;
|
||||
|
||||
//
|
||||
// Install Config Access protocol to driver handle
|
||||
//
|
||||
Status = gBS->InstallProtocolInterface (
|
||||
&DriverHandle,
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&CallbackInfo->DriverHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
&mHiiVendorDevicePath,
|
||||
&gEfiHiiConfigAccessProtocolGuid,
|
||||
EFI_NATIVE_INTERFACE,
|
||||
&CallbackInfo->ConfigAccess
|
||||
&CallbackInfo->ConfigAccess,
|
||||
NULL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Finish;
|
||||
@@ -1349,7 +1378,7 @@ PlatOverMngrInit (
|
||||
Status = HiiDatabase->NewPackageList (
|
||||
HiiDatabase,
|
||||
PackageList,
|
||||
DriverHandle,
|
||||
CallbackInfo->DriverHandle,
|
||||
&CallbackInfo->RegisteredHandle
|
||||
);
|
||||
FreePool (PackageList);
|
||||
@@ -1405,7 +1434,14 @@ PlatOverMngrInit (
|
||||
|
||||
Finish:
|
||||
if (CallbackInfo->DriverHandle != NULL) {
|
||||
HiiLibDestroyHiiDriverHandle (CallbackInfo->DriverHandle);
|
||||
gBS->UninstallMultipleProtocolInterfaces (
|
||||
CallbackInfo->DriverHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
&mHiiVendorDevicePath,
|
||||
&gEfiHiiConfigAccessProtocolGuid,
|
||||
&CallbackInfo->ConfigAccess,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
if (CallbackInfo != NULL) {
|
||||
FreePool (CallbackInfo);
|
||||
|
@@ -58,7 +58,6 @@
|
||||
PlatformDriverOverrideLib
|
||||
HiiLib
|
||||
IfrSupportLib
|
||||
ExtendedHiiLib
|
||||
ExtendedIfrSupportLib
|
||||
BaseMemoryLib
|
||||
MemoryAllocationLib
|
||||
@@ -85,4 +84,4 @@
|
||||
gEfiFormBrowser2ProtocolGuid ## CONSUMED
|
||||
gEfiHiiConfigRoutingProtocolGuid ## CONSUMED
|
||||
gEfiHiiConfigAccessProtocolGuid ## PRODUCED
|
||||
gEfiDevicePathToTextProtocolGuid ## CONSUMED
|
||||
gEfiDevicePathToTextProtocolGuid ## CONSUMED
|
||||
|
@@ -25,26 +25,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#define BROWSER_STATE_VALIDATE_PASSWORD 0
|
||||
#define BROWSER_STATE_SET_PASSWORD 1
|
||||
|
||||
|
||||
///
|
||||
/// HII specific Vendor Device Path Node definition.
|
||||
///
|
||||
#pragma pack(1)
|
||||
typedef struct {
|
||||
VENDOR_DEVICE_PATH VendorDevicePath;
|
||||
UINT32 Reserved;
|
||||
UINT64 UniqueId;
|
||||
} HII_VENDOR_DEVICE_PATH_NODE;
|
||||
#pragma pack()
|
||||
|
||||
///
|
||||
/// HII specific Vendor Device Path definition.
|
||||
///
|
||||
typedef struct {
|
||||
HII_VENDOR_DEVICE_PATH_NODE Node;
|
||||
EFI_DEVICE_PATH_PROTOCOL End;
|
||||
} HII_VENDOR_DEVICE_PATH;
|
||||
|
||||
///
|
||||
/// GUIDed opcodes defined for EDKII implementation
|
||||
///
|
||||
|
@@ -1,57 +0,0 @@
|
||||
/** @file
|
||||
This library includes two extended HII functions to
|
||||
create and destory Hii Package by create the virtual Driver Handle.
|
||||
|
||||
Copyright (c) 2008, Intel Corporation. <BR>
|
||||
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 text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#ifndef __EXTENDED_HII_LIB_H__
|
||||
#define __EXTENDED_HII_LIB_H__
|
||||
|
||||
/**
|
||||
The HII driver handle passed in for HiiDatabase.NewPackageList() requires
|
||||
that there should be DevicePath Protocol installed on it.
|
||||
This routine create a virtual Driver Handle by installing a vendor device
|
||||
path on it, so as to use it to invoke HiiDatabase.NewPackageList().
|
||||
The Device Path created is a Vendor Device Path specific to Intel's implemenation
|
||||
and it is defined as HII_VENDOR_DEVICE_PATH_NODE.
|
||||
|
||||
|
||||
@param DriverHandle Handle to be returned
|
||||
|
||||
@retval EFI_SUCCESS Handle destroy success.
|
||||
@retval EFI_OUT_OF_RESOURCES Not enough memory.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
HiiLibCreateHiiDriverHandle (
|
||||
OUT EFI_HANDLE *DriverHandle
|
||||
);
|
||||
|
||||
/**
|
||||
Destroy the Driver Handle created by CreateHiiDriverHandle().
|
||||
|
||||
If no Device Path protocol is installed on the DriverHandle, then ASSERT.
|
||||
If this Device Path protocol is failed to be uninstalled, then ASSERT.
|
||||
|
||||
@param DriverHandle Handle returned by CreateHiiDriverHandle()
|
||||
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
HiiLibDestroyHiiDriverHandle (
|
||||
IN EFI_HANDLE DriverHandle
|
||||
);
|
||||
|
||||
|
||||
#endif
|
@@ -1,145 +0,0 @@
|
||||
/** @file
|
||||
Library instance for ExtendedHiiLib.
|
||||
|
||||
This library instance implements the common HII routines which is
|
||||
related to HII but reference data structures that are not defined in
|
||||
UEFI specification, for example HII_VENDOR_DEVICE_PATH.
|
||||
|
||||
|
||||
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||
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 text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#include <Uefi.h>
|
||||
#include <Protocol/DevicePath.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/DevicePathLib.h>
|
||||
#include <Guid/MdeModuleHii.h>
|
||||
|
||||
|
||||
//
|
||||
// Hii vendor device path template
|
||||
//
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED CONST HII_VENDOR_DEVICE_PATH mHiiVendorDevicePathTemplate = {
|
||||
{
|
||||
{
|
||||
{
|
||||
HARDWARE_DEVICE_PATH,
|
||||
HW_VENDOR_DP,
|
||||
{
|
||||
(UINT8) (sizeof (HII_VENDOR_DEVICE_PATH_NODE)),
|
||||
(UINT8) ((sizeof (HII_VENDOR_DEVICE_PATH_NODE)) >> 8)
|
||||
}
|
||||
},
|
||||
EFI_IFR_TIANO_GUID
|
||||
},
|
||||
0,
|
||||
0
|
||||
},
|
||||
{
|
||||
END_DEVICE_PATH_TYPE,
|
||||
END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
{
|
||||
END_DEVICE_PATH_LENGTH
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
The HII driver handle passed in for HiiDatabase.NewPackageList() requires
|
||||
that there should be DevicePath Protocol installed on it.
|
||||
This routine create a virtual Driver Handle by installing a vendor device
|
||||
path on it, so as to use it to invoke HiiDatabase.NewPackageList().
|
||||
The Device Path created is a Vendor Device Path specific to Intel's implemenation
|
||||
and it is defined as HII_VENDOR_DEVICE_PATH_NODE.
|
||||
|
||||
|
||||
@param DriverHandle Handle to be returned
|
||||
|
||||
@retval EFI_SUCCESS Handle destroy success.
|
||||
@retval EFI_OUT_OF_RESOURCES Not enough memory.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
HiiLibCreateHiiDriverHandle (
|
||||
OUT EFI_HANDLE *DriverHandle
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
HII_VENDOR_DEVICE_PATH_NODE *VendorDevicePath;
|
||||
|
||||
VendorDevicePath = AllocateCopyPool (sizeof (HII_VENDOR_DEVICE_PATH), &mHiiVendorDevicePathTemplate);
|
||||
if (VendorDevicePath == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
//
|
||||
// Use memory address as unique ID to distinguish from different device paths
|
||||
//
|
||||
VendorDevicePath->UniqueId = (UINT64) ((UINTN) VendorDevicePath);
|
||||
|
||||
*DriverHandle = NULL;
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
DriverHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
VendorDevicePath,
|
||||
NULL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Destroy the Driver Handle created by CreateHiiDriverHandle().
|
||||
|
||||
If no Device Path protocol is installed on the DriverHandle, then ASSERT.
|
||||
If this Device Path protocol is failed to be uninstalled, then ASSERT.
|
||||
|
||||
@param DriverHandle Handle returned by CreateHiiDriverHandle()
|
||||
|
||||
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
HiiLibDestroyHiiDriverHandle (
|
||||
IN EFI_HANDLE DriverHandle
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
|
||||
Status = gBS->HandleProtocol (
|
||||
DriverHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
(VOID **) &DevicePath
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
Status = gBS->UninstallProtocolInterface (
|
||||
DriverHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
DevicePath
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
FreePool (DevicePath);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,48 +0,0 @@
|
||||
#/** @file
|
||||
#
|
||||
# Library instance for ExtendedHiiLib.
|
||||
#
|
||||
# This library instance implements the common HII routines which is
|
||||
# related to HII but reference data structures that are not defined in
|
||||
# UEFI specification, for example HII_VENDOR_DEVICE_PATH.
|
||||
#
|
||||
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||
# 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 text of the license may be found at
|
||||
# http://opensource.org/licenses/bsd-license.php
|
||||
#
|
||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#
|
||||
#**/
|
||||
|
||||
[Defines]
|
||||
INF_VERSION = 0x00010005
|
||||
BASE_NAME = ExtendedHiiLib
|
||||
FILE_GUID = 35961516-ABA1-4636-A4C0-608E62BE8BB0
|
||||
MODULE_TYPE = DXE_DRIVER
|
||||
VERSION_STRING = 1.0
|
||||
LIBRARY_CLASS = ExtendedHiiLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
|
||||
EFI_SPECIFICATION_VERSION = 0x0002000A
|
||||
|
||||
#
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||
#
|
||||
|
||||
[Sources.common]
|
||||
ExtendedHiiLib.c
|
||||
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
MemoryAllocationLib
|
||||
DebugLib
|
||||
DevicePathLib
|
||||
|
||||
[Protocols]
|
||||
gEfiDevicePathProtocolGuid ## SOMETIMES_PRODUCES
|
||||
|
@@ -60,11 +60,6 @@
|
||||
## @libraryclass Provides a set of interfaces to do IFR opcode creation and interact with a UEFI Form Browser.
|
||||
IfrSupportLib|Include/Library/IfrSupportLib.h
|
||||
|
||||
## @libraryclass Includes two extended HII functions to create and destory Hii Package
|
||||
# by create the virtual Driver Handle.
|
||||
##
|
||||
ExtendedHiiLib|Include/Library/ExtendedHiiLib.h
|
||||
|
||||
## @libraryclass Defines APIs that is related to IFR operations but specific to EDK II
|
||||
# implementation.
|
||||
##
|
||||
|
@@ -62,7 +62,6 @@
|
||||
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
|
||||
UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
|
||||
UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
|
||||
ExtendedHiiLib|MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.inf
|
||||
UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
|
||||
NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
|
||||
IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
|
||||
@@ -276,7 +275,6 @@
|
||||
MdeModulePkg/Library/DxePlatDriOverLib/DxePlatDriOverLib.inf
|
||||
MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
|
||||
MdeModulePkg/Library/DxePrintLibPrint2Protocol/DxePrintLibPrint2Protocol.inf
|
||||
MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.inf
|
||||
MdeModulePkg/Library/ExtendedIfrSupportLib/ExtendedIfrSupportLib.inf
|
||||
MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
|
||||
MdeModulePkg/Library/PeiRecoveryLibNull/PeiRecoveryLibNull.inf
|
||||
|
@@ -23,6 +23,56 @@ EFI_GUID mInventoryGuid = INVENTORY_GUID;
|
||||
|
||||
CHAR16 VariableName[] = L"MyIfrNVData";
|
||||
|
||||
HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath1 = {
|
||||
{
|
||||
{
|
||||
HARDWARE_DEVICE_PATH,
|
||||
HW_VENDOR_DP,
|
||||
{
|
||||
(UINT8) (sizeof (VENDOR_DEVICE_PATH)),
|
||||
(UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
|
||||
}
|
||||
},
|
||||
//
|
||||
// {C153B68D-EBFC-488e-B110-662867745B87}
|
||||
//
|
||||
{ 0xc153b68d, 0xebfc, 0x488e, { 0xb1, 0x10, 0x66, 0x28, 0x67, 0x74, 0x5b, 0x87 } }
|
||||
},
|
||||
{
|
||||
END_DEVICE_PATH_TYPE,
|
||||
END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
{
|
||||
(UINT8) (END_DEVICE_PATH_LENGTH),
|
||||
(UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath2 = {
|
||||
{
|
||||
{
|
||||
HARDWARE_DEVICE_PATH,
|
||||
HW_VENDOR_DP,
|
||||
{
|
||||
(UINT8) (sizeof (VENDOR_DEVICE_PATH)),
|
||||
(UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
|
||||
}
|
||||
},
|
||||
//
|
||||
// {06F37F07-0C48-40e9-8436-0A08A0BB76B0}
|
||||
//
|
||||
{ 0x6f37f07, 0xc48, 0x40e9, { 0x84, 0x36, 0xa, 0x8, 0xa0, 0xbb, 0x76, 0xb0 } }
|
||||
},
|
||||
{
|
||||
END_DEVICE_PATH_TYPE,
|
||||
END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
{
|
||||
(UINT8) (END_DEVICE_PATH_LENGTH),
|
||||
(UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
Encode the password using a simple algorithm.
|
||||
|
||||
@@ -689,7 +739,7 @@ DriverSampleInit (
|
||||
EFI_STATUS SavedStatus;
|
||||
EFI_HII_PACKAGE_LIST_HEADER *PackageList;
|
||||
EFI_HII_HANDLE HiiHandle[2];
|
||||
EFI_HANDLE DriverHandle[2];
|
||||
EFI_HANDLE DriverHandle[2] = {NULL, NULL};
|
||||
DRIVER_SAMPLE_PRIVATE_DATA *PrivateData;
|
||||
EFI_SCREEN_DESCRIPTOR Screen;
|
||||
EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
|
||||
@@ -766,23 +816,18 @@ DriverSampleInit (
|
||||
}
|
||||
PrivateData->HiiConfigRouting = HiiConfigRouting;
|
||||
|
||||
//
|
||||
// Install Config Access protocol
|
||||
//
|
||||
Status = HiiLibCreateHiiDriverHandle (&DriverHandle[0]);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
PrivateData->DriverHandle[0] = DriverHandle[0];
|
||||
|
||||
Status = gBS->InstallProtocolInterface (
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&DriverHandle[0],
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
&mHiiVendorDevicePath1,
|
||||
&gEfiHiiConfigAccessProtocolGuid,
|
||||
EFI_NATIVE_INTERFACE,
|
||||
&PrivateData->ConfigAccess
|
||||
&PrivateData->ConfigAccess,
|
||||
NULL
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
PrivateData->DriverHandle[0] = DriverHandle[0];
|
||||
|
||||
//
|
||||
// Publish our HII data
|
||||
//
|
||||
@@ -811,10 +856,14 @@ DriverSampleInit (
|
||||
//
|
||||
// Publish another Fromset
|
||||
//
|
||||
Status = HiiLibCreateHiiDriverHandle (&DriverHandle[1]);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&DriverHandle[1],
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
&mHiiVendorDevicePath2,
|
||||
NULL
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
PrivateData->DriverHandle[1] = DriverHandle[1];
|
||||
|
||||
PackageList = HiiLibPreparePackageList (
|
||||
|
@@ -42,7 +42,7 @@ Revision History
|
||||
#include <Library/IfrSupportLib.h>
|
||||
#include <Library/ExtendedIfrSupportLib.h>
|
||||
#include <Library/HiiLib.h>
|
||||
#include <Library/ExtendedHiiLib.h>
|
||||
#include <Library/DevicePathLib.h>
|
||||
|
||||
#include "NVDataStruc.h"
|
||||
|
||||
@@ -97,4 +97,16 @@ typedef struct {
|
||||
|
||||
#define DRIVER_SAMPLE_PRIVATE_FROM_THIS(a) CR (a, DRIVER_SAMPLE_PRIVATE_DATA, ConfigAccess, DRIVER_SAMPLE_PRIVATE_SIGNATURE)
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
///
|
||||
/// HII specific Vendor Device Path definition.
|
||||
///
|
||||
typedef struct {
|
||||
VENDOR_DEVICE_PATH VendorDevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL End;
|
||||
} HII_VENDOR_DEVICE_PATH;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif
|
||||
|
@@ -53,7 +53,6 @@
|
||||
DebugLib
|
||||
HiiLib
|
||||
IfrSupportLib
|
||||
ExtendedHiiLib
|
||||
ExtendedIfrSupportLib
|
||||
|
||||
[Protocols]
|
||||
|
@@ -24,6 +24,31 @@ LIST_ENTRY mIScsiConfigFormList = {
|
||||
&mIScsiConfigFormList
|
||||
};
|
||||
|
||||
HII_VENDOR_DEVICE_PATH mIScsiHiiVendorDevicePath = {
|
||||
{
|
||||
{
|
||||
HARDWARE_DEVICE_PATH,
|
||||
HW_VENDOR_DP,
|
||||
{
|
||||
(UINT8) (sizeof (VENDOR_DEVICE_PATH)),
|
||||
(UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
|
||||
}
|
||||
},
|
||||
//
|
||||
// {49D7B73E-143D-4716-977B-C45F1CB038CC}
|
||||
//
|
||||
{ 0x49d7b73e, 0x143d, 0x4716, { 0x97, 0x7b, 0xc4, 0x5f, 0x1c, 0xb0, 0x38, 0xcc } }
|
||||
},
|
||||
{
|
||||
END_DEVICE_PATH_TYPE,
|
||||
END_ENTIRE_DEVICE_PATH_SUBTYPE,
|
||||
{
|
||||
(UINT8) (END_DEVICE_PATH_LENGTH),
|
||||
(UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
Convert the IPv4 address into a dotted string.
|
||||
|
||||
@@ -908,7 +933,7 @@ IScsiConfigFormInit (
|
||||
return Status;
|
||||
}
|
||||
|
||||
CallbackInfo = (ISCSI_FORM_CALLBACK_INFO *) AllocatePool (sizeof (ISCSI_FORM_CALLBACK_INFO));
|
||||
CallbackInfo = (ISCSI_FORM_CALLBACK_INFO *) AllocateZeroPool (sizeof (ISCSI_FORM_CALLBACK_INFO));
|
||||
if (CallbackInfo == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
@@ -928,22 +953,15 @@ IScsiConfigFormInit (
|
||||
}
|
||||
|
||||
//
|
||||
// Create driver handle used by HII database
|
||||
// Install Device Path Protocol and Config Access protocol to driver handle
|
||||
//
|
||||
Status = HiiLibCreateHiiDriverHandle (&CallbackInfo->DriverHandle);
|
||||
if (EFI_ERROR (Status)) {
|
||||
FreePool(CallbackInfo);
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// Install Config Access protocol to driver handle
|
||||
//
|
||||
Status = gBS->InstallProtocolInterface (
|
||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||
&CallbackInfo->DriverHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
&mIScsiHiiVendorDevicePath,
|
||||
&gEfiHiiConfigAccessProtocolGuid,
|
||||
EFI_NATIVE_INTERFACE,
|
||||
&CallbackInfo->ConfigAccess
|
||||
&CallbackInfo->ConfigAccess,
|
||||
NULL
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
@@ -1010,13 +1028,14 @@ IScsiConfigFormUnload (
|
||||
//
|
||||
// Uninstall EFI_HII_CONFIG_ACCESS_PROTOCOL
|
||||
//
|
||||
gBS->UninstallProtocolInterface (
|
||||
mCallbackInfo->DriverHandle,
|
||||
&gEfiHiiConfigAccessProtocolGuid,
|
||||
&mCallbackInfo->ConfigAccess
|
||||
);
|
||||
HiiLibDestroyHiiDriverHandle (mCallbackInfo->DriverHandle);
|
||||
|
||||
gBS->UninstallMultipleProtocolInterfaces (
|
||||
mCallbackInfo->DriverHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
&mIScsiHiiVendorDevicePath,
|
||||
&gEfiHiiConfigAccessProtocolGuid,
|
||||
&mCallbackInfo->ConfigAccess,
|
||||
NULL
|
||||
);
|
||||
gBS->FreePool (mCallbackInfo);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
@@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
#include <Protocol/HiiConfigRouting.h>
|
||||
#include <Library/HiiLib.h>
|
||||
#include <Library/ExtendedHiiLib.h>
|
||||
#include <Library/DevicePathLib.h>
|
||||
#include <Library/IfrSupportLib.h>
|
||||
#include <Library/ExtendedIfrSupportLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
@@ -103,6 +103,18 @@ typedef struct _ISCSI_FORM_CALLBACK_INFO {
|
||||
ISCSI_CONFIG_FORM_ENTRY *Current;
|
||||
} ISCSI_FORM_CALLBACK_INFO;
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
///
|
||||
/// HII specific Vendor Device Path definition.
|
||||
///
|
||||
typedef struct {
|
||||
VENDOR_DEVICE_PATH VendorDevicePath;
|
||||
EFI_DEVICE_PATH_PROTOCOL End;
|
||||
} HII_VENDOR_DEVICE_PATH;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
/**
|
||||
Updates the iSCSI configuration form to add/delete an entry for the iSCSI
|
||||
device specified by the Controller.
|
||||
|
@@ -79,7 +79,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
PrintLib
|
||||
HiiLib
|
||||
IfrSupportLib
|
||||
ExtendedHiiLib
|
||||
ExtendedIfrSupportLib
|
||||
NetLib
|
||||
|
||||
|
@@ -525,7 +525,6 @@ InitializeSetup (
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_HANDLE HiiDriverHandle;
|
||||
EFI_HII_PACKAGE_LIST_HEADER *PackageList;
|
||||
|
||||
//
|
||||
@@ -555,15 +554,12 @@ InitializeSetup (
|
||||
//
|
||||
// Publish our HII data
|
||||
//
|
||||
Status = HiiLibCreateHiiDriverHandle (&HiiDriverHandle);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
PackageList = HiiLibPreparePackageList (1, &gSetupBrowserGuid, SetupBrowserStrings);
|
||||
ASSERT (PackageList != NULL);
|
||||
Status = mHiiDatabase->NewPackageList (
|
||||
mHiiDatabase,
|
||||
PackageList,
|
||||
HiiDriverHandle,
|
||||
ImageHandle,
|
||||
&gHiiHandle
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
@@ -42,7 +42,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
#include <Library/IfrSupportLib.h>
|
||||
#include <Library/ExtendedIfrSupportLib.h>
|
||||
#include <Library/HiiLib.h>
|
||||
#include <Library/ExtendedHiiLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
|
||||
#include "Colors.h"
|
||||
|
@@ -61,7 +61,6 @@
|
||||
PrintLib
|
||||
IfrSupportLib
|
||||
HiiLib
|
||||
ExtendedHiiLib
|
||||
|
||||
[Guids]
|
||||
gEfiIfrTianoGuid ## CONSUMES ## GUID
|
||||
|
Reference in New Issue
Block a user