struct comedi_insn *insn,
unsigned int *data)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
unsigned int i;
if ((data[0] != APCI3120_EOC_MODE) && (data[0] != APCI3120_EOS_MODE))
unsigned int *chanlist,
char check)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
unsigned int i;
unsigned int gain;
unsigned short us_TmpValue;
struct comedi_insn *insn,
unsigned int *data)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
unsigned short us_ConvertTiming, us_TmpValue, i;
unsigned char b_Tmp;
static int apci3120_reset(struct comedi_device *dev)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
unsigned int i;
unsigned short us_TmpValue;
static int apci3120_exttrig_enable(struct comedi_device *dev)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
devpriv->us_OutputRegister |= APCI3120_ENABLE_EXT_TRIGGER;
outw(devpriv->us_OutputRegister, dev->iobase + APCI3120_WR_ADDRESS);
static int apci3120_exttrig_disable(struct comedi_device *dev)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
devpriv->us_OutputRegister &= ~APCI3120_ENABLE_EXT_TRIGGER;
outw(devpriv->us_OutputRegister, dev->iobase + APCI3120_WR_ADDRESS);
static int apci3120_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
/* Disable A2P Fifo write and AMWEN signal */
outw(0, devpriv->i_IobaseAddon + 4);
struct comedi_device *dev,
struct comedi_subdevice *s)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
struct comedi_cmd *cmd = &s->async->cmd;
unsigned char b_Tmp;
unsigned int ui_Tmp, ui_DelayTiming = 0, ui_TimerValue1 = 0, dmalen0 =
static int apci3120_ai_cmd(struct comedi_device *dev,
struct comedi_subdevice *s)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
struct comedi_cmd *cmd = &s->async->cmd;
/* loading private structure with cmd structure inputs */
unsigned short *dma_buffer,
unsigned int num_samples)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
struct comedi_cmd *cmd = &s->async->cmd;
devpriv->ui_AiActualScan +=
static void apci3120_interrupt_dma(int irq, void *d)
{
struct comedi_device *dev = d;
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
struct comedi_subdevice *s = dev->read_subdev;
struct comedi_cmd *cmd = &s->async->cmd;
unsigned int next_dma_buf, samplesinbuf;
*/
static int apci3120_interrupt_handle_eos(struct comedi_device *dev)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
struct comedi_subdevice *s = dev->read_subdev;
int n_chan, i;
int err = 1;
static irqreturn_t apci3120_interrupt(int irq, void *d)
{
struct comedi_device *dev = d;
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
struct comedi_subdevice *s = dev->read_subdev;
unsigned short int_daq;
unsigned int int_amcc, ui_Check, i;
struct comedi_insn *insn,
unsigned int *data)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
unsigned int ui_Timervalue2;
unsigned short us_TmpValue;
unsigned char b_Tmp;
struct comedi_insn *insn,
unsigned int *data)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
unsigned int ui_Timervalue2 = 0;
unsigned short us_TmpValue;
unsigned char b_Tmp;
struct comedi_insn *insn,
unsigned int *data)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
unsigned char b_Tmp;
unsigned short us_TmpValue, us_TmpValue_2, us_StatusValue;
struct comedi_insn *insn,
unsigned int *data)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
unsigned int val;
/* the input channels are bits 11:8 of the status reg */
struct comedi_insn *insn,
unsigned int *data)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
if (comedi_dio_update_state(s, data)) {
/* The do channels are bits 7:4 of the do register */
struct comedi_insn *insn,
unsigned int *data)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
unsigned int ui_Range, ui_Channel;
unsigned short us_TmpValue;
#include <linux/module.h>
#include <linux/pci.h>
+#include <linux/sched.h>
+#include <linux/interrupt.h>
#include "../comedidev.h"
#include "comedi_fc.h"
#include "amcc_s5933.h"
-#include "addi-data/addi_common.h"
-
-#include "addi-data/hwdrv_apci3120.c"
-
enum apci3120_boardid {
BOARD_APCI3120,
BOARD_APCI3001,
},
};
+struct apci3120_private {
+ int iobase;
+ int i_IobaseAmcc;
+ int i_IobaseAddon;
+ int i_IobaseReserved;
+ unsigned int ui_AiActualScan;
+ unsigned int ui_AiNbrofChannels;
+ unsigned int ui_AiChannelList[32];
+ unsigned int ui_AiReadData[32];
+ unsigned short us_UseDma;
+ unsigned char b_DmaDoubleBuffer;
+ unsigned int ui_DmaActualBuffer;
+ unsigned short *ul_DmaBufferVirtual[2];
+ dma_addr_t ul_DmaBufferHw[2];
+ unsigned int ui_DmaBufferSize[2];
+ unsigned int ui_DmaBufferUsesize[2];
+ unsigned char b_DigitalOutputRegister;
+ unsigned char b_TimerSelectMode;
+ unsigned char b_ModeSelectRegister;
+ unsigned short us_OutputRegister;
+ unsigned char b_Timer2Mode;
+ unsigned char b_Timer2Interrupt;
+ unsigned int ai_running:1;
+ unsigned char b_InterruptMode;
+ unsigned char b_EocEosInterrupt;
+ unsigned int ui_EocEosConversionTime;
+ unsigned char b_ExttrigEnable;
+ struct task_struct *tsk_Current;
+};
+
+#include "addi-data/hwdrv_apci3120.c"
+
static int apci3120_auto_attach(struct comedi_device *dev,
unsigned long context)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
const struct apci3120_board *this_board = NULL;
- struct addi_private *devpriv;
+ struct apci3120_private *devpriv;
struct comedi_subdevice *s;
int ret, order, i;
static void apci3120_detach(struct comedi_device *dev)
{
- struct addi_private *devpriv = dev->private;
+ struct apci3120_private *devpriv = dev->private;
if (dev->iobase)
apci3120_reset(dev);