vmci_driver.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * VMware VMCI Driver
  4. *
  5. * Copyright (C) 2012 VMware, Inc. All rights reserved.
  6. */
  7. #ifndef _VMCI_DRIVER_H_
  8. #define _VMCI_DRIVER_H_
  9. #include <linux/vmw_vmci_defs.h>
  10. #include <linux/wait.h>
  11. #include "vmci_queue_pair.h"
  12. #include "vmci_context.h"
  13. enum vmci_obj_type {
  14. VMCIOBJ_VMX_VM = 10,
  15. VMCIOBJ_CONTEXT,
  16. VMCIOBJ_SOCKET,
  17. VMCIOBJ_NOT_SET,
  18. };
  19. /* For storing VMCI structures in file handles. */
  20. struct vmci_obj {
  21. void *ptr;
  22. enum vmci_obj_type type;
  23. };
  24. /*
  25. * Needed by other components of this module. It's okay to have one global
  26. * instance of this because there can only ever be one VMCI device. Our
  27. * virtual hardware enforces this.
  28. */
  29. extern struct pci_dev *vmci_pdev;
  30. u32 vmci_get_context_id(void);
  31. int vmci_send_datagram(struct vmci_datagram *dg);
  32. void vmci_call_vsock_callback(bool is_host);
  33. int vmci_host_init(void);
  34. void vmci_host_exit(void);
  35. bool vmci_host_code_active(void);
  36. int vmci_host_users(void);
  37. int vmci_guest_init(void);
  38. void vmci_guest_exit(void);
  39. bool vmci_guest_code_active(void);
  40. u32 vmci_get_vm_context_id(void);
  41. bool vmci_use_ppn64(void);
  42. #endif /* _VMCI_DRIVER_H_ */