]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/DriverSampleDxe/DriverSample.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / DriverSampleDxe / DriverSample.h
1 /** @file
2
3 Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
4 SPDX-License-Identifier: BSD-2-Clause-Patent
5
6 Module Name:
7
8 DriverSample.h
9
10 Abstract:
11
12
13 Revision History
14
15
16 **/
17
18 #ifndef _DRIVER_SAMPLE_H_
19 #define _DRIVER_SAMPLE_H_
20
21 #include <Uefi.h>
22
23 #include <Protocol/HiiConfigRouting.h>
24 #include <Protocol/FormBrowser2.h>
25 #include <Protocol/HiiConfigAccess.h>
26 #include <Protocol/HiiDatabase.h>
27 #include <Protocol/HiiString.h>
28 #include <Protocol/FormBrowserEx.h>
29 #include <Protocol/HiiConfigKeyword.h>
30 #include <Protocol/HiiPopup.h>
31
32 #include <Guid/MdeModuleHii.h>
33 #include <Library/DebugLib.h>
34 #include <Library/BaseLib.h>
35 #include <Library/BaseMemoryLib.h>
36 #include <Library/UefiRuntimeServicesTableLib.h>
37 #include <Library/UefiDriverEntryPoint.h>
38 #include <Library/UefiBootServicesTableLib.h>
39 #include <Library/MemoryAllocationLib.h>
40 #include <Library/HiiLib.h>
41 #include <Library/DevicePathLib.h>
42 #include <Library/PrintLib.h>
43 #include <Library/UefiLib.h>
44
45 #include "NVDataStruc.h"
46
47 //
48 // This is the generated IFR binary data for each formset defined in VFR.
49 // This data array is ready to be used as input of HiiAddPackages() to
50 // create a packagelist (which contains Form packages, String packages, etc).
51 //
52 extern UINT8 VfrBin[];
53 extern UINT8 InventoryBin[];
54
55 //
56 // This is the generated String package data for all .UNI files.
57 // This data array is ready to be used as input of HiiAddPackages() to
58 // create a packagelist (which contains Form packages, String packages, etc).
59 //
60 extern UINT8 DriverSampleStrings[];
61
62 #define DYNAMIC_ONE_OF_VAR_OFFSET OFFSET_OF (DRIVER_SAMPLE_CONFIGURATION, DynamicOneof)
63 #define DYNAMIC_ORDERED_LIST_VAR_OFFSET OFFSET_OF (DRIVER_SAMPLE_CONFIGURATION, DynamicOrderedList)
64
65 #define DEFAULT_CLASS_MANUFACTURING_VALUE 0xFF
66 #define DEFAULT_CLASS_STANDARD_VALUE 0x0
67
68 //
69 // Number of name in Name/Value storage
70 //
71 #define NAME_VALUE_NAME_NUMBER 3
72
73 #define DRIVER_SAMPLE_PRIVATE_SIGNATURE SIGNATURE_32 ('D', 'S', 'p', 's')
74
75 typedef struct {
76 UINTN Signature;
77
78 EFI_HANDLE DriverHandle[2];
79 EFI_HII_HANDLE HiiHandle[2];
80 DRIVER_SAMPLE_CONFIGURATION Configuration;
81 MY_EFI_VARSTORE_DATA VarStoreConfig;
82 MY_EFI_BITS_VARSTORE_DATA BitsVarStoreConfig;
83 MY_EFI_UNION_DATA UnionConfig;
84
85 //
86 // Name/Value storage Name list
87 //
88 EFI_STRING_ID NameStringId[NAME_VALUE_NAME_NUMBER];
89 EFI_STRING NameValueName[NAME_VALUE_NAME_NUMBER];
90
91 //
92 // Consumed protocol
93 //
94 EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
95 EFI_HII_STRING_PROTOCOL *HiiString;
96 EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting;
97 EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL *HiiKeywordHandler;
98 EFI_HII_POPUP_PROTOCOL *HiiPopup;
99
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 ///
115 typedef struct {
116 VENDOR_DEVICE_PATH VendorDevicePath;
117 EFI_DEVICE_PATH_PROTOCOL End;
118 } HII_VENDOR_DEVICE_PATH;
119
120 #pragma pack()
121
122 #endif