blob: da47d8b23318aa01e5676d851a13c343c8b10964 [file] [log] [blame]
Patrick Williams691668f2023-11-01 08:19:10 -05001/* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
Rashmica Gupta80223232023-06-19 14:10:14 +10002#ifndef LIBPLDM_SRC_TRANSPORT_TRANSPORT_H
3#define LIBPLDM_SRC_TRANSPORT_TRANSPORT_H
Rashmica Guptac1b66f42022-12-09 16:24:45 +11004
Andrew Jefferyefb40062023-11-10 13:48:39 +10305#include <libpldm/base.h>
6#include <libpldm/pldm.h>
Rashmica Guptac1b66f42022-12-09 16:24:45 +11007struct pollfd;
8
9/**
10 * @brief Generic PLDM transport struct
11 *
12 * @var name - name of the transport
13 * @var version - version of transport to use
14 * @var recv - pointer to the transport specific function to receive a message
15 * @var send - pointer to the transport specific function to send a message
16 * @var init_pollfd - pointer to the transport specific init_pollfd function
17 */
18struct pldm_transport {
19 const char *name;
20 uint8_t version;
21 pldm_requester_rc_t (*recv)(struct pldm_transport *transport,
Rashmica Gupta24576292023-07-31 14:02:41 +100022 pldm_tid_t *tid, void **pldm_resp_msg,
Rashmica Guptaf1ebde42023-07-31 14:17:57 +100023 size_t *msg_len);
Rashmica Guptac1b66f42022-12-09 16:24:45 +110024 pldm_requester_rc_t (*send)(struct pldm_transport *transport,
Rashmica Guptaf1ebde42023-07-31 14:17:57 +100025 pldm_tid_t tid, const void *pldm_msg,
26 size_t msg_len);
Rashmica Guptac1b66f42022-12-09 16:24:45 +110027 int (*init_pollfd)(struct pldm_transport *transport,
28 struct pollfd *pollfd);
29};
30
Rashmica Gupta80223232023-06-19 14:10:14 +100031#endif // LIBPLDM_SRC_TRANSPORT_TRANSPORT_H