Thomas Gleixner | 685a6bf | 2019-05-29 16:57:36 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
George Zhang | 197dbaa | 2013-01-08 15:54:10 -0800 | [diff] [blame] | 2 | /* |
| 3 | * VMware VMCI Driver |
| 4 | * |
| 5 | * Copyright (C) 2012 VMware, Inc. All rights reserved. |
George Zhang | 197dbaa | 2013-01-08 15:54:10 -0800 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef _VMCI_DRIVER_H_ |
| 9 | #define _VMCI_DRIVER_H_ |
| 10 | |
| 11 | #include <linux/vmw_vmci_defs.h> |
| 12 | #include <linux/wait.h> |
| 13 | |
| 14 | #include "vmci_queue_pair.h" |
| 15 | #include "vmci_context.h" |
| 16 | |
| 17 | enum vmci_obj_type { |
| 18 | VMCIOBJ_VMX_VM = 10, |
| 19 | VMCIOBJ_CONTEXT, |
| 20 | VMCIOBJ_SOCKET, |
| 21 | VMCIOBJ_NOT_SET, |
| 22 | }; |
| 23 | |
| 24 | /* For storing VMCI structures in file handles. */ |
| 25 | struct vmci_obj { |
| 26 | void *ptr; |
| 27 | enum vmci_obj_type type; |
| 28 | }; |
| 29 | |
Andy King | 6d6dfb4 | 2013-08-23 09:22:14 -0700 | [diff] [blame] | 30 | /* |
| 31 | * Needed by other components of this module. It's okay to have one global |
| 32 | * instance of this because there can only ever be one VMCI device. Our |
| 33 | * virtual hardware enforces this. |
| 34 | */ |
| 35 | extern struct pci_dev *vmci_pdev; |
| 36 | |
George Zhang | 197dbaa | 2013-01-08 15:54:10 -0800 | [diff] [blame] | 37 | u32 vmci_get_context_id(void); |
| 38 | int vmci_send_datagram(struct vmci_datagram *dg); |
Stefano Garzarella | b1bba80 | 2019-11-14 10:57:47 +0100 | [diff] [blame] | 39 | void vmci_call_vsock_callback(bool is_host); |
George Zhang | 197dbaa | 2013-01-08 15:54:10 -0800 | [diff] [blame] | 40 | |
| 41 | int vmci_host_init(void); |
| 42 | void vmci_host_exit(void); |
| 43 | bool vmci_host_code_active(void); |
Stefano Garzarella | b1bba80 | 2019-11-14 10:57:47 +0100 | [diff] [blame] | 44 | int vmci_host_users(void); |
George Zhang | 197dbaa | 2013-01-08 15:54:10 -0800 | [diff] [blame] | 45 | |
| 46 | int vmci_guest_init(void); |
| 47 | void vmci_guest_exit(void); |
| 48 | bool vmci_guest_code_active(void); |
| 49 | u32 vmci_get_vm_context_id(void); |
| 50 | |
Vishnu DASA | f2db736 | 2019-02-15 16:32:47 +0000 | [diff] [blame] | 51 | bool vmci_use_ppn64(void); |
| 52 | |
George Zhang | 197dbaa | 2013-01-08 15:54:10 -0800 | [diff] [blame] | 53 | #endif /* _VMCI_DRIVER_H_ */ |