summaryrefslogtreecommitdiffstats
path: root/driver/umem.h
diff options
context:
space:
mode:
authorVasilii Chernov <vchernov@inr.ru>2016-03-03 10:34:49 +0100
committerVasilii Chernov <vchernov@inr.ru>2016-03-03 10:34:49 +0100
commitee16e47966afe180d3c32e2b1d93301052894fac (patch)
tree56aecf261aaae57e28c08cef573ae6642ec5394d /driver/umem.h
parent02d0026e2df2ba5c68c0c1a67aec4437c9e8e8f3 (diff)
parent195c28f3074486165b6e0935362810f8a1fb9531 (diff)
downloadpcitool-ee16e47966afe180d3c32e2b1d93301052894fac.tar.gz
pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.tar.bz2
pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.tar.xz
pcitool-ee16e47966afe180d3c32e2b1d93301052894fac.zip
Merge with http://ufo.kit.edu/ufo/log/csa/pcitool 369 revision
Diffstat (limited to 'driver/umem.h')
-rw-r--r--driver/umem.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/driver/umem.h b/driver/umem.h
index d16c466..d504ecb 100644
--- a/driver/umem.h
+++ b/driver/umem.h
@@ -1,5 +1,26 @@
+#ifndef _PCIDRIVER_UMEM_H
+#define _PCIDRIVER_UMEM_H
+
+#include <linux/sysfs.h>
+
+#include "ioctl.h"
+
+/* Define an entry in the umem list (this list is per device) */
+/* This list keeps references to the SG lists for each mapped userspace region */
+typedef struct {
+ int id;
+ struct list_head list;
+ unsigned int nr_pages; /* number of pages for this user memeory area */
+ struct page **pages; /* list of pointers to the pages */
+ unsigned int nents; /* actual entries in the scatter/gatter list (NOT nents for the map function, but the result) */
+ struct scatterlist *sg; /* list of sg entries */
+ struct device_attribute sysfs_attr; /* initialized when adding the entry */
+} pcidriver_umem_entry_t;
+
int pcidriver_umem_sgmap( pcidriver_privdata_t *privdata, umem_handle_t *umem_handle );
int pcidriver_umem_sgunmap( pcidriver_privdata_t *privdata, pcidriver_umem_entry_t *umem_entry );
int pcidriver_umem_sgget( pcidriver_privdata_t *privdata, umem_sglist_t *umem_sglist );
int pcidriver_umem_sync( pcidriver_privdata_t *privdata, umem_handle_t *umem_handle );
pcidriver_umem_entry_t *pcidriver_umem_find_entry_id( pcidriver_privdata_t *privdata, int id );
+
+#endif /* _PCIDRIVER_UMEM_H */