Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
ni_pcidio.c File Reference
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/firmware.h>
#include "../comedidev.h"
#include "comedi_fc.h"
#include "mite.h"

Go to the source code of this file.

Data Structures

struct  nidio_board
 
struct  nidio96_private
 

Macros

#define USE_DMA
 
#define DPRINTK(format, args...)   do { } while (0)
 
#define PCI_DIO_SIZE   4096
 
#define PCI_MITE_SIZE   4096
 
#define Window_Address   4 /* W */
 
#define Interrupt_And_Window_Status   4 /* R */
 
#define IntStatus1   (1<<0)
 
#define IntStatus2   (1<<1)
 
#define WindowAddressStatus_mask   0x7c
 
#define Master_DMA_And_Interrupt_Control   5 /* W */
 
#define InterruptLine(x)   ((x)&3)
 
#define OpenInt   (1<<2)
 
#define Group_Status   5 /* R */
 
#define DataLeft   (1<<0)
 
#define Req   (1<<2)
 
#define StopTrig   (1<<3)
 
#define Group_1_Flags   6 /* R */
 
#define Group_2_Flags   7 /* R */
 
#define TransferReady   (1<<0)
 
#define CountExpired   (1<<1)
 
#define Waited   (1<<5)
 
#define PrimaryTC   (1<<6)
 
#define SecondaryTC   (1<<7)
 
#define Group_1_First_Clear   6 /* W */
 
#define Group_2_First_Clear   7 /* W */
 
#define ClearWaited   (1<<3)
 
#define ClearPrimaryTC   (1<<4)
 
#define ClearSecondaryTC   (1<<5)
 
#define DMAReset   (1<<6)
 
#define FIFOReset   (1<<7)
 
#define ClearAll   0xf8
 
#define Group_1_FIFO   8 /* W */
 
#define Group_2_FIFO   12 /* W */
 
#define Transfer_Count   20
 
#define Chip_ID_D   24
 
#define Chip_ID_I   25
 
#define Chip_ID_O   26
 
#define Chip_Version   27
 
#define Port_IO(x)   (28+(x))
 
#define Port_Pin_Directions(x)   (32+(x))
 
#define Port_Pin_Mask(x)   (36+(x))
 
#define Port_Pin_Polarities(x)   (40+(x))
 
#define Master_Clock_Routing   45
 
#define RTSIClocking(x)   (((x)&3)<<4)
 
#define Group_1_Second_Clear   46 /* W */
 
#define Group_2_Second_Clear   47 /* W */
 
#define ClearExpired   (1<<0)
 
#define Port_Pattern(x)   (48+(x))
 
#define Data_Path   64
 
#define FIFOEnableA   (1<<0)
 
#define FIFOEnableB   (1<<1)
 
#define FIFOEnableC   (1<<2)
 
#define FIFOEnableD   (1<<3)
 
#define Funneling(x)   (((x)&3)<<4)
 
#define GroupDirection   (1<<7)
 
#define Protocol_Register_1   65
 
#define OpMode   Protocol_Register_1
 
#define RunMode(x)   ((x)&7)
 
#define Numbered   (1<<3)
 
#define Protocol_Register_2   66
 
#define ClockReg   Protocol_Register_2
 
#define ClockLine(x)   (((x)&3)<<5)
 
#define InvertStopTrig   (1<<7)
 
#define DataLatching(x)   (((x)&3)<<5)
 
#define Protocol_Register_3   67
 
#define Sequence   Protocol_Register_3
 
#define Protocol_Register_14   68 /* 16 bit */
 
#define ClockSpeed   Protocol_Register_14
 
#define Protocol_Register_4   70
 
#define ReqReg   Protocol_Register_4
 
#define ReqConditioning(x)   (((x)&7)<<3)
 
#define Protocol_Register_5   71
 
#define BlockMode   Protocol_Register_5
 
#define FIFO_Control   72
 
#define ReadyLevel(x)   ((x)&7)
 
#define Protocol_Register_6   73
 
#define LinePolarities   Protocol_Register_6
 
#define InvertAck   (1<<0)
 
#define InvertReq   (1<<1)
 
#define InvertClock   (1<<2)
 
#define InvertSerial   (1<<3)
 
#define OpenAck   (1<<4)
 
#define OpenClock   (1<<5)
 
#define Protocol_Register_7   74
 
#define AckSer   Protocol_Register_7
 
#define AckLine(x)   (((x)&3)<<2)
 
#define ExchangePins   (1<<7)
 
#define Interrupt_Control   75
 
#define DMA_Line_Control_Group1   76
 
#define DMA_Line_Control_Group2   108
 
#define Transfer_Size_Control   77
 
#define TransferWidth(x)   ((x)&3)
 
#define TransferLength(x)   (((x)&3)<<3)
 
#define RequireRLevel   (1<<5)
 
#define Protocol_Register_15   79
 
#define DAQOptions   Protocol_Register_15
 
#define StartSource(x)   ((x)&0x3)
 
#define InvertStart   (1<<2)
 
#define StopSource(x)   (((x)&0x3)<<3)
 
#define ReqStart   (1<<6)
 
#define PreStart   (1<<7)
 
#define Pattern_Detection   81
 
#define DetectionMethod   (1<<0)
 
#define InvertMatch   (1<<1)
 
#define IE_Pattern_Detection   (1<<2)
 
#define Protocol_Register_9   82
 
#define ReqDelay   Protocol_Register_9
 
#define Protocol_Register_10   83
 
#define ReqNotDelay   Protocol_Register_10
 
#define Protocol_Register_11   84
 
#define AckDelay   Protocol_Register_11
 
#define Protocol_Register_12   85
 
#define AckNotDelay   Protocol_Register_12
 
#define Protocol_Register_13   86
 
#define Data1Delay   Protocol_Register_13
 
#define Protocol_Register_8   88 /* 32 bit */
 
#define StartDelay   Protocol_Register_8
 
#define FW_PCI_6534_MAIN   "ni6534a.bin"
 
#define FW_PCI_6534_SCARAB_DI   "niscrb01.bin"
 
#define FW_PCI_6534_SCARAB_DO   "niscrb02.bin"
 
#define TIMER_BASE   50 /* nanoseconds */
 
#define IntEn   (CountExpired|Waited|PrimaryTC|SecondaryTC)
 
#define n_nidio_boards   ARRAY_SIZE(nidio_boards)
 
#define this_board   ((const struct nidio_board *)dev->board_ptr)
 
#define devpriv   ((struct nidio96_private *)dev->private)
 
#define ni_pcidio_print_flags(x)
 
#define ni_pcidio_print_status(x)
 
#define MAX_SPEED   (TIMER_BASE) /* in nanoseconds */
 

Enumerations

enum  pci_6534_firmware_registers {
  Firmware_Control_Register = 0x100, Firmware_Status_Register = 0x104, Firmware_Data_Register = 0x108, Firmware_Mask_Register = 0x10c,
  Firmware_Debug_Register = 0x110
}
 
enum  pci_6534_fpga_registers {
  FPGA_Control1_Register = 0x200, FPGA_Control2_Register = 0x204, FPGA_Irq_Mask_Register = 0x208, FPGA_Status_Register = 0x20c,
  FPGA_Signature_Register = 0x210, FPGA_SCALS_Counter_Register = 0x280, FPGA_SCAMS_Counter_Register = 0x284, FPGA_SCBLS_Counter_Register = 0x288,
  FPGA_SCBMS_Counter_Register = 0x28c, FPGA_Temp_Control_Register = 0x2a0, FPGA_DAR_Register = 0x2a8, FPGA_ELC_Read_Register = 0x2b8,
  FPGA_ELC_Write_Register = 0x2bc
}
 
enum  FPGA_Control_Bits { FPGA_Enable_Bit = 0x8000 }
 

Functions

 MODULE_FIRMWARE (FW_PCI_6534_MAIN)
 
 MODULE_FIRMWARE (FW_PCI_6534_SCARAB_DI)
 
 MODULE_FIRMWARE (FW_PCI_6534_SCARAB_DO)
 
 MODULE_DEVICE_TABLE (pci, ni_pcidio_pci_table)
 
 module_comedi_pci_driver (ni_pcidio_driver, ni_pcidio_pci_driver)
 
 MODULE_AUTHOR ("Comedi http://www.comedi.org")
 
 MODULE_DESCRIPTION ("Comedi low-level driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define AckDelay   Protocol_Register_11

Definition at line 224 of file ni_pcidio.c.

#define AckLine (   x)    (((x)&3)<<2)

Definition at line 180 of file ni_pcidio.c.

#define AckNotDelay   Protocol_Register_12

Definition at line 227 of file ni_pcidio.c.

#define AckSer   Protocol_Register_7

Definition at line 179 of file ni_pcidio.c.

#define BlockMode   Protocol_Register_5

Definition at line 164 of file ni_pcidio.c.

#define Chip_ID_D   24

Definition at line 116 of file ni_pcidio.c.

#define Chip_ID_I   25

Definition at line 117 of file ni_pcidio.c.

#define Chip_ID_O   26

Definition at line 118 of file ni_pcidio.c.

#define Chip_Version   27

Definition at line 119 of file ni_pcidio.c.

#define ClearAll   0xf8

Definition at line 110 of file ni_pcidio.c.

#define ClearExpired   (1<<0)

Definition at line 130 of file ni_pcidio.c.

#define ClearPrimaryTC   (1<<4)

Definition at line 106 of file ni_pcidio.c.

#define ClearSecondaryTC   (1<<5)

Definition at line 107 of file ni_pcidio.c.

#define ClearWaited   (1<<3)

Definition at line 105 of file ni_pcidio.c.

#define ClockLine (   x)    (((x)&3)<<5)

Definition at line 149 of file ni_pcidio.c.

#define ClockReg   Protocol_Register_2

Definition at line 148 of file ni_pcidio.c.

#define ClockSpeed   Protocol_Register_14

Definition at line 157 of file ni_pcidio.c.

#define CountExpired   (1<<1)

Definition at line 95 of file ni_pcidio.c.

#define DAQOptions   Protocol_Register_15

Definition at line 205 of file ni_pcidio.c.

#define Data1Delay   Protocol_Register_13

Definition at line 230 of file ni_pcidio.c.

#define Data_Path   64

Definition at line 134 of file ni_pcidio.c.

#define DataLatching (   x)    (((x)&3)<<5)

Definition at line 151 of file ni_pcidio.c.

#define DataLeft   (1<<0)

Definition at line 88 of file ni_pcidio.c.

#define DetectionMethod   (1<<0)

Definition at line 213 of file ni_pcidio.c.

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

Definition at line 313 of file ni_pcidio.c.

#define DMA_Line_Control_Group1   76

Definition at line 186 of file ni_pcidio.c.

#define DMA_Line_Control_Group2   108

Definition at line 187 of file ni_pcidio.c.

#define DMAReset   (1<<6)

Definition at line 108 of file ni_pcidio.c.

#define DPRINTK (   format,
  args... 
)    do { } while (0)

Definition at line 70 of file ni_pcidio.c.

#define ExchangePins   (1<<7)

Definition at line 181 of file ni_pcidio.c.

#define FIFO_Control   72

Definition at line 166 of file ni_pcidio.c.

#define FIFOEnableA   (1<<0)

Definition at line 135 of file ni_pcidio.c.

#define FIFOEnableB   (1<<1)

Definition at line 136 of file ni_pcidio.c.

#define FIFOEnableC   (1<<2)

Definition at line 137 of file ni_pcidio.c.

#define FIFOEnableD   (1<<3)

Definition at line 138 of file ni_pcidio.c.

#define FIFOReset   (1<<7)

Definition at line 109 of file ni_pcidio.c.

#define Funneling (   x)    (((x)&3)<<4)

Definition at line 139 of file ni_pcidio.c.

#define FW_PCI_6534_MAIN   "ni6534a.bin"

Definition at line 236 of file ni_pcidio.c.

#define FW_PCI_6534_SCARAB_DI   "niscrb01.bin"

Definition at line 237 of file ni_pcidio.c.

#define FW_PCI_6534_SCARAB_DO   "niscrb02.bin"

Definition at line 238 of file ni_pcidio.c.

#define Group_1_FIFO   8 /* W */

Definition at line 112 of file ni_pcidio.c.

#define Group_1_First_Clear   6 /* W */

Definition at line 103 of file ni_pcidio.c.

#define Group_1_Flags   6 /* R */

Definition at line 92 of file ni_pcidio.c.

#define Group_1_Second_Clear   46 /* W */

Definition at line 128 of file ni_pcidio.c.

#define Group_2_FIFO   12 /* W */

Definition at line 113 of file ni_pcidio.c.

#define Group_2_First_Clear   7 /* W */

Definition at line 104 of file ni_pcidio.c.

#define Group_2_Flags   7 /* R */

Definition at line 93 of file ni_pcidio.c.

#define Group_2_Second_Clear   47 /* W */

Definition at line 129 of file ni_pcidio.c.

#define Group_Status   5 /* R */

Definition at line 87 of file ni_pcidio.c.

#define GroupDirection   (1<<7)

Definition at line 140 of file ni_pcidio.c.

#define IE_Pattern_Detection   (1<<2)

Definition at line 215 of file ni_pcidio.c.

#define IntEn   (CountExpired|Waited|PrimaryTC|SecondaryTC)

Definition at line 273 of file ni_pcidio.c.

#define Interrupt_And_Window_Status   4 /* R */

Definition at line 79 of file ni_pcidio.c.

#define Interrupt_Control   75

Definition at line 183 of file ni_pcidio.c.

#define InterruptLine (   x)    ((x)&3)

Definition at line 85 of file ni_pcidio.c.

#define IntStatus1   (1<<0)

Definition at line 80 of file ni_pcidio.c.

#define IntStatus2   (1<<1)

Definition at line 81 of file ni_pcidio.c.

#define InvertAck   (1<<0)

Definition at line 171 of file ni_pcidio.c.

#define InvertClock   (1<<2)

Definition at line 173 of file ni_pcidio.c.

#define InvertMatch   (1<<1)

Definition at line 214 of file ni_pcidio.c.

#define InvertReq   (1<<1)

Definition at line 172 of file ni_pcidio.c.

#define InvertSerial   (1<<3)

Definition at line 174 of file ni_pcidio.c.

#define InvertStart   (1<<2)

Definition at line 207 of file ni_pcidio.c.

#define InvertStopTrig   (1<<7)

Definition at line 150 of file ni_pcidio.c.

#define LinePolarities   Protocol_Register_6

Definition at line 170 of file ni_pcidio.c.

#define Master_Clock_Routing   45

Definition at line 125 of file ni_pcidio.c.

#define Master_DMA_And_Interrupt_Control   5 /* W */

Definition at line 84 of file ni_pcidio.c.

#define MAX_SPEED   (TIMER_BASE) /* in nanoseconds */
#define n_nidio_boards   ARRAY_SIZE(nidio_boards)

Definition at line 301 of file ni_pcidio.c.

#define ni_pcidio_print_flags (   x)

Definition at line 329 of file ni_pcidio.c.

#define ni_pcidio_print_status (   x)

Definition at line 330 of file ni_pcidio.c.

#define Numbered   (1<<3)

Definition at line 145 of file ni_pcidio.c.

#define OpenAck   (1<<4)

Definition at line 175 of file ni_pcidio.c.

#define OpenClock   (1<<5)

Definition at line 176 of file ni_pcidio.c.

#define OpenInt   (1<<2)

Definition at line 86 of file ni_pcidio.c.

#define OpMode   Protocol_Register_1

Definition at line 143 of file ni_pcidio.c.

#define Pattern_Detection   81

Definition at line 212 of file ni_pcidio.c.

#define PCI_DIO_SIZE   4096

Definition at line 73 of file ni_pcidio.c.

#define PCI_MITE_SIZE   4096

Definition at line 74 of file ni_pcidio.c.

#define Port_IO (   x)    (28+(x))

Definition at line 120 of file ni_pcidio.c.

#define Port_Pattern (   x)    (48+(x))

Definition at line 132 of file ni_pcidio.c.

#define Port_Pin_Directions (   x)    (32+(x))

Definition at line 121 of file ni_pcidio.c.

#define Port_Pin_Mask (   x)    (36+(x))

Definition at line 122 of file ni_pcidio.c.

#define Port_Pin_Polarities (   x)    (40+(x))

Definition at line 123 of file ni_pcidio.c.

#define PreStart   (1<<7)

Definition at line 210 of file ni_pcidio.c.

#define PrimaryTC   (1<<6)

Definition at line 97 of file ni_pcidio.c.

#define Protocol_Register_1   65

Definition at line 142 of file ni_pcidio.c.

#define Protocol_Register_10   83

Definition at line 220 of file ni_pcidio.c.

#define Protocol_Register_11   84

Definition at line 223 of file ni_pcidio.c.

#define Protocol_Register_12   85

Definition at line 226 of file ni_pcidio.c.

#define Protocol_Register_13   86

Definition at line 229 of file ni_pcidio.c.

#define Protocol_Register_14   68 /* 16 bit */

Definition at line 156 of file ni_pcidio.c.

#define Protocol_Register_15   79

Definition at line 204 of file ni_pcidio.c.

#define Protocol_Register_2   66

Definition at line 147 of file ni_pcidio.c.

#define Protocol_Register_3   67

Definition at line 153 of file ni_pcidio.c.

#define Protocol_Register_4   70

Definition at line 159 of file ni_pcidio.c.

#define Protocol_Register_5   71

Definition at line 163 of file ni_pcidio.c.

#define Protocol_Register_6   73

Definition at line 169 of file ni_pcidio.c.

#define Protocol_Register_7   74

Definition at line 178 of file ni_pcidio.c.

#define Protocol_Register_8   88 /* 32 bit */

Definition at line 232 of file ni_pcidio.c.

#define Protocol_Register_9   82

Definition at line 217 of file ni_pcidio.c.

#define ReadyLevel (   x)    ((x)&7)

Definition at line 167 of file ni_pcidio.c.

#define Req   (1<<2)

Definition at line 89 of file ni_pcidio.c.

#define ReqConditioning (   x)    (((x)&7)<<3)

Definition at line 161 of file ni_pcidio.c.

#define ReqDelay   Protocol_Register_9

Definition at line 218 of file ni_pcidio.c.

#define ReqNotDelay   Protocol_Register_10

Definition at line 221 of file ni_pcidio.c.

#define ReqReg   Protocol_Register_4

Definition at line 160 of file ni_pcidio.c.

#define ReqStart   (1<<6)

Definition at line 209 of file ni_pcidio.c.

#define RequireRLevel   (1<<5)

Definition at line 202 of file ni_pcidio.c.

#define RTSIClocking (   x)    (((x)&3)<<4)

Definition at line 126 of file ni_pcidio.c.

#define RunMode (   x)    ((x)&7)

Definition at line 144 of file ni_pcidio.c.

#define SecondaryTC   (1<<7)

Definition at line 98 of file ni_pcidio.c.

#define Sequence   Protocol_Register_3

Definition at line 154 of file ni_pcidio.c.

#define StartDelay   Protocol_Register_8

Definition at line 233 of file ni_pcidio.c.

#define StartSource (   x)    ((x)&0x3)

Definition at line 206 of file ni_pcidio.c.

#define StopSource (   x)    (((x)&0x3)<<3)

Definition at line 208 of file ni_pcidio.c.

#define StopTrig   (1<<3)

Definition at line 90 of file ni_pcidio.c.

#define this_board   ((const struct nidio_board *)dev->board_ptr)

Definition at line 302 of file ni_pcidio.c.

#define TIMER_BASE   50 /* nanoseconds */

Definition at line 270 of file ni_pcidio.c.

#define Transfer_Count   20

Definition at line 115 of file ni_pcidio.c.

#define Transfer_Size_Control   77

Definition at line 199 of file ni_pcidio.c.

#define TransferLength (   x)    (((x)&3)<<3)

Definition at line 201 of file ni_pcidio.c.

#define TransferReady   (1<<0)

Definition at line 94 of file ni_pcidio.c.

#define TransferWidth (   x)    ((x)&3)

Definition at line 200 of file ni_pcidio.c.

#define USE_DMA

Definition at line 54 of file ni_pcidio.c.

#define Waited   (1<<5)

Definition at line 96 of file ni_pcidio.c.

#define Window_Address   4 /* W */

Definition at line 78 of file ni_pcidio.c.

#define WindowAddressStatus_mask   0x7c

Definition at line 82 of file ni_pcidio.c.

Enumeration Type Documentation

Enumerator:
FPGA_Enable_Bit 

Definition at line 266 of file ni_pcidio.c.

Enumerator:
Firmware_Control_Register 
Firmware_Status_Register 
Firmware_Data_Register 
Firmware_Mask_Register 
Firmware_Debug_Register 

Definition at line 243 of file ni_pcidio.c.

Enumerator:
FPGA_Control1_Register 
FPGA_Control2_Register 
FPGA_Irq_Mask_Register 
FPGA_Status_Register 
FPGA_Signature_Register 
FPGA_SCALS_Counter_Register 
FPGA_SCAMS_Counter_Register 
FPGA_SCBLS_Counter_Register 
FPGA_SCBMS_Counter_Register 
FPGA_Temp_Control_Register 
FPGA_DAR_Register 
FPGA_ELC_Read_Register 
FPGA_ELC_Write_Register 

Definition at line 251 of file ni_pcidio.c.

Function Documentation

MODULE_AUTHOR ( "Comedi http://www.comedi.org"  )
module_comedi_pci_driver ( ni_pcidio_driver  ,
ni_pcidio_pci_driver   
)
MODULE_DESCRIPTION ( "Comedi low-level driver )
MODULE_DEVICE_TABLE ( pci  ,
ni_pcidio_pci_table   
)
MODULE_FIRMWARE ( FW_PCI_6534_MAIN  )
MODULE_FIRMWARE ( FW_PCI_6534_SCARAB_DI  )
MODULE_FIRMWARE ( FW_PCI_6534_SCARAB_DO  )
MODULE_LICENSE ( "GPL"  )