Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * VMware VMCI Driver
0004  *
0005  * Copyright (C) 2012 VMware, Inc. All rights reserved.
0006  */
0007 
0008 #ifndef _VMCI_DRIVER_H_
0009 #define _VMCI_DRIVER_H_
0010 
0011 #include <linux/vmw_vmci_defs.h>
0012 #include <linux/wait.h>
0013 
0014 #include "vmci_queue_pair.h"
0015 #include "vmci_context.h"
0016 
0017 enum vmci_obj_type {
0018     VMCIOBJ_VMX_VM = 10,
0019     VMCIOBJ_CONTEXT,
0020     VMCIOBJ_SOCKET,
0021     VMCIOBJ_NOT_SET,
0022 };
0023 
0024 /* For storing VMCI structures in file handles. */
0025 struct vmci_obj {
0026     void *ptr;
0027     enum vmci_obj_type type;
0028 };
0029 
0030 /*
0031  * Needed by other components of this module.  It's okay to have one global
0032  * instance of this because there can only ever be one VMCI device.  Our
0033  * virtual hardware enforces this.
0034  */
0035 extern struct pci_dev *vmci_pdev;
0036 
0037 u32 vmci_get_context_id(void);
0038 int vmci_send_datagram(struct vmci_datagram *dg);
0039 void vmci_call_vsock_callback(bool is_host);
0040 
0041 int vmci_host_init(void);
0042 void vmci_host_exit(void);
0043 bool vmci_host_code_active(void);
0044 int vmci_host_users(void);
0045 
0046 int vmci_guest_init(void);
0047 void vmci_guest_exit(void);
0048 bool vmci_guest_code_active(void);
0049 u32 vmci_get_vm_context_id(void);
0050 
0051 bool vmci_use_ppn64(void);
0052 
0053 #endif /* _VMCI_DRIVER_H_ */