summaryrefslogtreecommitdiffstats
path: root/driver/kmem.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/kmem.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/kmem.h')
-rw-r--r--driver/kmem.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/driver/kmem.h b/driver/kmem.h
index 503620e..e793bd6 100644
--- a/driver/kmem.h
+++ b/driver/kmem.h
@@ -1,3 +1,35 @@
+#ifndef _PCIDRIVER_KMEM_H
+#define _PCIDRIVER_KMEM_H
+
+#include <linux/sysfs.h>
+
+#include "../pcilib/kmem.h"
+#include "ioctl.h"
+
+/* Define an entry in the kmem list (this list is per device) */
+/* This list keeps references to the allocated kernel buffers */
+typedef struct {
+ int id;
+ enum dma_data_direction direction;
+
+ struct list_head list;
+ dma_addr_t dma_handle;
+ unsigned long cpua;
+ unsigned long size;
+ unsigned long type;
+ unsigned long align;
+
+ unsigned long use;
+ unsigned long item;
+
+ spinlock_t lock;
+ unsigned long mode;
+ unsigned long refs;
+
+ struct device_attribute sysfs_attr; /* initialized when adding the entry */
+} pcidriver_kmem_entry_t;
+
+
int pcidriver_kmem_alloc( pcidriver_privdata_t *privdata, kmem_handle_t *kmem_handle );
int pcidriver_kmem_free( pcidriver_privdata_t *privdata, kmem_handle_t *kmem_handle );
int pcidriver_kmem_sync_entry( pcidriver_privdata_t *privdata, pcidriver_kmem_entry_t *kmem_entry, int direction );
@@ -7,3 +39,7 @@ pcidriver_kmem_entry_t *pcidriver_kmem_find_entry( pcidriver_privdata_t *privdat
pcidriver_kmem_entry_t *pcidriver_kmem_find_entry_id( pcidriver_privdata_t *privdata, int id );
pcidriver_kmem_entry_t *pcidriver_kmem_find_entry_use(pcidriver_privdata_t *privdata, unsigned long use, unsigned long item);
int pcidriver_kmem_free_entry( pcidriver_privdata_t *privdata, pcidriver_kmem_entry_t *kmem_entry );
+
+int pcidriver_mmap_kmem( pcidriver_privdata_t *privdata, struct vm_area_struct *vmap );
+
+#endif /* _PCIDRIVER_KMEM_H */