xref: /freebsd/sys/dev/vmware/vmci/vmci_driver.h (revision cfd6422a5217410fbd66f7a7a8a64d9d85e61229)
1 /*-
2  * Copyright (c) 2018 VMware, Inc.
3  *
4  * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
5  *
6  * $FreeBSD$
7  */
8 
9 /* VMCI driver interface. */
10 
11 #ifndef _VMCI_DRIVER_H_
12 #define _VMCI_DRIVER_H_
13 
14 #include <sys/types.h>
15 #include <sys/syslog.h>
16 #include <sys/systm.h>
17 
18 #include "vmci_call_defs.h"
19 #include "vmci_kernel_if.h"
20 
21 #ifndef VMCI_DEBUG_LOGGING
22 #define VMCI_LOG_DEBUG(_args, ...)
23 #else /* VMCI_DEBUG_LOGGING */
24 #define VMCI_LOG_DEBUG(_args, ...)					\
25 	log(LOG_DEBUG, _args, ##__VA_ARGS__)
26 #endif /* !VMCI_DEBUG_LOGGING */
27 #define VMCI_LOG_INFO(_args, ...)					\
28 	log(LOG_INFO, _args, ##__VA_ARGS__)
29 #define VMCI_LOG_WARNING(_args, ...)					\
30 	log(LOG_WARNING, _args, ##__VA_ARGS__)
31 #define VMCI_LOG_ERROR(_args, ...)					\
32 	log(LOG_ERR, _args, ##__VA_ARGS__)
33 
34 int	vmci_components_init(void);
35 void	vmci_components_cleanup(void);
36 int	vmci_send_datagram(struct vmci_datagram *dg);
37 
38 void	vmci_util_init(void);
39 void	vmci_util_exit(void);
40 bool	vmci_check_host_capabilities(void);
41 void	vmci_read_datagrams_from_port(vmci_io_handle io_handle,
42 	    vmci_io_port dg_in_port, uint8_t *dg_in_buffer,
43 	    size_t dg_in_buffer_size);
44 
45 #endif /* !_VMCI_DRIVER_H_ */
46