xref: /openbmc/libpldm/include/libpldm/transport/mctp-demux.h (revision 9d2a1c6ad095d0b04d1c39a794487eafda1f34fb)
1 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
2 #ifndef LIBPLDM_DEMUX_H
3 #define LIBPLDM_DEMUX_H
4 
5 #include "config.h"
6 #include "libpldm/base.h"
7 #include "libpldm/pldm.h"
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 struct pldm_transport_mctp_demux;
14 
15 /* Init the transport backend */
16 int pldm_transport_mctp_demux_init(struct pldm_transport_mctp_demux **ctx);
17 
18 /* Destroy the transport backend */
19 void pldm_transport_mctp_demux_destroy(struct pldm_transport_mctp_demux *ctx);
20 
21 /* Get the core pldm transport struct */
22 struct pldm_transport *
23 pldm_transport_mctp_demux_core(struct pldm_transport_mctp_demux *ctx);
24 
25 #ifdef PLDM_HAS_POLL
26 struct pollfd;
27 /* Init pollfd for async calls */
28 int pldm_transport_mctp_demux_init_pollfd(struct pldm_transport_mctp_demux *ctx,
29 					  struct pollfd *pollfd);
30 #endif
31 
32 /* Inserts a TID-to-EID mapping into the transport's device map */
33 int pldm_transport_mctp_demux_map_tid(struct pldm_transport_mctp_demux *ctx,
34 				      pldm_tid_t tid, mctp_eid_t eid);
35 
36 /* Removes a TID-to-EID mapping from the transport's device map */
37 int pldm_transport_mctp_demux_unmap_tid(struct pldm_transport_mctp_demux *ctx,
38 					pldm_tid_t tid, mctp_eid_t eid);
39 
40 #ifdef __cplusplus
41 }
42 #endif
43 
44 #endif /* LIBPLDM_DEMUX_H */
45