Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
pcmmio.c File Reference
#include <linux/interrupt.h>
#include <linux/slab.h>
#include "../comedidev.h"
#include "pcm_common.h"
#include <linux/pci.h>

Go to the source code of this file.

Data Structures

struct  pcmmio_board
 
struct  pcmmio_subdev_private
 
struct  pcmmio_private
 

Macros

#define CHANS_PER_PORT   8
 
#define PORTS_PER_ASIC   6
 
#define INTR_PORTS_PER_ASIC   3
 
#define MAX_CHANS_PER_SUBDEV   24 /* number of channels per comedi subdevice */
 
#define PORTS_PER_SUBDEV   (MAX_CHANS_PER_SUBDEV/CHANS_PER_PORT)
 
#define CHANS_PER_ASIC   (CHANS_PER_PORT*PORTS_PER_ASIC)
 
#define INTR_CHANS_PER_ASIC   24
 
#define INTR_PORTS_PER_SUBDEV   (INTR_CHANS_PER_ASIC/CHANS_PER_PORT)
 
#define MAX_DIO_CHANS   (PORTS_PER_ASIC*1*CHANS_PER_PORT)
 
#define MAX_ASICS   (MAX_DIO_CHANS/CHANS_PER_ASIC)
 
#define SDEV_NO   ((int)(s - dev->subdevices))
 
#define CALC_N_DIO_SUBDEVS(nchans)   ((nchans)/MAX_CHANS_PER_SUBDEV + (!!((nchans)%MAX_CHANS_PER_SUBDEV)) /*+ (nchans > INTR_CHANS_PER_ASIC ? 2 : 1)*/)
 
#define ASIC_IOSIZE   (0x0B)
 
#define PCMMIO48_IOSIZE   ASIC_IOSIZE
 
#define REG_PORT0   0x0
 
#define REG_PORT1   0x1
 
#define REG_PORT2   0x2
 
#define REG_PORT3   0x3
 
#define REG_PORT4   0x4
 
#define REG_PORT5   0x5
 
#define REG_INT_PENDING   0x6
 
#define REG_PAGELOCK
 
#define REG_POL0   0x8
 
#define REG_POL1   0x9
 
#define REG_POL2   0xA
 
#define REG_ENAB0   0x8
 
#define REG_ENAB1   0x9
 
#define REG_ENAB2   0xA
 
#define REG_INT_ID0   0x8
 
#define REG_INT_ID1   0x9
 
#define REG_INT_ID2   0xA
 
#define NUM_PAGED_REGS   3
 
#define NUM_PAGES   4
 
#define FIRST_PAGED_REG   0x8
 
#define REG_PAGE_BITOFFSET   6
 
#define REG_LOCK_BITOFFSET   0
 
#define REG_PAGE_MASK   (~((0x1<<REG_PAGE_BITOFFSET)-1))
 
#define REG_LOCK_MASK   (~(REG_PAGE_MASK))
 
#define PAGE_POL   1
 
#define PAGE_ENAB   2
 
#define PAGE_INT_ID   3
 
#define devpriv   ((struct pcmmio_private *)dev->private)
 
#define subpriv   ((struct pcmmio_subdev_private *)s->private)
 

Functions

 module_comedi_driver (pcmmio_driver)
 
 MODULE_AUTHOR ("Comedi http://www.comedi.org")
 
 MODULE_DESCRIPTION ("Comedi low-level driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define ASIC_IOSIZE   (0x0B)

Definition at line 99 of file pcmmio.c.

#define CALC_N_DIO_SUBDEVS (   nchans)    ((nchans)/MAX_CHANS_PER_SUBDEV + (!!((nchans)%MAX_CHANS_PER_SUBDEV)) /*+ (nchans > INTR_CHANS_PER_ASIC ? 2 : 1)*/)

Definition at line 97 of file pcmmio.c.

#define CHANS_PER_ASIC   (CHANS_PER_PORT*PORTS_PER_ASIC)

Definition at line 91 of file pcmmio.c.

#define CHANS_PER_PORT   8

Definition at line 86 of file pcmmio.c.

#define devpriv   ((struct pcmmio_private *)dev->private)

Definition at line 261 of file pcmmio.c.

#define FIRST_PAGED_REG   0x8

Definition at line 135 of file pcmmio.c.

#define INTR_CHANS_PER_ASIC   24

Definition at line 92 of file pcmmio.c.

#define INTR_PORTS_PER_ASIC   3

Definition at line 88 of file pcmmio.c.

#define INTR_PORTS_PER_SUBDEV   (INTR_CHANS_PER_ASIC/CHANS_PER_PORT)

Definition at line 93 of file pcmmio.c.

#define MAX_ASICS   (MAX_DIO_CHANS/CHANS_PER_ASIC)

Definition at line 95 of file pcmmio.c.

#define MAX_CHANS_PER_SUBDEV   24 /* number of channels per comedi subdevice */

Definition at line 89 of file pcmmio.c.

#define MAX_DIO_CHANS   (PORTS_PER_ASIC*1*CHANS_PER_PORT)

Definition at line 94 of file pcmmio.c.

#define NUM_PAGED_REGS   3

Definition at line 133 of file pcmmio.c.

#define NUM_PAGES   4

Definition at line 134 of file pcmmio.c.

#define PAGE_ENAB   2

Definition at line 141 of file pcmmio.c.

#define PAGE_INT_ID   3

Definition at line 142 of file pcmmio.c.

#define PAGE_POL   1

Definition at line 140 of file pcmmio.c.

#define PCMMIO48_IOSIZE   ASIC_IOSIZE

Definition at line 100 of file pcmmio.c.

#define PORTS_PER_ASIC   6

Definition at line 87 of file pcmmio.c.

#define PORTS_PER_SUBDEV   (MAX_CHANS_PER_SUBDEV/CHANS_PER_PORT)

Definition at line 90 of file pcmmio.c.

#define REG_ENAB0   0x8

Definition at line 126 of file pcmmio.c.

#define REG_ENAB1   0x9

Definition at line 127 of file pcmmio.c.

#define REG_ENAB2   0xA

Definition at line 128 of file pcmmio.c.

#define REG_INT_ID0   0x8

Definition at line 129 of file pcmmio.c.

#define REG_INT_ID1   0x9

Definition at line 130 of file pcmmio.c.

#define REG_INT_ID2   0xA

Definition at line 131 of file pcmmio.c.

#define REG_INT_PENDING   0x6

Definition at line 121 of file pcmmio.c.

#define REG_LOCK_BITOFFSET   0

Definition at line 137 of file pcmmio.c.

#define REG_LOCK_MASK   (~(REG_PAGE_MASK))

Definition at line 139 of file pcmmio.c.

#define REG_PAGE_BITOFFSET   6

Definition at line 136 of file pcmmio.c.

#define REG_PAGE_MASK   (~((0x1<<REG_PAGE_BITOFFSET)-1))

Definition at line 138 of file pcmmio.c.

#define REG_PAGELOCK
Value:
0x7 /*
* page selector register, upper 2 bits select
* a page and bits 0-5 are used to 'lock down'
* a particular port above to make it readonly.
*/

Definition at line 122 of file pcmmio.c.

#define REG_POL0   0x8

Definition at line 123 of file pcmmio.c.

#define REG_POL1   0x9

Definition at line 124 of file pcmmio.c.

#define REG_POL2   0xA

Definition at line 125 of file pcmmio.c.

#define REG_PORT0   0x0

Definition at line 115 of file pcmmio.c.

#define REG_PORT1   0x1

Definition at line 116 of file pcmmio.c.

#define REG_PORT2   0x2

Definition at line 117 of file pcmmio.c.

#define REG_PORT3   0x3

Definition at line 118 of file pcmmio.c.

#define REG_PORT4   0x4

Definition at line 119 of file pcmmio.c.

#define REG_PORT5   0x5

Definition at line 120 of file pcmmio.c.

#define SDEV_NO   ((int)(s - dev->subdevices))

Definition at line 96 of file pcmmio.c.

#define subpriv   ((struct pcmmio_subdev_private *)s->private)

Definition at line 262 of file pcmmio.c.

Function Documentation

MODULE_AUTHOR ( "Comedi http://www.comedi.org"  )
module_comedi_driver ( pcmmio_driver  )
MODULE_DESCRIPTION ( "Comedi low-level driver )
MODULE_LICENSE ( "GPL"  )