2 Thunk driver's entry that install filter for DataRecord.
4 Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 LIST_ENTRY mStructureList
;
23 Entry Point of thunk driver.
25 @param[in] ImageHandle Image handle of this driver.
26 @param[in] SystemTable Pointer to EFI system table.
28 @retval EFI_SUCCESS The event handlers were registered.
29 @retval EFI_DEVICE_ERROR Failed to register the event handlers
34 IN EFI_HANDLE ImageHandle
,
35 IN EFI_SYSTEM_TABLE
*SystemTable
39 EFI_DATA_HUB_PROTOCOL
*DataHub
;
40 EFI_EVENT FilterEvent
;
42 Status
= gBS
->LocateProtocol (&gEfiDataHubProtocolGuid
, NULL
, (VOID
**) &DataHub
);
43 ASSERT_EFI_ERROR (Status
);
44 ASSERT (DataHub
!= NULL
);
46 InitializeListHead (&mStructureList
);
49 // Register SmBios Data Filter Function.
50 // This function is notified at TPL_CALLBACK.
52 Status
= gBS
->CreateEvent (
59 if (EFI_ERROR (Status
)) {
63 Status
= DataHub
->RegisterFilterDriver (
67 EFI_DATA_RECORD_CLASS_DATA
,
70 if (EFI_ERROR (Status
)) {
71 gBS
->CloseEvent (FilterEvent
);
80 Smbios data filter function. This function is invoked when there is data records
81 available in the Data Hub.
83 @param Event The event that is signaled.
84 @param Context not used here.
94 EFI_DATA_HUB_PROTOCOL
*DataHub
;
95 EFI_HANDLE DataHubHandle
;
97 UINT64 MonotonicCount
;
98 EFI_DATA_RECORD_HEADER
*Record
;
100 Status
= EFI_SUCCESS
;
104 // Get the Data Hub Protocol. Assume only one instance
105 // of Data Hub Protocol is availabe in the system.
107 HandleSize
= sizeof (EFI_HANDLE
);
109 Status
= gBS
->LocateHandle (
111 &gEfiDataHubProtocolGuid
,
117 if (EFI_ERROR (Status
)) {
121 Status
= gBS
->HandleProtocol (
123 &gEfiDataHubProtocolGuid
,
127 if (EFI_ERROR (Status
)) {
131 // Get all available data records from data hub
138 Status
= DataHub
->GetNextRecord (
145 if (!EFI_ERROR (Status
)) {
146 if (Record
->DataRecordClass
== EFI_DATA_RECORD_CLASS_DATA
) {
149 // It's of expected Data Type. Process it.
151 SmbiosProcessDataRecord (Record
);
154 } while (!EFI_ERROR (Status
) && (MonotonicCount
!= 0));