]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OldMdePkg/Include/Protocol/DataHub.h
Moved the MdePkg to OldMdePkg so that new code in MdePkg does not break existing...
[mirror_edk2.git] / OldMdePkg / Include / Protocol / DataHub.h
diff --git a/OldMdePkg/Include/Protocol/DataHub.h b/OldMdePkg/Include/Protocol/DataHub.h
new file mode 100644 (file)
index 0000000..affe4b8
--- /dev/null
@@ -0,0 +1,212 @@
+/** @file\r
+  The data hub protocol is used both by agents wishing to log\r
+  data and those wishing to be made aware of all information that\r
+  has been logged.\r
+\r
+  For more information please look at Intel Platform Innovation \r
+  Framework for EFI Data Hub Specification.\r
+\r
+  Copyright (c) 2006, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DataHub.h\r
+\r
+  @par Revision Reference:\r
+  This protocol is defined in Framework for EFI Data Hub Specification.\r
+  Version 0.9.\r
+\r
+**/\r
+\r
+#ifndef __DATA_HUB_H__\r
+#define __DATA_HUB_H__\r
+\r
+#define EFI_DATA_HUB_PROTOCOL_GUID \\r
+  { \\r
+    0xae80d021, 0x618e, 0x11d4, {0xbc, 0xd7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \\r
+  }\r
+\r
+//\r
+// EFI generic Data Hub Header\r
+//\r
+// A Data Record is an EFI_DATA_RECORD_HEADER followed by RecordSize bytes of\r
+//  data. The format of the data is defined by the DataRecordGuid.\r
+//\r
+// If EFI_DATA_RECORD_HEADER is extended in the future the Version number must\r
+//  change and the HeaderSize will change if the definition of\r
+//  EFI_DATA_RECORD_HEADER is extended.\r
+//\r
+// The logger is responcible for initializing:\r
+//  Version, HeaderSize, RecordSize, DataRecordGuid, DataRecordClass\r
+//\r
+// The Data Hub driver is responcible for initializing:\r
+//   LogTime and LogMonotonicCount.\r
+//\r
+#define EFI_DATA_RECORD_HEADER_VERSION  0x0100\r
+typedef struct {\r
+  UINT16    Version;\r
+  UINT16    HeaderSize;\r
+  UINT32    RecordSize;\r
+  EFI_GUID  DataRecordGuid;\r
+  EFI_GUID  ProducerName;\r
+  UINT64    DataRecordClass;\r
+  EFI_TIME  LogTime;\r
+  UINT64    LogMonotonicCount;\r
+} EFI_DATA_RECORD_HEADER;\r
+\r
+//\r
+// Definition of DataRecordClass. These are used to filter out class types\r
+// at a very high level. The DataRecordGuid still defines the format of\r
+// the data. See DateHub.doc for rules on what can and can not be a\r
+// new DataRecordClass\r
+//\r
+#define EFI_DATA_RECORD_CLASS_DEBUG         0x0000000000000001\r
+#define EFI_DATA_RECORD_CLASS_ERROR         0x0000000000000002\r
+#define EFI_DATA_RECORD_CLASS_DATA          0x0000000000000004\r
+#define EFI_DATA_RECORD_CLASS_PROGRESS_CODE 0x0000000000000008\r
+\r
+//\r
+// Forward reference for pure ANSI compatability\r
+//\r
+typedef struct _EFI_DATA_HUB_PROTOCOL EFI_DATA_HUB_PROTOCOL;\r
+\r
+/**\r
+  Logs a data record to the system event log.\r
+\r
+  @param  This                  The EFI_DATA_HUB_PROTOCOL instance.\r
+  @param  description\r
+  @param  DataRecordGuid        A GUID that indicates the format of the data passed into RawData.\r
+  @param  ProducerName          A GUID that indicates the identity of the caller to this API.\r
+  @param  DataRecordClass       This class indicates the generic type of the data record.\r
+  @param  RawData               The DataRecordGuid-defined data to be logged.\r
+  @param  RawDataSize           The size in bytes of RawData.\r
+\r
+  @retval EFI_SUCCESS           Data was logged.\r
+  @retval EFI_OUT_OF_RESOURCES  Data was not logged due to lack of system resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DATA_HUB_LOG_DATA) (\r
+  IN  EFI_DATA_HUB_PROTOCOL   *This,\r
+  IN  EFI_GUID                *DataRecordGuid,\r
+  IN  EFI_GUID                *ProducerName,\r
+  IN  UINT64                  DataRecordClass,\r
+  IN  VOID                    *RawData,\r
+  IN  UINT32                  RawDataSize\r
+  );\r
+\r
+/**\r
+  Allows the system data log to be searched.\r
+\r
+  @param  This                  The EFI_DATA_HUB_PROTOCOL instance.\r
+  @param  MonotonicCount        On input, it specifies the Record to return.\r
+                                An input of zero means to return the first record.\r
+  @param  FilterDriver          If FilterDriver is not passed in a MonotonicCount of zero,\r
+                                it means to return the first data record. If FilterDriver is passed in,\r
+                                then a MonotonicCount of zero means to return the first data not yet read\r
+                                by FilterDriver.\r
+  @param  Record                Returns a dynamically allocated memory buffer with a data\r
+                                record that matches MonotonicCount.\r
+\r
+  @retval EFI_SUCCESS           Data was returned in Record.\r
+  @retval EFI_INVALID_PARAMETER FilterDriver was passed in but does not exist.\r
+  @retval EFI_NOT_FOUND         MonotonicCount does not match any data record\r
+                                in the system. If a MonotonicCount of zero was passed in, then no\r
+                                data records exist in the system.\r
+  @retval EFI_OUT_OF_RESOURCES  Record was not returned due to lack\r
+                                of system resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DATA_HUB_GET_NEXT_RECORD) (\r
+  IN EFI_DATA_HUB_PROTOCOL    *This,\r
+  IN OUT  UINT64              *MonotonicCount,\r
+  IN  EFI_EVENT               *FilterDriver OPTIONAL,\r
+  OUT EFI_DATA_RECORD_HEADER  **Record\r
+  );\r
+\r
+/**\r
+  Registers an event to be signaled every time a data record is logged in the system.\r
+\r
+  @param  This                  The EFI_DATA_HUB_PROTOCOL instance.\r
+  @param  FilterEvent           The EFI_EVENT to signal whenever data that matches\r
+                                FilterClass is logged in the system.\r
+  @param  FilterTpl             The maximum EFI_TPL at which FilterEvent can be signaled.\r
+                                It is strongly recommended that you use the lowest EFI_TPL possible.\r
+  @param  FilterClass           FilterEvent will be signaled whenever a bit\r
+                                in EFI_DATA_RECORD_HEADER.DataRecordClass is also set in FilterClass.\r
+                                If FilterClass is zero, no class-based filtering will be performed.\r
+  @param  FilterDataRecordGuid  FilterEvent will be signaled whenever\r
+                                FilterDataRecordGuid matches EFI_DATA_RECORD_HEADER.DataRecordGuid.\r
+                                If FilterDataRecordGuid is NULL, then no GUID-based filtering will be performed.\r
+\r
+  @retval EFI_SUCCESS           The filter driver event was registered\r
+  @retval EFI_ALREADY_STARTED   FilterEvent was previously registered and cannot be registered again.\r
+  @retval EFI_OUT_OF_RESOURCES  The filter driver event was not registered\r
+                                due to lack of system resources.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DATA_HUB_REGISTER_FILTER_DRIVER) (\r
+  IN EFI_DATA_HUB_PROTOCOL    *This,\r
+  IN EFI_EVENT                FilterEvent,\r
+  IN EFI_TPL                  FilterTpl,\r
+  IN UINT64                   FilterClass,\r
+  IN EFI_GUID                 *FilterDataRecordGuid OPTIONAL\r
+  );\r
+\r
+/**\r
+  Stops a filter driver from being notified when data records are logged.\r
+\r
+  @param  This                  The EFI_DATA_HUB_PROTOCOL instance.\r
+  @param  FilterEvent           The EFI_EVENT to remove from the list of events to be\r
+                                signaled every time errors are logged.\r
+\r
+  @retval EFI_SUCCESS           The filter driver represented by FilterEvent was shut off.\r
+  @retval EFI_NOT_FOUND         FilterEvent did not exist.\r
+\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_DATA_HUB_UNREGISTER_FILTER_DRIVER) (\r
+  IN EFI_DATA_HUB_PROTOCOL    *This,\r
+  IN EFI_EVENT                FilterEvent\r
+  );\r
+\r
+/**\r
+  @par Protocol Description:\r
+  This protocol is used to log information and register filter drivers \r
+  to receive data records.\r
+\r
+  @param LogData\r
+  Logs a data record. \r
+\r
+  @param GetNextDataRecord\r
+  Gets a data record. Used both to view the memory-based log and to \r
+  get information about which data records have been consumed by a filter driver.\r
+\r
+  @param RegisterFilterDriver\r
+  Allows the registration of an EFI event to act as a filter driver for all data records that are logged. \r
+\r
+  @param UnregisterFilterDriver\r
+  Used to remove a filter driver that was added with RegisterFilterDriver(). \r
+\r
+**/\r
+struct _EFI_DATA_HUB_PROTOCOL {\r
+  EFI_DATA_HUB_LOG_DATA                 LogData;\r
+  EFI_DATA_HUB_GET_NEXT_RECORD          GetNextRecord;\r
+  EFI_DATA_HUB_REGISTER_FILTER_DRIVER   RegisterFilterDriver;\r
+  EFI_DATA_HUB_UNREGISTER_FILTER_DRIVER UnregisterFilterDriver;\r
+};\r
+\r
+extern EFI_GUID gEfiDataHubProtocolGuid;\r
+\r
+#endif\r