2 The common header file for the thunk driver.
4 Copyright (c) 2009 - 2010, 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.
15 #ifndef _DATAHUB_TO_SMBIOS_THUNK_
16 #define _DATAHUB_TO_SMBIOS_THUNK_
18 #include <FrameworkDxe.h>
19 #include <IndustryStandard/SmBios.h>
21 #include <Guid/EventGroup.h>
22 #include <Guid/SmBios.h>
23 #include <Protocol/DataHub.h>
24 #include <Guid/DataHubRecords.h>
25 #include <Protocol/HiiDatabase.h>
26 #include <Protocol/Smbios.h>
28 #include <Library/BaseLib.h>
29 #include <Library/PcdLib.h>
30 #include <Library/DebugLib.h>
31 #include <Library/UefiLib.h>
32 #include <Library/HiiLib.h>
33 #include <Library/BaseMemoryLib.h>
34 #include <Library/ReportStatusCodeLib.h>
35 #include <Library/UefiDriverEntryPoint.h>
36 #include <Library/MemoryAllocationLib.h>
37 #include <Library/UefiBootServicesTableLib.h>
40 // Conversion Table that describes the translation method for
41 // Data Hub Data Records of certain SubClass and RecordNumber
44 BySubclassInstanceSubinstanceProducer
,
45 BySubClassInstanceProducer
,
47 } SMBIOS_STRUCTURE_LOCATING_METHOD
;
50 RecordDataUnchangedOffsetSpecified
,
51 ByFunctionWithOffsetSpecified
,
53 ByFunctionWithWholeDataRecord
,
55 } SMBIOS_FIELD_FILLING_METHOD
;
57 typedef struct _SMBIOS_STRUCTURE_NODE SMBIOS_STRUCTURE_NODE
;
64 } EFI_SMBIOS_TABLE_TYPE127
;
68 (*SMBIOS_FIELD_FILLING_FUNCTION
) (
69 IN OUT SMBIOS_STRUCTURE_NODE
* StructureNode
,
70 IN UINT32 Offset OPTIONAL
,
72 IN UINT32 RecordDataSize
77 // Data Hub Data Record's SubClass and RecordNumber
83 // Translation method applied
86 SMBIOS_STRUCTURE_LOCATING_METHOD StructureLocatingMethod
;
87 SMBIOS_FIELD_FILLING_METHOD FieldFillingMethod
;
89 SMBIOS_FIELD_FILLING_FUNCTION FieldFillingFunction
;
91 } SMBIOS_CONVERSION_TABLE_ENTRY
;
94 // SMBIOS_LINK_DATA_FIXUP nodes indicate the Link fields that
95 // need to be fixed up when creating the resulting Smbios image.
97 #define SMBIOS_LINK_DATA_FIXUP_NODE_SIGNATURE SIGNATURE_32 ('S', 'm', 'l', 'n')
107 EFI_INTER_LINK_DATA LinkData
;
109 } SMBIOS_LINK_DATA_FIXUP_NODE
;
112 // The global Structure List node.
113 // The Structure List is populated as more and more
114 // Structures (of various types) are discovered and inserted.
115 // The nodes in the Structure List will be concatenated
116 // to form the ultimate SMBIOS table.
118 #define SMBIOS_STRUCTURE_NODE_SIGNATURE SIGNATURE_32 ('S', 'm', 'b', 's')
120 struct _SMBIOS_STRUCTURE_NODE
{
131 EFI_GUID ProducerName
;
134 // the Smbios structure
136 UINT32 StructureSize
; // Actual structure size including strings
138 EFI_SMBIOS_TABLE_HEADER
*Structure
;
141 EFI_SMBIOS_HANDLE SmbiosHandle
; // Smbios Handle in SMBIOS database.
143 EFI_SMBIOS_TYPE SmbiosType
;
145 LIST_ENTRY LinkDataFixup
;
150 // Smbios type info table. Indicates minimum length
151 // for each Smbios type as the indicator of the initial size of buffer
152 // allocated for the structure instance of a specific type.
157 UINT8 MinLength
; // Minimal structure size including
158 // TWO trailing bytes of 0x00
160 BOOLEAN IsRequired
; // Required structure type defined by Smbios Spec
161 BOOLEAN IsCreated
; // Created in this run
162 } SMBIOS_TYPE_INFO_TABLE_ENTRY
;
165 // EDK framwork Memory Data hub definition to support EDK/Framework driver.
168 STRING_REF MemoryDeviceLocator
;
169 STRING_REF MemoryBankLocator
;
170 STRING_REF MemoryManufacturer
;
171 STRING_REF MemorySerialNumber
;
172 STRING_REF MemoryAssetTag
;
173 STRING_REF MemoryPartNumber
;
174 EFI_INTER_LINK_DATA MemoryArrayLink
;
175 EFI_INTER_LINK_DATA MemorySubArrayLink
;
176 UINT16 MemoryTotalWidth
;
177 UINT16 MemoryDataWidth
;
178 UINT64 MemoryDeviceSize
;
179 EFI_MEMORY_FORM_FACTOR MemoryFormFactor
;
180 UINT8 MemoryDeviceSet
;
181 EFI_MEMORY_ARRAY_TYPE MemoryType
;
182 EFI_MEMORY_TYPE_DETAIL MemoryTypeDetail
;
184 EFI_MEMORY_STATE MemoryState
;
185 UINT8 MemoryAttributes
;
186 } FRAMEWORK_MEMORY_ARRAY_LINK_DATA
;
189 EFI_MEMORY_ARRAY_LOCATION MemoryArrayLocation
;
190 EFI_MEMORY_ARRAY_USE MemoryArrayUse
;
191 EFI_MEMORY_ERROR_CORRECTION MemoryErrorCorrection
;
192 UINT32 MaximumMemoryCapacity
;
193 UINT16 NumberMemoryDevices
;
194 } FRAMEWORK_MEMORY_ARRAY_LOCATION_DATA
;
199 extern SMBIOS_CONVERSION_TABLE_ENTRY mConversionTable
[];
200 extern SMBIOS_TYPE_INFO_TABLE_ENTRY mTypeInfoTable
[];
201 extern LIST_ENTRY mStructureList
;
204 // Function Prototypes
207 Smbios data filter function. This function is invoked when there is data records
208 available in the Data Hub.
210 @param Event The event that is signaled.
211 @param Context not used here.
221 // Function prototypes
224 Process a datahub's record and find corresponding translation way to translate
227 @param Record Point to datahub record.
230 SmbiosProcessDataRecord (
231 IN EFI_DATA_RECORD_HEADER
*Record
235 Calculate the minimal length for a SMBIOS type. This length maybe not equal
236 to sizeof (SMBIOS_RECORD_STRUCTURE), but defined in conformance chapter in SMBIOS specification.
238 @param Type SMBIOS's type.
240 @return the minimal length of a smbios record.
243 SmbiosGetTypeMinimalLength (
248 Enlarge the structure buffer of a structure node in SMBIOS database.
249 The function maybe lead the structure pointer for SMBIOS record changed.
251 @param StructureNode The structure node whose structure buffer is to be enlarged.
252 @param NewLength The new length of SMBIOS record which does not include unformat area.
253 @param OldBufferSize The old size of SMBIOS record buffer.
254 @param NewBufferSize The new size is targeted for enlarged.
256 @retval EFI_OUT_OF_RESOURCES No more memory to allocate new record
257 @retval EFI_SUCCESS Success to enlarge the record buffer size.
260 SmbiosEnlargeStructureBuffer (
261 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
268 Update the structure buffer of a structure node in SMBIOS database.
269 The function lead the structure pointer for SMBIOS record changed.
271 @param StructureNode The structure node whose structure buffer is to be enlarged.
272 @param NewRecord The new SMBIOS record.
276 SmbiosUpdateStructureBuffer (
277 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
278 IN EFI_SMBIOS_TABLE_HEADER
*NewRecord
282 Fill a standard Smbios string field.
284 This function will convert the unicode string to single byte chars, and only
285 English language is supported.
286 This function changes the Structure pointer value of the structure node,
287 which should be noted by Caller.
289 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
290 @param Offset Offset of SMBIOS record which RecordData will be filled.
291 @param RecordData RecordData buffer will be filled.
292 @param RecordDataSize The size of RecordData buffer.
294 @retval EFI_INVALID_PARAMETER RecordDataSize is too larger
295 @retval EFI_OUT_OF_RESOURCES No memory to allocate new buffer for string
296 @retval EFI_SUCCESS Sucess append string for a SMBIOS record.
300 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
303 IN UINT32 RecordDataSize
307 Fill the inter link field for a SMBIOS recorder.
309 Some SMBIOS recorder need to reference the handle of another SMBIOS record. But
310 maybe another SMBIOS record has not been added, so put the InterLink request into
311 a linked list and the interlink will be fixedup when a new SMBIOS record is added.
313 @param StructureNode Point to SMBIOS_STRUCTURE_NODE which reference another record's handle
314 @param LinkSmbiosNodeOffset The offset in this record for holding the handle of another SMBIOS record
315 @param LinkSmbiosType The type of SMBIOS record want to be linked.
316 @param InterLink Point to EFI_INTER_LINK_DATA will be put linked list.
317 @param SubClassGuid The guid of subclass for linked SMBIOS record.
319 @retval EFI_SUCESS The linked record is found and no need fixup in future.
320 @retval !EFI_SUCESS The linked record can not be found and InterLink is put a fixing-p linked list.
324 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
325 IN UINT16 LinkSmbiosNodeOffset
,
326 IN UINT8 LinkSmbiosType
,
327 IN EFI_INTER_LINK_DATA
*InterLink
,
328 IN EFI_GUID
*SubClassGuid
332 Find a handle that matches the Link Data and the target Smbios type.
334 @param TargetType the Smbios type
335 @param SubClass the SubClass
336 @param LinkData Specifies Instance, SubInstance and ProducerName
337 @param Handle the HandleNum found
339 @retval EFI_NOT_FOUND Can not find the record according to handle
340 @retval EFI_SUCCESS Success to find the handle
345 IN EFI_GUID
*SubClass
,
346 IN EFI_INTER_LINK_DATA
*LinkData
,
347 IN OUT UINT16
*HandleNum
351 Field Filling Function. Transform an EFI_EXP_BASE10_DATA to a word, with 'Mega'
354 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
355 @param Offset Offset of SMBIOS record which RecordData will be filled.
356 @param RecordData RecordData buffer will be filled.
357 @param RecordDataSize The size of RecordData buffer.
359 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
360 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
363 SmbiosFldBase10ToWordWithMega (
364 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
367 IN UINT32 RecordDataSize
371 Field Filling Function. Transform an EFI_EXP_BASE2_DATA to a word, with 'Kilo'
372 as the unit. Granularity implemented for Cache Size.
374 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
375 @param Offset Offset of SMBIOS record which RecordData will be filled.
376 @param RecordData RecordData buffer will be filled.
377 @param RecordDataSize The size of RecordData buffer.
379 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
380 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
383 SmbiosFldBase2ToWordWithKilo (
384 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
387 IN UINT32 RecordDataSize
391 Field Filling Function: truncate record data to byte and fill in the
392 field as indicated by Offset.
394 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
395 @param Offset Offset of SMBIOS record which RecordData will be filled.
396 @param RecordData RecordData buffer will be filled.
397 @param RecordDataSize The size of RecordData buffer.
399 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
400 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
403 SmbiosFldTruncateToByte (
404 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
407 IN UINT32 RecordDataSize
411 Field Filling Function for Processor SubClass record type 6 -- ProcessorID.
414 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
415 @param Offset Offset of SMBIOS record which RecordData will be filled.
416 @param RecordData RecordData buffer will be filled.
417 @param RecordDataSize The size of RecordData buffer.
419 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
422 SmbiosFldProcessorType6 (
423 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
426 IN UINT32 RecordDataSize
430 Field Filling Function for Processor SubClass record type 9 -- Voltage.
433 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
434 @param Offset Offset of SMBIOS record which RecordData will be filled.
435 @param RecordData RecordData buffer will be filled.
436 @param RecordDataSize The size of RecordData buffer.
438 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
441 SmbiosFldProcessorType9 (
442 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
445 IN UINT32 RecordDataSize
449 Field Filling Function for Processor SubClass record type 17 -- Cache association.
451 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
452 @param Offset Offset of SMBIOS record which RecordData will be filled.
453 @param RecordData RecordData buffer will be filled.
454 @param RecordDataSize The size of RecordData buffer.
456 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
459 SmbiosFldProcessorType17 (
460 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
463 IN UINT32 RecordDataSize
467 Field Filling Function. Transform an EFI_EXP_BASE2_DATA to a word, with 10exp-9
470 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
471 @param Offset Offset of SMBIOS record which RecordData will be filled.
472 @param RecordData RecordData buffer will be filled.
473 @param RecordDataSize The size of RecordData buffer.
475 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
476 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
479 SmbiosFldBase10ToByteWithNano (
480 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
483 IN UINT32 RecordDataSize
487 Field Filling Function: truncate record data to byte and fill in the
488 field as indicated by Offset.
490 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
491 @param Offset Offset of SMBIOS record which RecordData will be filled.
492 @param RecordData RecordData buffer will be filled.
493 @param RecordDataSize The size of RecordData buffer.
495 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
496 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
499 SmbiosFldTruncateToWord (
500 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
503 IN UINT32 RecordDataSize
507 Field Filling Function for Cache SubClass record type 10 -- Cache Config.
510 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
511 @param Offset Offset of SMBIOS record which RecordData will be filled.
512 @param RecordData RecordData buffer will be filled.
513 @param RecordDataSize The size of RecordData buffer.
515 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
518 SmbiosFldCacheType10 (
519 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
522 IN UINT32 RecordDataSize
526 Check if OEM structure has included 2 trailing 0s in data record.
528 @param RecordData Point to record data will be checked.
529 @param RecordDataSize The size of record data.
531 @retval 0 2 trailing 0s exist in unformatted section
532 @retval 1 1 trailing 0 exists at the end of unformatted section
533 @retval -1 There is no 0 at the end of unformatted section
536 SmbiosCheckTrailingZero (
538 IN UINT32 RecordDataSize
542 Field Filling Function for Cache SubClass record type 5&6 -- Cache SRAM type.
545 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
546 @param Offset Offset of SMBIOS record which RecordData will be filled.
547 @param RecordData RecordData buffer will be filled.
548 @param RecordDataSize The size of RecordData buffer.
550 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
553 SmbiosFldCacheType5 (
554 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
557 IN UINT32 RecordDataSize
561 Field Filling Function for Memory SubClass record type 2 -- Physical Memory
564 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
565 @param Offset Offset of SMBIOS record which RecordData will be filled.
566 @param RecordData RecordData buffer will be filled.
567 @param RecordDataSize The size of RecordData buffer.
569 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
572 SmbiosFldMemoryType2 (
573 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
576 IN UINT32 RecordDataSize
580 Field Filling Function for Memory SubClass record type 3 -
581 - Memory Device: SMBIOS Type 17
583 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
584 @param Offset Offset of SMBIOS record which RecordData will be filled.
585 @param RecordData RecordData buffer will be filled.
586 @param RecordDataSize The size of RecordData buffer.
588 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
591 SmbiosFldMemoryType3 (
592 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
595 IN UINT32 RecordDataSize
599 Field Filling Function for Memory SubClass record type 4
600 -- Memory Array Mapped Address: SMBIOS Type 19
602 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
603 @param Offset Offset of SMBIOS record which RecordData will be filled.
604 @param RecordData RecordData buffer will be filled.
605 @param RecordDataSize The size of RecordData buffer.
607 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
610 SmbiosFldMemoryType4 (
611 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
614 IN UINT32 RecordDataSize
618 Field Filling Function for Memory SubClass record type 5
619 -- Memory Device Mapped Address: SMBIOS Type 20
621 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
622 @param Offset Offset of SMBIOS record which RecordData will be filled.
623 @param RecordData RecordData buffer will be filled.
624 @param RecordDataSize The size of RecordData buffer.
626 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
629 SmbiosFldMemoryType5 (
630 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
633 IN UINT32 RecordDataSize
637 Field Filling Function for Memory SubClass record type 6
638 -- Memory Channel Type: SMBIOS Type 37
640 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
641 @param Offset Offset of SMBIOS record which RecordData will be filled.
642 @param RecordData RecordData buffer will be filled.
643 @param RecordDataSize The size of RecordData buffer.
645 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
648 SmbiosFldMemoryType6 (
649 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
652 IN UINT32 RecordDataSize
656 Field Filling Function for Memory SubClass record type 7
657 -- Memory Channel Device: SMBIOS Type 37
659 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
660 @param Offset Offset of SMBIOS record which RecordData will be filled.
661 @param RecordData RecordData buffer will be filled.
662 @param RecordDataSize The size of RecordData buffer.
664 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
667 SmbiosFldMemoryType7 (
668 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
671 IN UINT32 RecordDataSize
675 Field Filling Function for Memory SubClass record type 8
676 -- Memory Controller information: SMBIOS Type 5
678 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
679 @param Offset Offset of SMBIOS record which RecordData will be filled.
680 @param RecordData RecordData buffer will be filled.
681 @param RecordDataSize The size of RecordData buffer.
683 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
686 SmbiosFldMemoryType8 (
687 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
690 IN UINT32 RecordDataSize
694 Field Filling Function for Memory SubClass record type
695 -- Memory 32 Bit Error Information: SMBIOS Type 18
697 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
698 @param Offset Offset of SMBIOS record which RecordData will be filled.
699 @param RecordData RecordData buffer will be filled.
700 @param RecordDataSize The size of RecordData buffer.
702 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
705 SmbiosFldMemoryType9 (
706 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
709 IN UINT32 RecordDataSize
713 Field Filling Function for Memory SubClass record type
714 -- Memory 64 Bit Error Information: SMBIOS Type 33
716 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
717 @param Offset Offset of SMBIOS record which RecordData will be filled.
718 @param RecordData RecordData buffer will be filled.
719 @param RecordDataSize The size of RecordData buffer.
721 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
724 SmbiosFldMemoryType10 (
725 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
728 IN UINT32 RecordDataSize
732 Field Filling Function for Misc SubClass record type 0 -- Bios Information.
734 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
735 @param Offset Offset of SMBIOS record which RecordData will be filled.
736 @param RecordData RecordData buffer will be filled.
737 @param RecordDataSize The size of RecordData buffer.
739 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
743 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
746 IN UINT32 RecordDataSize
750 Field Filling Function. Transform an EFI_EXP_BASE2_DATA to a byte, with '64k'
753 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
754 @param Offset Offset of SMBIOS record which RecordData will be filled.
755 @param RecordData RecordData buffer will be filled.
756 @param RecordDataSize The size of RecordData buffer.
758 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
759 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
762 SmbiosFldBase2ToByteWith64K (
763 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
766 IN UINT32 RecordDataSize
770 Field Filling Function for Misc SubClass record type 1 -- System Information.
772 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
773 @param Offset Offset of SMBIOS record which RecordData will be filled.
774 @param RecordData RecordData buffer will be filled.
775 @param RecordDataSize The size of RecordData buffer.
777 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
781 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
784 IN UINT32 RecordDataSize
788 Field Filling Function for record type 2 -- Base Board Manufacture.
790 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
791 @param Offset Offset of SMBIOS record which RecordData will be filled.
792 @param RecordData RecordData buffer will be filled.
793 @param RecordDataSize The size of RecordData buffer.
795 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
799 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
802 IN UINT32 RecordDataSize
806 Field Filling Function for Misc SubClass record type 3 -
807 - System Enclosure or Chassis.
809 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
810 @param Offset Offset of SMBIOS record which RecordData will be filled.
811 @param RecordData RecordData buffer will be filled.
812 @param RecordDataSize The size of RecordData buffer.
814 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
818 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
821 IN UINT32 RecordDataSize
825 Field Filling Function for Misc SubClass record type 8 -- Port Connector.
827 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
828 @param Offset Offset of SMBIOS record which RecordData will be filled.
829 @param RecordData RecordData buffer will be filled.
830 @param RecordDataSize The size of RecordData buffer.
832 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
836 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
839 IN UINT32 RecordDataSize
843 Field Filling Function for Misc SubClass record type 9 -- System slot.
845 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
846 @param Offset Offset of SMBIOS record which RecordData will be filled.
847 @param RecordData RecordData buffer will be filled.
848 @param RecordDataSize The size of RecordData buffer.
850 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
854 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
857 IN UINT32 RecordDataSize
861 Field Filling Function for Misc SubClass record type 10 - Onboard Device.
863 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
864 @param Offset Offset of SMBIOS record which RecordData will be filled.
865 @param RecordData RecordData buffer will be filled.
866 @param RecordDataSize The size of RecordData buffer.
868 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
871 SmbiosFldMiscType10 (
872 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
875 IN UINT32 RecordDataSize
879 Field Filling Function for Misc SubClass record type 11 - OEM Strings.
881 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
882 @param Offset Offset of SMBIOS record which RecordData will be filled.
883 @param RecordData RecordData buffer will be filled.
884 @param RecordDataSize The size of RecordData buffer.
886 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
889 SmbiosFldMiscType11 (
890 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
893 IN UINT32 RecordDataSize
897 Field Filling Function for Misc SubClass record type 12 - System Options.
899 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
900 @param Offset Offset of SMBIOS record which RecordData will be filled.
901 @param RecordData RecordData buffer will be filled.
902 @param RecordDataSize The size of RecordData buffer.
904 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
907 SmbiosFldMiscType12 (
908 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
911 IN UINT32 RecordDataSize
915 Field Filling Function for Misc SubClass record type 13 - BIOS Language.
917 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
918 @param Offset Offset of SMBIOS record which RecordData will be filled.
919 @param RecordData RecordData buffer will be filled.
920 @param RecordDataSize The size of RecordData buffer.
922 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
925 SmbiosFldMiscType13 (
926 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
929 IN UINT32 RecordDataSize
933 Field Filling Function for Misc SubClass record type 14 - System Language String
934 Current solution assumes that EFI_MISC_SYSTEM_LANGUAGE_STRINGs are logged with
935 their LanguageId having ascending orders.
937 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
938 @param Offset Offset of SMBIOS record which RecordData will be filled.
939 @param RecordData RecordData buffer will be filled.
940 @param RecordDataSize The size of RecordData buffer.
942 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
945 SmbiosFldMiscType14 (
946 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
949 IN UINT32 RecordDataSize
953 Field Filling Function for Misc SubClass record type 15 -- System Event Log.
955 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
956 @param Offset Offset of SMBIOS record which RecordData will be filled.
957 @param RecordData RecordData buffer will be filled.
958 @param RecordDataSize The size of RecordData buffer.
960 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
963 SmbiosFldMiscType15 (
964 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
967 IN UINT32 RecordDataSize
971 Field Filling Function for Misc SubClass record type 21 - Pointing Device.
973 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
974 @param Offset Offset of SMBIOS record which RecordData will be filled.
975 @param RecordData RecordData buffer will be filled.
976 @param RecordDataSize The size of RecordData buffer.
978 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
981 SmbiosFldMiscType21 (
982 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
985 IN UINT32 RecordDataSize
990 Field Filling Function for Misc SubClass record type 32 -- System Boot Information.
992 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
993 @param Offset Offset of SMBIOS record which RecordData will be filled.
994 @param RecordData RecordData buffer will be filled.
995 @param RecordDataSize The size of RecordData buffer.
997 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1000 SmbiosFldMiscType32 (
1001 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1003 IN VOID
*RecordData
,
1004 IN UINT32 RecordDataSize
1008 Field Filling Function for Misc SubClass record type 38 -- IPMI device info.
1010 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1011 @param Offset Offset of SMBIOS record which RecordData will be filled.
1012 @param RecordData RecordData buffer will be filled.
1013 @param RecordDataSize The size of RecordData buffer.
1015 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1018 SmbiosFldMiscType38 (
1019 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1021 IN VOID
*RecordData
,
1022 IN UINT32 RecordDataSize
1026 Field Filling Function for Misc SubClass record type 0x80-0xFF -- OEM.
1028 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1029 @param Offset Offset of SMBIOS record which RecordData will be filled.
1030 @param RecordData RecordData buffer will be filled.
1031 @param RecordDataSize The size of RecordData buffer.
1033 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1036 SmbiosFldMiscTypeOEM (
1037 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1039 IN VOID
*RecordData
,
1040 IN UINT32 RecordDataSize
1044 Field Filling Function for Memory SubClass record type 3 -
1045 - Memory Device: SMBIOS Type 6
1047 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1048 @param Offset Offset of SMBIOS record which RecordData will be filled.
1049 @param RecordData RecordData buffer will be filled.
1050 @param RecordDataSize The size of RecordData buffer.
1052 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1055 SmbiosFldSMBIOSType6 (
1056 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1058 IN VOID
*RecordData
,
1059 IN UINT32 RecordDataSize
1063 Field Filling Function for Misc SubClass record type 22 - Portable Battery.
1065 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1066 @param Offset Offset of SMBIOS record which RecordData will be filled.
1067 @param RecordData RecordData buffer will be filled.
1068 @param RecordDataSize The size of RecordData buffer.
1070 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1073 SmbiosFldMiscType22 (
1074 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1076 IN VOID
*RecordData
,
1077 IN UINT32 RecordDataSize
1081 Field Filling Function for Misc SubClass record type 22 - Portable Battery.
1083 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1084 @param Offset Offset of SMBIOS record which RecordData will be filled.
1085 @param RecordData RecordData buffer will be filled.
1086 @param RecordDataSize The size of RecordData buffer.
1088 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1091 SmbiosFldMiscType22 (
1092 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1094 IN VOID
*RecordData
,
1095 IN UINT32 RecordDataSize
1099 Field Filling Function for Misc SubClass record type 23 - System Reset.
1101 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1102 @param Offset Offset of SMBIOS record which RecordData will be filled.
1103 @param RecordData RecordData buffer will be filled.
1104 @param RecordDataSize The size of RecordData buffer.
1106 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1109 SmbiosFldMiscType23 (
1110 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1112 IN VOID
*RecordData
,
1113 IN UINT32 RecordDataSize
1117 Field Filling Function for Misc SubClass record type 24 - Hardware Security.
1119 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1120 @param Offset Offset of SMBIOS record which RecordData will be filled.
1121 @param RecordData RecordData buffer will be filled.
1122 @param RecordDataSize The size of RecordData buffer.
1124 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1127 SmbiosFldMiscType24 (
1128 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1130 IN VOID
*RecordData
,
1131 IN UINT32 RecordDataSize
1135 Field Filling Function for Misc SubClass record type 25 - System Power Controls.
1137 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1138 @param Offset Offset of SMBIOS record which RecordData will be filled.
1139 @param RecordData RecordData buffer will be filled.
1140 @param RecordDataSize The size of RecordData buffer.
1142 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1145 SmbiosFldMiscType25 (
1146 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1148 IN VOID
*RecordData
,
1149 IN UINT32 RecordDataSize
1153 Field Filling Function for Misc SubClass record type 26 - Voltage Probe.
1155 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1156 @param Offset Offset of SMBIOS record which RecordData will be filled.
1157 @param RecordData RecordData buffer will be filled.
1158 @param RecordDataSize The size of RecordData buffer.
1160 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1163 SmbiosFldMiscType26 (
1164 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1166 IN VOID
*RecordData
,
1167 IN UINT32 RecordDataSize
1171 Field Filling Function for Misc SubClass record type 27 - Cooling Device.
1173 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1174 @param Offset Offset of SMBIOS record which RecordData will be filled.
1175 @param RecordData RecordData buffer will be filled.
1176 @param RecordDataSize The size of RecordData buffer.
1178 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1181 SmbiosFldMiscType27 (
1182 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1184 IN VOID
*RecordData
,
1185 IN UINT32 RecordDataSize
1189 Field Filling Function for Misc SubClass record type 28 -- Temperature Probe.
1191 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1192 @param Offset Offset of SMBIOS record which RecordData will be filled.
1193 @param RecordData RecordData buffer will be filled.
1194 @param RecordDataSize The size of RecordData buffer.
1196 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1199 SmbiosFldMiscType28 (
1200 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1202 IN VOID
*RecordData
,
1203 IN UINT32 RecordDataSize
1207 Field Filling Function for Misc SubClass record type 29 -- Electrical Current Probe.
1209 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1210 @param Offset Offset of SMBIOS record which RecordData will be filled.
1211 @param RecordData RecordData buffer will be filled.
1212 @param RecordDataSize The size of RecordData buffer.
1214 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1217 SmbiosFldMiscType29 (
1218 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1220 IN VOID
*RecordData
,
1221 IN UINT32 RecordDataSize
1225 Field Filling Function for Misc SubClass record type 30 -- Out-of-Band Remote Access.
1227 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1228 @param Offset Offset of SMBIOS record which RecordData will be filled.
1229 @param RecordData RecordData buffer will be filled.
1230 @param RecordDataSize The size of RecordData buffer.
1232 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1235 SmbiosFldMiscType30 (
1236 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1238 IN VOID
*RecordData
,
1239 IN UINT32 RecordDataSize
1243 Field Filling Function for Misc SubClass record type 34 -- Management Device.
1245 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1246 @param Offset Offset of SMBIOS record which RecordData will be filled.
1247 @param RecordData RecordData buffer will be filled.
1248 @param RecordDataSize The size of RecordData buffer.
1250 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1253 SmbiosFldMiscType34 (
1254 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1256 IN VOID
*RecordData
,
1257 IN UINT32 RecordDataSize
1261 Field Filling Function for Misc SubClass record type 35 -- Management Device Component.
1263 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1264 @param Offset Offset of SMBIOS record which RecordData will be filled.
1265 @param RecordData RecordData buffer will be filled.
1266 @param RecordDataSize The size of RecordData buffer.
1268 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1271 SmbiosFldMiscType35 (
1272 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1274 IN VOID
*RecordData
,
1275 IN UINT32 RecordDataSize
1279 Field Filling Function for Misc SubClass record type 36 -- Management Device Threshold.
1281 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1282 @param Offset Offset of SMBIOS record which RecordData will be filled.
1283 @param RecordData RecordData buffer will be filled.
1284 @param RecordDataSize The size of RecordData buffer.
1286 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1289 SmbiosFldMiscType36 (
1290 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1292 IN VOID
*RecordData
,
1293 IN UINT32 RecordDataSize
1297 Field Filling Function for Misc SubClass record type 38 -- IPMI device info.
1299 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1300 @param Offset Offset of SMBIOS record which RecordData will be filled.
1301 @param RecordData RecordData buffer will be filled.
1302 @param RecordDataSize The size of RecordData buffer.
1304 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1307 SmbiosFldMiscType38 (
1308 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1310 IN VOID
*RecordData
,
1311 IN UINT32 RecordDataSize
1315 Field Filling Function for Misc SubClass record type 39 -- Power supply.
1317 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1318 @param Offset Offset of SMBIOS record which RecordData will be filled.
1319 @param RecordData RecordData buffer will be filled.
1320 @param RecordDataSize The size of RecordData buffer.
1322 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1325 SmbiosFldMiscType39 (
1326 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1328 IN VOID
*RecordData
,
1329 IN UINT32 RecordDataSize
1333 Field Filling Function for Misc SubClass record type 127 - End-of-Table.
1335 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1336 @param Offset Offset of SMBIOS record which RecordData will be filled.
1337 @param RecordData RecordData buffer will be filled.
1338 @param RecordDataSize The size of RecordData buffer.
1340 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1343 SmbiosFldMiscType127 (
1344 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1346 IN VOID
*RecordData
,
1347 IN UINT32 RecordDataSize
1351 Create a blank smbios record. The datahub record is only a field of smbios record.
1352 So before fill any field from datahub's record. A blank smbios record need to be
1355 @param ProducerHandle The produce handle for a datahub record
1356 @param StructureNode Point to SMBIOS_STRUCTURE_NODE
1358 @retval EFI_OUT_OF_RESOURCES Fail to allocate memory for new blank SMBIOS record.
1359 @retval EFI_SUCCESS Success to create blank smbios record.
1362 SmbiosProtocolCreateRecord (
1363 IN EFI_HANDLE ProducerHandle
, OPTIONAL
1364 IN SMBIOS_STRUCTURE_NODE
*StructureNode
1368 Get pointer of EFI_SMBIOS_PROTOCOL.
1370 @return pointer of EFI_SMBIOS_PROTOCOL.
1372 EFI_SMBIOS_PROTOCOL
*
1378 Get pointer of a SMBIOS record's buffer according to its handle.
1380 @param Handle The handle of SMBIOS record want to be searched.
1381 @param Type The type of SMBIOS record want to be searched.
1382 @param ProducerHandle The producer handle of SMBIOS record.
1384 @return EFI_SMBIOS_TABLE_HEADER Point to a SMBIOS record's buffer.
1386 EFI_SMBIOS_TABLE_HEADER
*
1387 GetSmbiosBufferFromHandle (
1388 IN EFI_SMBIOS_HANDLE Handle
,
1389 IN EFI_SMBIOS_TYPE Type
,
1390 IN EFI_HANDLE ProducerHandle OPTIONAL
1395 Get the full size of smbios structure including optional strings that follow the formatted structure.
1397 @param Head Pointer to the beginning of smbios structure.
1398 @param Size The returned size.
1399 @param NumberOfStrings The returned number of optional strings that follow the formatted structure.
1401 @retval EFI_SUCCESS Size retured in Size.
1402 @retval EFI_INVALID_PARAMETER Input smbios structure mal-formed or Size is NULL.
1407 GetSmbiosStructureSize (
1408 IN EFI_SMBIOS_TABLE_HEADER
*Head
,
1410 OUT UINT8
*NumberOfStrings