1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
4 #ifndef _GUEST_CHANNEL_H
5 #define _GUEST_CHANNEL_H
11 #include <channel_commands.h>
14 * Connect to the Virtio-Serial VM end-point located in path. It is
15 * thread safe for unique lcore_ids. This function must be only called once from
19 * The path to the serial device on the filesystem
26 * - Negative on error.
28 int guest_channel_host_connect(const char *path, unsigned int lcore_id);
31 * Disconnect from an already connected Virtio-Serial Endpoint.
38 void guest_channel_host_disconnect(unsigned int lcore_id);
41 * Send a message contained in pkt over the Virtio-Serial to the host endpoint.
44 * Pointer to a populated struct guest_agent_pkt
51 * - Negative on channel not connected.
52 * - errno on write to channel error.
54 int guest_channel_send_msg(struct channel_packet *pkt, unsigned int lcore_id);
57 * Send a message contained in pkt over the Virtio-Serial to the host endpoint.
60 * Pointer to a populated struct channel_packet
67 * - Negative on error.
69 int rte_power_guest_channel_send_msg(struct channel_packet *pkt,
70 unsigned int lcore_id);
73 * Read a message contained in pkt over the Virtio-Serial
74 * from the host endpoint.
77 * Pointer to channel_packet or
78 * channel_packet_freq_list struct.
81 * Size of expected data packet.
88 * - Negative on error.
90 int power_guest_channel_read_msg(void *pkt,
92 unsigned int lcore_id);
95 * Receive a message contained in pkt over the Virtio-Serial
96 * from the host endpoint.
99 * Pointer to channel_packet or
100 * channel_packet_freq_list struct.
103 * Size of expected data packet.
110 * - Negative on error.
114 rte_power_guest_channel_receive_msg(void *pkt,
116 unsigned int lcore_id);