vmci_driver.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * VMware VMCI Driver
  3. *
  4. * Copyright (C) 2012 VMware, Inc. All rights reserved.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation version 2 and no later version.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  12. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  13. * for more details.
  14. */
  15. #ifndef _VMCI_DRIVER_H_
  16. #define _VMCI_DRIVER_H_
  17. #include <linux/vmw_vmci_defs.h>
  18. #include <linux/wait.h>
  19. #include "vmci_queue_pair.h"
  20. #include "vmci_context.h"
  21. enum vmci_obj_type {
  22. VMCIOBJ_VMX_VM = 10,
  23. VMCIOBJ_CONTEXT,
  24. VMCIOBJ_SOCKET,
  25. VMCIOBJ_NOT_SET,
  26. };
  27. /* For storing VMCI structures in file handles. */
  28. struct vmci_obj {
  29. void *ptr;
  30. enum vmci_obj_type type;
  31. };
  32. /*
  33. * Needed by other components of this module. It's okay to have one global
  34. * instance of this because there can only ever be one VMCI device. Our
  35. * virtual hardware enforces this.
  36. */
  37. extern struct pci_dev *vmci_pdev;
  38. u32 vmci_get_context_id(void);
  39. int vmci_send_datagram(struct vmci_datagram *dg);
  40. int vmci_host_init(void);
  41. void vmci_host_exit(void);
  42. bool vmci_host_code_active(void);
  43. int vmci_guest_init(void);
  44. void vmci_guest_exit(void);
  45. bool vmci_guest_code_active(void);
  46. u32 vmci_get_vm_context_id(void);
  47. #endif /* _VMCI_DRIVER_H_ */