Patrick Williams | 691668f | 2023-11-01 08:19:10 -0500 | [diff] [blame] | 1 | /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ |
Rashmica Gupta | 8022323 | 2023-06-19 14:10:14 +1000 | [diff] [blame] | 2 | #ifndef LIBPLDM_SRC_TRANSPORT_TRANSPORT_H |
| 3 | #define LIBPLDM_SRC_TRANSPORT_TRANSPORT_H |
Rashmica Gupta | c1b66f4 | 2022-12-09 16:24:45 +1100 | [diff] [blame] | 4 | |
Andrew Jeffery | efb4006 | 2023-11-10 13:48:39 +1030 | [diff] [blame] | 5 | #include <libpldm/base.h> |
| 6 | #include <libpldm/pldm.h> |
Rashmica Gupta | c1b66f4 | 2022-12-09 16:24:45 +1100 | [diff] [blame] | 7 | struct 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 | */ |
| 18 | struct pldm_transport { |
| 19 | const char *name; |
| 20 | uint8_t version; |
| 21 | pldm_requester_rc_t (*recv)(struct pldm_transport *transport, |
Rashmica Gupta | 2457629 | 2023-07-31 14:02:41 +1000 | [diff] [blame] | 22 | pldm_tid_t *tid, void **pldm_resp_msg, |
Rashmica Gupta | f1ebde4 | 2023-07-31 14:17:57 +1000 | [diff] [blame] | 23 | size_t *msg_len); |
Rashmica Gupta | c1b66f4 | 2022-12-09 16:24:45 +1100 | [diff] [blame] | 24 | pldm_requester_rc_t (*send)(struct pldm_transport *transport, |
Rashmica Gupta | f1ebde4 | 2023-07-31 14:17:57 +1000 | [diff] [blame] | 25 | pldm_tid_t tid, const void *pldm_msg, |
| 26 | size_t msg_len); |
Rashmica Gupta | c1b66f4 | 2022-12-09 16:24:45 +1100 | [diff] [blame] | 27 | int (*init_pollfd)(struct pldm_transport *transport, |
| 28 | struct pollfd *pollfd); |
| 29 | }; |
| 30 | |
Rashmica Gupta | 8022323 | 2023-06-19 14:10:14 +1000 | [diff] [blame] | 31 | #endif // LIBPLDM_SRC_TRANSPORT_TRANSPORT_H |