blob: 29870c0f1f1e2b8ec5663df5c15063589dbf5610 [file] [log] [blame]
Vishal Bhoj82c80712015-12-15 21:13:33 +05301/** @file
2
3Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
4This program and the accompanying materials
5are licensed and made available under the terms and conditions of the BSD License
6which accompanies this distribution. The full text of the license may be found at
7http://opensource.org/licenses/bsd-license.php
8
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12Module Name:
13
14 DriverSample.h
15
16Abstract:
17
18
19Revision History
20
21
22**/
23
24#ifndef _DRIVER_SAMPLE_H_
25#define _DRIVER_SAMPLE_H_
26
27#include <Uefi.h>
28
29#include <Protocol/HiiConfigRouting.h>
30#include <Protocol/FormBrowser2.h>
31#include <Protocol/HiiConfigAccess.h>
32#include <Protocol/HiiDatabase.h>
33#include <Protocol/HiiString.h>
34#include <Protocol/FormBrowserEx.h>
35
36#include <Guid/MdeModuleHii.h>
37#include <Library/DebugLib.h>
38#include <Library/BaseLib.h>
39#include <Library/BaseMemoryLib.h>
40#include <Library/UefiRuntimeServicesTableLib.h>
41#include <Library/UefiDriverEntryPoint.h>
42#include <Library/UefiBootServicesTableLib.h>
43#include <Library/MemoryAllocationLib.h>
44#include <Library/HiiLib.h>
45#include <Library/DevicePathLib.h>
46#include <Library/PrintLib.h>
47#include <Library/UefiLib.h>
48
49#include "NVDataStruc.h"
50
51//
52// This is the generated IFR binary data for each formset defined in VFR.
53// This data array is ready to be used as input of HiiAddPackages() to
54// create a packagelist (which contains Form packages, String packages, etc).
55//
56extern UINT8 VfrBin[];
57extern UINT8 InventoryBin[];
58
59//
60// This is the generated String package data for all .UNI files.
61// This data array is ready to be used as input of HiiAddPackages() to
62// create a packagelist (which contains Form packages, String packages, etc).
63//
64extern UINT8 DriverSampleStrings[];
65
66#define DYNAMIC_ONE_OF_VAR_OFFSET OFFSET_OF (DRIVER_SAMPLE_CONFIGURATION, DynamicOneof)
67#define DYNAMIC_ORDERED_LIST_VAR_OFFSET OFFSET_OF (DRIVER_SAMPLE_CONFIGURATION, DynamicOrderedList)
68
69#define DEFAULT_CLASS_MANUFACTURING_VALUE 0xFF
70#define DEFAULT_CLASS_STANDARD_VALUE 0x0
71
72//
73// Number of name in Name/Value storage
74//
75#define NAME_VALUE_NAME_NUMBER 3
76
77#define DRIVER_SAMPLE_PRIVATE_SIGNATURE SIGNATURE_32 ('D', 'S', 'p', 's')
78
79typedef struct {
80 UINTN Signature;
81
82 EFI_HANDLE DriverHandle[2];
83 EFI_HII_HANDLE HiiHandle[2];
84 DRIVER_SAMPLE_CONFIGURATION Configuration;
85 MY_EFI_VARSTORE_DATA VarStoreConfig;
86 UINT8 PasswordState;
87
88 //
89 // Name/Value storage Name list
90 //
91 EFI_STRING_ID NameStringId[NAME_VALUE_NAME_NUMBER];
92 EFI_STRING NameValueName[NAME_VALUE_NAME_NUMBER];
93
94 //
95 // Consumed protocol
96 //
97 EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
98 EFI_HII_STRING_PROTOCOL *HiiString;
99 EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting;
100 EFI_FORM_BROWSER2_PROTOCOL *FormBrowser2;
101
102 //
103 // Produced protocol
104 //
105 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;
106} DRIVER_SAMPLE_PRIVATE_DATA;
107
108#define DRIVER_SAMPLE_PRIVATE_FROM_THIS(a) CR (a, DRIVER_SAMPLE_PRIVATE_DATA, ConfigAccess, DRIVER_SAMPLE_PRIVATE_SIGNATURE)
109
110#pragma pack(1)
111
112///
113/// HII specific Vendor Device Path definition.
114///
115typedef struct {
116 VENDOR_DEVICE_PATH VendorDevicePath;
117 EFI_DEVICE_PATH_PROTOCOL End;
118} HII_VENDOR_DEVICE_PATH;
119
120#pragma pack()
121
122#endif