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