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 
16 #ifndef VMCI_DOORBELL_H
17 #define VMCI_DOORBELL_H
18 
19 #include <linux/vmw_vmci_defs.h>
20 #include <linux/types.h>
21 
22 #include "vmci_driver.h"
23 
24 /*
25  * VMCINotifyResourceInfo: Used to create and destroy doorbells, and
26  * generate a notification for a doorbell or queue pair.
27  */
28 struct vmci_dbell_notify_resource_info {
29 	struct vmci_handle handle;
30 	u16 resource;
31 	u16 action;
32 	s32 result;
33 };
34 
35 /*
36  * Structure used for checkpointing the doorbell mappings. It is
37  * written to the checkpoint as is, so changing this structure will
38  * break checkpoint compatibility.
39  */
40 struct dbell_cpt_state {
41 	struct vmci_handle handle;
42 	u64 bitmap_idx;
43 };
44 
45 int vmci_dbell_host_context_notify(u32 src_cid, struct vmci_handle handle);
46 int vmci_dbell_get_priv_flags(struct vmci_handle handle, u32 *priv_flags);
47 
48 bool vmci_dbell_register_notification_bitmap(u32 bitmap_ppn);
49 void vmci_dbell_scan_notification_entries(u8 *bitmap);
50 
51 #endif /* VMCI_DOORBELL_H */
52