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