OpenBIC
OpenSource Bridge-IC
pldm_base.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_BASE_H
18#define _PLDM_BASE_H
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#include "pldm.h"
25#include <stdint.h>
26
27/* commands of pldm type 0x00 : PLDM_TYPE_CTRL_DISCOV */
28#define PLDM_BASE_CMD_CODE_SETTID 0x01
29#define PLDM_BASE_CMD_CODE_GETTID 0x02
30#define PLDM_BASE_CMD_CODE_GET_PLDM_VER 0x03
31#define PLDM_BASE_CMD_CODE_GET_PLDM_TYPE 0x04
32#define PLDM_BASE_CMD_CODE_GET_PLDM_CMDS 0x05
33
34#define DEFAULT_TID 0x86
35
36#define GET_PLDM_TYPE_BUF_SIZE 8
37#define GET_PLDM_COMMAND_BUF_SIZE 32
38
39#define INVALID_PLDM_TYPE_IN_REQUEST_DATA 0x83
40#define INVALID_PLDM_VERSION_IN_REQUEST_DATA 0x84
41
44 PLDM_ERROR = 0x01,
51 /* Use reserved region for oem define */
53};
54
59};
60
62 PLDM_START = 0x01,
64 PLDM_END = 0x04,
66};
67
69 uint8_t tid;
70} __attribute__((packed));
71
74} __attribute__((packed));
75
78 uint8_t tid;
79} __attribute__((packed));
80
84} __attribute__((packed));
85
87 uint8_t type;
88 uint32_t version;
89} __attribute__((packed));
90
94} __attribute__((packed));
95
96uint8_t pldm_base_handler_query(uint8_t code, void **ret_fn);
97
98uint8_t plat_pldm_get_tid();
99
100#ifdef __cplusplus
101}
102#endif
103
104#endif /* _PLDM_BASE_H */
uint8_t pldm_base_handler_query(uint8_t code, void **ret_fn)
Definition: pldm_base.c:136
pldm_completion_codes
Definition: pldm_base.h:42
@ PLDM_SUCCESS
Definition: pldm_base.h:43
@ PLDM_INVALID_TRANSFER_OPERATION_FLAG
Definition: pldm_base.h:50
@ PLDM_ERROR_INVALID_DATA
Definition: pldm_base.h:45
@ PLDM_ERROR_INVALID_PLDM_TYPE
Definition: pldm_base.h:49
@ PLDM_LATER_RESP
Definition: pldm_base.h:52
@ PLDM_ERROR_INVALID_LENGTH
Definition: pldm_base.h:46
@ PLDM_ERROR_UNSUPPORTED_PLDM_CMD
Definition: pldm_base.h:48
@ PLDM_ERROR
Definition: pldm_base.h:44
@ PLDM_ERROR_NOT_READY
Definition: pldm_base.h:47
struct _set_tid_req __attribute__((packed))
Definition: cci.h:57
pldm_transport_protocol_type
Definition: pldm_base.h:55
@ PLDM_TRANSPORT_PROTOCOL_TYPE_NCSI
Definition: pldm_base.h:57
@ PLDM_TRANSPORT_PROTOCOL_TYPE_OEM
Definition: pldm_base.h:58
@ PLDM_TRANSPORT_PROTOCOL_TYPE_MCTP
Definition: pldm_base.h:56
uint8_t plat_pldm_get_tid()
Definition: pldm_base.c:28
pldm_transfer_flag
Definition: pldm_base.h:61
@ PLDM_START_AND_END
Definition: pldm_base.h:65
@ PLDM_MIDDLE
Definition: pldm_base.h:63
@ PLDM_END
Definition: pldm_base.h:64
@ PLDM_START
Definition: pldm_base.h:62
#define GET_PLDM_TYPE_BUF_SIZE
Definition: pldm_base.h:36
#define GET_PLDM_COMMAND_BUF_SIZE
Definition: pldm_base.h:37
Definition: pldm_base.h:86
uint32_t version
Definition: pldm_base.h:88
uint8_t type
Definition: pldm_base.h:87
Definition: pldm_base.h:91
uint8_t completion_code
Definition: pldm_base.h:92
uint8_t pldm_commands[GET_PLDM_COMMAND_BUF_SIZE]
Definition: pldm_base.h:93
Definition: pldm_base.h:81
uint8_t completion_code
Definition: pldm_base.h:82
uint8_t pldm_types[GET_PLDM_TYPE_BUF_SIZE]
Definition: pldm_base.h:83
Definition: pldm_base.h:76
uint8_t tid
Definition: pldm_base.h:78
uint8_t completion_code
Definition: pldm_base.h:77
Definition: pldm_base.h:68
uint8_t tid
Definition: pldm_base.h:69
Definition: pldm_base.h:72
uint8_t completion_code
Definition: pldm_base.h:73