1
#ifndef _PCIDRIVER_DEV_H
2
#define _PCIDRIVER_DEV_H
4
typedef struct pcidriver_privdata_s pcidriver_privdata_t;
10
/* Hold the driver private data */
11
struct pcidriver_privdata_s {
12
int devid; /* the device id */
13
dev_t devno; /* device number (major and minor) */
14
struct pci_dev *pdev; /* PCI device */
15
struct device *class_dev; /* Class device */
16
struct cdev cdev; /* char device struct */
17
int mmap_mode; /* current mmap mode */
18
int mmap_area; /* current PCI mmap area */
21
int irq_enabled; /* Non-zero if IRQ is enabled */
22
int irq_count; /* Just an IRQ counter */
24
wait_queue_head_t irq_queues[ PCIDRIVER_INT_MAXSOURCES ]; /* One queue per interrupt source */
25
atomic_t irq_outstanding[ PCIDRIVER_INT_MAXSOURCES ]; /* Outstanding interrupts per queue */
26
volatile unsigned int *bars_kmapped[6]; /* PCI BARs mmapped in kernel space */
29
spinlock_t kmemlist_lock; /* Spinlock to lock kmem list operations */
30
struct list_head kmem_list; /* List of 'kmem_list_entry's associated with this device */
31
pcidriver_kmem_entry_t *kmem_last_sync; /* Last accessed kmem entry */
32
atomic_t kmem_count; /* id for next kmem entry */
34
int kmem_cur_id; /* Currently selected kmem buffer, for mmap */
36
spinlock_t umemlist_lock; /* Spinlock to lock umem list operations */
37
struct list_head umem_list; /* List of 'umem_list_entry's associated with this device */
38
atomic_t umem_count; /* id for next umem entry */
40
int msi_mode; /* Flag specifying if interrupt have been initialized in MSI mode */
41
atomic_t refs; /* Reference counter */
44
const struct file_operations *pcidriver_get_fops(void);
46
void pcidriver_module_get(pcidriver_privdata_t *privdata);
47
void pcidriver_module_put(pcidriver_privdata_t *privdata);
49
long pcidriver_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
51
#endif /* _PCIDRIVER_DEV_H */