1
#ifndef _PCIDRIVER_BASE_H
2
#define _PCIDRIVER_BASE_H
8
* This file contains prototypes and data structures for internal use of the pciDriver.
13
/* prototypes for file_operations */
14
static struct file_operations pcidriver_fops;
15
int pcidriver_mmap( struct file *filp, struct vm_area_struct *vmap );
16
int pcidriver_open(struct inode *inode, struct file *filp );
17
int pcidriver_release(struct inode *inode, struct file *filp);
19
/* prototypes for device operations */
20
static struct pci_driver pcidriver_driver;
21
static int __devinit pcidriver_probe(struct pci_dev *pdev, const struct pci_device_id *id);
22
static void __devexit pcidriver_remove(struct pci_dev *pdev);
26
/* prototypes for module operations */
27
static int __init pcidriver_init(void);
28
static void pcidriver_exit(void);
31
* This is the table of PCI devices handled by this driver by default
32
* If you want to add devices dynamically to this list, do:
34
* echo "vendor device" > /sys/bus/pci/drivers/pciDriver/new_id
35
* where vendor and device are in hex, without leading '0x'.
37
* The IDs themselves can be found in common.h
39
* For more info, see <kernel-source>/Documentation/pci.txt
41
* __devinitdata is applied because the kernel does not need those
42
* tables any more after boot is finished on systems which don't
47
static const __devinitdata struct pci_device_id pcidriver_ids[] = {
48
{ PCI_DEVICE( PCIE_XILINX_VENDOR_ID, PCIE_ML605_DEVICE_ID ) }, // PCI-E Xilinx ML605
49
{ PCI_DEVICE( PCIE_XILINX_VENDOR_ID, PCIE_IPECAMERA_DEVICE_ID ) }, // PCI-E IPE Camera
50
{ PCI_DEVICE( PCIE_XILINX_VENDOR_ID, PCIE_KAPTURE_DEVICE_ID ) }, // PCI-E KAPTURE board for HEB
54
/* prototypes for internal driver functions */
55
int pcidriver_pci_read( pcidriver_privdata_t *privdata, pci_cfg_cmd *pci_cmd );
56
int pcidriver_pci_write( pcidriver_privdata_t *privdata, pci_cfg_cmd *pci_cmd );
57
int pcidriver_pci_info( pcidriver_privdata_t *privdata, pcilib_board_info_t *pci_info );
59
int pcidriver_mmap_pci( pcidriver_privdata_t *privdata, struct vm_area_struct *vmap , int bar );
60
int pcidriver_mmap_kmem( pcidriver_privdata_t *privdata, struct vm_area_struct *vmap );
62
/*************************************************************************/
64
/* Hold the allocated major & minor numbers */
65
static dev_t pcidriver_devt;
67
/* Number of devices allocated */
68
static atomic_t pcidriver_deviceCount;
70
/* Sysfs attributes */
71
static DEVICE_ATTR(mmap_mode, (S_IRUGO | S_IWUGO), pcidriver_show_mmap_mode, pcidriver_store_mmap_mode);
72
static DEVICE_ATTR(mmap_area, (S_IRUGO | S_IWUGO), pcidriver_show_mmap_area, pcidriver_store_mmap_area);
73
static DEVICE_ATTR(kmem_count, S_IRUGO, pcidriver_show_kmem_count, NULL);
74
static DEVICE_ATTR(kbuffers, S_IRUGO, pcidriver_show_kbuffers, NULL);
75
static DEVICE_ATTR(kmem_alloc, S_IWUGO, NULL, pcidriver_store_kmem_alloc);
76
static DEVICE_ATTR(kmem_free, S_IWUGO, NULL, pcidriver_store_kmem_free);
77
static DEVICE_ATTR(umappings, S_IRUGO, pcidriver_show_umappings, NULL);
78
static DEVICE_ATTR(umem_unmap, S_IWUGO, NULL, pcidriver_store_umem_unmap);
81
static DEVICE_ATTR(irq_count, S_IRUGO, pcidriver_show_irq_count, NULL);
82
static DEVICE_ATTR(irq_queues, S_IRUGO, pcidriver_show_irq_queues, NULL);