/* Structures */
/* structure for the boardtype */
-typedef struct {
- const char *pc_DriverName; // driver name
- int i_VendorId; //PCI vendor a device ID of card
+struct addi_board {
+ const char *pc_DriverName; /* driver name */
+ int i_VendorId; /* PCI vendor a device ID of card */
int i_DeviceId;
int i_IorangeBase0;
int i_IorangeBase1;
- int i_IorangeBase2; // base 2 range
- int i_IorangeBase3; // base 3 range
- int i_PCIEeprom; // eeprom present or not
- char *pc_EepromChip; // type of chip
- int i_NbrAiChannel; // num of A/D chans
- int i_NbrAiChannelDiff; // num of A/D chans in diff mode
- int i_AiChannelList; // len of chanlist
- int i_NbrAoChannel; // num of D/A chans
- int i_AiMaxdata; // resolution of A/D
- int i_AoMaxdata; // resolution of D/A
+ int i_IorangeBase2; /* base 2 range */
+ int i_IorangeBase3; /* base 3 range */
+ int i_PCIEeprom; /* eeprom present or not */
+ char *pc_EepromChip; /* type of chip */
+ int i_NbrAiChannel; /* num of A/D chans */
+ int i_NbrAiChannelDiff; /* num of A/D chans in diff mode */
+ int i_AiChannelList; /* len of chanlist */
+ int i_NbrAoChannel; /* num of D/A chans */
+ int i_AiMaxdata; /* resolution of A/D */
+ int i_AoMaxdata; /* resolution of D/A */
const struct comedi_lrange *pr_AiRangelist; /* rangelist for A/D */
const struct comedi_lrange *pr_AoRangelist; /* rangelist for D/A */
- int i_NbrDiChannel; // Number of DI channels
- int i_NbrDoChannel; // Number of DO channels
- int i_DoMaxdata; // data to set all chanels high
+ int i_NbrDiChannel; /* Number of DI channels */
+ int i_NbrDoChannel; /* Number of DO channels */
+ int i_DoMaxdata; /* data to set all channels high */
- int i_NbrTTLChannel; // Number of TTL channels
+ int i_NbrTTLChannel; /* Number of TTL channels */
const struct comedi_lrange *pr_TTLRangelist; /* rangelist for TTL */
- int i_Dma; // dma present or not
- int i_Timer; // timer subdevice present or not
+ int i_Dma; /* dma present or not */
+ int i_Timer; /* timer subdevice present or not */
unsigned char b_AvailableConvertUnit;
- unsigned int ui_MinAcquisitiontimeNs; // Minimum Acquisition in Nano secs
- unsigned int ui_MinDelaytimeNs; // Minimum Delay in Nano secs
+ unsigned int ui_MinAcquisitiontimeNs; /* Minimum Acquisition in Nano secs */
+ unsigned int ui_MinDelaytimeNs; /* Minimum Delay in Nano secs */
/* interrupt and reset */
void (*v_hwdrv_Interrupt)(int irq, void *d);
int (*i_hwdr_WriteTTLIOChlOnOff)(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
-} boardtype;
+};
-//MODULE INFO STRUCTURE
+/* MODULE INFO STRUCTURE */
-typedef union {
+union str_ModuleInfo {
/* Incremental counter infos */
struct {
union {
unsigned char b_CDAReadFIFOOverflow;
} s_CDAModuleInfo;
-} str_ModuleInfo;
+};
/* Private structure for the addi_apci3120 driver */
-typedef struct {
+struct addi_private {
int iobase;
- int i_IobaseAmcc; // base+size for AMCC chip
- int i_IobaseAddon; //addon base address
+ int i_IobaseAmcc; /* base+size for AMCC chip */
+ int i_IobaseAddon; /* addon base address */
int i_IobaseReserved;
unsigned long dw_AiBase;
- struct pcilst_struct *amcc; // ptr too AMCC data
- unsigned char allocated; // we have blocked card
- unsigned char b_ValidDriver; // driver is ok
- unsigned char b_AiContinuous; // we do unlimited AI
+ struct pcilst_struct *amcc; /* ptr too AMCC data */
+ unsigned char allocated; /* we have blocked card */
+ unsigned char b_ValidDriver; /* driver is ok */
+ unsigned char b_AiContinuous; /* we do unlimited AI */
unsigned char b_AiInitialisation;
- unsigned int ui_AiActualScan; //how many scans we finished
- unsigned int ui_AiBufferPtr; // data buffer ptr in samples
- unsigned int ui_AiNbrofChannels; // how many channels is measured
- unsigned int ui_AiScanLength; // Length of actual scanlist
- unsigned int ui_AiActualScanPosition; // position in actual scan
- unsigned int * pui_AiChannelList; // actual chanlist
- unsigned int ui_AiChannelList[32]; // actual chanlist
- unsigned char b_AiChannelConfiguration[32]; // actual chanlist
+ unsigned int ui_AiActualScan; /* how many scans we finished */
+ unsigned int ui_AiBufferPtr; /* data buffer ptr in samples */
+ unsigned int ui_AiNbrofChannels; /* how many channels is measured */
+ unsigned int ui_AiScanLength; /* Length of actual scanlist */
+ unsigned int ui_AiActualScanPosition; /* position in actual scan */
+ unsigned int *pui_AiChannelList; /* actual chanlist */
+ unsigned int ui_AiChannelList[32]; /* actual chanlist */
+ unsigned char b_AiChannelConfiguration[32]; /* actual chanlist */
unsigned int ui_AiReadData[32];
unsigned int dw_AiInitialised;
- unsigned int ui_AiTimer0; //Timer Constant for Timer0
- unsigned int ui_AiTimer1; //Timer constant for Timer1
+ unsigned int ui_AiTimer0; /* Timer Constant for Timer0 */
+ unsigned int ui_AiTimer1; /* Timer constant for Timer1 */
unsigned int ui_AiFlags;
unsigned int ui_AiDataLength;
- short *AiData; // Pointer to sample data
- unsigned int ui_AiNbrofScans; // number of scans to do
- unsigned short us_UseDma; // To use Dma or not
- unsigned char b_DmaDoubleBuffer; // we can use double buffering
- unsigned int ui_DmaActualBuffer; // which buffer is used now
+ short *AiData; /* Pointer to sample data */
+ unsigned int ui_AiNbrofScans; /* number of scans to do */
+ unsigned short us_UseDma; /* To use Dma or not */
+ unsigned char b_DmaDoubleBuffer; /* we can use double buffering */
+ unsigned int ui_DmaActualBuffer; /* which buffer is used now */
/* UPDATE-0.7.57->0.7.68 */
/* unsigned int ul_DmaBufferVirtual[2]; pointers to begin of DMA buffer */
- short *ul_DmaBufferVirtual[2]; // pointers to begin of DMA buffer
- unsigned int ul_DmaBufferHw[2]; // hw address of DMA buff
- unsigned int ui_DmaBufferSize[2]; // size of dma buffer in bytes
- unsigned int ui_DmaBufferUsesize[2]; // which size we may now used for transfer
- unsigned int ui_DmaBufferSamples[2]; // size in samples
- unsigned int ui_DmaBufferPages[2]; // number of pages in buffer
- unsigned char b_DigitalOutputRegister; // Digital Output Register
+ short *ul_DmaBufferVirtual[2]; /* pointers to begin of DMA buffer */
+ unsigned int ul_DmaBufferHw[2]; /* hw address of DMA buff */
+ unsigned int ui_DmaBufferSize[2]; /* size of dma buffer in bytes */
+ unsigned int ui_DmaBufferUsesize[2]; /* which size we may now used for transfer */
+ unsigned int ui_DmaBufferSamples[2]; /* size in samples */
+ unsigned int ui_DmaBufferPages[2]; /* number of pages in buffer */
+ unsigned char b_DigitalOutputRegister; /* Digital Output Register */
unsigned char b_OutputMemoryStatus;
- unsigned char b_AnalogInputChannelNbr; // Analog input channel Nbr
- unsigned char b_AnalogOutputChannelNbr; // Analog input Output Nbr
- unsigned char b_TimerSelectMode; // Contain data written at iobase + 0C
- unsigned char b_ModeSelectRegister; // Contain data written at iobase + 0E
- unsigned short us_OutputRegister; // Contain data written at iobase + 0
+ unsigned char b_AnalogInputChannelNbr; /* Analog input channel Nbr */
+ unsigned char b_AnalogOutputChannelNbr; /* Analog input Output Nbr */
+ unsigned char b_TimerSelectMode; /* Contain data written at iobase + 0C */
+ unsigned char b_ModeSelectRegister; /* Contain data written at iobase + 0E */
+ unsigned short us_OutputRegister; /* Contain data written at iobase + 0 */
unsigned char b_InterruptState;
- unsigned char b_TimerInit; // Specify if InitTimerWatchdog was load
- unsigned char b_TimerStarted; // Specify if timer 2 is running or not
- unsigned char b_Timer2Mode; // Specify the timer 2 mode
- unsigned char b_Timer2Interrupt; //Timer2 interrupt enable or disable
- unsigned char b_AiCyclicAcquisition; // indicate cyclic acquisition
- unsigned char b_InterruptMode; // eoc eos or dma
- unsigned char b_EocEosInterrupt; // Enable disable eoc eos interrupt
+ unsigned char b_TimerInit; /* Specify if InitTimerWatchdog was load */
+ unsigned char b_TimerStarted; /* Specify if timer 2 is running or not */
+ unsigned char b_Timer2Mode; /* Specify the timer 2 mode */
+ unsigned char b_Timer2Interrupt; /* Timer2 interrupt enable or disable */
+ unsigned char b_AiCyclicAcquisition; /* indicate cyclic acquisition */
+ unsigned char b_InterruptMode; /* eoc eos or dma */
+ unsigned char b_EocEosInterrupt; /* Enable disable eoc eos interrupt */
unsigned int ui_EocEosConversionTime;
unsigned char b_EocEosConversionTimeBase;
unsigned char b_SingelDiff;
/* Pointer to the current process */
struct task_struct *tsk_Current;
- boardtype *ps_BoardInfo;
+ struct addi_board *ps_BoardInfo;
/* Hardware board infos for 1710 */
struct {
} s_FIFOInterruptParameters[APCI1710_SAVE_INTERRUPT];
} s_InterruptParameters;
- str_ModuleInfo s_ModuleInfo[4];
+ union str_ModuleInfo s_ModuleInfo[4];
unsigned int ul_TTLPortConfiguration[10];
-} addi_private;
+};
static unsigned short pci_list_builded; /* set to 1 when list of card is known */
static int i_ADDI_Detach(struct comedi_device *dev);
static int i_ADDI_Reset(struct comedi_device *dev);
-static irqreturn_t v_ADDI_Interrupt(int irq, void *d PT_REGS_ARG);
+static irqreturn_t v_ADDI_Interrupt(int irq, void *d);
static int i_ADDIDATA_InsnReadEeprom(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);