OpenBIC
OpenSource Bridge-IC
pldm_smbios.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _PLDM_SMBIOS_H
18#define _PLDM_SMBIOS_H
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#include "pldm.h"
25
26// Size of the largest SMBIOS structure, DSP0134_3.6.0
27#define MAXIMUM_STRUCTURE_SIZE 65535
28// For version 2.1 and later, handle values are in the range 0 to 0xFEFFh.
29#define MAXIMUM_HANDLE_NUM 0xFEFF
30
31typedef enum {
34
35typedef enum {
36 /* GetSMBIOSStructureByType */
43
44typedef enum {
50
51typedef enum {
55
56// Based on DSP0134 v3.6.0
57typedef enum {
60
61typedef struct {
62 uint8_t type;
63 uint8_t length;
64 uint16_t handle;
65} __attribute__((packed)) smbios_structure_header;
66
67typedef struct {
68 smbios_structure_header header;
69 uint8_t vendor;
70 uint8_t bios_version;
82} __attribute__((packed)) smbios_bios_information;
83
84typedef struct {
87 uint8_t type;
89} __attribute__((packed)) pldm_get_smbios_structure_by_type_req;
90
91typedef struct {
95} __attribute__((packed)) pldm_get_smbios_structure_by_type_resp;
96
98
99uint8_t pldm_smbios_handler_query(uint8_t code, void **ret_fn);
100
101uint8_t pldm_smbios_get_text_strings_count(char *text_strings);
102
103uint8_t pldm_smbios_get_text_strings_size(char *text_strings);
104
105int pldm_smbios_set_bios_information(smbios_bios_information *new_bios_information);
106
107const char *pldm_smbios_get_bios_version();
108
109#ifdef __cplusplus
110}
111#endif
112
113#endif /*_PLDM_SMBIOS_H*/
typedef __attribute__
Definition: mctp_ctrl.h:109
uint8_t type
Definition: pldm_base.h:0
uint8_t pldm_smbios_get_text_strings_size(char *text_strings)
Definition: pldm_smbios.c:91
const char * pldm_smbios_get_bios_version()
Definition: pldm_smbios.c:168
pldm_smbios_completion_codes
Definition: pldm_smbios.h:35
@ PLDM_SMBIOS_INVALID_DATA_TRANSFER_HANDLE
Definition: pldm_smbios.h:37
@ PLDM_SMBIOS_INVALID_TRANSFER_OPERATION_FLAG
Definition: pldm_smbios.h:38
@ PLDM_SMBIOS_INVALID_SMBIOS_STRUCTURE_INSTANCE_ID
Definition: pldm_smbios.h:41
@ PLDM_SMBIOS_NO_SMBIOS_STRUCTURES
Definition: pldm_smbios.h:39
@ PLDM_SMBIOS_INVALID_SMBIOS_STRUCTURE_TYPE
Definition: pldm_smbios.h:40
void pldm_smbios_init_structures()
Definition: pldm_smbios.c:60
pldm_smbios_transfer_flag
Definition: pldm_smbios.h:44
@ PLDM_SMBIOS_TRANSFER_FLAG_START
Definition: pldm_smbios.h:45
@ PLDM_SMBIOS_TRANSFER_FLAG_START_AND_END
Definition: pldm_smbios.h:48
@ PLDM_SMBIOS_TRANSFER_FLAG_MIDDLE
Definition: pldm_smbios.h:46
@ PLDM_SMBIOS_TRANSFER_FLAG_END
Definition: pldm_smbios.h:47
pldm_smbios_commands
Definition: pldm_smbios.h:31
@ PLDM_SMBIOS_CMD_CODE_GET_SMBIOS_STRUCTURE_BY_TYPE
Definition: pldm_smbios.h:32
pldm_smbios_transfer_operation_flag
Definition: pldm_smbios.h:51
@ PLDM_SMBIOS_TRANSFER_OPERATION_FLAG_GET_FIRST_PART
Definition: pldm_smbios.h:53
@ PLDM_SMBIOS_TRANSFER_OPERATION_FLAG_GET_NEXT_PART
Definition: pldm_smbios.h:52
int pldm_smbios_set_bios_information(smbios_bios_information *new_bios_information)
Definition: pldm_smbios.c:117
uint8_t pldm_smbios_handler_query(uint8_t code, void **ret_fn)
Definition: pldm_smbios.c:414
uint8_t pldm_smbios_get_text_strings_count(char *text_strings)
Definition: pldm_smbios.c:67
smbios_structure_types
Definition: pldm_smbios.h:57
@ SMBIOS_BIOS_INFORMATION
Definition: pldm_smbios.h:58
uint32_t data_transfer_handle
Definition: pldm_smbios.h:85
char * text_strings
Definition: pldm_smbios.h:81
uint32_t next_data_transfer_handle
Definition: pldm_smbios.h:93
uint8_t vendor
Definition: pldm_smbios.h:69
uint8_t type
Definition: pldm_smbios.h:62
uint8_t length
Definition: pldm_smbios.h:63
uint8_t embedded_controller_firmware_major_release
Definition: pldm_smbios.h:78
uint8_t embedded_controller_firmware_minor_release
Definition: pldm_smbios.h:79
uint8_t bios_release_date
Definition: pldm_smbios.h:72
uint64_t bios_characteristics
Definition: pldm_smbios.h:74
uint16_t bios_characteristics_extension_bytes
Definition: pldm_smbios.h:75
uint8_t system_bios_minor_release
Definition: pldm_smbios.h:77
uint8_t system_bios_major_release
Definition: pldm_smbios.h:76
uint16_t bios_starting_address_segment
Definition: pldm_smbios.h:71
uint8_t transfer_flag
Definition: pldm_smbios.h:94
smbios_structure_header header
Definition: pldm_smbios.h:68
uint8_t transfer_operation_flag
Definition: pldm_smbios.h:86
uint16_t extended_bios_rom_size
Definition: pldm_smbios.h:80
uint8_t bios_rom_size
Definition: pldm_smbios.h:73
uint16_t handle
Definition: pldm_smbios.h:64
uint8_t completion_code
Definition: pldm_smbios.h:92
uint16_t structure_instance_id
Definition: pldm_smbios.h:88
uint8_t bios_version
Definition: pldm_smbios.h:70