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