/alps/ipecamera

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/ipecamera

« back to all changes in this revision

Viewing changes to driver/base.h

  • Committer: Suren A. Chilingaryan
  • Date: 2015-04-27 00:28:57 UTC
  • Revision ID: csa@suren.me-20150427002857-82fk6r3e8rfgy4wr
First stand-alone ipecamera implementation

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef _PCIDRIVER_BASE_H
2
 
#define _PCIDRIVER_BASE_H
3
 
 
4
 
#include "sysfs.h"
5
 
 
6
 
/**
7
 
 *
8
 
 * This file contains prototypes and data structures for internal use of the pciDriver.
9
 
 *
10
 
 *
11
 
 */
12
 
 
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);
18
 
 
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);
23
 
 
24
 
 
25
 
 
26
 
/* prototypes for module operations */
27
 
static int __init pcidriver_init(void);
28
 
static void pcidriver_exit(void);
29
 
 
30
 
/*
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:
33
 
 *
34
 
 *   echo "vendor device" > /sys/bus/pci/drivers/pciDriver/new_id
35
 
 * where vendor and device are in hex, without leading '0x'.
36
 
 *
37
 
 * The IDs themselves can be found in common.h
38
 
 *
39
 
 * For more info, see <kernel-source>/Documentation/pci.txt
40
 
 *
41
 
 * __devinitdata is applied because the kernel does not need those
42
 
 * tables any more after boot is finished on systems which don't
43
 
 * support hotplug.
44
 
 *
45
 
 */
46
 
 
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
51
 
        {0,0,0,0},
52
 
};
53
 
 
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 );
58
 
 
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 );
61
 
 
62
 
/*************************************************************************/
63
 
/* Static data */
64
 
/* Hold the allocated major & minor numbers */
65
 
static dev_t pcidriver_devt;
66
 
 
67
 
/* Number of devices allocated */
68
 
static atomic_t pcidriver_deviceCount;
69
 
 
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);
79
 
 
80
 
#ifdef ENABLE_IRQ
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);
83
 
#endif
84
 
 
85
 
#endif