2 The common header file for the thunk driver.
4 Copyright (c) 2009 - 2015, 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 <Guid/ZeroGuid.h>
24 #include <Protocol/DataHub.h>
25 #include <Guid/DataHubRecords.h>
26 #include <Protocol/HiiDatabase.h>
27 #include <Protocol/Smbios.h>
29 #include <Library/BaseLib.h>
30 #include <Library/PcdLib.h>
31 #include <Library/DebugLib.h>
32 #include <Library/UefiLib.h>
33 #include <Library/HiiLib.h>
34 #include <Library/BaseMemoryLib.h>
35 #include <Library/ReportStatusCodeLib.h>
36 #include <Library/UefiDriverEntryPoint.h>
37 #include <Library/MemoryAllocationLib.h>
38 #include <Library/UefiBootServicesTableLib.h>
41 // Conversion Table that describes the translation method for
42 // Data Hub Data Records of certain SubClass and RecordNumber
45 BySubclassInstanceSubinstanceProducer
,
46 BySubClassInstanceProducer
,
48 } SMBIOS_STRUCTURE_LOCATING_METHOD
;
51 RecordDataUnchangedOffsetSpecified
,
52 ByFunctionWithOffsetSpecified
,
54 ByFunctionWithWholeDataRecord
,
56 } SMBIOS_FIELD_FILLING_METHOD
;
58 typedef struct _SMBIOS_STRUCTURE_NODE SMBIOS_STRUCTURE_NODE
;
65 } EFI_SMBIOS_TABLE_TYPE127
;
69 (*SMBIOS_FIELD_FILLING_FUNCTION
) (
70 IN OUT SMBIOS_STRUCTURE_NODE
* StructureNode
,
71 IN UINT32 Offset OPTIONAL
,
73 IN UINT32 RecordDataSize
78 // Data Hub Data Record's SubClass and RecordNumber
84 // Translation method applied
87 SMBIOS_STRUCTURE_LOCATING_METHOD StructureLocatingMethod
;
88 SMBIOS_FIELD_FILLING_METHOD FieldFillingMethod
;
90 SMBIOS_FIELD_FILLING_FUNCTION FieldFillingFunction
;
92 } SMBIOS_CONVERSION_TABLE_ENTRY
;
95 // SMBIOS_LINK_DATA_FIXUP nodes indicate the Link fields that
96 // need to be fixed up when creating the resulting Smbios image.
98 #define SMBIOS_LINK_DATA_FIXUP_NODE_SIGNATURE SIGNATURE_32 ('S', 'm', 'l', 'n')
108 EFI_INTER_LINK_DATA LinkData
;
110 } SMBIOS_LINK_DATA_FIXUP_NODE
;
113 // The global Structure List node.
114 // The Structure List is populated as more and more
115 // Structures (of various types) are discovered and inserted.
116 // The nodes in the Structure List will be concatenated
117 // to form the ultimate SMBIOS table.
119 #define SMBIOS_STRUCTURE_NODE_SIGNATURE SIGNATURE_32 ('S', 'm', 'b', 's')
121 struct _SMBIOS_STRUCTURE_NODE
{
132 EFI_GUID ProducerName
;
135 // the Smbios structure
137 UINT32 StructureSize
; // Actual structure size including strings
139 EFI_SMBIOS_TABLE_HEADER
*Structure
;
142 EFI_SMBIOS_HANDLE SmbiosHandle
; // Smbios Handle in SMBIOS database.
144 EFI_SMBIOS_TYPE SmbiosType
;
146 LIST_ENTRY LinkDataFixup
;
151 // Smbios type info table. Indicates minimum length
152 // for each Smbios type as the indicator of the initial size of buffer
153 // allocated for the structure instance of a specific type.
158 UINT8 MinLength
; // Minimal structure size including
159 // TWO trailing bytes of 0x00
161 BOOLEAN IsRequired
; // Required structure type defined by Smbios Spec
162 BOOLEAN IsCreated
; // Created in this run
163 } SMBIOS_TYPE_INFO_TABLE_ENTRY
;
166 // EDK framwork Memory Data hub definition to support EDK/Framework driver.
169 STRING_REF MemoryDeviceLocator
;
170 STRING_REF MemoryBankLocator
;
171 STRING_REF MemoryManufacturer
;
172 STRING_REF MemorySerialNumber
;
173 STRING_REF MemoryAssetTag
;
174 STRING_REF MemoryPartNumber
;
175 EFI_INTER_LINK_DATA MemoryArrayLink
;
176 EFI_INTER_LINK_DATA MemorySubArrayLink
;
177 UINT16 MemoryTotalWidth
;
178 UINT16 MemoryDataWidth
;
179 UINT64 MemoryDeviceSize
;
180 EFI_MEMORY_FORM_FACTOR MemoryFormFactor
;
181 UINT8 MemoryDeviceSet
;
182 EFI_MEMORY_ARRAY_TYPE MemoryType
;
183 EFI_MEMORY_TYPE_DETAIL MemoryTypeDetail
;
185 EFI_MEMORY_STATE MemoryState
;
186 UINT8 MemoryAttributes
;
187 } FRAMEWORK_MEMORY_ARRAY_LINK_DATA
;
190 EFI_MEMORY_ARRAY_LOCATION MemoryArrayLocation
;
191 EFI_MEMORY_ARRAY_USE MemoryArrayUse
;
192 EFI_MEMORY_ERROR_CORRECTION MemoryErrorCorrection
;
193 UINT32 MaximumMemoryCapacity
;
194 UINT16 NumberMemoryDevices
;
195 } FRAMEWORK_MEMORY_ARRAY_LOCATION_DATA
;
200 extern SMBIOS_CONVERSION_TABLE_ENTRY mConversionTable
[];
201 extern SMBIOS_TYPE_INFO_TABLE_ENTRY mTypeInfoTable
[];
202 extern LIST_ENTRY mStructureList
;
205 // Function Prototypes
208 Smbios data filter function. This function is invoked when there is data records
209 available in the Data Hub.
211 @param Event The event that is signaled.
212 @param Context not used here.
222 // Function prototypes
225 Process a datahub's record and find corresponding translation way to translate
228 @param Record Point to datahub record.
231 SmbiosProcessDataRecord (
232 IN EFI_DATA_RECORD_HEADER
*Record
236 Calculate the minimal length for a SMBIOS type. This length maybe not equal
237 to sizeof (SMBIOS_RECORD_STRUCTURE), but defined in conformance chapter in SMBIOS specification.
239 @param Type SMBIOS's type.
241 @return the minimal length of a smbios record.
244 SmbiosGetTypeMinimalLength (
249 Enlarge the structure buffer of a structure node in SMBIOS database.
250 The function maybe lead the structure pointer for SMBIOS record changed.
252 @param StructureNode The structure node whose structure buffer is to be enlarged.
253 @param NewLength The new length of SMBIOS record which does not include unformat area.
254 @param OldBufferSize The old size of SMBIOS record buffer.
255 @param NewBufferSize The new size is targeted for enlarged.
257 @retval EFI_OUT_OF_RESOURCES No more memory to allocate new record
258 @retval EFI_SUCCESS Success to enlarge the record buffer size.
261 SmbiosEnlargeStructureBuffer (
262 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
269 Update the structure buffer of a structure node in SMBIOS database.
270 The function lead the structure pointer for SMBIOS record changed.
272 @param StructureNode The structure node whose structure buffer is to be enlarged.
273 @param NewRecord The new SMBIOS record.
277 SmbiosUpdateStructureBuffer (
278 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
279 IN EFI_SMBIOS_TABLE_HEADER
*NewRecord
283 Fill a standard Smbios string field.
285 This function will convert the unicode string to single byte chars, and only
286 English language is supported.
287 This function changes the Structure pointer value of the structure node,
288 which should be noted by Caller.
290 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
291 @param Offset Offset of SMBIOS record which RecordData will be filled.
292 @param RecordData RecordData buffer will be filled.
293 @param RecordDataSize The size of RecordData buffer.
295 @retval EFI_INVALID_PARAMETER RecordDataSize is too larger
296 @retval EFI_OUT_OF_RESOURCES No memory to allocate new buffer for string
297 @retval EFI_SUCCESS Sucess append string for a SMBIOS record.
301 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
304 IN UINT32 RecordDataSize
308 Fill the inter link field for a SMBIOS recorder.
310 Some SMBIOS recorder need to reference the handle of another SMBIOS record. But
311 maybe another SMBIOS record has not been added, so put the InterLink request into
312 a linked list and the interlink will be fixedup when a new SMBIOS record is added.
314 @param StructureNode Point to SMBIOS_STRUCTURE_NODE which reference another record's handle
315 @param LinkSmbiosNodeOffset The offset in this record for holding the handle of another SMBIOS record
316 @param LinkSmbiosType The type of SMBIOS record want to be linked.
317 @param InterLink Point to EFI_INTER_LINK_DATA will be put linked list.
318 @param SubClassGuid The guid of subclass for linked SMBIOS record.
320 @retval EFI_SUCESS The linked record is found and no need fixup in future.
321 @retval !EFI_SUCESS The linked record can not be found and InterLink is put a fixing-p linked list.
325 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
326 IN UINT16 LinkSmbiosNodeOffset
,
327 IN UINT8 LinkSmbiosType
,
328 IN EFI_INTER_LINK_DATA
*InterLink
,
329 IN EFI_GUID
*SubClassGuid
333 Find a handle that matches the Link Data and the target Smbios type.
335 @param TargetType the Smbios type
336 @param SubClass the SubClass
337 @param LinkData Specifies Instance, SubInstance and ProducerName
338 @param Handle the HandleNum found
340 @retval EFI_NOT_FOUND Can not find the record according to handle
341 @retval EFI_SUCCESS Success to find the handle
346 IN EFI_GUID
*SubClass
,
347 IN EFI_INTER_LINK_DATA
*LinkData
,
348 IN OUT UINT16
*HandleNum
352 Field Filling Function. Transform an EFI_EXP_BASE10_DATA to a word, with 'Mega'
355 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
356 @param Offset Offset of SMBIOS record which RecordData will be filled.
357 @param RecordData RecordData buffer will be filled.
358 @param RecordDataSize The size of RecordData buffer.
360 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
361 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
364 SmbiosFldBase10ToWordWithMega (
365 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
368 IN UINT32 RecordDataSize
372 Field Filling Function. Transform an EFI_EXP_BASE2_DATA to a word, with 'Kilo'
373 as the unit. Granularity implemented for Cache Size.
375 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
376 @param Offset Offset of SMBIOS record which RecordData will be filled.
377 @param RecordData RecordData buffer will be filled.
378 @param RecordDataSize The size of RecordData buffer.
380 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
381 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
384 SmbiosFldBase2ToWordWithKilo (
385 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
388 IN UINT32 RecordDataSize
392 Field Filling Function: truncate record data to byte and fill in the
393 field as indicated by Offset.
395 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
396 @param Offset Offset of SMBIOS record which RecordData will be filled.
397 @param RecordData RecordData buffer will be filled.
398 @param RecordDataSize The size of RecordData buffer.
400 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
401 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
404 SmbiosFldTruncateToByte (
405 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
408 IN UINT32 RecordDataSize
412 Field Filling Function for Processor SubClass record type 6 -- ProcessorID.
415 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
416 @param Offset Offset of SMBIOS record which RecordData will be filled.
417 @param RecordData RecordData buffer will be filled.
418 @param RecordDataSize The size of RecordData buffer.
420 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
423 SmbiosFldProcessorType6 (
424 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
427 IN UINT32 RecordDataSize
431 Field Filling Function for Processor SubClass record type 9 -- Voltage.
434 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
435 @param Offset Offset of SMBIOS record which RecordData will be filled.
436 @param RecordData RecordData buffer will be filled.
437 @param RecordDataSize The size of RecordData buffer.
439 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
442 SmbiosFldProcessorType9 (
443 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
446 IN UINT32 RecordDataSize
450 Field Filling Function for Processor SubClass record type 17 -- Cache association.
452 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
453 @param Offset Offset of SMBIOS record which RecordData will be filled.
454 @param RecordData RecordData buffer will be filled.
455 @param RecordDataSize The size of RecordData buffer.
457 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
460 SmbiosFldProcessorType17 (
461 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
464 IN UINT32 RecordDataSize
468 Field Filling Function. Transform an EFI_EXP_BASE2_DATA to a word, with 10exp-9
471 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
472 @param Offset Offset of SMBIOS record which RecordData will be filled.
473 @param RecordData RecordData buffer will be filled.
474 @param RecordDataSize The size of RecordData buffer.
476 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
477 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
480 SmbiosFldBase10ToByteWithNano (
481 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
484 IN UINT32 RecordDataSize
488 Field Filling Function: truncate record data to byte and fill in the
489 field as indicated by Offset.
491 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
492 @param Offset Offset of SMBIOS record which RecordData will be filled.
493 @param RecordData RecordData buffer will be filled.
494 @param RecordDataSize The size of RecordData buffer.
496 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
497 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
500 SmbiosFldTruncateToWord (
501 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
504 IN UINT32 RecordDataSize
508 Field Filling Function for Cache SubClass record type 10 -- Cache Config.
511 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
512 @param Offset Offset of SMBIOS record which RecordData will be filled.
513 @param RecordData RecordData buffer will be filled.
514 @param RecordDataSize The size of RecordData buffer.
516 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
519 SmbiosFldCacheType10 (
520 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
523 IN UINT32 RecordDataSize
527 Check if OEM structure has included 2 trailing 0s in data record.
529 @param RecordData Point to record data will be checked.
530 @param RecordDataSize The size of record data.
532 @retval 0 2 trailing 0s exist in unformatted section
533 @retval 1 1 trailing 0 exists at the end of unformatted section
534 @retval -1 There is no 0 at the end of unformatted section
537 SmbiosCheckTrailingZero (
539 IN UINT32 RecordDataSize
543 Field Filling Function for Cache SubClass record type 5&6 -- Cache SRAM type.
546 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
547 @param Offset Offset of SMBIOS record which RecordData will be filled.
548 @param RecordData RecordData buffer will be filled.
549 @param RecordDataSize The size of RecordData buffer.
551 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
554 SmbiosFldCacheType5 (
555 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
558 IN UINT32 RecordDataSize
562 Field Filling Function for Memory SubClass record type 2 -- Physical Memory
565 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
566 @param Offset Offset of SMBIOS record which RecordData will be filled.
567 @param RecordData RecordData buffer will be filled.
568 @param RecordDataSize The size of RecordData buffer.
570 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
573 SmbiosFldMemoryType2 (
574 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
577 IN UINT32 RecordDataSize
581 Field Filling Function for Memory SubClass record type 3 -
582 - Memory Device: SMBIOS Type 17
584 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
585 @param Offset Offset of SMBIOS record which RecordData will be filled.
586 @param RecordData RecordData buffer will be filled.
587 @param RecordDataSize The size of RecordData buffer.
589 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
592 SmbiosFldMemoryType3 (
593 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
596 IN UINT32 RecordDataSize
600 Field Filling Function for Memory SubClass record type 4
601 -- Memory Array Mapped Address: SMBIOS Type 19
603 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
604 @param Offset Offset of SMBIOS record which RecordData will be filled.
605 @param RecordData RecordData buffer will be filled.
606 @param RecordDataSize The size of RecordData buffer.
608 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
611 SmbiosFldMemoryType4 (
612 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
615 IN UINT32 RecordDataSize
619 Field Filling Function for Memory SubClass record type 5
620 -- Memory Device Mapped Address: SMBIOS Type 20
622 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
623 @param Offset Offset of SMBIOS record which RecordData will be filled.
624 @param RecordData RecordData buffer will be filled.
625 @param RecordDataSize The size of RecordData buffer.
627 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
630 SmbiosFldMemoryType5 (
631 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
634 IN UINT32 RecordDataSize
638 Field Filling Function for Memory SubClass record type 6
639 -- Memory Channel Type: SMBIOS Type 37
641 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
642 @param Offset Offset of SMBIOS record which RecordData will be filled.
643 @param RecordData RecordData buffer will be filled.
644 @param RecordDataSize The size of RecordData buffer.
646 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
649 SmbiosFldMemoryType6 (
650 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
653 IN UINT32 RecordDataSize
657 Field Filling Function for Memory SubClass record type 7
658 -- Memory Channel Device: SMBIOS Type 37
660 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
661 @param Offset Offset of SMBIOS record which RecordData will be filled.
662 @param RecordData RecordData buffer will be filled.
663 @param RecordDataSize The size of RecordData buffer.
665 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
668 SmbiosFldMemoryType7 (
669 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
672 IN UINT32 RecordDataSize
676 Field Filling Function for Memory SubClass record type 8
677 -- Memory Controller information: SMBIOS Type 5
679 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
680 @param Offset Offset of SMBIOS record which RecordData will be filled.
681 @param RecordData RecordData buffer will be filled.
682 @param RecordDataSize The size of RecordData buffer.
684 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
687 SmbiosFldMemoryType8 (
688 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
691 IN UINT32 RecordDataSize
695 Field Filling Function for Memory SubClass record type
696 -- Memory 32 Bit Error Information: SMBIOS Type 18
698 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
699 @param Offset Offset of SMBIOS record which RecordData will be filled.
700 @param RecordData RecordData buffer will be filled.
701 @param RecordDataSize The size of RecordData buffer.
703 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
706 SmbiosFldMemoryType9 (
707 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
710 IN UINT32 RecordDataSize
714 Field Filling Function for Memory SubClass record type
715 -- Memory 64 Bit Error Information: SMBIOS Type 33
717 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
718 @param Offset Offset of SMBIOS record which RecordData will be filled.
719 @param RecordData RecordData buffer will be filled.
720 @param RecordDataSize The size of RecordData buffer.
722 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
725 SmbiosFldMemoryType10 (
726 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
729 IN UINT32 RecordDataSize
733 Field Filling Function for Misc SubClass record type 0 -- Bios Information.
735 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
736 @param Offset Offset of SMBIOS record which RecordData will be filled.
737 @param RecordData RecordData buffer will be filled.
738 @param RecordDataSize The size of RecordData buffer.
740 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
744 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
747 IN UINT32 RecordDataSize
751 Field Filling Function. Transform an EFI_EXP_BASE2_DATA to a byte, with '64k'
754 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
755 @param Offset Offset of SMBIOS record which RecordData will be filled.
756 @param RecordData RecordData buffer will be filled.
757 @param RecordDataSize The size of RecordData buffer.
759 @retval EFI_INVALID_PARAMETER RecordDataSize is invalid.
760 @retval EFI_SUCCESS RecordData is successed to be filled into given SMBIOS record.
763 SmbiosFldBase2ToByteWith64K (
764 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
767 IN UINT32 RecordDataSize
771 Field Filling Function for Misc SubClass record type 1 -- System Information.
773 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
774 @param Offset Offset of SMBIOS record which RecordData will be filled.
775 @param RecordData RecordData buffer will be filled.
776 @param RecordDataSize The size of RecordData buffer.
778 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
782 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
785 IN UINT32 RecordDataSize
789 Field Filling Function for record type 2 -- Base Board Manufacture.
791 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
792 @param Offset Offset of SMBIOS record which RecordData will be filled.
793 @param RecordData RecordData buffer will be filled.
794 @param RecordDataSize The size of RecordData buffer.
796 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
800 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
803 IN UINT32 RecordDataSize
807 Field Filling Function for Misc SubClass record type 3 -
808 - System Enclosure or Chassis.
810 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
811 @param Offset Offset of SMBIOS record which RecordData will be filled.
812 @param RecordData RecordData buffer will be filled.
813 @param RecordDataSize The size of RecordData buffer.
815 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
819 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
822 IN UINT32 RecordDataSize
826 Field Filling Function for Misc SubClass record type 8 -- Port Connector.
828 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
829 @param Offset Offset of SMBIOS record which RecordData will be filled.
830 @param RecordData RecordData buffer will be filled.
831 @param RecordDataSize The size of RecordData buffer.
833 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
837 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
840 IN UINT32 RecordDataSize
844 Field Filling Function for Misc SubClass record type 9 -- System slot.
846 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
847 @param Offset Offset of SMBIOS record which RecordData will be filled.
848 @param RecordData RecordData buffer will be filled.
849 @param RecordDataSize The size of RecordData buffer.
851 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
855 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
858 IN UINT32 RecordDataSize
862 Field Filling Function for Misc SubClass record type 10 - Onboard Device.
864 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
865 @param Offset Offset of SMBIOS record which RecordData will be filled.
866 @param RecordData RecordData buffer will be filled.
867 @param RecordDataSize The size of RecordData buffer.
869 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
872 SmbiosFldMiscType10 (
873 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
876 IN UINT32 RecordDataSize
880 Field Filling Function for Misc SubClass record type 11 - OEM Strings.
882 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
883 @param Offset Offset of SMBIOS record which RecordData will be filled.
884 @param RecordData RecordData buffer will be filled.
885 @param RecordDataSize The size of RecordData buffer.
887 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
890 SmbiosFldMiscType11 (
891 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
894 IN UINT32 RecordDataSize
898 Field Filling Function for Misc SubClass record type 12 - System Options.
900 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
901 @param Offset Offset of SMBIOS record which RecordData will be filled.
902 @param RecordData RecordData buffer will be filled.
903 @param RecordDataSize The size of RecordData buffer.
905 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
908 SmbiosFldMiscType12 (
909 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
912 IN UINT32 RecordDataSize
916 Field Filling Function for Misc SubClass record type 13 - BIOS Language.
918 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
919 @param Offset Offset of SMBIOS record which RecordData will be filled.
920 @param RecordData RecordData buffer will be filled.
921 @param RecordDataSize The size of RecordData buffer.
923 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
926 SmbiosFldMiscType13 (
927 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
930 IN UINT32 RecordDataSize
934 Field Filling Function for Misc SubClass record type 14 - System Language String
935 Current solution assumes that EFI_MISC_SYSTEM_LANGUAGE_STRINGs are logged with
936 their LanguageId having ascending orders.
938 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
939 @param Offset Offset of SMBIOS record which RecordData will be filled.
940 @param RecordData RecordData buffer will be filled.
941 @param RecordDataSize The size of RecordData buffer.
943 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
946 SmbiosFldMiscType14 (
947 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
950 IN UINT32 RecordDataSize
954 Field Filling Function for Misc SubClass record type 15 -- System Event Log.
956 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
957 @param Offset Offset of SMBIOS record which RecordData will be filled.
958 @param RecordData RecordData buffer will be filled.
959 @param RecordDataSize The size of RecordData buffer.
961 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
964 SmbiosFldMiscType15 (
965 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
968 IN UINT32 RecordDataSize
972 Field Filling Function for Misc SubClass record type 21 - Pointing Device.
974 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
975 @param Offset Offset of SMBIOS record which RecordData will be filled.
976 @param RecordData RecordData buffer will be filled.
977 @param RecordDataSize The size of RecordData buffer.
979 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
982 SmbiosFldMiscType21 (
983 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
986 IN UINT32 RecordDataSize
991 Field Filling Function for Misc SubClass record type 32 -- System Boot Information.
993 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
994 @param Offset Offset of SMBIOS record which RecordData will be filled.
995 @param RecordData RecordData buffer will be filled.
996 @param RecordDataSize The size of RecordData buffer.
998 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1001 SmbiosFldMiscType32 (
1002 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1004 IN VOID
*RecordData
,
1005 IN UINT32 RecordDataSize
1009 Field Filling Function for Misc SubClass record type 38 -- IPMI device info.
1011 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1012 @param Offset Offset of SMBIOS record which RecordData will be filled.
1013 @param RecordData RecordData buffer will be filled.
1014 @param RecordDataSize The size of RecordData buffer.
1016 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1019 SmbiosFldMiscType38 (
1020 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1022 IN VOID
*RecordData
,
1023 IN UINT32 RecordDataSize
1027 Field Filling Function for Misc SubClass record type 0x80-0xFF -- OEM.
1029 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1030 @param Offset Offset of SMBIOS record which RecordData will be filled.
1031 @param RecordData RecordData buffer will be filled.
1032 @param RecordDataSize The size of RecordData buffer.
1034 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1037 SmbiosFldMiscTypeOEM (
1038 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1040 IN VOID
*RecordData
,
1041 IN UINT32 RecordDataSize
1045 Field Filling Function for Memory SubClass record type 3 -
1046 - Memory Device: SMBIOS Type 6
1048 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1049 @param Offset Offset of SMBIOS record which RecordData will be filled.
1050 @param RecordData RecordData buffer will be filled.
1051 @param RecordDataSize The size of RecordData buffer.
1053 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1056 SmbiosFldSMBIOSType6 (
1057 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1059 IN VOID
*RecordData
,
1060 IN UINT32 RecordDataSize
1064 Field Filling Function for Misc SubClass record type 22 - Portable Battery.
1066 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1067 @param Offset Offset of SMBIOS record which RecordData will be filled.
1068 @param RecordData RecordData buffer will be filled.
1069 @param RecordDataSize The size of RecordData buffer.
1071 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1074 SmbiosFldMiscType22 (
1075 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1077 IN VOID
*RecordData
,
1078 IN UINT32 RecordDataSize
1082 Field Filling Function for Misc SubClass record type 22 - Portable Battery.
1084 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1085 @param Offset Offset of SMBIOS record which RecordData will be filled.
1086 @param RecordData RecordData buffer will be filled.
1087 @param RecordDataSize The size of RecordData buffer.
1089 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1092 SmbiosFldMiscType22 (
1093 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1095 IN VOID
*RecordData
,
1096 IN UINT32 RecordDataSize
1100 Field Filling Function for Misc SubClass record type 23 - System Reset.
1102 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1103 @param Offset Offset of SMBIOS record which RecordData will be filled.
1104 @param RecordData RecordData buffer will be filled.
1105 @param RecordDataSize The size of RecordData buffer.
1107 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1110 SmbiosFldMiscType23 (
1111 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1113 IN VOID
*RecordData
,
1114 IN UINT32 RecordDataSize
1118 Field Filling Function for Misc SubClass record type 24 - Hardware Security.
1120 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1121 @param Offset Offset of SMBIOS record which RecordData will be filled.
1122 @param RecordData RecordData buffer will be filled.
1123 @param RecordDataSize The size of RecordData buffer.
1125 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1128 SmbiosFldMiscType24 (
1129 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1131 IN VOID
*RecordData
,
1132 IN UINT32 RecordDataSize
1136 Field Filling Function for Misc SubClass record type 25 - System Power Controls.
1138 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1139 @param Offset Offset of SMBIOS record which RecordData will be filled.
1140 @param RecordData RecordData buffer will be filled.
1141 @param RecordDataSize The size of RecordData buffer.
1143 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1146 SmbiosFldMiscType25 (
1147 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1149 IN VOID
*RecordData
,
1150 IN UINT32 RecordDataSize
1154 Field Filling Function for Misc SubClass record type 26 - Voltage Probe.
1156 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1157 @param Offset Offset of SMBIOS record which RecordData will be filled.
1158 @param RecordData RecordData buffer will be filled.
1159 @param RecordDataSize The size of RecordData buffer.
1161 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1164 SmbiosFldMiscType26 (
1165 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1167 IN VOID
*RecordData
,
1168 IN UINT32 RecordDataSize
1172 Field Filling Function for Misc SubClass record type 27 - Cooling Device.
1174 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1175 @param Offset Offset of SMBIOS record which RecordData will be filled.
1176 @param RecordData RecordData buffer will be filled.
1177 @param RecordDataSize The size of RecordData buffer.
1179 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1182 SmbiosFldMiscType27 (
1183 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1185 IN VOID
*RecordData
,
1186 IN UINT32 RecordDataSize
1190 Field Filling Function for Misc SubClass record type 28 -- Temperature Probe.
1192 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1193 @param Offset Offset of SMBIOS record which RecordData will be filled.
1194 @param RecordData RecordData buffer will be filled.
1195 @param RecordDataSize The size of RecordData buffer.
1197 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1200 SmbiosFldMiscType28 (
1201 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1203 IN VOID
*RecordData
,
1204 IN UINT32 RecordDataSize
1208 Field Filling Function for Misc SubClass record type 29 -- Electrical Current Probe.
1210 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1211 @param Offset Offset of SMBIOS record which RecordData will be filled.
1212 @param RecordData RecordData buffer will be filled.
1213 @param RecordDataSize The size of RecordData buffer.
1215 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1218 SmbiosFldMiscType29 (
1219 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1221 IN VOID
*RecordData
,
1222 IN UINT32 RecordDataSize
1226 Field Filling Function for Misc SubClass record type 30 -- Out-of-Band Remote Access.
1228 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1229 @param Offset Offset of SMBIOS record which RecordData will be filled.
1230 @param RecordData RecordData buffer will be filled.
1231 @param RecordDataSize The size of RecordData buffer.
1233 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1236 SmbiosFldMiscType30 (
1237 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1239 IN VOID
*RecordData
,
1240 IN UINT32 RecordDataSize
1244 Field Filling Function for Misc SubClass record type 34 -- Management Device.
1246 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1247 @param Offset Offset of SMBIOS record which RecordData will be filled.
1248 @param RecordData RecordData buffer will be filled.
1249 @param RecordDataSize The size of RecordData buffer.
1251 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1254 SmbiosFldMiscType34 (
1255 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1257 IN VOID
*RecordData
,
1258 IN UINT32 RecordDataSize
1262 Field Filling Function for Misc SubClass record type 35 -- Management Device Component.
1264 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1265 @param Offset Offset of SMBIOS record which RecordData will be filled.
1266 @param RecordData RecordData buffer will be filled.
1267 @param RecordDataSize The size of RecordData buffer.
1269 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1272 SmbiosFldMiscType35 (
1273 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1275 IN VOID
*RecordData
,
1276 IN UINT32 RecordDataSize
1280 Field Filling Function for Misc SubClass record type 36 -- Management Device Threshold.
1282 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1283 @param Offset Offset of SMBIOS record which RecordData will be filled.
1284 @param RecordData RecordData buffer will be filled.
1285 @param RecordDataSize The size of RecordData buffer.
1287 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1290 SmbiosFldMiscType36 (
1291 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1293 IN VOID
*RecordData
,
1294 IN UINT32 RecordDataSize
1298 Field Filling Function for Misc SubClass record type 38 -- IPMI device info.
1300 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1301 @param Offset Offset of SMBIOS record which RecordData will be filled.
1302 @param RecordData RecordData buffer will be filled.
1303 @param RecordDataSize The size of RecordData buffer.
1305 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1308 SmbiosFldMiscType38 (
1309 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1311 IN VOID
*RecordData
,
1312 IN UINT32 RecordDataSize
1316 Field Filling Function for Misc SubClass record type 39 -- Power supply.
1318 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1319 @param Offset Offset of SMBIOS record which RecordData will be filled.
1320 @param RecordData RecordData buffer will be filled.
1321 @param RecordDataSize The size of RecordData buffer.
1323 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1326 SmbiosFldMiscType39 (
1327 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1329 IN VOID
*RecordData
,
1330 IN UINT32 RecordDataSize
1334 Field Filling Function for Misc SubClass record type 127 - End-of-Table.
1336 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1337 @param Offset Offset of SMBIOS record which RecordData will be filled.
1338 @param RecordData RecordData buffer will be filled.
1339 @param RecordDataSize The size of RecordData buffer.
1341 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1344 SmbiosFldMiscType127 (
1345 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1347 IN VOID
*RecordData
,
1348 IN UINT32 RecordDataSize
1352 Create a blank smbios record. The datahub record is only a field of smbios record.
1353 So before fill any field from datahub's record. A blank smbios record need to be
1356 @param ProducerHandle The produce handle for a datahub record
1357 @param StructureNode Point to SMBIOS_STRUCTURE_NODE
1359 @retval EFI_OUT_OF_RESOURCES Fail to allocate memory for new blank SMBIOS record.
1360 @retval EFI_SUCCESS Success to create blank smbios record.
1363 SmbiosProtocolCreateRecord (
1364 IN EFI_HANDLE ProducerHandle
, OPTIONAL
1365 IN SMBIOS_STRUCTURE_NODE
*StructureNode
1369 Get pointer of EFI_SMBIOS_PROTOCOL.
1371 @return pointer of EFI_SMBIOS_PROTOCOL.
1373 EFI_SMBIOS_PROTOCOL
*
1379 Get pointer of a SMBIOS record's buffer according to its handle.
1381 @param Handle The handle of SMBIOS record want to be searched.
1382 @param Type The type of SMBIOS record want to be searched.
1383 @param ProducerHandle The producer handle of SMBIOS record.
1385 @return EFI_SMBIOS_TABLE_HEADER Point to a SMBIOS record's buffer.
1387 EFI_SMBIOS_TABLE_HEADER
*
1388 GetSmbiosBufferFromHandle (
1389 IN EFI_SMBIOS_HANDLE Handle
,
1390 IN EFI_SMBIOS_TYPE Type
,
1391 IN EFI_HANDLE ProducerHandle OPTIONAL
1396 Get the full size of smbios structure including optional strings that follow the formatted structure.
1398 @param Head Pointer to the beginning of smbios structure.
1399 @param Size The returned size.
1400 @param NumberOfStrings The returned number of optional strings that follow the formatted structure.
1402 @retval EFI_SUCCESS Size retured in Size.
1403 @retval EFI_INVALID_PARAMETER Input smbios structure mal-formed or Size is NULL.
1408 GetSmbiosStructureSize (
1409 IN EFI_SMBIOS_TABLE_HEADER
*Head
,
1411 OUT UINT8
*NumberOfStrings