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