diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2016-03-02 19:37:30 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2016-03-02 19:37:30 +0100 |
commit | 1120e8745ccd3e512fe2016c9e5092fcd378490a (patch) | |
tree | 0e89ac6cd82c213a78d79d10d3fecff06f21127d /driver/kmem.h | |
parent | 01e857cca352e73243d00b62a0c248a35cea6b71 (diff) | |
download | pcitool-1120e8745ccd3e512fe2016c9e5092fcd378490a.tar.gz pcitool-1120e8745ccd3e512fe2016c9e5092fcd378490a.tar.bz2 pcitool-1120e8745ccd3e512fe2016c9e5092fcd378490a.tar.xz pcitool-1120e8745ccd3e512fe2016c9e5092fcd378490a.zip |
Restructure driver headers
Diffstat (limited to 'driver/kmem.h')
-rw-r--r-- | driver/kmem.h | 36 |
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 */ |