2 Routines that support Misc SubClass data records translation.
4 Copyright (c) 2009, Intel Corporation
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.
18 Field Filling Function for Misc SubClass record type 0 -- Bios Information.
20 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
21 @param Offset Offset of SMBIOS record which RecordData will be filled.
22 @param RecordData RecordData buffer will be filled.
23 @param RecordDataSize The size of RecordData buffer.
25 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
29 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
32 IN UINT32 RecordDataSize
36 EFI_MISC_BIOS_VENDOR_DATA
*BiosInfo
;
41 BiosInfo
= (EFI_MISC_BIOS_VENDOR_DATA
*) RecordData
;
48 OFFSET_OF (SMBIOS_TABLE_TYPE0
, Vendor
),
49 &(BiosInfo
->BiosVendor
),
50 2 // 64 * sizeof(CHAR16)
58 OFFSET_OF (SMBIOS_TABLE_TYPE0
, BiosVersion
),
59 &(BiosInfo
->BiosVersion
),
60 2 // 64 * sizeof(CHAR16)
68 OFFSET_OF (SMBIOS_TABLE_TYPE0
, BiosReleaseDate
),
69 &(BiosInfo
->BiosReleaseDate
),
70 2 // 64 * sizeof(CHAR16)
74 // Bios Starting Address Segment
77 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE0
, BiosSegment
),
78 &BiosInfo
->BiosStartingAddress
,
83 // Bios Physical device size
85 SmbiosFldBase2ToByteWith64K (
87 OFFSET_OF (SMBIOS_TABLE_TYPE0
, BiosSize
),
88 &BiosInfo
->BiosPhysicalDeviceSize
,
89 sizeof (EFI_EXP_BASE2_DATA
)
91 (*(UINT8
*) ((UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE0
, BiosSize
)))--;
94 // Bios Characteristics
97 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE0
, BiosCharacteristics
),
98 &BiosInfo
->BiosCharacteristics1
,
103 // Bios Characteristics higher four bytes
106 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE0
, BiosCharacteristics
) + 4,
107 &BiosInfo
->BiosCharacteristics2
,
112 // Bios Characteristics Extension1/2
115 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE0
, BIOSCharacteristicsExtensionBytes
),
116 (UINT8
*) &BiosInfo
->BiosCharacteristics1
+ 4,
121 // System BIOS Major Release
124 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE0
, SystemBiosMajorRelease
),
125 (UINT8
*) &BiosInfo
->BiosMajorRelease
,
130 // System BIOS Minor Release
133 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE0
, SystemBiosMinorRelease
),
134 (UINT8
*) &BiosInfo
->BiosMinorRelease
,
139 // Embedded Controller Firmware Major Release
142 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE0
, EmbeddedControllerFirmwareMajorRelease
),
143 (UINT8
*) &BiosInfo
->BiosEmbeddedFirmwareMajorRelease
,
148 // Embedded Controller Firmware Minor Release
151 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE0
, EmbeddedControllerFirmwareMinorRelease
),
152 (UINT8
*) &BiosInfo
->BiosEmbeddedFirmwareMinorRelease
,
160 Field Filling Function for Misc SubClass record type 1 -- System Information.
162 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
163 @param Offset Offset of SMBIOS record which RecordData will be filled.
164 @param RecordData RecordData buffer will be filled.
165 @param RecordDataSize The size of RecordData buffer.
167 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
171 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
174 IN UINT32 RecordDataSize
178 EFI_MISC_SYSTEM_MANUFACTURER_DATA
*SystemInfo
;
180 Status
= EFI_SUCCESS
;
183 SystemInfo
= (EFI_MISC_SYSTEM_MANUFACTURER_DATA
*) RecordData
;
186 // System Manufacturer
190 OFFSET_OF (SMBIOS_TABLE_TYPE1
, Manufacturer
),
191 &(SystemInfo
->SystemManufacturer
),
192 2 // 64 * sizeof(CHAR16)
196 // System Product Name
200 OFFSET_OF (SMBIOS_TABLE_TYPE1
, ProductName
),
201 &(SystemInfo
->SystemProductName
),
202 2 // 64 * sizeof(CHAR16)
210 OFFSET_OF (SMBIOS_TABLE_TYPE1
, Version
),
211 &(SystemInfo
->SystemVersion
),
212 2 // 64 * sizeof(CHAR16)
216 // System Serial Number
220 OFFSET_OF (SMBIOS_TABLE_TYPE1
, SerialNumber
),
221 &(SystemInfo
->SystemSerialNumber
),
222 2 // 64 * sizeof(CHAR16)
229 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE1
, Uuid
),
230 &SystemInfo
->SystemUuid
,
238 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE1
, WakeUpType
),
239 &SystemInfo
->SystemWakeupType
,
248 OFFSET_OF (SMBIOS_TABLE_TYPE1
, SKUNumber
),
249 &(SystemInfo
->SystemSKUNumber
),
250 2 // 64 * sizeof(CHAR16)
258 OFFSET_OF (SMBIOS_TABLE_TYPE1
, Family
),
259 &(SystemInfo
->SystemFamily
),
260 2 // 64 * sizeof(CHAR16)
267 Field Filling Function for record type 2 -- Base Board Manufacture.
269 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
270 @param Offset Offset of SMBIOS record which RecordData will be filled.
271 @param RecordData RecordData buffer will be filled.
272 @param RecordDataSize The size of RecordData buffer.
274 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
278 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
281 IN UINT32 RecordDataSize
285 EFI_MISC_BASE_BOARD_MANUFACTURER_DATA
*Bbm
;
286 Status
= EFI_SUCCESS
;
287 Bbm
= (EFI_MISC_BASE_BOARD_MANUFACTURER_DATA
*) RecordData
;
294 OFFSET_OF (SMBIOS_TABLE_TYPE2
, Manufacturer
),
295 &(Bbm
->BaseBoardManufacturer
),
304 OFFSET_OF (SMBIOS_TABLE_TYPE2
, ProductName
),
305 &(Bbm
->BaseBoardProductName
),
314 OFFSET_OF (SMBIOS_TABLE_TYPE2
, Version
),
315 &(Bbm
->BaseBoardVersion
),
324 OFFSET_OF (SMBIOS_TABLE_TYPE2
, SerialNumber
),
325 &(Bbm
->BaseBoardSerialNumber
),
334 OFFSET_OF (SMBIOS_TABLE_TYPE2
, AssetTag
),
335 &(Bbm
->BaseBoardAssetTag
),
340 // Location in Chassis
344 OFFSET_OF (SMBIOS_TABLE_TYPE2
, LocationInChassis
),
345 &(Bbm
->BaseBoardChassisLocation
),
353 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE2
, FeatureFlag
),
354 &Bbm
->BaseBoardFeatureFlags
,
361 *(UINT8
*) ((UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE2
, BoardType
)) = (UINT8
) Bbm
->BaseBoardType
;
368 (UINT16
) OFFSET_OF (SMBIOS_TABLE_TYPE2
, ChassisHandle
),
369 3, // SMBIOS type 3 - System Enclosure or Chassis
370 &Bbm
->BaseBoardChassisLink
,
371 &gEfiMiscSubClassGuid
375 // Number of Contained Object Handles
377 *(UINT8
*) ((UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE2
, NumberOfContainedObjectHandles
)) = (UINT8
) Bbm
->BaseBoardNumberLinks
;
383 Field Filling Function for Misc SubClass record type 3 -
384 - System Enclosure or Chassis.
386 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
387 @param Offset Offset of SMBIOS record which RecordData will be filled.
388 @param RecordData RecordData buffer will be filled.
389 @param RecordDataSize The size of RecordData buffer.
391 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
395 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
398 IN UINT32 RecordDataSize
402 EFI_MISC_CHASSIS_MANUFACTURER_DATA
*Ec
;
403 EFI_MISC_ELEMENTS
*Element
;
405 UINT8 ContainedElementType
;
406 Status
= EFI_SUCCESS
;
407 Ec
= (EFI_MISC_CHASSIS_MANUFACTURER_DATA
*) RecordData
;
412 *(UINT8
*)((UINT8
*) (StructureNode
->Structure
) +
413 OFFSET_OF (SMBIOS_TABLE_TYPE3
, Type
))
414 = (UINT8
) (Ec
->ChassisType
.ChassisType
| Ec
->ChassisType
.ChassisLockPresent
<< 7);
418 // Chassis Bootup State
421 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE3
, BootupState
),
422 &Ec
->ChassisBootupState
,
427 // Chassis Power Supply State
430 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE3
, PowerSupplyState
),
431 &Ec
->ChassisPowerSupplyState
,
436 // Chassis Thermal State
439 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE3
, ThermalState
),
440 &Ec
->ChassisThermalState
,
445 // Chassis Security State
448 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE3
, SecurityStatus
),
449 &Ec
->ChassisSecurityState
,
454 // Chassis Oem Defined
457 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE3
, OemDefined
),
458 &Ec
->ChassisOemDefined
,
465 *(UINT8
*)((UINT8
*)(StructureNode
->Structure
) +
466 OFFSET_OF (SMBIOS_TABLE_TYPE3
, Height
))
467 = (UINT8
)Ec
->ChassisHeight
;
470 // Chassis Number Power Cords
472 *(UINT8
*)((UINT8
*)(StructureNode
->Structure
) +
473 OFFSET_OF (SMBIOS_TABLE_TYPE3
, NumberofPowerCords
))
474 = (UINT8
)Ec
->ChassisNumberPowerCords
;
477 // Chassis Element Count
479 *(UINT8
*)((UINT8
*)(StructureNode
->Structure
) +
480 OFFSET_OF (SMBIOS_TABLE_TYPE3
, ContainedElementCount
))
481 = (UINT8
)Ec
->ChassisElementCount
;
483 if( Ec
->ChassisElementCount
) {
485 // Element Record Length
486 // Current solution covers first 3 bytes; user can extend to meet its requirements.
488 *(UINT8
*)((UINT8
*)(StructureNode
->Structure
) +
489 OFFSET_OF (SMBIOS_TABLE_TYPE3
, ContainedElementRecordLength
))
490 = (UINT8
)sizeof(CONTAINED_ELEMENT
);
493 // Update the structure's length and StructureSize
495 StructureNode
->Structure
->Length
= (UINT8
)(StructureNode
->Structure
->Length
+
496 Ec
->ChassisElementCount
* sizeof(CONTAINED_ELEMENT
));
497 Status
= SmbiosEnlargeStructureBuffer (
499 StructureNode
->Structure
->Length
,
500 StructureNode
->StructureSize
,
501 StructureNode
->StructureSize
+ Ec
->ChassisElementCount
* sizeof(CONTAINED_ELEMENT
)
503 if (EFI_ERROR (Status
)) {
508 // Contained Elements
510 for (Index
=0, Element
= &Ec
->ChassisElements
;
511 Index
< Ec
->ChassisElementCount
;
512 Index
+= 1, Element
++) {
515 // ContainedElementType
517 ContainedElementType
= (UINT8
)((Element
->ChassisElementType
.RecordType
== 1)
518 ? (UINT8
)(Element
->ChassisElementType
.RecordType
<< 7 | Element
->ChassisElementType
.Type
)
519 : (UINT8
)(Element
->ChassisBaseBoard
));
520 *(UINT8
*)((UINT8
*)(StructureNode
->Structure
) +
521 OFFSET_OF (SMBIOS_TABLE_TYPE3
, ContainedElements
) +
522 Index
* sizeof(CONTAINED_ELEMENT
) +
523 OFFSET_OF(CONTAINED_ELEMENT
,ContainedElementType
))
524 = ContainedElementType
;
527 // ContainedElementMinimum
529 *(UINT8
*)((UINT8
*)(StructureNode
->Structure
) +
530 OFFSET_OF (SMBIOS_TABLE_TYPE3
, ContainedElements
) +
531 Index
* sizeof(CONTAINED_ELEMENT
) +
532 OFFSET_OF(CONTAINED_ELEMENT
,ContainedElementMinimum
))
533 = (UINT8
)Element
->ChassisElementMinimum
;
536 // ContainedElementMaximum
538 *(UINT8
*)((UINT8
*)(StructureNode
->Structure
) +
539 OFFSET_OF (SMBIOS_TABLE_TYPE3
, ContainedElements
) +
540 Index
* sizeof(CONTAINED_ELEMENT
) +
541 OFFSET_OF(CONTAINED_ELEMENT
,ContainedElementMaximum
))
542 = (UINT8
)Element
->ChassisElementMaximum
;
547 // Move the filling of following four String fields after Contained Elements
548 // because they would break SMBIOS table.
549 // Chassis Manufacturer
553 OFFSET_OF (SMBIOS_TABLE_TYPE3
, Manufacturer
),
554 &(Ec
->ChassisManufacturer
),
555 2 // 64 * sizeof(CHAR16)
563 OFFSET_OF (SMBIOS_TABLE_TYPE3
, Version
),
564 &(Ec
->ChassisVersion
),
565 2 // 64 * sizeof(CHAR16)
569 // Chassis Serial Number
573 OFFSET_OF (SMBIOS_TABLE_TYPE3
, SerialNumber
),
574 &(Ec
->ChassisSerialNumber
),
575 2 // 64 * sizeof(CHAR16)
583 OFFSET_OF (SMBIOS_TABLE_TYPE3
, AssetTag
),
584 &(Ec
->ChassisAssetTag
),
585 2 // 64 * sizeof(CHAR16)
592 Field Filling Function for Misc SubClass record type 8 -- Port Connector.
594 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
595 @param Offset Offset of SMBIOS record which RecordData will be filled.
596 @param RecordData RecordData buffer will be filled.
597 @param RecordDataSize The size of RecordData buffer.
599 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
603 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
606 IN UINT32 RecordDataSize
610 EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA
*Picd
;
612 Status
= EFI_SUCCESS
;
613 Picd
= (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA
*) RecordData
;
616 // Internal Connector Designator
620 OFFSET_OF (SMBIOS_TABLE_TYPE8
, InternalReferenceDesignator
),
621 &(Picd
->PortInternalConnectorDesignator
),
622 2 // 64 * sizeof(CHAR16)
626 // Internal Connector Type
628 *(UINT8
*) ((UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE8
, InternalConnectorType
)) = (UINT8
) Picd
->PortInternalConnectorType
;
631 // External Connector Designator
635 OFFSET_OF (SMBIOS_TABLE_TYPE8
, ExternalReferenceDesignator
),
636 &(Picd
->PortExternalConnectorDesignator
),
637 2 // 64 * sizeof(CHAR16)
641 // Internal Connector Type
643 *(UINT8
*) ((UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE8
, ExternalConnectorType
)) = (UINT8
) Picd
->PortExternalConnectorType
;
646 // Internal Connector Type
648 *(UINT8
*) ((UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE8
, PortType
)) = (UINT8
) Picd
->PortType
;
654 Field Filling Function for Misc SubClass record type 9 -- System slot.
656 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
657 @param Offset Offset of SMBIOS record which RecordData will be filled.
658 @param RecordData RecordData buffer will be filled.
659 @param RecordDataSize The size of RecordData buffer.
661 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
665 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
668 IN UINT32 RecordDataSize
672 EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA
*Slot
;
674 Status
= EFI_SUCCESS
;
675 Slot
= (EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA
*) RecordData
;
682 OFFSET_OF (SMBIOS_TABLE_TYPE9
, SlotDesignation
),
683 &(Slot
->SlotDesignation
),
684 2 // 64 * sizeof(CHAR16)
691 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE9
, SlotType
),
697 // Slot Data Bus Width
700 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE9
, SlotDataBusWidth
),
701 &Slot
->SlotDataBusWidth
,
709 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE9
, CurrentUsage
),
718 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE9
, SlotLength
),
727 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE9
, SlotID
),
733 // Slot Characteristics
736 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE9
, SlotCharacteristics1
),
737 &Slot
->SlotCharacteristics
,
745 Field Filling Function for Misc SubClass record type 10 - Onboard Device.
747 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
748 @param Offset Offset of SMBIOS record which RecordData will be filled.
749 @param RecordData RecordData buffer will be filled.
750 @param RecordDataSize The size of RecordData buffer.
752 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
755 SmbiosFldMiscType10 (
756 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
759 IN UINT32 RecordDataSize
763 EFI_MISC_ONBOARD_DEVICE_DATA
*OnboardDevice
;
764 UINTN NumberOfDevices
;
768 Status
= EFI_SUCCESS
;
769 OnboardDevice
= (EFI_MISC_ONBOARD_DEVICE_DATA
*) RecordData
;
771 NumberOfDevices
= (StructureNode
->Structure
->Length
- 4) / 2;
772 for (Index
= 0; Index
< NumberOfDevices
; Index
+= 1) {
774 // OnBoard Device Description
778 (UINT32
) (OFFSET_OF (SMBIOS_TABLE_TYPE10
, Device
) + 1 + (2 * Index
)),
779 &(OnboardDevice
->OnBoardDeviceDescription
),
780 2 // 64 * sizeof(CHAR16)
784 // Status & Type: Bit 7 Devicen Status, Bits 6:0 Type of Device
786 StatusAndType
= (UINT8
) OnboardDevice
->OnBoardDeviceStatus
.DeviceType
;
787 if (OnboardDevice
->OnBoardDeviceStatus
.DeviceEnabled
!= 0) {
788 StatusAndType
|= 0x80;
790 StatusAndType
&= 0x7F;
793 * (UINT8
*) ((UINT8
*) (StructureNode
->Structure
) + (OFFSET_OF (SMBIOS_TABLE_TYPE10
, Device
) + (2 * Index
))) = StatusAndType
;
800 Field Filling Function for Misc SubClass record type 11 - OEM Strings.
802 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
803 @param Offset Offset of SMBIOS record which RecordData will be filled.
804 @param RecordData RecordData buffer will be filled.
805 @param RecordDataSize The size of RecordData buffer.
807 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
810 SmbiosFldMiscType11 (
811 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
814 IN UINT32 RecordDataSize
817 EFI_MISC_OEM_STRING_DATA
*OemString
;
819 OemString
= (EFI_MISC_OEM_STRING_DATA
*)RecordData
;
825 OFFSET_OF (SMBIOS_TABLE_TYPE11
, StringCount
),
826 &(OemString
->OemStringRef
[0]),
833 Field Filling Function for Misc SubClass record type 12 - System Options.
835 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
836 @param Offset Offset of SMBIOS record which RecordData will be filled.
837 @param RecordData RecordData buffer will be filled.
838 @param RecordDataSize The size of RecordData buffer.
840 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
843 SmbiosFldMiscType12 (
844 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
847 IN UINT32 RecordDataSize
851 EFI_MISC_SYSTEM_OPTION_STRING_DATA
*Sos
;
852 UINTN NumberOfInstallableLanguages
;
855 Status
= EFI_SUCCESS
;
856 Sos
= (EFI_MISC_SYSTEM_OPTION_STRING_DATA
*) RecordData
;
859 // As MiscDataHub spec defines,
860 // NumberOfInstallableLanguages should retrieve from Type 13.
862 NumberOfInstallableLanguages
= (StructureNode
->Structure
->Length
- 4);
863 for (Index
= 0; Index
< NumberOfInstallableLanguages
; Index
+= 1) {
865 // OnBoard Device Description
869 (UINT32
) (OFFSET_OF (SMBIOS_TABLE_TYPE12
, StringCount
) + (Index
)),
870 &(Sos
->SystemOptionStringRef
[Index
]),
879 Field Filling Function for Misc SubClass record type 13 - BIOS Language.
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 SmbiosFldMiscType13 (
890 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
893 IN UINT32 RecordDataSize
896 EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA
*InstallableLanguage
;
898 InstallableLanguage
= (EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA
*) RecordData
;
901 // Number Of Installable Languages
903 *(UINT8
*) ((UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE13
, InstallableLanguages
)) = (UINT8
) (InstallableLanguage
->NumberOfInstallableLanguages
);
909 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE13
, Flags
),
910 &InstallableLanguage
->LanguageFlags
,
915 // Current Language Number
919 OFFSET_OF (SMBIOS_TABLE_TYPE13
, CurrentLanguages
),
920 &(InstallableLanguage
->CurrentLanguageNumber
),
921 2 // 64 * sizeof(CHAR16)
928 Field Filling Function for Misc SubClass record type 14 - System Language String
929 Current solution assumes that EFI_MISC_SYSTEM_LANGUAGE_STRINGs are logged with
930 their LanguageId having ascending orders.
932 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
933 @param Offset Offset of SMBIOS record which RecordData will be filled.
934 @param RecordData RecordData buffer will be filled.
935 @param RecordDataSize The size of RecordData buffer.
937 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
940 SmbiosFldMiscType14 (
941 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
944 IN UINT32 RecordDataSize
947 UINT16 CurrentLanguageNumber
;
948 EFI_MISC_SYSTEM_LANGUAGE_STRING
*LanguageString
;
950 LanguageString
= (EFI_MISC_SYSTEM_LANGUAGE_STRING
*) RecordData
;
953 // Backup CurrentLanguage
956 &CurrentLanguageNumber
,
957 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE13
, CurrentLanguages
),
962 // Clear the field so that SmbiosFldString can be reused
964 *(UINT8
*)((UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE13
, CurrentLanguages
)) = 0;
968 OFFSET_OF (SMBIOS_TABLE_TYPE13
, CurrentLanguages
),
969 &(LanguageString
->SystemLanguageString
),
970 2 // 64 * sizeof(CHAR16)
974 // Restore CurrentLanguage
977 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE13
, CurrentLanguages
),
978 &CurrentLanguageNumber
,
986 Field Filling Function for Misc SubClass record type 15 -- System Event Log.
988 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
989 @param Offset Offset of SMBIOS record which RecordData will be filled.
990 @param RecordData RecordData buffer will be filled.
991 @param RecordDataSize The size of RecordData buffer.
993 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
996 SmbiosFldMiscType15 (
997 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1000 IN UINT32 RecordDataSize
1004 EFI_MISC_SYSTEM_EVENT_LOG_DATA
*SystemEventLog
;
1006 Status
= EFI_SUCCESS
;
1007 SystemEventLog
= NULL
;
1009 SystemEventLog
= (EFI_MISC_SYSTEM_EVENT_LOG_DATA
*) RecordData
;
1015 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE15
, LogAreaLength
),
1016 &(SystemEventLog
->LogAreaLength
),
1021 // Log Header Start Offset
1024 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE15
, LogHeaderStartOffset
),
1025 &(SystemEventLog
->LogHeaderStartOffset
),
1030 // Log Data Start Offset
1033 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE15
, LogDataStartOffset
),
1034 &(SystemEventLog
->LogDataStartOffset
),
1042 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE15
, AccessMethod
),
1043 &(SystemEventLog
->AccessMethod
),
1051 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE15
, LogStatus
),
1052 &(SystemEventLog
->LogStatus
),
1060 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE15
, LogChangeToken
),
1061 &(SystemEventLog
->LogChangeToken
),
1066 // Access Method Address
1069 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE15
, AccessMethodAddress
),
1070 &(SystemEventLog
->AccessMethodAddress
),
1075 // Log Header Format
1078 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE15
, LogHeaderFormat
),
1079 &(SystemEventLog
->LogHeaderFormat
),
1084 // Number of Supported Log Type Descriptors
1087 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE15
, NumberOfSupportedLogTypeDescriptors
),
1088 &(SystemEventLog
->NumberOfSupportedLogType
),
1093 // Length of each Log Type Descriptor
1096 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE15
, LengthOfLogTypeDescriptor
),
1097 &(SystemEventLog
->LengthOfLogDescriptor
),
1105 Field Filling Function for Misc SubClass record type 21 - Pointing Device.
1107 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1108 @param Offset Offset of SMBIOS record which RecordData will be filled.
1109 @param RecordData RecordData buffer will be filled.
1110 @param RecordDataSize The size of RecordData buffer.
1112 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1115 SmbiosFldMiscType21 (
1116 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1118 IN VOID
*RecordData
,
1119 IN UINT32 RecordDataSize
1122 EFI_MISC_POINTING_DEVICE_TYPE_DATA
*PointingDeviceData
;
1124 PointingDeviceData
= (EFI_MISC_POINTING_DEVICE_TYPE_DATA
*) RecordData
;
1127 // Pointing Device Type
1129 *(UINT8
*) ((UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE21
, Type
)) = (UINT8
) (PointingDeviceData
->PointingDeviceType
);
1132 // Pointing Device Interface
1134 *(UINT8
*) ((UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE21
, Interface
)) = (UINT8
) (PointingDeviceData
->PointingDeviceInterface
);
1137 // Number Pointing Device Buttons
1139 *(UINT8
*) ((UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE21
, NumberOfButtons
)) = (UINT8
) (PointingDeviceData
->NumberPointingDeviceButtons
);
1145 Field Filling Function for Misc SubClass record type 22 - Portable Battery.
1147 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1148 @param Offset Offset of SMBIOS record which RecordData will be filled.
1149 @param RecordData RecordData buffer will be filled.
1150 @param RecordDataSize The size of RecordData buffer.
1152 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1155 SmbiosFldMiscType22 (
1156 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1158 IN VOID
*RecordData
,
1159 IN UINT32 RecordDataSize
1162 EFI_MISC_PORTABLE_BATTERY
*PortableBattery
;
1163 STRING_REF Chemistry
;
1164 PortableBattery
= (EFI_MISC_PORTABLE_BATTERY
*)RecordData
;
1171 OFFSET_OF (SMBIOS_TABLE_TYPE22
, Location
),
1172 &(PortableBattery
->Location
),
1173 2 // 64 * sizeof(CHAR16)
1181 OFFSET_OF (SMBIOS_TABLE_TYPE22
, Manufacturer
),
1182 &(PortableBattery
->Manufacturer
),
1191 OFFSET_OF (SMBIOS_TABLE_TYPE22
, ManufactureDate
),
1192 &(PortableBattery
->ManufactureDate
),
1201 OFFSET_OF (SMBIOS_TABLE_TYPE22
, SerialNumber
),
1202 &(PortableBattery
->SerialNumber
),
1211 OFFSET_OF (SMBIOS_TABLE_TYPE22
, DeviceName
),
1212 &(PortableBattery
->DeviceName
),
1220 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE22
, DeviceChemistry
),
1221 &PortableBattery
->DeviceChemistry
,
1229 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE22
, DeviceCapacity
),
1230 &PortableBattery
->DesignCapacity
,
1238 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE22
, DesignVoltage
),
1239 &PortableBattery
->DesignVoltage
,
1244 // SBDSVersionNumber
1248 OFFSET_OF (SMBIOS_TABLE_TYPE22
, SBDSVersionNumber
),
1249 &(PortableBattery
->SBDSVersionNumber
),
1250 2 // 64 * sizeof(CHAR16)
1257 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE22
, MaximumErrorInBatteryData
),
1258 &PortableBattery
->MaximumError
,
1266 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE22
, SBDSSerialNumber
),
1267 &PortableBattery
->SBDSSerialNumber
,
1272 // SBDSManufactureDate
1275 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE22
, SBDSManufactureDate
),
1276 &PortableBattery
->SBDSManufactureDate
,
1281 // Avoid alignment issue on IPF
1285 &PortableBattery
->SBDSDeviceChemistry
,
1290 // SBDSDeviceChemistry
1294 OFFSET_OF (SMBIOS_TABLE_TYPE22
, SBDSDeviceChemistry
),
1296 2 // 64 * sizeof(CHAR16)
1300 // DesignCapacityMultiplier
1303 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE22
, DesignCapacityMultiplier
),
1304 &PortableBattery
->DesignCapacityMultiplier
,
1312 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE22
, OEMSpecific
),
1313 &PortableBattery
->OEMSpecific
,
1321 Field Filling Function for Misc SubClass record type 23 - System Reset.
1323 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1324 @param Offset Offset of SMBIOS record which RecordData will be filled.
1325 @param RecordData RecordData buffer will be filled.
1326 @param RecordDataSize The size of RecordData buffer.
1328 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1331 SmbiosFldMiscType23 (
1332 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1334 IN VOID
*RecordData
,
1335 IN UINT32 RecordDataSize
1338 EFI_MISC_RESET_CAPABILITIES_DATA
*SystemResetData
;
1340 SystemResetData
= (EFI_MISC_RESET_CAPABILITIES_DATA
*) RecordData
;
1343 // Reset Capabilities
1346 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE23
, Capabilities
),
1347 &(SystemResetData
->ResetCapabilities
),
1355 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE23
, ResetCount
),
1356 &(SystemResetData
->ResetCount
),
1364 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE23
, ResetLimit
),
1365 &(SystemResetData
->ResetLimit
),
1370 // Reset Timer Interval
1373 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE23
, TimerInterval
),
1374 &(SystemResetData
->ResetTimerInterval
),
1382 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE23
, Timeout
),
1383 &(SystemResetData
->ResetTimeout
),
1391 Field Filling Function for Misc SubClass record type 24 - Hardware Security.
1393 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1394 @param Offset Offset of SMBIOS record which RecordData will be filled.
1395 @param RecordData RecordData buffer will be filled.
1396 @param RecordDataSize The size of RecordData buffer.
1398 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1401 SmbiosFldMiscType24 (
1402 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1404 IN VOID
*RecordData
,
1405 IN UINT32 RecordDataSize
1408 EFI_MISC_HARDWARE_SECURITY_SETTINGS_DATA
*HardwareSecurity
;
1410 HardwareSecurity
= (EFI_MISC_HARDWARE_SECURITY_SETTINGS_DATA
*)RecordData
;
1413 // Hardware Security Settings
1416 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE24
, HardwareSecuritySettings
),
1417 &HardwareSecurity
->HardwareSecuritySettings
,
1425 Field Filling Function for Misc SubClass record type 25 - System Power Controls.
1427 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1428 @param Offset Offset of SMBIOS record which RecordData will be filled.
1429 @param RecordData RecordData buffer will be filled.
1430 @param RecordDataSize The size of RecordData buffer.
1432 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1435 SmbiosFldMiscType25 (
1436 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1438 IN VOID
*RecordData
,
1439 IN UINT32 RecordDataSize
1442 EFI_MISC_SCHEDULED_POWER_ON_MONTH
*PowerOnMonth
;
1444 PowerOnMonth
= (EFI_MISC_SCHEDULED_POWER_ON_MONTH
*)RecordData
;
1447 // ScheduledPoweronMonth
1450 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE25
, NextScheduledPowerOnMonth
),
1451 &PowerOnMonth
->ScheduledPoweronMonth
,
1456 // ScheduledPoweronDayOfMonth
1459 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE25
, NextScheduledPowerOnDayOfMonth
),
1460 &PowerOnMonth
->ScheduledPoweronDayOfMonth
,
1465 // ScheduledPoweronHour
1468 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE25
, NextScheduledPowerOnHour
),
1469 &PowerOnMonth
->ScheduledPoweronHour
,
1474 // ScheduledPoweronMinute
1477 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE25
, NextScheduledPowerOnMinute
),
1478 &PowerOnMonth
->ScheduledPoweronMinute
,
1483 // ScheduledPoweronSecond
1486 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE25
, NextScheduledPowerOnSecond
),
1487 &PowerOnMonth
->ScheduledPoweronSecond
,
1495 Field Filling Function for Misc SubClass record type 26 - Voltage Probe.
1497 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1498 @param Offset Offset of SMBIOS record which RecordData will be filled.
1499 @param RecordData RecordData buffer will be filled.
1500 @param RecordDataSize The size of RecordData buffer.
1502 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1505 SmbiosFldMiscType26 (
1506 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1508 IN VOID
*RecordData
,
1509 IN UINT32 RecordDataSize
1512 EFI_MISC_VOLTAGE_PROBE_DESCRIPTION
*VoltageProbe
;
1514 VoltageProbe
= (EFI_MISC_VOLTAGE_PROBE_DESCRIPTION
*)RecordData
;
1517 // VoltageProbe Description
1521 OFFSET_OF (SMBIOS_TABLE_TYPE26
, Description
),
1522 &(VoltageProbe
->VoltageProbeDescription
),
1523 2 // 64 * sizeof(CHAR16)
1527 // VoltageProbeLocation
1530 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE26
, LocationAndStatus
),
1531 &VoltageProbe
->VoltageProbeLocation
,
1536 // VoltageProbeMaximumValue
1539 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE26
, MaximumValue
),
1540 &VoltageProbe
->VoltageProbeMaximumValue
,
1545 // VoltageProbeMinimumValue
1548 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE26
, MinimumValue
),
1549 &VoltageProbe
->VoltageProbeMinimumValue
,
1554 // VoltageProbeResolution
1557 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE26
, Resolution
),
1558 &VoltageProbe
->VoltageProbeResolution
,
1563 // VoltageProbeTolerance
1566 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE26
, Tolerance
),
1567 &VoltageProbe
->VoltageProbeTolerance
,
1572 // VoltageProbeAccuracy
1575 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE26
, Accuracy
),
1576 &VoltageProbe
->VoltageProbeAccuracy
,
1581 // VoltageProbeNominalValue
1584 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE26
, NominalValue
),
1585 &VoltageProbe
->VoltageProbeNominalValue
,
1590 // VoltageProbeOemDefined
1593 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE26
, OEMDefined
),
1594 &VoltageProbe
->VoltageProbeOemDefined
,
1602 Field Filling Function for Misc SubClass record type 27 - Cooling Device.
1604 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1605 @param Offset Offset of SMBIOS record which RecordData will be filled.
1606 @param RecordData RecordData buffer will be filled.
1607 @param RecordDataSize The size of RecordData buffer.
1609 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1612 SmbiosFldMiscType27 (
1613 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1615 IN VOID
*RecordData
,
1616 IN UINT32 RecordDataSize
1619 EFI_MISC_COOLING_DEVICE_TEMP_LINK
*CoolingDevice
;
1621 CoolingDevice
= (EFI_MISC_COOLING_DEVICE_TEMP_LINK
*)RecordData
;
1627 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE27
, DeviceTypeAndStatus
),
1628 &CoolingDevice
->CoolingDeviceType
,
1633 // Temperature Probe
1635 SmbiosFldInterLink (
1637 (UINT16
) OFFSET_OF (SMBIOS_TABLE_TYPE27
, TemperatureProbeHandle
),
1638 28, // SMBIOS type 28 - Temperature Probe
1639 &CoolingDevice
->CoolingDeviceTemperatureLink
,
1640 &gEfiMiscSubClassGuid
1644 // CoolingDeviceUnitGroup
1647 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE27
, CoolingUnitGroup
),
1648 &CoolingDevice
->CoolingDeviceUnitGroup
,
1653 // CoolingDeviceUnitGroup
1656 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE27
, OEMDefined
),
1657 &CoolingDevice
->CoolingDeviceOemDefined
,
1662 // CoolingDeviceNominalSpeed
1665 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE27
, NominalSpeed
),
1666 &CoolingDevice
->CoolingDeviceNominalSpeed
,
1674 Field Filling Function for Misc SubClass record type 28 -- Temperature Probe.
1676 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1677 @param Offset Offset of SMBIOS record which RecordData will be filled.
1678 @param RecordData RecordData buffer will be filled.
1679 @param RecordDataSize The size of RecordData buffer.
1681 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1684 SmbiosFldMiscType28 (
1685 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1687 IN VOID
*RecordData
,
1688 IN UINT32 RecordDataSize
1691 EFI_MISC_TEMPERATURE_PROBE_DESCRIPTION
*TemperatureProbe
;
1693 TemperatureProbe
= (EFI_MISC_TEMPERATURE_PROBE_DESCRIPTION
*)RecordData
;
1696 // TemperatureProbeDescription
1700 OFFSET_OF (SMBIOS_TABLE_TYPE28
, Description
),
1701 &(TemperatureProbe
->TemperatureProbeDescription
),
1706 // TemperatureProbeLocation
1709 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE28
, LocationAndStatus
),
1710 &TemperatureProbe
->TemperatureProbeLocation
,
1715 // TemperatureProbeMaximumValue
1718 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE28
, MaximumValue
),
1719 &TemperatureProbe
->TemperatureProbeMaximumValue
,
1724 // TemperatureProbeMinimumValue
1727 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE28
, MinimumValue
),
1728 &TemperatureProbe
->TemperatureProbeMinimumValue
,
1733 // TemperatureProbeResolution
1736 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE28
, Resolution
),
1737 &TemperatureProbe
->TemperatureProbeResolution
,
1743 // TemperatureProbeTolerance
1746 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE28
, Tolerance
),
1747 &TemperatureProbe
->TemperatureProbeTolerance
,
1752 // TemperatureProbeAccuracy
1755 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE28
, Accuracy
),
1756 &TemperatureProbe
->TemperatureProbeAccuracy
,
1761 // TemperatureProbeNominalValue
1764 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE28
, NominalValue
),
1765 &TemperatureProbe
->TemperatureProbeNominalValue
,
1770 // TemperatureProbeOemDefined
1773 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE28
, OEMDefined
),
1774 &TemperatureProbe
->TemperatureProbeOemDefined
,
1782 Field Filling Function for Misc SubClass record type 29 -- Electrical Current Probe.
1784 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1785 @param Offset Offset of SMBIOS record which RecordData will be filled.
1786 @param RecordData RecordData buffer will be filled.
1787 @param RecordDataSize The size of RecordData buffer.
1789 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1792 SmbiosFldMiscType29 (
1793 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1795 IN VOID
*RecordData
,
1796 IN UINT32 RecordDataSize
1799 EFI_MISC_ELECTRICAL_CURRENT_PROBE_DESCRIPTION
*ElectricalProbe
;
1801 ElectricalProbe
= (EFI_MISC_ELECTRICAL_CURRENT_PROBE_DESCRIPTION
*)RecordData
;
1804 // ElectricalCurrentProbeDescription
1808 OFFSET_OF (SMBIOS_TABLE_TYPE29
, Description
),
1809 &(ElectricalProbe
->ElectricalCurrentProbeDescription
),
1810 2 // 64 * sizeof(CHAR16)
1814 // ElectricalCurrentProbeLocation
1817 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE29
, LocationAndStatus
),
1818 &ElectricalProbe
->ElectricalCurrentProbeLocation
,
1823 // ElectricalCurrentProbeMaximumValue
1826 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE29
, MaximumValue
),
1827 &ElectricalProbe
->ElectricalCurrentProbeMaximumValue
,
1832 // ElectricalCurrentProbeMinimumValue
1835 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE29
, MinimumValue
),
1836 &ElectricalProbe
->ElectricalCurrentProbeMinimumValue
,
1841 // ElectricalCurrentProbeResolution
1844 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE29
, Resolution
),
1845 &ElectricalProbe
->ElectricalCurrentProbeResolution
,
1850 // ElectricalCurrentProbeTolerance
1853 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE29
, Tolerance
),
1854 &ElectricalProbe
->ElectricalCurrentProbeTolerance
,
1859 // ElectricalCurrentProbeAccuracy
1862 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE29
, Accuracy
),
1863 &ElectricalProbe
->ElectricalCurrentProbeAccuracy
,
1867 // ElectricalCurrentProbeNominalValue
1870 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE29
, NominalValue
),
1871 &ElectricalProbe
->ElectricalCurrentProbeNominalValue
,
1876 // ElectricalCurrentProbeOemDefined
1879 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE29
, OEMDefined
),
1880 &ElectricalProbe
->ElectricalCurrentProbeOemDefined
,
1888 Field Filling Function for Misc SubClass record type 30 -- Out-of-Band Remote Access.
1890 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1891 @param Offset Offset of SMBIOS record which RecordData will be filled.
1892 @param RecordData RecordData buffer will be filled.
1893 @param RecordDataSize The size of RecordData buffer.
1895 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1898 SmbiosFldMiscType30 (
1899 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1901 IN VOID
*RecordData
,
1902 IN UINT32 RecordDataSize
1905 EFI_MISC_REMOTE_ACCESS_MANUFACTURER_DESCRIPTION
*RemoteData
;
1907 RemoteData
= (EFI_MISC_REMOTE_ACCESS_MANUFACTURER_DESCRIPTION
*)RecordData
;
1910 // ManufacturerNameDescription
1914 OFFSET_OF (SMBIOS_TABLE_TYPE30
, ManufacturerName
),
1915 &(RemoteData
->RemoteAccessManufacturerNameDescription
),
1916 2 // 64 * sizeof(CHAR16)
1920 // RemoteAccessConnections
1923 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE30
, Connections
),
1924 &RemoteData
->RemoteAccessConnections
,
1932 Field Filling Function for Misc SubClass record type 32 -- System Boot Information.
1934 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1935 @param Offset Offset of SMBIOS record which RecordData will be filled.
1936 @param RecordData RecordData buffer will be filled.
1937 @param RecordDataSize The size of RecordData buffer.
1939 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1942 SmbiosFldMiscType32 (
1943 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1945 IN VOID
*RecordData
,
1946 IN UINT32 RecordDataSize
1950 EFI_MISC_BOOT_INFORMATION_STATUS_DATA
*BootInfo
;
1952 Status
= EFI_SUCCESS
;
1953 BootInfo
= (EFI_MISC_BOOT_INFORMATION_STATUS_DATA
*) RecordData
;
1956 // Set reserved bytes
1958 ZeroMem ((UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE32
, Reserved
), 6);
1961 // Set BootInformation Status
1964 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE32
, BootStatus
),
1965 &BootInfo
->BootInformationStatus
,
1970 // Set Additional Data
1973 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE32
, BootStatus
) + 1,
1974 &BootInfo
->BootInformationData
,
1982 Field Filling Function for Misc SubClass record type 34 -- Management Device.
1984 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
1985 @param Offset Offset of SMBIOS record which RecordData will be filled.
1986 @param RecordData RecordData buffer will be filled.
1987 @param RecordDataSize The size of RecordData buffer.
1989 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
1992 SmbiosFldMiscType34 (
1993 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
1995 IN VOID
*RecordData
,
1996 IN UINT32 RecordDataSize
1999 EFI_MISC_MANAGEMENT_DEVICE_DESCRIPTION
*ManagementDevice
;
2001 ManagementDevice
= (EFI_MISC_MANAGEMENT_DEVICE_DESCRIPTION
*)RecordData
;
2004 // ManagementDeviceDescription
2008 OFFSET_OF (SMBIOS_TABLE_TYPE34
, Description
),
2009 &(ManagementDevice
->ManagementDeviceDescription
),
2010 2 // 64 * sizeof(CHAR16)
2014 // ManagementDeviceType
2017 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE34
, Type
),
2018 &ManagementDevice
->ManagementDeviceType
,
2023 // ManagementDeviceAddress
2026 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE34
, Address
),
2027 &ManagementDevice
->ManagementDeviceAddress
,
2032 // ManagementDeviceAddressType
2035 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE34
, AddressType
),
2036 &ManagementDevice
->ManagementDeviceAddressType
,
2044 Field Filling Function for Misc SubClass record type 36 -- Management Device Threshold.
2046 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
2047 @param Offset Offset of SMBIOS record which RecordData will be filled.
2048 @param RecordData RecordData buffer will be filled.
2049 @param RecordDataSize The size of RecordData buffer.
2051 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
2054 SmbiosFldMiscType36 (
2055 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
2057 IN VOID
*RecordData
,
2058 IN UINT32 RecordDataSize
2061 EFI_MISC_MANAGEMENT_DEVICE_THRESHOLD
*DeviceThreshold
;
2063 DeviceThreshold
= (EFI_MISC_MANAGEMENT_DEVICE_THRESHOLD
*)RecordData
;
2066 // LowerThresNonCritical
2069 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE36
, LowerThresholdNonCritical
),
2070 &DeviceThreshold
->LowerThresNonCritical
,
2075 // UpperThresNonCritical
2078 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE36
, UpperThresholdNonCritical
),
2079 &DeviceThreshold
->UpperThresNonCritical
,
2084 // LowerThresCritical
2087 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE36
, LowerThresholdCritical
),
2088 &DeviceThreshold
->LowerThresCritical
,
2093 // UpperThresCritical
2096 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE36
, UpperThresholdCritical
),
2097 &DeviceThreshold
->UpperThresCritical
,
2102 // LowerThresNonRecover
2105 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE36
, LowerThresholdNonRecoverable
),
2106 &DeviceThreshold
->LowerThresNonRecover
,
2111 // UpperThresNonRecover
2114 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE36
, UpperThresholdNonRecoverable
),
2115 &DeviceThreshold
->UpperThresNonRecover
,
2123 Field Filling Function for Misc SubClass record type 38 -- IPMI device info.
2125 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
2126 @param Offset Offset of SMBIOS record which RecordData will be filled.
2127 @param RecordData RecordData buffer will be filled.
2128 @param RecordDataSize The size of RecordData buffer.
2130 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
2133 SmbiosFldMiscType38 (
2134 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
2136 IN VOID
*RecordData
,
2137 IN UINT32 RecordDataSize
2140 EFI_MISC_IPMI_INTERFACE_TYPE_DATA
*IpmiInfo
;
2142 IpmiInfo
= (EFI_MISC_IPMI_INTERFACE_TYPE_DATA
*) RecordData
;
2147 *(UINT8
*) ((UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE38
, InterfaceType
)) = (UINT8
) (IpmiInfo
->IpmiInterfaceType
);
2150 // IPMI specification revision
2152 *(UINT8
*) ((UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE38
, IPMISpecificationRevision
)) =
2153 (UINT8
) ((IpmiInfo
->IpmiSpecificationRevision
.IpmiSpecLeastSignificantDigit
) + \
2154 (IpmiInfo
->IpmiSpecificationRevision
.IpmiSpecMostSignificantDigit
<< 4));
2157 // I2C slave address
2159 *(UINT8
*) ((UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE38
, I2CSlaveAddress
)) = (UINT8
) (IpmiInfo
->IpmiI2CSlaveAddress
);
2162 // NV storage device address
2164 *(UINT8
*) ((UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE38
, NVStorageDeviceAddress
)) = (UINT8
) (IpmiInfo
->IpmiNvDeviceAddress
);
2170 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE38
, BaseAddress
),
2171 &IpmiInfo
->IpmiBaseAddress
,
2179 Field Filling Function for Misc SubClass record type 39 -- Power supply.
2181 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
2182 @param Offset Offset of SMBIOS record which RecordData will be filled.
2183 @param RecordData RecordData buffer will be filled.
2184 @param RecordDataSize The size of RecordData buffer.
2186 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
2189 SmbiosFldMiscType39 (
2190 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
2192 IN VOID
*RecordData
,
2193 IN UINT32 RecordDataSize
2196 EFI_MISC_SYSTEM_POWER_SUPPLY
*PowerSupply
;
2198 PowerSupply
= (EFI_MISC_SYSTEM_POWER_SUPPLY
*)RecordData
;
2204 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE39
, PowerUnitGroup
),
2205 &PowerSupply
->PowerUnitGroup
,
2210 // PowerSupplyLocation
2214 OFFSET_OF (SMBIOS_TABLE_TYPE39
, Location
),
2215 &(PowerSupply
->PowerSupplyLocation
),
2216 2 // 64 * sizeof(CHAR16)
2220 // PowerSupplyDeviceName
2224 OFFSET_OF (SMBIOS_TABLE_TYPE39
, DeviceName
),
2225 &(PowerSupply
->PowerSupplyDeviceName
),
2226 2 // 64 * sizeof(CHAR16)
2230 // PowerSupplyManufacturer
2234 OFFSET_OF (SMBIOS_TABLE_TYPE39
, Manufacturer
),
2235 &(PowerSupply
->PowerSupplyManufacturer
),
2236 2 // 64 * sizeof(CHAR16)
2240 // PowerSupplySerialNumber
2244 OFFSET_OF (SMBIOS_TABLE_TYPE39
, SerialNumber
),
2245 &(PowerSupply
->PowerSupplySerialNumber
),
2246 2 // 64 * sizeof(CHAR16)
2250 // PowerSupplyAssetTagNumber
2254 OFFSET_OF (SMBIOS_TABLE_TYPE39
, AssetTagNumber
),
2255 &(PowerSupply
->PowerSupplyAssetTagNumber
),
2256 2 // 64 * sizeof(CHAR16)
2260 // PowerSupplyModelPartNumber
2264 OFFSET_OF (SMBIOS_TABLE_TYPE39
, ModelPartNumber
),
2265 &(PowerSupply
->PowerSupplyModelPartNumber
),
2266 2 // 64 * sizeof(CHAR16)
2270 // PowerSupplyRevisionLevel
2274 OFFSET_OF (SMBIOS_TABLE_TYPE39
, RevisionLevel
),
2275 &(PowerSupply
->PowerSupplyRevisionLevel
),
2276 2 // 64 * sizeof(CHAR16)
2280 // PowerSupplyMaxPowerCapacity
2283 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE39
, MaxPowerCapacity
),
2284 &PowerSupply
->PowerSupplyMaxPowerCapacity
,
2289 // PowerSupplyCharacteristics
2292 (UINT8
*) (StructureNode
->Structure
) + OFFSET_OF (SMBIOS_TABLE_TYPE39
, PowerSupplyCharacteristics
),
2293 &PowerSupply
->PowerSupplyCharacteristics
,
2298 // PowerSupplyInputVoltageProbeLink
2300 SmbiosFldInterLink (
2302 (UINT16
) OFFSET_OF (SMBIOS_TABLE_TYPE39
, InputVoltageProbeHandle
),
2303 26, // SMBIOS type 26 - Voltage Probe
2304 &PowerSupply
->PowerSupplyInputVoltageProbeLink
,
2305 &gEfiMiscSubClassGuid
2309 // PowerSupplyCoolingDeviceLink
2311 SmbiosFldInterLink (
2313 (UINT16
) OFFSET_OF (SMBIOS_TABLE_TYPE39
, CoolingDeviceHandle
),
2314 27, // SMBIOS type 27 - Cooling Device
2315 &PowerSupply
->PowerSupplyCoolingDeviceLink
,
2316 &gEfiMiscSubClassGuid
2320 // PowerSupplyInputCurrentProbeLink
2322 SmbiosFldInterLink (
2324 (UINT16
) OFFSET_OF (SMBIOS_TABLE_TYPE39
, InputCurrentProbeHandle
),
2325 29, // SMBIOS type 29 - Electrical Current Probe
2326 &PowerSupply
->PowerSupplyInputCurrentProbeLink
,
2327 &gEfiMiscSubClassGuid
2334 Field Filling Function for Misc SubClass record type 0x80-0xFF -- OEM.
2336 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
2337 @param Offset Offset of SMBIOS record which RecordData will be filled.
2338 @param RecordData RecordData buffer will be filled.
2339 @param RecordDataSize The size of RecordData buffer.
2341 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
2344 SmbiosFldMiscTypeOEM (
2345 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
2347 IN VOID
*RecordData
,
2348 IN UINT32 RecordDataSize
2352 UINT8
*NewRecordData
;
2353 UINT32 IncrementDataSize
;
2356 UINT32 StructureSize
;
2357 UINT8 CountOfString
;
2359 Status
= EFI_SUCCESS
;
2360 NewRecordData
= NULL
;
2363 // Check if OEM structure has included 2 trailing 0s in data record, if not,
2364 // we append them at the end to ensure OEM structure is always correct with 2 trailing 0s.
2366 Result
= SmbiosCheckTrailingZero (RecordData
, RecordDataSize
);
2369 DEBUG ((EFI_D_ERROR
, "OEM SMBIOS type %x is not valid!!\n", ((SMBIOS_STRUCTURE
*) RecordData
) -> Type
));
2372 // No 2 trailing 0s exist
2374 DEBUG ((EFI_D_ERROR
, "OEM SMBIOS type has NO 2 trailing 0s!!\n"));
2375 IncrementDataSize
= 2;
2378 // Only 1 trailing 0 exist at the end
2380 DEBUG ((EFI_D_ERROR
, "OEM SMBIOS type has only 1 trailing 0!!\n"));
2381 IncrementDataSize
= 1;
2383 NewRecordData
= AllocateZeroPool (RecordDataSize
+ IncrementDataSize
);
2384 ASSERT (NewRecordData
!= NULL
);
2385 CopyMem (NewRecordData
, RecordData
, RecordDataSize
);
2386 RecordData
= NewRecordData
;
2387 RecordDataSize
+= IncrementDataSize
;
2390 Status
= GetSmbiosStructureSize (StructureNode
->Structure
, &StructureSize
, &CountOfString
);
2391 ASSERT_EFI_ERROR (Status
);
2393 if (StructureSize
< RecordDataSize
) {
2394 Status
= SmbiosEnlargeStructureBuffer (
2396 ((EFI_SMBIOS_TABLE_HEADER
*)RecordData
)->Length
,
2400 if (EFI_ERROR (Status
)) {
2406 // Copy the entire data (including the Smbios structure header),
2407 // but preserve the handle that is already allocated.
2409 Handle
= StructureNode
->Structure
->Handle
;
2411 StructureNode
->Structure
,
2415 StructureNode
->Structure
->Handle
= Handle
;
2416 StructureNode
->StructureSize
= RecordDataSize
;
2418 if (NewRecordData
!= NULL
) {
2419 FreePool (NewRecordData
);
2426 Field Filling Function for Misc SubClass record type 127 - End-of-Table.
2428 @param StructureNode Pointer to SMBIOS_STRUCTURE_NODE which is current processed.
2429 @param Offset Offset of SMBIOS record which RecordData will be filled.
2430 @param RecordData RecordData buffer will be filled.
2431 @param RecordDataSize The size of RecordData buffer.
2433 @retval EFI_SUCCESS Success fill RecordData into SMBIOS's record buffer.
2436 SmbiosFldMiscType127 (
2437 IN OUT SMBIOS_STRUCTURE_NODE
*StructureNode
,
2439 IN VOID
*RecordData
,
2440 IN UINT32 RecordDataSize