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
49d2a1c6aSAndrew Jeffery 
5*efb40069SAndrew Jeffery #include <libpldm/base.h>
6*efb40069SAndrew Jeffery #include <libpldm/pldm.h>
7c1b66f42SRashmica Gupta 
8c1b66f42SRashmica Gupta #ifdef __cplusplus
9c1b66f42SRashmica Gupta extern "C" {
10c1b66f42SRashmica Gupta #endif
11c1b66f42SRashmica Gupta 
12c1b66f42SRashmica Gupta struct pldm_transport_mctp_demux;
13c1b66f42SRashmica Gupta 
14c1b66f42SRashmica Gupta /* Init the transport backend */
15c1b66f42SRashmica Gupta int pldm_transport_mctp_demux_init(struct pldm_transport_mctp_demux **ctx);
16c1b66f42SRashmica Gupta 
17c1b66f42SRashmica Gupta /* Destroy the transport backend */
18c1b66f42SRashmica Gupta void pldm_transport_mctp_demux_destroy(struct pldm_transport_mctp_demux *ctx);
19c1b66f42SRashmica Gupta 
20c1b66f42SRashmica Gupta /* Get the core pldm transport struct */
21c1b66f42SRashmica Gupta struct pldm_transport *
22c1b66f42SRashmica Gupta pldm_transport_mctp_demux_core(struct pldm_transport_mctp_demux *ctx);
23c1b66f42SRashmica Gupta 
24c1b66f42SRashmica Gupta #ifdef PLDM_HAS_POLL
25c1b66f42SRashmica Gupta struct pollfd;
26c1b66f42SRashmica Gupta /* Init pollfd for async calls */
2736402ffbSBonnieLo-wiwynn int pldm_transport_mctp_demux_init_pollfd(struct pldm_transport *t,
28c1b66f42SRashmica Gupta 					  struct pollfd *pollfd);
29c1b66f42SRashmica Gupta #endif
30c1b66f42SRashmica Gupta 
31c1b66f42SRashmica Gupta /* Inserts a TID-to-EID mapping into the transport's device map */
32c1b66f42SRashmica Gupta int pldm_transport_mctp_demux_map_tid(struct pldm_transport_mctp_demux *ctx,
33c1b66f42SRashmica Gupta 				      pldm_tid_t tid, mctp_eid_t eid);
34c1b66f42SRashmica Gupta 
35c1b66f42SRashmica Gupta /* Removes a TID-to-EID mapping from the transport's device map */
36c1b66f42SRashmica Gupta int pldm_transport_mctp_demux_unmap_tid(struct pldm_transport_mctp_demux *ctx,
37c1b66f42SRashmica Gupta 					pldm_tid_t tid, mctp_eid_t eid);
38c1b66f42SRashmica Gupta 
39c1b66f42SRashmica Gupta #ifdef __cplusplus
40c1b66f42SRashmica Gupta }
41c1b66f42SRashmica Gupta #endif
42c1b66f42SRashmica Gupta 
439d2a1c6aSAndrew Jeffery #endif /* LIBPLDM_DEMUX_H */
44