2019-05-29 23:57:36 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2013-01-08 23:54:10 +00:00
|
|
|
/*
|
|
|
|
* VMware VMCI Driver
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 VMware, Inc. All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _VMCI_DRIVER_H_
|
|
|
|
#define _VMCI_DRIVER_H_
|
|
|
|
|
|
|
|
#include <linux/vmw_vmci_defs.h>
|
|
|
|
#include <linux/wait.h>
|
|
|
|
|
|
|
|
#include "vmci_queue_pair.h"
|
|
|
|
#include "vmci_context.h"
|
|
|
|
|
|
|
|
enum vmci_obj_type {
|
|
|
|
VMCIOBJ_VMX_VM = 10,
|
|
|
|
VMCIOBJ_CONTEXT,
|
|
|
|
VMCIOBJ_SOCKET,
|
|
|
|
VMCIOBJ_NOT_SET,
|
|
|
|
};
|
|
|
|
|
|
|
|
/* For storing VMCI structures in file handles. */
|
|
|
|
struct vmci_obj {
|
|
|
|
void *ptr;
|
|
|
|
enum vmci_obj_type type;
|
|
|
|
};
|
|
|
|
|
2013-08-23 16:22:14 +00:00
|
|
|
/*
|
|
|
|
* Needed by other components of this module. It's okay to have one global
|
|
|
|
* instance of this because there can only ever be one VMCI device. Our
|
|
|
|
* virtual hardware enforces this.
|
|
|
|
*/
|
|
|
|
extern struct pci_dev *vmci_pdev;
|
|
|
|
|
2013-01-08 23:54:10 +00:00
|
|
|
u32 vmci_get_context_id(void);
|
|
|
|
int vmci_send_datagram(struct vmci_datagram *dg);
|
2019-11-14 09:57:47 +00:00
|
|
|
void vmci_call_vsock_callback(bool is_host);
|
2013-01-08 23:54:10 +00:00
|
|
|
|
|
|
|
int vmci_host_init(void);
|
|
|
|
void vmci_host_exit(void);
|
|
|
|
bool vmci_host_code_active(void);
|
2019-11-14 09:57:47 +00:00
|
|
|
int vmci_host_users(void);
|
2013-01-08 23:54:10 +00:00
|
|
|
|
|
|
|
int vmci_guest_init(void);
|
|
|
|
void vmci_guest_exit(void);
|
|
|
|
bool vmci_guest_code_active(void);
|
|
|
|
u32 vmci_get_vm_context_id(void);
|
|
|
|
|
2019-02-15 16:32:47 +00:00
|
|
|
bool vmci_use_ppn64(void);
|
|
|
|
|
2013-01-08 23:54:10 +00:00
|
|
|
#endif /* _VMCI_DRIVER_H_ */
|