2 * Copyright (c) 2018 VMware, Inc.
4 * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
9 /* Driver for VMware Virtual Machine Communication Interface (VMCI) device. */
14 #include <sys/param.h>
16 #include <sys/mutex.h>
17 #include <sys/systm.h>
18 #include <sys/taskqueue.h>
20 #include <machine/bus.h>
22 #include "vmci_datagram.h"
23 #include "vmci_kernel_if.h"
25 /* VMCI device vendor and device ID */
26 #define VMCI_VMWARE_VENDOR_ID 0x15AD
27 #define VMCI_VMWARE_DEVICE_ID 0x0740
29 #define VMCI_VERSION 1
31 struct vmci_dma_alloc {
32 bus_dma_tag_t dma_tag;
39 struct vmci_interrupt {
40 struct resource *vmci_irq;
48 struct mtx vmci_spinlock;
50 struct resource *vmci_res0;
51 bus_space_tag_t vmci_iot0;
52 bus_space_handle_t vmci_ioh0;
53 unsigned int vmci_ioaddr;
54 struct resource *vmci_res1;
55 bus_space_tag_t vmci_iot1;
56 bus_space_handle_t vmci_ioh1;
58 struct vmci_dma_alloc vmci_notifications_bitmap;
61 vmci_intr_type vmci_intr_type;
62 struct vmci_interrupt vmci_intrs[VMCI_MAX_INTRS];
63 struct task vmci_interrupt_dq_task;
64 struct task vmci_interrupt_bm_task;
66 struct task vmci_delayed_work_task;
67 struct mtx vmci_delayed_work_lock;
68 vmci_list(vmci_delayed_work_info) vmci_delayed_work_infos;
70 unsigned int capabilities;
73 int vmci_dma_malloc(bus_size_t size, bus_size_t align,
74 struct vmci_dma_alloc *dma);
75 void vmci_dma_free(struct vmci_dma_alloc *);
76 int vmci_schedule_delayed_work_fn(vmci_work_fn *work_fn, void *data);
78 #endif /* !_VMCI_H_ */