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