]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/DataHub.h
IntelFrameworkPkg: Clean up source files
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / DataHub.h
CommitLineData
79964ac8 1/** @file\r
2 The data hub protocol is used both by agents wishing to log\r
3 data and those wishing to be made aware of all information that\r
4e361093 4 has been logged. This protocol may only be called <= TPL_NOTIFY.\r
79964ac8 5\r
1c2f052d
LG
6Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
7This program and the accompanying materials are licensed and made available under\r
8the terms and conditions of the BSD License that accompanies this distribution.\r
f22f941e 9The full text of the license may be found at\r
1c2f052d
LG
10http://opensource.org/licenses/bsd-license.php.\r
11\r
12THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
f22f941e 13WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
736e104f 14\r
f7590642 15 @par Revision Reference:\r
16 The Data Hub Protocol is defined in Framework for EFI Data Hub Specification\r
17 Version 0.9.\r
18\r
79964ac8 19**/\r
20\r
d2be628f 21#ifndef __DATA_HUB_H__\r
22#define __DATA_HUB_H__\r
79964ac8 23\r
24#define EFI_DATA_HUB_PROTOCOL_GUID \\r
25 { \\r
26 0xae80d021, 0x618e, 0x11d4, {0xbc, 0xd7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
27 }\r
28\r
29//\r
30// EFI generic Data Hub Header\r
31//\r
32// A Data Record is an EFI_DATA_RECORD_HEADER followed by RecordSize bytes of\r
33// data. The format of the data is defined by the DataRecordGuid.\r
34//\r
5259c97d 35// If EFI_DATA_RECORD_HEADER is extended in the future, the Version number and HeaderSize must\r
1c2f052d 36// change.\r
79964ac8 37//\r
38// The logger is responcible for initializing:\r
39// Version, HeaderSize, RecordSize, DataRecordGuid, DataRecordClass\r
40//\r
41// The Data Hub driver is responcible for initializing:\r
42// LogTime and LogMonotonicCount.\r
43//\r
44#define EFI_DATA_RECORD_HEADER_VERSION 0x0100\r
45typedef struct {\r
46 UINT16 Version;\r
47 UINT16 HeaderSize;\r
48 UINT32 RecordSize;\r
49 EFI_GUID DataRecordGuid;\r
50 EFI_GUID ProducerName;\r
51 UINT64 DataRecordClass;\r
52 EFI_TIME LogTime;\r
53 UINT64 LogMonotonicCount;\r
54} EFI_DATA_RECORD_HEADER;\r
55\r
56//\r
57// Definition of DataRecordClass. These are used to filter out class types\r
58// at a very high level. The DataRecordGuid still defines the format of\r
5259c97d 59// the data. See the Data Hub Specification for rules on what can and can not be a\r
79964ac8 60// new DataRecordClass\r
61//\r
62#define EFI_DATA_RECORD_CLASS_DEBUG 0x0000000000000001\r
63#define EFI_DATA_RECORD_CLASS_ERROR 0x0000000000000002\r
64#define EFI_DATA_RECORD_CLASS_DATA 0x0000000000000004\r
65#define EFI_DATA_RECORD_CLASS_PROGRESS_CODE 0x0000000000000008\r
66\r
67//\r
68// Forward reference for pure ANSI compatability\r
69//\r
70typedef struct _EFI_DATA_HUB_PROTOCOL EFI_DATA_HUB_PROTOCOL;\r
71\r
72/**\r
73 Logs a data record to the system event log.\r
74\r
75 @param This The EFI_DATA_HUB_PROTOCOL instance.\r
79964ac8 76 @param DataRecordGuid A GUID that indicates the format of the data passed into RawData.\r
77 @param ProducerName A GUID that indicates the identity of the caller to this API.\r
78 @param DataRecordClass This class indicates the generic type of the data record.\r
79 @param RawData The DataRecordGuid-defined data to be logged.\r
80 @param RawDataSize The size in bytes of RawData.\r
81\r
82 @retval EFI_SUCCESS Data was logged.\r
83 @retval EFI_OUT_OF_RESOURCES Data was not logged due to lack of system resources.\r
84\r
85**/\r
86typedef\r
87EFI_STATUS\r
69686d56 88(EFIAPI *EFI_DATA_HUB_LOG_DATA)(\r
79964ac8 89 IN EFI_DATA_HUB_PROTOCOL *This,\r
90 IN EFI_GUID *DataRecordGuid,\r
91 IN EFI_GUID *ProducerName,\r
92 IN UINT64 DataRecordClass,\r
93 IN VOID *RawData,\r
94 IN UINT32 RawDataSize\r
95 );\r
96\r
97/**\r
98 Allows the system data log to be searched.\r
99\r
100 @param This The EFI_DATA_HUB_PROTOCOL instance.\r
101 @param MonotonicCount On input, it specifies the Record to return.\r
1c2f052d 102 An input of zero means to return the first record,\r
f22f941e 103 as does an input of one.\r
104 @param FilterDriver If FilterDriver is not passed in a MonotonicCount\r
1c2f052d
LG
105 of zero, it means to return the first data record.\r
106 If FilterDriver is passed in, then a MonotonicCount\r
f22f941e 107 of zero means to return the first data not yet read\r
79964ac8 108 by FilterDriver.\r
1c2f052d 109 @param Record Returns a dynamically allocated memory buffer with\r
f22f941e 110 a data record that matches MonotonicCount.\r
79964ac8 111\r
112 @retval EFI_SUCCESS Data was returned in Record.\r
113 @retval EFI_INVALID_PARAMETER FilterDriver was passed in but does not exist.\r
114 @retval EFI_NOT_FOUND MonotonicCount does not match any data record\r
1c2f052d 115 in the system. If a MonotonicCount of zero was\r
f22f941e 116 passed in, then no data records exist in the system.\r
79964ac8 117 @retval EFI_OUT_OF_RESOURCES Record was not returned due to lack\r
118 of system resources.\r
1c2f052d
LG
119 @note Inconsistent with specification here:\r
120 In Framework for EFI Data Hub Specification, Version 0.9, This definition\r
121 is named as EFI_DATA_HUB_GET_NEXT_DATA_RECORD. The inconsistency is\r
122 maintained for backward compatibility.\r
79964ac8 123**/\r
124typedef\r
125EFI_STATUS\r
69686d56 126(EFIAPI *EFI_DATA_HUB_GET_NEXT_RECORD)(\r
79964ac8 127 IN EFI_DATA_HUB_PROTOCOL *This,\r
128 IN OUT UINT64 *MonotonicCount,\r
129 IN EFI_EVENT *FilterDriver OPTIONAL,\r
130 OUT EFI_DATA_RECORD_HEADER **Record\r
131 );\r
132\r
133/**\r
134 Registers an event to be signaled every time a data record is logged in the system.\r
135\r
136 @param This The EFI_DATA_HUB_PROTOCOL instance.\r
137 @param FilterEvent The EFI_EVENT to signal whenever data that matches\r
138 FilterClass is logged in the system.\r
1c2f052d
LG
139 @param FilterTpl The maximum EFI_TPL at which FilterEvent can be\r
140 signaled. It is strongly recommended that you use\r
141 the lowest EFI_TPL possible.\r
79964ac8 142 @param FilterClass FilterEvent will be signaled whenever a bit\r
1c2f052d
LG
143 in EFI_DATA_RECORD_HEADER.DataRecordClass is also\r
144 set in FilterClass. If FilterClass is zero, no\r
f22f941e 145 class-based filtering will be performed.\r
79964ac8 146 @param FilterDataRecordGuid FilterEvent will be signaled whenever\r
1c2f052d
LG
147 FilterDataRecordGuid matches\r
148 EFI_DATA_RECORD_HEADER.DataRecordGuid.\r
149 If FilterDataRecordGuid is NULL, then no GUID-based\r
f22f941e 150 filtering will be performed.\r
79964ac8 151\r
152 @retval EFI_SUCCESS The filter driver event was registered\r
1c2f052d 153 @retval EFI_ALREADY_STARTED FilterEvent was previously registered and cannot\r
f22f941e 154 be registered again.\r
79964ac8 155 @retval EFI_OUT_OF_RESOURCES The filter driver event was not registered\r
156 due to lack of system resources.\r
1c2f052d
LG
157 @note Inconsistent with specification here:\r
158 In Framework for EFI Data Hub Specification, Version 0.9, This definition\r
159 is named as EFI_DATA_HUB_REGISTER_DATA_FILTER_DRIVER. The inconsistency\r
160 is maintained for backward compatibility.\r
79964ac8 161**/\r
162typedef\r
163EFI_STATUS\r
69686d56 164(EFIAPI *EFI_DATA_HUB_REGISTER_FILTER_DRIVER)(\r
79964ac8 165 IN EFI_DATA_HUB_PROTOCOL *This,\r
166 IN EFI_EVENT FilterEvent,\r
167 IN EFI_TPL FilterTpl,\r
168 IN UINT64 FilterClass,\r
169 IN EFI_GUID *FilterDataRecordGuid OPTIONAL\r
170 );\r
171\r
172/**\r
173 Stops a filter driver from being notified when data records are logged.\r
174\r
175 @param This The EFI_DATA_HUB_PROTOCOL instance.\r
176 @param FilterEvent The EFI_EVENT to remove from the list of events to be\r
177 signaled every time errors are logged.\r
178\r
179 @retval EFI_SUCCESS The filter driver represented by FilterEvent was shut off.\r
180 @retval EFI_NOT_FOUND FilterEvent did not exist.\r
1c2f052d
LG
181 @note Inconsistent with specification here:\r
182 In Framework for EFI Data Hub Specification, Version 0.9, This definition\r
183 is named as EFI_DATA_HUB_UNREGISTER_DATA_FILTER_DRIVER. The inconsistency\r
184 is maintained for backward compatibility.\r
79964ac8 185**/\r
186typedef\r
187EFI_STATUS\r
69686d56 188(EFIAPI *EFI_DATA_HUB_UNREGISTER_FILTER_DRIVER)(\r
79964ac8 189 IN EFI_DATA_HUB_PROTOCOL *This,\r
190 IN EFI_EVENT FilterEvent\r
191 );\r
192\r
193/**\r
79964ac8 194 This protocol is used to log information and register filter drivers\r
195 to receive data records.\r
79964ac8 196**/\r
197struct _EFI_DATA_HUB_PROTOCOL {\r
4e97801c 198 ///\r
199 /// Logs a data record.\r
200 ///\r
1c2f052d
LG
201 EFI_DATA_HUB_LOG_DATA LogData;\r
202\r
4e97801c 203 ///\r
204 /// Gets a data record. Used both to view the memory-based log and to\r
205 /// get information about which data records have been consumed by a filter driver.\r
206 ///\r
79964ac8 207 EFI_DATA_HUB_GET_NEXT_RECORD GetNextRecord;\r
1c2f052d 208\r
4e97801c 209 ///\r
210 /// Allows the registration of an EFI event to act as a filter driver for all data records that are logged.\r
211 ///\r
79964ac8 212 EFI_DATA_HUB_REGISTER_FILTER_DRIVER RegisterFilterDriver;\r
1c2f052d 213\r
4e97801c 214 ///\r
215 /// Used to remove a filter driver that was added with RegisterFilterDriver().\r
216 ///\r
79964ac8 217 EFI_DATA_HUB_UNREGISTER_FILTER_DRIVER UnregisterFilterDriver;\r
218};\r
219\r
220extern EFI_GUID gEfiDataHubProtocolGuid;\r
221\r
222#endif\r