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