/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool
365 by Suren A. Chilingaryan
Restructure driver headers
1
#ifndef _PCIDRIVER_KMEM_H
2
#define _PCIDRIVER_KMEM_H
3
4
#include <linux/sysfs.h>
5
400 by Suren A. Chilingaryan
Further fixes for out-of-source compilation
6
#include "pcilib/kmem.h"
365 by Suren A. Chilingaryan
Restructure driver headers
7
#include "ioctl.h"
8
9
/* Define an entry in the kmem list (this list is per device) */
10
/* This list keeps references to the allocated kernel buffers */
11
typedef struct {
12
    int id;
13
    enum dma_data_direction direction;
14
15
    struct list_head list;
16
    dma_addr_t dma_handle;
17
    unsigned long cpua;
18
    unsigned long size;
19
    unsigned long type;
20
    unsigned long align;
21
22
    unsigned long use;
23
    unsigned long item;
24
25
    spinlock_t lock;
26
    unsigned long mode;
27
    unsigned long refs;
28
29
    struct device_attribute sysfs_attr;	/* initialized when adding the entry */
30
} pcidriver_kmem_entry_t;
31
32
1 by Suren A. Chilingaryan
Initial import
33
int pcidriver_kmem_alloc( pcidriver_privdata_t *privdata, kmem_handle_t *kmem_handle );
34
int pcidriver_kmem_free(  pcidriver_privdata_t *privdata, kmem_handle_t *kmem_handle );
148 by Suren A. Chilingaryan
Synchronize kernel buffers during the read-kernel-memory and while accessing via sysfs
35
int pcidriver_kmem_sync_entry( pcidriver_privdata_t *privdata, pcidriver_kmem_entry_t *kmem_entry, int direction );
1 by Suren A. Chilingaryan
Initial import
36
int pcidriver_kmem_sync(  pcidriver_privdata_t *privdata, kmem_sync_t *kmem_sync );
37
int pcidriver_kmem_free_all(  pcidriver_privdata_t *privdata );
38
pcidriver_kmem_entry_t *pcidriver_kmem_find_entry( pcidriver_privdata_t *privdata, kmem_handle_t *kmem_handle );
39
pcidriver_kmem_entry_t *pcidriver_kmem_find_entry_id( pcidriver_privdata_t *privdata, int id );
71 by Suren A. Chilingaryan
First iteration of work to preserve DMA state between executions
40
pcidriver_kmem_entry_t *pcidriver_kmem_find_entry_use(pcidriver_privdata_t *privdata, unsigned long use, unsigned long item);
1 by Suren A. Chilingaryan
Initial import
41
int pcidriver_kmem_free_entry( pcidriver_privdata_t *privdata, pcidriver_kmem_entry_t *kmem_entry );
365 by Suren A. Chilingaryan
Restructure driver headers
42
43
int pcidriver_mmap_kmem( pcidriver_privdata_t *privdata, struct vm_area_struct *vmap );
44
45
#endif /* _PCIDRIVER_KMEM_H */