2 * QEMU VMWARE paravirtual RDMA ring utilities
4 * Copyright (C) 2018 Oracle
5 * Copyright (C) 2018 Red Hat Inc
8 * Yuval Shaia <yuval.shaia@oracle.com>
9 * Marcel Apfelbaum <marcel@redhat.com>
11 * This work is licensed under the terms of the GNU GPL, version 2 or later.
12 * See the COPYING file in the top-level directory.
16 #ifndef PVRDMA_DEV_RING_H
17 #define PVRDMA_DEV_RING_H
20 #define MAX_RING_NAME_SZ 32
22 typedef struct PvrdmaRing
{
23 char name
[MAX_RING_NAME_SZ
];
27 struct pvrdma_ring
*ring_state
; /* used only for unmap */
32 int pvrdma_ring_init(PvrdmaRing
*ring
, const char *name
, PCIDevice
*dev
,
33 struct pvrdma_ring
*ring_state
, uint32_t max_elems
,
34 size_t elem_sz
, dma_addr_t
*tbl
, uint32_t npages
);
35 void *pvrdma_ring_next_elem_read(PvrdmaRing
*ring
);
36 void pvrdma_ring_read_inc(PvrdmaRing
*ring
);
37 void *pvrdma_ring_next_elem_write(PvrdmaRing
*ring
);
38 void pvrdma_ring_write_inc(PvrdmaRing
*ring
);
39 void pvrdma_ring_free(PvrdmaRing
*ring
);