lib: remove C++ include guard from private headers
[dpdk.git] / lib / power / guest_channel.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation
3  */
4 #ifndef _GUEST_CHANNEL_H
5 #define _GUEST_CHANNEL_H
6
7 /**
8  * Check if any Virtio-Serial VM end-points exist in path.
9  *
10  * @param path
11  *  The path to the serial device on the filesystem
12  *
13  * @return
14  *  - 1 if at least one potential end-point found.
15  *  - 0 if no end-points found.
16  */
17 int guest_channel_host_check_exists(const char *path);
18
19 /**
20  * Connect to the Virtio-Serial VM end-point located in path. It is
21  * thread safe for unique lcore_ids. This function must be only called once from
22  * each lcore.
23  *
24  * @param path
25  *  The path to the serial device on the filesystem
26  *
27  * @param lcore_id
28  *  lcore_id.
29  *
30  * @return
31  *  - 0 on success.
32  *  - Negative on error.
33  */
34 int guest_channel_host_connect(const char *path, unsigned int lcore_id);
35
36 /**
37  * Disconnect from an already connected Virtio-Serial Endpoint.
38  *
39  *
40  * @param lcore_id
41  *  lcore_id.
42  *
43  */
44 void guest_channel_host_disconnect(unsigned int lcore_id);
45
46 /**
47  * Send a message contained in pkt over the Virtio-Serial to the host endpoint.
48  *
49  * @param pkt
50  *  Pointer to a populated struct guest_agent_pkt
51  *
52  * @param lcore_id
53  *  lcore_id.
54  *
55  * @return
56  *  - 0 on success.
57  *  - Negative on channel not connected.
58  *  - errno on write to channel error.
59  */
60 int guest_channel_send_msg(struct rte_power_channel_packet *pkt,
61                 unsigned int lcore_id);
62
63 /**
64  * Read a message contained in pkt over the Virtio-Serial
65  * from the host endpoint.
66  *
67  * @param pkt
68  *  Pointer to rte_power_channel_packet or
69  *  rte_power_channel_packet_freq_list struct.
70  *
71  * @param pkt_len
72  *  Size of expected data packet.
73  *
74  * @param lcore_id
75  *  lcore_id.
76  *
77  * @return
78  *  - 0 on success.
79  *  - Negative on error.
80  */
81 int power_guest_channel_read_msg(void *pkt,
82                 size_t pkt_len,
83                 unsigned int lcore_id);
84
85 #endif