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