OpenBIC
OpenSource Bridge-IC
plat_mctp.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 _PLAT_MCTP_h
18#define _PLAT_MCTP_h
19#include <kernel.h>
20#include "storage_handler.h"
21#include "pldm.h"
22
23/* mctp endpoint */
24#define MCTP_EID_BMC 0x08
25#define MCTP_EID_SATMC 0xF0
26
28 uint8_t iana[IANA_LEN];
29 uint8_t netfn_lun;
30 uint8_t ipmi_cmd;
31} __attribute__((__packed__));
32;
33
35 uint8_t completion_code;
36 uint8_t netfn_lun;
37 uint8_t ipmi_cmd;
38 uint8_t ipmi_comp_code;
39} __attribute__((__packed__));
40;
41
42enum {
45};
46
50} __attribute__((__packed__));
51
55} __attribute__((__packed__));
56
57/* init the mctp moduel for platform */
58void plat_mctp_init(void);
59void send_cmd_to_dev(struct k_timer *timer);
60void send_cmd_to_dev_handler(struct k_work *work);
61bool mctp_add_sel_to_ipmi(struct ipmi_storage_add_sel_req *sel_msg, uint8_t sel_type);
63mctp_port *plat_get_mctp_port(uint8_t index);
65
66#endif /* _PLAT_MCTP_h */
void plat_mctp_init(void)
Definition: plat_mctp.c:218
void send_cmd_to_dev(struct k_timer *timer)
Definition: plat_mctp.c:582
bool mctp_add_sel_to_ipmi(common_addsel_msg_t *sel_msg)
Definition: plat_mctp.c:271
void send_cmd_to_dev_handler(struct k_work *work)
Definition: plat_mctp.c:563
#define IANA_LEN
Definition: pldm_oem.h:27
Definition: mctp.h:204
Definition: storage_handler.h:56
Definition: storage_handler.h:63
Definition: plat_mctp.h:23
uint8_t netfn_lun
Definition: plat_mctp.h:25
uint8_t ipmi_cmd
Definition: plat_mctp.h:26
uint8_t iana[IANA_LEN]
Definition: plat_mctp.h:24
Definition: plat_mctp.h:30
uint8_t ipmi_comp_code
Definition: plat_mctp.h:35
uint8_t ipmi_cmd
Definition: plat_mctp.h:34
uint8_t netfn_lun
Definition: plat_mctp.h:33
uint8_t completion_code
Definition: plat_mctp.h:31
Definition: plat_mctp.h:39
struct ipmi_storage_add_sel_req req_data
Definition: plat_mctp.h:41
struct mctp_to_ipmi_header_req header
Definition: plat_mctp.h:40
Definition: plat_mctp.h:44
struct mctp_to_ipmi_header_resp header
Definition: plat_mctp.h:45
struct ipmi_storage_add_sel_resp resp_data
Definition: plat_mctp.h:46
uint8_t plat_get_mctp_port_count()
Definition: mctp.c:688
mctp_port * plat_get_mctp_port(uint8_t index)
Definition: mctp.c:693
void satmc_status_update()
Definition: plat_mctp.c:121
@ ADD_COMMON_SEL
Definition: plat_mctp.h:43
@ ADD_OEM_SEL
Definition: plat_mctp.h:44
enum @186 __attribute__