1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
4 #ifndef _GUEST_CHANNEL_H
5 #define _GUEST_CHANNEL_H
12 * Check if any Virtio-Serial VM end-points exist in path.
15 * The path to the serial device on the filesystem
18 * - 1 if at least one potential end-point found.
19 * - 0 if no end-points found.
21 int guest_channel_host_check_exists(const char *path);
24 * Connect to the Virtio-Serial VM end-point located in path. It is
25 * thread safe for unique lcore_ids. This function must be only called once from
29 * The path to the serial device on the filesystem
36 * - Negative on error.
38 int guest_channel_host_connect(const char *path, unsigned int lcore_id);
41 * Disconnect from an already connected Virtio-Serial Endpoint.
48 void guest_channel_host_disconnect(unsigned int lcore_id);
51 * Send a message contained in pkt over the Virtio-Serial to the host endpoint.
54 * Pointer to a populated struct guest_agent_pkt
61 * - Negative on channel not connected.
62 * - errno on write to channel error.
64 int guest_channel_send_msg(struct rte_power_channel_packet *pkt,
65 unsigned int lcore_id);
68 * Read a message contained in pkt over the Virtio-Serial
69 * from the host endpoint.
72 * Pointer to rte_power_channel_packet or
73 * rte_power_channel_packet_freq_list struct.
76 * Size of expected data packet.
83 * - Negative on error.
85 int power_guest_channel_read_msg(void *pkt,
87 unsigned int lcore_id);