summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/DriverSampleDxe
diff options
context:
space:
mode:
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-02 08:48:03 +0000
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>2009-04-02 08:48:03 +0000
commitf6f910dd125144707e3516bbb517b8ec7a388c06 (patch)
tree8bd9280b012a7ca5366fdee7c9579723d9485b60 /MdeModulePkg/Universal/DriverSampleDxe
parent186ca8b0cd473901fd0a6ce39d7f091383672799 (diff)
downloadedk2-platforms-f6f910dd125144707e3516bbb517b8ec7a388c06.tar.xz
Retire Extended HII library class.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8011 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/DriverSampleDxe')
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c83
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/DriverSample.h14
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf1
3 files changed, 79 insertions, 19 deletions
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
index e470a82cc7..8fcce40327 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
+++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
@@ -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 (
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.h b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.h
index d33740826c..cdecddbfe7 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.h
+++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.h
@@ -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
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf b/MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf
index d1da67da04..bba6ab0abf 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf
+++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSampleDxe.inf
@@ -53,7 +53,6 @@
DebugLib
HiiLib
IfrSupportLib
- ExtendedHiiLib
ExtendedIfrSupportLib
[Protocols]