]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/DriverSampleDxe/DriverSample.h
MdeModulePkg: Add match2 opcode support in SetupBrowserDxe and sample code in DriverS...
[mirror_edk2.git] / MdeModulePkg / Universal / DriverSampleDxe / DriverSample.h
index 60fa280fee62c6230fe07ae00882d7e7e0c57de9..29870c0f1f1e2b8ec5663df5c15063589dbf5610 100644 (file)
-/** @file
-
-Copyright (c) 2007, 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
-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.
-
-Module Name:
-
-  DriverSample.h
-
-Abstract:
-
-
-Revision History
-
-
-**/
-
-#ifndef _DRIVER_SAMPLE_H
-#define _DRIVER_SAMPLE_H
-
-#include <PiDxe.h>
-
-#include <Protocol/HiiConfigRouting.h>
-#include <Protocol/FormBrowser2.h>
-#include <Protocol/HiiConfigAccess.h>
-#include <Protocol/HiiDatabase.h>
-#include <Protocol/HiiString.h>
-
-#include <Library/DebugLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/UefiDriverEntryPoint.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/IfrSupportLib.h>
-#include <Library/ExtendedIfrSupportLib.h>
-#include <Library/HiiLib.h>
-#include <Library/ExtendedHiiLib.h>
-
-#include <MdeModuleHii.h>
-
-
-#include "NVDataStruc.h"
-
-//
-// This is the generated <AltResp> for defaults defined in VFR
-//
-extern UINT8 VfrMyIfrNVDataDefault0000[];
-
-//
-// This is the generated IFR binary data for each formset defined in VFR.
-// This data array is ready to be used as input of HiiLibPreparePackageList() to
-// create a packagelist (which contains Form packages, String packages, etc).
-//
-extern UINT8  VfrBin[];
-extern UINT8  InventoryBin[];
-
-//
-// This is the generated String package data for all .UNI files.
-// This data array is ready to be used as input of HiiLibPreparePackageList() to
-// create a packagelist (which contains Form packages, String packages, etc).
-//
-extern UINT8  DriverSampleStrings[];
-
-#define SAMPLE_STRING               L"This is an error!"
-
-#define DRIVER_SAMPLE_PRIVATE_SIGNATURE EFI_SIGNATURE_32 ('D', 'S', 'p', 's')
-
-typedef struct {
-  UINTN                            Signature;
-
-  EFI_HANDLE                       DriverHandle[2];
-  EFI_HII_HANDLE                   HiiHandle[2];
-  DRIVER_SAMPLE_CONFIGURATION      Configuration;
-  UINT8                            PasswordState;
-
-  //
-  // Consumed protocol
-  //
-  EFI_HII_DATABASE_PROTOCOL        *HiiDatabase;
-  EFI_HII_STRING_PROTOCOL          *HiiString;
-  EFI_HII_CONFIG_ROUTING_PROTOCOL  *HiiConfigRouting;
-  EFI_FORM_BROWSER2_PROTOCOL       *FormBrowser2;
-
-  //
-  // Produced protocol
-  //
-  EFI_HII_CONFIG_ACCESS_PROTOCOL   ConfigAccess;
-} DRIVER_SAMPLE_PRIVATE_DATA;
-
-#define DRIVER_SAMPLE_PRIVATE_FROM_THIS(a)  CR (a, DRIVER_SAMPLE_PRIVATE_DATA, ConfigAccess, DRIVER_SAMPLE_PRIVATE_SIGNATURE)
-
-#endif
+/** @file\r
+\r
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+Module Name:\r
+\r
+  DriverSample.h\r
+\r
+Abstract:\r
+\r
+\r
+Revision History\r
+\r
+\r
+**/\r
+\r
+#ifndef _DRIVER_SAMPLE_H_\r
+#define _DRIVER_SAMPLE_H_\r
+\r
+#include <Uefi.h>\r
+\r
+#include <Protocol/HiiConfigRouting.h>\r
+#include <Protocol/FormBrowser2.h>\r
+#include <Protocol/HiiConfigAccess.h>\r
+#include <Protocol/HiiDatabase.h>\r
+#include <Protocol/HiiString.h>\r
+#include <Protocol/FormBrowserEx.h>\r
+\r
+#include <Guid/MdeModuleHii.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
+#include <Library/UefiDriverEntryPoint.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/HiiLib.h>\r
+#include <Library/DevicePathLib.h>\r
+#include <Library/PrintLib.h>\r
+#include <Library/UefiLib.h>\r
+\r
+#include "NVDataStruc.h"\r
+\r
+//\r
+// This is the generated IFR binary data for each formset defined in VFR.\r
+// This data array is ready to be used as input of HiiAddPackages() to\r
+// create a packagelist (which contains Form packages, String packages, etc).\r
+//\r
+extern UINT8  VfrBin[];\r
+extern UINT8  InventoryBin[];\r
+\r
+//\r
+// This is the generated String package data for all .UNI files.\r
+// This data array is ready to be used as input of HiiAddPackages() to\r
+// create a packagelist (which contains Form packages, String packages, etc).\r
+//\r
+extern UINT8  DriverSampleStrings[];\r
+\r
+#define DYNAMIC_ONE_OF_VAR_OFFSET        OFFSET_OF (DRIVER_SAMPLE_CONFIGURATION, DynamicOneof)\r
+#define DYNAMIC_ORDERED_LIST_VAR_OFFSET  OFFSET_OF (DRIVER_SAMPLE_CONFIGURATION, DynamicOrderedList)\r
+\r
+#define DEFAULT_CLASS_MANUFACTURING_VALUE     0xFF\r
+#define DEFAULT_CLASS_STANDARD_VALUE          0x0\r
+\r
+//\r
+// Number of name in Name/Value storage\r
+//\r
+#define NAME_VALUE_NAME_NUMBER       3\r
+\r
+#define DRIVER_SAMPLE_PRIVATE_SIGNATURE SIGNATURE_32 ('D', 'S', 'p', 's')\r
+\r
+typedef struct {\r
+  UINTN                            Signature;\r
+\r
+  EFI_HANDLE                       DriverHandle[2];\r
+  EFI_HII_HANDLE                   HiiHandle[2];\r
+  DRIVER_SAMPLE_CONFIGURATION      Configuration;\r
+  MY_EFI_VARSTORE_DATA             VarStoreConfig;\r
+  UINT8                            PasswordState;\r
+\r
+  //\r
+  // Name/Value storage Name list\r
+  //\r
+  EFI_STRING_ID                    NameStringId[NAME_VALUE_NAME_NUMBER];\r
+  EFI_STRING                       NameValueName[NAME_VALUE_NAME_NUMBER];\r
+\r
+  //\r
+  // Consumed protocol\r
+  //\r
+  EFI_HII_DATABASE_PROTOCOL        *HiiDatabase;\r
+  EFI_HII_STRING_PROTOCOL          *HiiString;\r
+  EFI_HII_CONFIG_ROUTING_PROTOCOL  *HiiConfigRouting;\r
+  EFI_FORM_BROWSER2_PROTOCOL       *FormBrowser2;\r
+\r
+  //\r
+  // Produced protocol\r
+  //\r
+  EFI_HII_CONFIG_ACCESS_PROTOCOL   ConfigAccess;\r
+} DRIVER_SAMPLE_PRIVATE_DATA;\r
+\r
+#define DRIVER_SAMPLE_PRIVATE_FROM_THIS(a)  CR (a, DRIVER_SAMPLE_PRIVATE_DATA, ConfigAccess, DRIVER_SAMPLE_PRIVATE_SIGNATURE)\r
+\r
+#pragma pack(1)\r
+\r
+///\r
+/// HII specific Vendor Device Path definition.\r
+///\r
+typedef struct {\r
+  VENDOR_DEVICE_PATH             VendorDevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL       End;\r
+} HII_VENDOR_DEVICE_PATH;\r
+\r
+#pragma pack()\r
+\r
+#endif\r