2 The common header file for the thunk driver.
4 Copyright (c) 2009 - 2010, Intel Corporation. <BR>
5 All rights reserved. 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 Fill a standard Smbios string field.
270 This function will convert the unicode string to single byte chars, and only
271 English language is supported.
272 This function changes the Structure pointer value of the structure node,
273 which should be noted by Caller.
275 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
276 @param Offset Offset of SMBIOS record which RecordData will be filled.
277 @param RecordData RecordData buffer will be filled.
278 @param RecordDataSize The size of RecordData buffer.
280 @retval EFI_INVALID_PARAMETER RecordDataSize is too larger
281 @retval EFI_OUT_OF_RESOURCES No memory to allocate new buffer for string
282 @retval EFI_SUCCESS Sucess append string for a SMBIOS record.
286 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
289 IN UINT32 RecordDataSize
293 Fill the inter link field for a SMBIOS recorder.
295 Some SMBIOS recorder need to reference the handle of another SMBIOS record. But
296 maybe another SMBIOS record has not been added, so put the InterLink request into
297 a linked list and the interlink will be fixedup when a new SMBIOS record is added.
299 @param StructureNode Point to SMBIOS_STRUCTURE_NODE which reference another record's handle
300 @param LinkSmbiosNodeOffset The offset in this record for holding the handle of another SMBIOS record
301 @param LinkSmbiosType The type of SMBIOS record want to be linked.
302 @param InterLink Point to EFI_INTER_LINK_DATA will be put linked list.
303 @param SubClassGuid The guid of subclass for linked SMBIOS record.
305 @retval EFI_SUCESS The linked record is found and no need fixup in future.
306 @retval !EFI_SUCESS The linked record can not be found and InterLink is put a fixing-p linked list.
310 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
311 IN UINT16 LinkSmbiosNodeOffset
,
312 IN UINT8 LinkSmbiosType
,
313 IN EFI_INTER_LINK_DATA
*InterLink
,
314 IN EFI_GUID
*SubClassGuid
318 Find a handle that matches the Link Data and the target Smbios type.
320 @param TargetType the Smbios type
321 @param SubClass the SubClass
322 @param LinkData Specifies Instance, SubInstance and ProducerName
323 @param Handle the HandleNum found
325 @retval EFI_NOT_FOUND Can not find the record according to handle
326 @retval EFI_SUCCESS Success to find the handle
331 IN EFI_GUID
*SubClass
,
332 IN EFI_INTER_LINK_DATA
*LinkData
,
333 IN OUT UINT16
*HandleNum
337 Field Filling Function. Transform an EFI_EXP_BASE10_DATA to a word, with 'Mega'
340 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
341 @param Offset Offset of SMBIOS record which RecordData will be filled.
342 @param RecordData RecordData buffer will be filled.
343 @param RecordDataSize The size of RecordData buffer.
345 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
346 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
349 SmbiosFldBase10ToWordWithMega (
350 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
353 IN UINT32 RecordDataSize
357 Field Filling Function. Transform an EFI_EXP_BASE2_DATA to a word, with 'Kilo'
358 as the unit. Granularity implemented for Cache Size.
360 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
361 @param Offset Offset of SMBIOS record which RecordData will be filled.
362 @param RecordData RecordData buffer will be filled.
363 @param RecordDataSize The size of RecordData buffer.
365 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
366 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
369 SmbiosFldBase2ToWordWithKilo (
370 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
373 IN UINT32 RecordDataSize
377 Field Filling Function: truncate record data to byte and fill in the
378 field as indicated by Offset.
380 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
381 @param Offset Offset of SMBIOS record which RecordData will be filled.
382 @param RecordData RecordData buffer will be filled.
383 @param RecordDataSize The size of RecordData buffer.
385 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
386 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
389 SmbiosFldTruncateToByte (
390 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
393 IN UINT32 RecordDataSize
397 Field Filling Function for Processor SubClass record type 6 -- ProcessorID.
400 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
401 @param Offset Offset of SMBIOS record which RecordData will be filled.
402 @param RecordData RecordData buffer will be filled.
403 @param RecordDataSize The size of RecordData buffer.
405 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
408 SmbiosFldProcessorType6 (
409 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
412 IN UINT32 RecordDataSize
416 Field Filling Function for Processor SubClass record type 9 -- Voltage.
419 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
420 @param Offset Offset of SMBIOS record which RecordData will be filled.
421 @param RecordData RecordData buffer will be filled.
422 @param RecordDataSize The size of RecordData buffer.
424 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
427 SmbiosFldProcessorType9 (
428 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
431 IN UINT32 RecordDataSize
435 Field Filling Function for Processor SubClass record type 17 -- Cache association.
437 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
438 @param Offset Offset of SMBIOS record which RecordData will be filled.
439 @param RecordData RecordData buffer will be filled.
440 @param RecordDataSize The size of RecordData buffer.
442 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
445 SmbiosFldProcessorType17 (
446 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
449 IN UINT32 RecordDataSize
453 Field Filling Function. Transform an EFI_EXP_BASE2_DATA to a word, with 10exp-9
456 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
457 @param Offset Offset of SMBIOS record which RecordData will be filled.
458 @param RecordData RecordData buffer will be filled.
459 @param RecordDataSize The size of RecordData buffer.
461 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
462 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
465 SmbiosFldBase10ToByteWithNano (
466 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
469 IN UINT32 RecordDataSize
473 Field Filling Function: truncate record data to byte and fill in the
474 field as indicated by Offset.
476 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
477 @param Offset Offset of SMBIOS record which RecordData will be filled.
478 @param RecordData RecordData buffer will be filled.
479 @param RecordDataSize The size of RecordData buffer.
481 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
482 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
485 SmbiosFldTruncateToWord (
486 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
489 IN UINT32 RecordDataSize
493 Field Filling Function for Cache SubClass record type 10 -- Cache Config.
496 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
497 @param Offset Offset of SMBIOS record which RecordData will be filled.
498 @param RecordData RecordData buffer will be filled.
499 @param RecordDataSize The size of RecordData buffer.
501 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
504 SmbiosFldCacheType10 (
505 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
508 IN UINT32 RecordDataSize
512 Check if OEM structure has included 2 trailing 0s in data record.
514 @param RecordData Point to record data will be checked.
515 @param RecordDataSize The size of record data.
517 @retval 0 2 trailing 0s exist in unformatted section
518 @retval 1 1 trailing 0 exists at the end of unformatted section
519 @retval -1 There is no 0 at the end of unformatted section
522 SmbiosCheckTrailingZero (
524 IN UINT32 RecordDataSize
528 Field Filling Function for Cache SubClass record type 5&6 -- Cache SRAM type.
531 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
532 @param Offset Offset of SMBIOS record which RecordData will be filled.
533 @param RecordData RecordData buffer will be filled.
534 @param RecordDataSize The size of RecordData buffer.
536 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
539 SmbiosFldCacheType5 (
540 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
543 IN UINT32 RecordDataSize
547 Field Filling Function for Memory SubClass record type 2 -- Physical Memory
550 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
551 @param Offset Offset of SMBIOS record which RecordData will be filled.
552 @param RecordData RecordData buffer will be filled.
553 @param RecordDataSize The size of RecordData buffer.
555 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
558 SmbiosFldMemoryType2 (
559 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
562 IN UINT32 RecordDataSize
566 Field Filling Function for Memory SubClass record type 3 -
567 - Memory Device: SMBIOS Type 17
569 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
570 @param Offset Offset of SMBIOS record which RecordData will be filled.
571 @param RecordData RecordData buffer will be filled.
572 @param RecordDataSize The size of RecordData buffer.
574 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
577 SmbiosFldMemoryType3 (
578 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
581 IN UINT32 RecordDataSize
585 Field Filling Function for Memory SubClass record type 4
586 -- Memory Array Mapped Address: SMBIOS Type 19
588 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
589 @param Offset Offset of SMBIOS record which RecordData will be filled.
590 @param RecordData RecordData buffer will be filled.
591 @param RecordDataSize The size of RecordData buffer.
593 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
596 SmbiosFldMemoryType4 (
597 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
600 IN UINT32 RecordDataSize
604 Field Filling Function for Memory SubClass record type 5
605 -- Memory Device Mapped Address: SMBIOS Type 20
607 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
608 @param Offset Offset of SMBIOS record which RecordData will be filled.
609 @param RecordData RecordData buffer will be filled.
610 @param RecordDataSize The size of RecordData buffer.
612 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
615 SmbiosFldMemoryType5 (
616 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
619 IN UINT32 RecordDataSize
623 Field Filling Function for Memory SubClass record type 6
624 -- Memory Channel Type: SMBIOS Type 37
626 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
627 @param Offset Offset of SMBIOS record which RecordData will be filled.
628 @param RecordData RecordData buffer will be filled.
629 @param RecordDataSize The size of RecordData buffer.
631 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
634 SmbiosFldMemoryType6 (
635 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
638 IN UINT32 RecordDataSize
642 Field Filling Function for Memory SubClass record type 7
643 -- Memory Channel Device: SMBIOS Type 37
645 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
646 @param Offset Offset of SMBIOS record which RecordData will be filled.
647 @param RecordData RecordData buffer will be filled.
648 @param RecordDataSize The size of RecordData buffer.
650 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
653 SmbiosFldMemoryType7 (
654 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
657 IN UINT32 RecordDataSize
661 Field Filling Function for Memory SubClass record type 8
662 -- Memory Controller information: SMBIOS Type 5
664 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
665 @param Offset Offset of SMBIOS record which RecordData will be filled.
666 @param RecordData RecordData buffer will be filled.
667 @param RecordDataSize The size of RecordData buffer.
669 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
672 SmbiosFldMemoryType8 (
673 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
676 IN UINT32 RecordDataSize
680 Field Filling Function for Memory SubClass record type
681 -- Memory 32 Bit Error Information: SMBIOS Type 18
683 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
684 @param Offset Offset of SMBIOS record which RecordData will be filled.
685 @param RecordData RecordData buffer will be filled.
686 @param RecordDataSize The size of RecordData buffer.
688 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
691 SmbiosFldMemoryType9 (
692 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
695 IN UINT32 RecordDataSize
699 Field Filling Function for Memory SubClass record type
700 -- Memory 64 Bit Error Information: SMBIOS Type 33
702 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
703 @param Offset Offset of SMBIOS record which RecordData will be filled.
704 @param RecordData RecordData buffer will be filled.
705 @param RecordDataSize The size of RecordData buffer.
707 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
710 SmbiosFldMemoryType10 (
711 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
714 IN UINT32 RecordDataSize
718 Field Filling Function for Misc SubClass record type 0 -- Bios Information.
720 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
721 @param Offset Offset of SMBIOS record which RecordData will be filled.
722 @param RecordData RecordData buffer will be filled.
723 @param RecordDataSize The size of RecordData buffer.
725 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
729 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
732 IN UINT32 RecordDataSize
736 Field Filling Function. Transform an EFI_EXP_BASE2_DATA to a byte, with '64k'
739 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
740 @param Offset Offset of SMBIOS record which RecordData will be filled.
741 @param RecordData RecordData buffer will be filled.
742 @param RecordDataSize The size of RecordData buffer.
744 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
745 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
748 SmbiosFldBase2ToByteWith64K (
749 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
752 IN UINT32 RecordDataSize
756 Field Filling Function for Misc SubClass record type 1 -- System Information.
758 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
759 @param Offset Offset of SMBIOS record which RecordData will be filled.
760 @param RecordData RecordData buffer will be filled.
761 @param RecordDataSize The size of RecordData buffer.
763 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
767 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
770 IN UINT32 RecordDataSize
774 Field Filling Function for record type 2 -- Base Board Manufacture.
776 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
777 @param Offset Offset of SMBIOS record which RecordData will be filled.
778 @param RecordData RecordData buffer will be filled.
779 @param RecordDataSize The size of RecordData buffer.
781 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
785 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
788 IN UINT32 RecordDataSize
792 Field Filling Function for Misc SubClass record type 3 -
793 - System Enclosure or Chassis.
795 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
796 @param Offset Offset of SMBIOS record which RecordData will be filled.
797 @param RecordData RecordData buffer will be filled.
798 @param RecordDataSize The size of RecordData buffer.
800 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
804 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
807 IN UINT32 RecordDataSize
811 Field Filling Function for Misc SubClass record type 8 -- Port Connector.
813 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
814 @param Offset Offset of SMBIOS record which RecordData will be filled.
815 @param RecordData RecordData buffer will be filled.
816 @param RecordDataSize The size of RecordData buffer.
818 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
822 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
825 IN UINT32 RecordDataSize
829 Field Filling Function for Misc SubClass record type 9 -- System slot.
831 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
832 @param Offset Offset of SMBIOS record which RecordData will be filled.
833 @param RecordData RecordData buffer will be filled.
834 @param RecordDataSize The size of RecordData buffer.
836 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
840 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
843 IN UINT32 RecordDataSize
847 Field Filling Function for Misc SubClass record type 10 - Onboard Device.
849 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
850 @param Offset Offset of SMBIOS record which RecordData will be filled.
851 @param RecordData RecordData buffer will be filled.
852 @param RecordDataSize The size of RecordData buffer.
854 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
857 SmbiosFldMiscType10 (
858 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
861 IN UINT32 RecordDataSize
865 Field Filling Function for Misc SubClass record type 11 - OEM Strings.
867 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
868 @param Offset Offset of SMBIOS record which RecordData will be filled.
869 @param RecordData RecordData buffer will be filled.
870 @param RecordDataSize The size of RecordData buffer.
872 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
875 SmbiosFldMiscType11 (
876 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
879 IN UINT32 RecordDataSize
883 Field Filling Function for Misc SubClass record type 12 - System Options.
885 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
886 @param Offset Offset of SMBIOS record which RecordData will be filled.
887 @param RecordData RecordData buffer will be filled.
888 @param RecordDataSize The size of RecordData buffer.
890 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
893 SmbiosFldMiscType12 (
894 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
897 IN UINT32 RecordDataSize
901 Field Filling Function for Misc SubClass record type 13 - BIOS Language.
903 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
904 @param Offset Offset of SMBIOS record which RecordData will be filled.
905 @param RecordData RecordData buffer will be filled.
906 @param RecordDataSize The size of RecordData buffer.
908 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
911 SmbiosFldMiscType13 (
912 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
915 IN UINT32 RecordDataSize
919 Field Filling Function for Misc SubClass record type 14 - System Language String
920 Current solution assumes that EFI_MISC_SYSTEM_LANGUAGE_STRINGs are logged with
921 their LanguageId having ascending orders.
923 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
924 @param Offset Offset of SMBIOS record which RecordData will be filled.
925 @param RecordData RecordData buffer will be filled.
926 @param RecordDataSize The size of RecordData buffer.
928 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
931 SmbiosFldMiscType14 (
932 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
935 IN UINT32 RecordDataSize
939 Field Filling Function for Misc SubClass record type 15 -- System Event Log.
941 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
942 @param Offset Offset of SMBIOS record which RecordData will be filled.
943 @param RecordData RecordData buffer will be filled.
944 @param RecordDataSize The size of RecordData buffer.
946 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
949 SmbiosFldMiscType15 (
950 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
953 IN UINT32 RecordDataSize
957 Field Filling Function for Misc SubClass record type 21 - Pointing Device.
959 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
960 @param Offset Offset of SMBIOS record which RecordData will be filled.
961 @param RecordData RecordData buffer will be filled.
962 @param RecordDataSize The size of RecordData buffer.
964 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
967 SmbiosFldMiscType21 (
968 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
971 IN UINT32 RecordDataSize
976 Field Filling Function for Misc SubClass record type 32 -- System Boot Information.
978 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
979 @param Offset Offset of SMBIOS record which RecordData will be filled.
980 @param RecordData RecordData buffer will be filled.
981 @param RecordDataSize The size of RecordData buffer.
983 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
986 SmbiosFldMiscType32 (
987 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
990 IN UINT32 RecordDataSize
994 Field Filling Function for Misc SubClass record type 38 -- IPMI device info.
996 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
997 @param Offset Offset of SMBIOS record which RecordData will be filled.
998 @param RecordData RecordData buffer will be filled.
999 @param RecordDataSize The size of RecordData buffer.
1001 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1004 SmbiosFldMiscType38 (
1005 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1007 IN VOID
*RecordData
,
1008 IN UINT32 RecordDataSize
1012 Field Filling Function for Misc SubClass record type 0x80-0xFF -- OEM.
1014 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1015 @param Offset Offset of SMBIOS record which RecordData will be filled.
1016 @param RecordData RecordData buffer will be filled.
1017 @param RecordDataSize The size of RecordData buffer.
1019 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1022 SmbiosFldMiscTypeOEM (
1023 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1025 IN VOID
*RecordData
,
1026 IN UINT32 RecordDataSize
1030 Field Filling Function for Memory SubClass record type 3 -
1031 - Memory Device: SMBIOS Type 6
1033 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1034 @param Offset Offset of SMBIOS record which RecordData will be filled.
1035 @param RecordData RecordData buffer will be filled.
1036 @param RecordDataSize The size of RecordData buffer.
1038 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1041 SmbiosFldSMBIOSType6 (
1042 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1044 IN VOID
*RecordData
,
1045 IN UINT32 RecordDataSize
1049 Field Filling Function for Misc SubClass record type 22 - Portable Battery.
1051 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1052 @param Offset Offset of SMBIOS record which RecordData will be filled.
1053 @param RecordData RecordData buffer will be filled.
1054 @param RecordDataSize The size of RecordData buffer.
1056 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1059 SmbiosFldMiscType22 (
1060 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1062 IN VOID
*RecordData
,
1063 IN UINT32 RecordDataSize
1067 Field Filling Function for Misc SubClass record type 22 - Portable Battery.
1069 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1070 @param Offset Offset of SMBIOS record which RecordData will be filled.
1071 @param RecordData RecordData buffer will be filled.
1072 @param RecordDataSize The size of RecordData buffer.
1074 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1077 SmbiosFldMiscType22 (
1078 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1080 IN VOID
*RecordData
,
1081 IN UINT32 RecordDataSize
1085 Field Filling Function for Misc SubClass record type 23 - System Reset.
1087 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1088 @param Offset Offset of SMBIOS record which RecordData will be filled.
1089 @param RecordData RecordData buffer will be filled.
1090 @param RecordDataSize The size of RecordData buffer.
1092 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1095 SmbiosFldMiscType23 (
1096 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1098 IN VOID
*RecordData
,
1099 IN UINT32 RecordDataSize
1103 Field Filling Function for Misc SubClass record type 24 - Hardware Security.
1105 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1106 @param Offset Offset of SMBIOS record which RecordData will be filled.
1107 @param RecordData RecordData buffer will be filled.
1108 @param RecordDataSize The size of RecordData buffer.
1110 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1113 SmbiosFldMiscType24 (
1114 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1116 IN VOID
*RecordData
,
1117 IN UINT32 RecordDataSize
1121 Field Filling Function for Misc SubClass record type 25 - System Power Controls.
1123 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1124 @param Offset Offset of SMBIOS record which RecordData will be filled.
1125 @param RecordData RecordData buffer will be filled.
1126 @param RecordDataSize The size of RecordData buffer.
1128 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1131 SmbiosFldMiscType25 (
1132 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1134 IN VOID
*RecordData
,
1135 IN UINT32 RecordDataSize
1139 Field Filling Function for Misc SubClass record type 26 - Voltage Probe.
1141 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1142 @param Offset Offset of SMBIOS record which RecordData will be filled.
1143 @param RecordData RecordData buffer will be filled.
1144 @param RecordDataSize The size of RecordData buffer.
1146 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1149 SmbiosFldMiscType26 (
1150 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1152 IN VOID
*RecordData
,
1153 IN UINT32 RecordDataSize
1157 Field Filling Function for Misc SubClass record type 27 - Cooling Device.
1159 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1160 @param Offset Offset of SMBIOS record which RecordData will be filled.
1161 @param RecordData RecordData buffer will be filled.
1162 @param RecordDataSize The size of RecordData buffer.
1164 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1167 SmbiosFldMiscType27 (
1168 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1170 IN VOID
*RecordData
,
1171 IN UINT32 RecordDataSize
1175 Field Filling Function for Misc SubClass record type 28 -- Temperature Probe.
1177 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1178 @param Offset Offset of SMBIOS record which RecordData will be filled.
1179 @param RecordData RecordData buffer will be filled.
1180 @param RecordDataSize The size of RecordData buffer.
1182 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1185 SmbiosFldMiscType28 (
1186 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1188 IN VOID
*RecordData
,
1189 IN UINT32 RecordDataSize
1193 Field Filling Function for Misc SubClass record type 29 -- Electrical Current Probe.
1195 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1196 @param Offset Offset of SMBIOS record which RecordData will be filled.
1197 @param RecordData RecordData buffer will be filled.
1198 @param RecordDataSize The size of RecordData buffer.
1200 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1203 SmbiosFldMiscType29 (
1204 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1206 IN VOID
*RecordData
,
1207 IN UINT32 RecordDataSize
1211 Field Filling Function for Misc SubClass record type 30 -- Out-of-Band Remote Access.
1213 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1214 @param Offset Offset of SMBIOS record which RecordData will be filled.
1215 @param RecordData RecordData buffer will be filled.
1216 @param RecordDataSize The size of RecordData buffer.
1218 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1221 SmbiosFldMiscType30 (
1222 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1224 IN VOID
*RecordData
,
1225 IN UINT32 RecordDataSize
1229 Field Filling Function for Misc SubClass record type 34 -- Management Device.
1231 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1232 @param Offset Offset of SMBIOS record which RecordData will be filled.
1233 @param RecordData RecordData buffer will be filled.
1234 @param RecordDataSize The size of RecordData buffer.
1236 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1239 SmbiosFldMiscType34 (
1240 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1242 IN VOID
*RecordData
,
1243 IN UINT32 RecordDataSize
1247 Field Filling Function for Misc SubClass record type 36 -- Management Device Threshold.
1249 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1250 @param Offset Offset of SMBIOS record which RecordData will be filled.
1251 @param RecordData RecordData buffer will be filled.
1252 @param RecordDataSize The size of RecordData buffer.
1254 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1257 SmbiosFldMiscType36 (
1258 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1260 IN VOID
*RecordData
,
1261 IN UINT32 RecordDataSize
1265 Field Filling Function for Misc SubClass record type 38 -- IPMI device info.
1267 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1268 @param Offset Offset of SMBIOS record which RecordData will be filled.
1269 @param RecordData RecordData buffer will be filled.
1270 @param RecordDataSize The size of RecordData buffer.
1272 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1275 SmbiosFldMiscType38 (
1276 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1278 IN VOID
*RecordData
,
1279 IN UINT32 RecordDataSize
1283 Field Filling Function for Misc SubClass record type 39 -- Power supply.
1285 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1286 @param Offset Offset of SMBIOS record which RecordData will be filled.
1287 @param RecordData RecordData buffer will be filled.
1288 @param RecordDataSize The size of RecordData buffer.
1290 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1293 SmbiosFldMiscType39 (
1294 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1296 IN VOID
*RecordData
,
1297 IN UINT32 RecordDataSize
1301 Field Filling Function for Misc SubClass record type 127 - End-of-Table.
1303 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1304 @param Offset Offset of SMBIOS record which RecordData will be filled.
1305 @param RecordData RecordData buffer will be filled.
1306 @param RecordDataSize The size of RecordData buffer.
1308 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1311 SmbiosFldMiscType127 (
1312 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1314 IN VOID
*RecordData
,
1315 IN UINT32 RecordDataSize
1319 Create a blank smbios record. The datahub record is only a field of smbios record.
1320 So before fill any field from datahub's record. A blank smbios record need to be
1323 @param ProducerHandle The produce handle for a datahub record
1324 @param StructureNode Point to SMBIOS_STRUCTURE_NODE
1326 @retval EFI_OUT_OF_RESOURCES Fail to allocate memory for new blank SMBIOS record.
1327 @retval EFI_SUCCESS Success to create blank smbios record.
1330 SmbiosProtocolCreateRecord (
1331 IN EFI_HANDLE ProducerHandle
, OPTIONAL
1332 IN SMBIOS_STRUCTURE_NODE
*StructureNode
1336 Get pointer of EFI_SMBIOS_PROTOCOL.
1338 @return pointer of EFI_SMBIOS_PROTOCOL.
1340 EFI_SMBIOS_PROTOCOL
*
1346 Get pointer of a SMBIOS record's buffer according to its handle.
1348 @param Handle The handle of SMBIOS record want to be searched.
1349 @param Type The type of SMBIOS record want to be searched.
1350 @param ProducerHandle The producer handle of SMBIOS record.
1352 @return EFI_SMBIOS_TABLE_HEADER Point to a SMBIOS record's buffer.
1354 EFI_SMBIOS_TABLE_HEADER
*
1355 GetSmbiosBufferFromHandle (
1356 IN EFI_SMBIOS_HANDLE Handle
,
1357 IN EFI_SMBIOS_TYPE Type
,
1358 IN EFI_HANDLE ProducerHandle OPTIONAL
1363 Get the full size of smbios structure including optional strings that follow the formatted structure.
1365 @param Head Pointer to the beginning of smbios structure.
1366 @param Size The returned size.
1367 @param NumberOfStrings The returned number of optional strings that follow the formatted structure.
1369 @retval EFI_SUCCESS Size retured in Size.
1370 @retval EFI_INVALID_PARAMETER Input smbios structure mal-formed or Size is NULL.
1375 GetSmbiosStructureSize (
1376 IN EFI_SMBIOS_TABLE_HEADER
*Head
,
1378 OUT UINT8
*NumberOfStrings