OpenBIC
OpenSource Bridge-IC
pldm_oem.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_OEM_H
18#define _PLDM_OEM_H
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#include "pldm.h"
25#include <stdint.h>
26
27#define IANA_LEN 0x03
28/* define for pldm oem event */
29#define OEM_EVENT_LEN 0x05
30#define EVENT_ASSERTED 0x01
31#define EVENT_DEASSERTED 0x00
32
33/* commands of pldm type 0x3F : PLDM_TYPE_OEM */
34#define PLDM_OEM_CMD_ECHO 0x00
35#define PLDM_OEM_IPMI_BRIDGE 0x01
36#define PLDM_OEM_WRITE_FILE_IO 0x02
37#define PLDM_OEM_READ_FILE_IO 0x03
38
39#define POWER_CONTROL_LEN 0x01
40
42 POST_CODE = 0x00,
45 HTTP_BOOT = 0X03,
46 APML_ALERT = 0x04,
47 EVENT_LOG = 0x05,
48 CRASH_DUMP = 0x06,
49};
50
52 SLED_CYCLE = 0x00,
60};
61
90};
91
98};
99
101
103 uint8_t iana[IANA_LEN];
104 uint8_t first_data;
105} __attribute__((packed));
106
109 uint8_t iana[IANA_LEN];
110 uint8_t first_data;
111} __attribute__((packed));
112
114 uint8_t iana[IANA_LEN];
115 uint8_t netfn_lun;
116 uint8_t cmd;
117 uint8_t first_data;
118} __attribute__((packed));
119
122 uint8_t iana[IANA_LEN];
123 uint8_t netfn_lun;
124 uint8_t cmd;
126 uint8_t first_data;
127} __attribute__((packed));
128
130 uint8_t cmd_code;
131 uint32_t data_length;
132 uint8_t messages[];
133} __attribute__((packed));
134
137} __attribute__((packed));
138
141 uint16_t offset;
142} __attribute__((packed));
143
145 uint16_t size;
146 uint32_t crc32;
147} __attribute__((packed));
148
150 uint8_t cmd_code;
151 uint8_t read_option;
153} __attribute__((packed));
154
156 uint8_t cmd_code;
157 uint8_t read_option;
160} __attribute__((packed));
161
164 uint8_t cmd_code;
165 uint8_t read_option;
168 uint8_t read_info[];
169} __attribute__((packed));
170
173 uint8_t cmd_code;
174 uint8_t read_option;
177 uint8_t read_info[];
178} __attribute__((packed));
179
181 uint8_t event_type;
182 uint8_t assert_type;
186} __attribute__((packed));
187
188uint8_t check_iana(const uint8_t *iana);
189uint8_t set_iana(uint8_t *buf, uint8_t buf_len);
191
192uint8_t pldm_oem_handler_query(uint8_t code, void **ret_fn);
193
194#ifdef __cplusplus
195}
196#endif
197
198#endif /* _PLDM_OEM_H */
READ_FILE_OPTION
Definition: pldm_oem.h:100
@ READ_FILE_ATTR
Definition: pldm_oem.h:100
@ READ_FILE_DATA
Definition: pldm_oem.h:100
cmd_type
Definition: pldm_oem.h:41
@ HTTP_BOOT
Definition: pldm_oem.h:45
@ BIOS_VERSION
Definition: pldm_oem.h:43
@ POWER_CONTROL
Definition: pldm_oem.h:44
@ CRASH_DUMP
Definition: pldm_oem.h:48
@ APML_ALERT
Definition: pldm_oem.h:46
@ EVENT_LOG
Definition: pldm_oem.h:47
@ POST_CODE
Definition: pldm_oem.h:42
uint8_t check_iana(const uint8_t *iana)
Definition: pldm_oem.c:36
uint8_t pldm_oem_handler_query(uint8_t code, void **ret_fn)
Definition: pldm_oem.c:216
#define IANA_LEN
Definition: pldm_oem.h:27
vr_event_source
Definition: pldm_oem.h:92
@ PVDDCR_CPU1
Definition: pldm_oem.h:95
@ PVDDCR_SOC
Definition: pldm_oem.h:94
@ PVDDIO
Definition: pldm_oem.h:96
@ PVDD11_S3
Definition: pldm_oem.h:97
@ PVDDCR_CPU0
Definition: pldm_oem.h:93
uint8_t send_event_log_to_bmc(struct pldm_addsel_data msg)
uint8_t iana[IANA_LEN]
Definition: pldm_oem.h:0
oem_event_type
Definition: pldm_oem.h:62
@ CHASSIS_POWER_CYCLE_BY_SLED_BTN
Definition: pldm_oem.h:80
@ BMC_COMES_OUT_COLD_RESET
Definition: pldm_oem.h:72
@ BIOS_FRB2_WDT_EXPIRE
Definition: pldm_oem.h:73
@ CHASSIS_POWER_ON_BY_NIC_INSERT
Definition: pldm_oem.h:78
@ VR_FAULT
Definition: pldm_oem.h:83
@ FRB3_TIMER_EXPIRE
Definition: pldm_oem.h:68
@ CPU_POWER_FAIL
Definition: pldm_oem.h:75
@ PLTRST_ASSERT
Definition: pldm_oem.h:88
@ DIMM_PMIC_ERROR
Definition: pldm_oem.h:70
@ FAN_ERROR
Definition: pldm_oem.h:86
@ PMALERT_ASSERT
Definition: pldm_oem.h:66
@ ADDC_DUMP
Definition: pldm_oem.h:71
@ P12V_STBY_UV
Definition: pldm_oem.h:65
@ APML_ALERT_ASSERT
Definition: pldm_oem.h:89
@ CPU_THERMAL_TRIP
Definition: pldm_oem.h:63
@ BIC_POWER_FAIL
Definition: pldm_oem.h:74
@ HSC_OCP
Definition: pldm_oem.h:64
@ FAST_PROCHOT_ASSERT
Definition: pldm_oem.h:67
@ SYS_THROTTLE
Definition: pldm_oem.h:82
@ BMC_REBOOT_REQUESTED
Definition: pldm_oem.h:77
@ POST_COMPLETED
Definition: pldm_oem.h:85
@ HDT_PRSNT_ASSERT
Definition: pldm_oem.h:87
@ SYS_MANAGEMENT_ERROR
Definition: pldm_oem.h:84
@ BMC_VBOOT_FAIL
Definition: pldm_oem.h:76
@ POWER_ON_SEQUENCE_FAIL
Definition: pldm_oem.h:69
@ BLADE_POWER_CYCLE_BY_BLADE_BTN
Definition: pldm_oem.h:79
@ HSC_FAULT
Definition: pldm_oem.h:81
uint8_t set_iana(uint8_t *buf, uint8_t buf_len)
Definition: pldm_oem.c:48
POWER_CONTROL_OPTION
Definition: pldm_oem.h:51
@ NIC3_POWER_CYCLE
Definition: pldm_oem.h:58
@ SLED_CYCLE
Definition: pldm_oem.h:52
@ SLOT_DC_CYCLE
Definition: pldm_oem.h:54
@ NIC1_POWER_CYCLE
Definition: pldm_oem.h:56
@ MAX_POWER_OPTION
Definition: pldm_oem.h:59
@ NIC2_POWER_CYCLE
Definition: pldm_oem.h:57
@ NIC0_POWER_CYCLE
Definition: pldm_oem.h:55
@ SLOT_12V_CYCLE
Definition: pldm_oem.h:53
struct _cmd_echo_req __attribute__((packed))
Definition: cci.h:57
Definition: pldm_oem.h:102
uint8_t iana[IANA_LEN]
Definition: pldm_oem.h:103
uint8_t first_data
Definition: pldm_oem.h:104
Definition: pldm_oem.h:107
uint8_t completion_code
Definition: pldm_oem.h:108
uint8_t iana[IANA_LEN]
Definition: pldm_oem.h:109
uint8_t first_data
Definition: pldm_oem.h:110
Definition: pldm_oem.h:113
uint8_t first_data
Definition: pldm_oem.h:117
uint8_t iana[IANA_LEN]
Definition: pldm_oem.h:114
uint8_t cmd
Definition: pldm_oem.h:116
uint8_t netfn_lun
Definition: pldm_oem.h:115
Definition: pldm_oem.h:120
uint8_t first_data
Definition: pldm_oem.h:126
uint8_t ipmi_comp_code
Definition: pldm_oem.h:125
uint8_t netfn_lun
Definition: pldm_oem.h:123
uint8_t iana[IANA_LEN]
Definition: pldm_oem.h:122
uint8_t cmd
Definition: pldm_oem.h:124
uint8_t completion_code
Definition: pldm_oem.h:121
Definition: pldm_oem.h:180
uint8_t assert_type
Definition: pldm_oem.h:182
uint8_t event_type
Definition: pldm_oem.h:181
uint8_t event_data_3
Definition: pldm_oem.h:185
uint8_t event_data_1
Definition: pldm_oem.h:183
uint8_t event_data_2
Definition: pldm_oem.h:184
Definition: pldm_oem.h:144
uint16_t size
Definition: pldm_oem.h:145
uint32_t crc32
Definition: pldm_oem.h:146
Definition: pldm_oem.h:139
uint16_t offset
Definition: pldm_oem.h:141
uint8_t transfer_flag
Definition: pldm_oem.h:140
Definition: pldm_oem.h:149
uint8_t read_option
Definition: pldm_oem.h:151
uint8_t read_info_length
Definition: pldm_oem.h:152
uint8_t cmd_code
Definition: pldm_oem.h:150
Definition: pldm_oem.h:162
uint8_t read_info[]
Definition: pldm_oem.h:168
uint8_t cmd_code
Definition: pldm_oem.h:164
struct pldm_oem_read_file_attr_info attr
Definition: pldm_oem.h:167
uint8_t read_info_length
Definition: pldm_oem.h:166
uint8_t read_option
Definition: pldm_oem.h:165
uint8_t completion_code
Definition: pldm_oem.h:163
Definition: pldm_oem.h:155
struct pldm_oem_read_file_data_info data
Definition: pldm_oem.h:159
uint8_t read_option
Definition: pldm_oem.h:157
uint8_t cmd_code
Definition: pldm_oem.h:156
uint8_t read_info_length
Definition: pldm_oem.h:158
Definition: pldm_oem.h:171
uint8_t completion_code
Definition: pldm_oem.h:172
struct pldm_oem_read_file_data_info data
Definition: pldm_oem.h:176
uint8_t read_option
Definition: pldm_oem.h:174
uint8_t read_info[]
Definition: pldm_oem.h:177
uint8_t cmd_code
Definition: pldm_oem.h:173
uint8_t read_info_length
Definition: pldm_oem.h:175
Definition: pldm_oem.h:129
uint8_t cmd_code
Definition: pldm_oem.h:130
uint32_t data_length
Definition: pldm_oem.h:131
uint8_t messages[]
Definition: pldm_oem.h:132
Definition: pldm_oem.h:135
uint8_t completion_code
Definition: pldm_oem.h:136