Commit 2696fb57 authored by Bill Pemberton's avatar Bill Pemberton Committed by Greg Kroah-Hartman

Staging: comedi: Remove C99 comments

Signed-off-by: default avatarBill Pemberton <wfp5p@virginia.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 70265d24
...@@ -736,7 +736,7 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su ...@@ -736,7 +736,7 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su
DPRINTK("Base timing selection is wrong\n"); DPRINTK("Base timing selection is wrong\n");
i_ReturnValue = -7; i_ReturnValue = -7;
} }
} // if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4)) } /* if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4)) */
else { else {
/***********************************/ /***********************************/
/* Timing unity selection is wrong */ /* Timing unity selection is wrong */
...@@ -744,8 +744,8 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su ...@@ -744,8 +744,8 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su
DPRINTK("Timing unity selection is wrong\n"); DPRINTK("Timing unity selection is wrong\n");
i_ReturnValue = -6; i_ReturnValue = -6;
} // if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4)) } /* if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4)) */
} // if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) } /* if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) */
else { else {
/*****************************************/ /*****************************************/
/* The selected PCI input clock is wrong */ /* The selected PCI input clock is wrong */
...@@ -753,8 +753,8 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su ...@@ -753,8 +753,8 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su
DPRINTK("The selected PCI input clock is wrong\n"); DPRINTK("The selected PCI input clock is wrong\n");
i_ReturnValue = -5; i_ReturnValue = -5;
} // if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) } /* if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) */
} // if (b_ChronoMode >= 0 && b_ChronoMode <= 7) } /* if (b_ChronoMode >= 0 && b_ChronoMode <= 7) */
else { else {
/***************************************/ /***************************************/
/* Chronometer mode selection is wrong */ /* Chronometer mode selection is wrong */
...@@ -762,7 +762,7 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su ...@@ -762,7 +762,7 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su
DPRINTK("Chronometer mode selection is wrong\n"); DPRINTK("Chronometer mode selection is wrong\n");
i_ReturnValue = -4; i_ReturnValue = -4;
} // if (b_ChronoMode >= 0 && b_ChronoMode <= 7) } /* if (b_ChronoMode >= 0 && b_ChronoMode <= 7) */
} else { } else {
/******************************************/ /******************************************/
/* The module is not a Chronometer module */ /* The module is not a Chronometer module */
...@@ -951,7 +951,7 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev, ...@@ -951,7 +951,7 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev,
ui_Address ui_Address
+ 32 + + 32 +
(64 * b_ModulNbr)); (64 * b_ModulNbr));
devpriv->tsk_Current = current; // Save the current process task structure devpriv->tsk_Current = current; /* Save the current process task structure */
} }
/***********************************/ /***********************************/
...@@ -980,7 +980,7 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev, ...@@ -980,7 +980,7 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev,
36 + 36 +
(64 * b_ModulNbr)); (64 * b_ModulNbr));
} // if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) } /* if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) */
else { else {
/********************************/ /********************************/
/* Interrupt parameter is wrong */ /* Interrupt parameter is wrong */
...@@ -988,8 +988,8 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev, ...@@ -988,8 +988,8 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev,
DPRINTK("Interrupt parameter is wrong\n"); DPRINTK("Interrupt parameter is wrong\n");
i_ReturnValue = -6; i_ReturnValue = -6;
} // if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) } /* if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) */
} // if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) } /* if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) */
else { else {
/***********************************************/ /***********************************************/
/* Chronometer acquisition mode cycle is wrong */ /* Chronometer acquisition mode cycle is wrong */
...@@ -997,7 +997,7 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev, ...@@ -997,7 +997,7 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev,
DPRINTK("Chronometer acquisition mode cycle is wrong\n"); DPRINTK("Chronometer acquisition mode cycle is wrong\n");
i_ReturnValue = -5; i_ReturnValue = -5;
} // if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) } /* if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) */
break; break;
case APCI1710_DISABLE: case APCI1710_DISABLE:
...@@ -1046,7 +1046,7 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev, ...@@ -1046,7 +1046,7 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev,
default: default:
DPRINTK("Inputs wrong! Enable or Disable chrono\n"); DPRINTK("Inputs wrong! Enable or Disable chrono\n");
i_ReturnValue = -8; i_ReturnValue = -8;
} // switch ENABLE/DISABLE } /* switch ENABLE/DISABLE */
} else { } else {
/*******************************/ /*******************************/
/* Chronometer not initialised */ /* Chronometer not initialised */
...@@ -1233,7 +1233,7 @@ int i_APCI1710_GetChronoProgressStatus(struct comedi_device * dev, ...@@ -1233,7 +1233,7 @@ int i_APCI1710_GetChronoProgressStatus(struct comedi_device * dev,
/******************/ /******************/
*pb_ChronoStatus = 3; *pb_ChronoStatus = 3;
} // if ((dw_Status & 8) == 8) } /* if ((dw_Status & 8) == 8) */
else { else {
/*******************************/ /*******************************/
/* Test if measurement stopped */ /* Test if measurement stopped */
...@@ -1245,7 +1245,7 @@ int i_APCI1710_GetChronoProgressStatus(struct comedi_device * dev, ...@@ -1245,7 +1245,7 @@ int i_APCI1710_GetChronoProgressStatus(struct comedi_device * dev,
/***********************/ /***********************/
*pb_ChronoStatus = 2; *pb_ChronoStatus = 2;
} // if ((dw_Status & 2) == 2) } /* if ((dw_Status & 2) == 2) */
else { else {
/*******************************/ /*******************************/
/* Test if measurement started */ /* Test if measurement started */
...@@ -1257,16 +1257,16 @@ int i_APCI1710_GetChronoProgressStatus(struct comedi_device * dev, ...@@ -1257,16 +1257,16 @@ int i_APCI1710_GetChronoProgressStatus(struct comedi_device * dev,
/************************/ /************************/
*pb_ChronoStatus = 1; *pb_ChronoStatus = 1;
} // if ((dw_Status & 1) == 1) } /* if ((dw_Status & 1) == 1) */
else { else {
/***************************/ /***************************/
/* Measurement not started */ /* Measurement not started */
/***************************/ /***************************/
*pb_ChronoStatus = 0; *pb_ChronoStatus = 0;
} // if ((dw_Status & 1) == 1) } /* if ((dw_Status & 1) == 1) */
} // if ((dw_Status & 2) == 2) } /* if ((dw_Status & 2) == 2) */
} // if ((dw_Status & 8) == 8) } /* if ((dw_Status & 8) == 8) */
} else { } else {
/*******************************/ /*******************************/
/* Chronometer not initialised */ /* Chronometer not initialised */
...@@ -1430,7 +1430,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev, ...@@ -1430,7 +1430,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev,
} }
break; break;
} // if ((dw_Status & 8) == 8) } /* if ((dw_Status & 8) == 8) */
else { else {
/*******************************/ /*******************************/
/* Test if measurement stopped */ /* Test if measurement stopped */
...@@ -1464,7 +1464,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev, ...@@ -1464,7 +1464,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev,
outl(0, devpriv->s_BoardInfos.ui_Address + 36 + (64 * b_ModulNbr)); outl(0, devpriv->s_BoardInfos.ui_Address + 36 + (64 * b_ModulNbr));
} }
break; break;
} // if ((dw_Status & 2) == 2) } /* if ((dw_Status & 2) == 2) */
else { else {
/*******************************/ /*******************************/
/* Test if measurement started */ /* Test if measurement started */
...@@ -1478,7 +1478,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev, ...@@ -1478,7 +1478,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev,
*pb_ChronoStatus *pb_ChronoStatus
= =
1; 1;
} // if ((dw_Status & 1) == 1) } /* if ((dw_Status & 1) == 1) */
else { else {
/***************************/ /***************************/
/* Measurement not started */ /* Measurement not started */
...@@ -1487,9 +1487,9 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev, ...@@ -1487,9 +1487,9 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev,
*pb_ChronoStatus *pb_ChronoStatus
= =
0; 0;
} // if ((dw_Status & 1) == 1) } /* if ((dw_Status & 1) == 1) */
} // if ((dw_Status & 2) == 2) } /* if ((dw_Status & 2) == 2) */
} // if ((dw_Status & 8) == 8) } /* if ((dw_Status & 8) == 8) */
if (dw_TimeOut == ui_TimeOut) { if (dw_TimeOut == ui_TimeOut) {
/*****************/ /*****************/
...@@ -1507,7 +1507,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev, ...@@ -1507,7 +1507,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev,
mdelay(1000); mdelay(1000);
} }
} // for (;;) } /* for (;;) */
/*****************************/ /*****************************/
/* Test if stop signal occur */ /* Test if stop signal occur */
...@@ -1922,7 +1922,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, ...@@ -1922,7 +1922,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev,
ui_Address + 20 + ui_Address + 20 +
(b_OutputChannel * 4) + (b_OutputChannel * 4) +
(64 * b_ModulNbr)); (64 * b_ModulNbr));
} // if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) } /* if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) */
else { else {
/****************************************/ /****************************************/
/* The selected digital output is wrong */ /* The selected digital output is wrong */
...@@ -1931,7 +1931,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, ...@@ -1931,7 +1931,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev,
DPRINTK("The selected digital output is wrong\n"); DPRINTK("The selected digital output is wrong\n");
i_ReturnValue = -4; i_ReturnValue = -4;
} // if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) } /* if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) */
break; break;
...@@ -1945,7 +1945,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, ...@@ -1945,7 +1945,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev,
ui_Address + 20 + ui_Address + 20 +
(b_OutputChannel * 4) + (b_OutputChannel * 4) +
(64 * b_ModulNbr)); (64 * b_ModulNbr));
} // if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) } /* if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) */
else { else {
/****************************************/ /****************************************/
/* The selected digital output is wrong */ /* The selected digital output is wrong */
...@@ -1954,7 +1954,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, ...@@ -1954,7 +1954,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev,
DPRINTK("The selected digital output is wrong\n"); DPRINTK("The selected digital output is wrong\n");
i_ReturnValue = -4; i_ReturnValue = -4;
} // if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) } /* if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) */
break; break;
...@@ -1978,7 +1978,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, ...@@ -1978,7 +1978,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev,
(unsigned char) (((dw_Status >> (unsigned char) (((dw_Status >>
b_InputChannel) b_InputChannel)
& 1) ^ 1); & 1) ^ 1);
} // if ((b_InputChannel >= 0) && (b_InputChannel <= 2)) } /* if ((b_InputChannel >= 0) && (b_InputChannel <= 2)) */
else { else {
/***************************************/ /***************************************/
/* The selected digital input is wrong */ /* The selected digital input is wrong */
...@@ -1986,7 +1986,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, ...@@ -1986,7 +1986,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev,
DPRINTK("The selected digital input is wrong\n"); DPRINTK("The selected digital input is wrong\n");
i_ReturnValue = -4; i_ReturnValue = -4;
} // if ((b_InputChannel >= 0) && (b_InputChannel <= 2)) } /* if ((b_InputChannel >= 0) && (b_InputChannel <= 2)) */
break; break;
......
...@@ -108,10 +108,10 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub ...@@ -108,10 +108,10 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub
unsigned int dw_WriteConfig = 0; unsigned int dw_WriteConfig = 0;
b_ModulNbr = (unsigned char) CR_AREF(insn->chanspec); b_ModulNbr = (unsigned char) CR_AREF(insn->chanspec);
b_ConfigType = (unsigned char) data[0]; // Memory or Init b_ConfigType = (unsigned char) data[0]; /* Memory or Init */
b_ChannelAMode = (unsigned char) data[1]; b_ChannelAMode = (unsigned char) data[1];
b_ChannelBMode = (unsigned char) data[2]; b_ChannelBMode = (unsigned char) data[2];
b_MemoryOnOff = (unsigned char) data[1]; // if memory operation b_MemoryOnOff = (unsigned char) data[1]; /* if memory operation */
i_ReturnValue = insn->n; i_ReturnValue = insn->n;
/**************************/ /**************************/
...@@ -126,7 +126,7 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub ...@@ -126,7 +126,7 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub
switch (b_ConfigType) { switch (b_ConfigType) {
case APCI1710_DIGIO_MEMORYONOFF: case APCI1710_DIGIO_MEMORYONOFF:
if (b_MemoryOnOff) // If Memory ON if (b_MemoryOnOff) /* If Memory ON */
{ {
/****************************/ /****************************/
/* Set the output memory on */ /* Set the output memory on */
...@@ -140,7 +140,7 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub ...@@ -140,7 +140,7 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub
/***************************/ /***************************/
devpriv->s_ModuleInfo[b_ModulNbr]. devpriv->s_ModuleInfo[b_ModulNbr].
s_DigitalIOInfo.dw_OutputMemory = 0; s_DigitalIOInfo.dw_OutputMemory = 0;
} else // If memory off } else /* If memory off */
{ {
/*****************************/ /*****************************/
/* Set the output memory off */ /* Set the output memory off */
...@@ -233,7 +233,7 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub ...@@ -233,7 +233,7 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub
DPRINTK("The module is not a digital I/O module\n"); DPRINTK("The module is not a digital I/O module\n");
i_ReturnValue = -3; i_ReturnValue = -3;
} }
} // end of Switch } /* end of Switch */
printk("Return Value %d\n", i_ReturnValue); printk("Return Value %d\n", i_ReturnValue);
return i_ReturnValue; return i_ReturnValue;
} }
...@@ -288,11 +288,11 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub ...@@ -288,11 +288,11 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
//_INT_ i_APCI1710_ReadDigitalIOChlValue (unsigned char_ b_BoardHandle, /* _INT_ i_APCI1710_ReadDigitalIOChlValue (unsigned char_ b_BoardHandle, */
// unsigned char_ b_ModulNbr, /*
// unsigned char_ b_InputChannel, * unsigned char_ b_ModulNbr, unsigned char_ b_InputChannel,
// * unsigned char *_ pb_ChannelStatus)
// unsigned char *_ pb_ChannelStatus) */
int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev,
struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data)
{ {
...@@ -356,7 +356,7 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, ...@@ -356,7 +356,7 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev,
i_ReturnValue = i_ReturnValue =
-6; -6;
} }
} // if (b_InputChannel == 5) } /* if (b_InputChannel == 5) */
else { else {
/***************************/ /***************************/
/* Test the channel B mode */ /* Test the channel B mode */
...@@ -375,8 +375,8 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, ...@@ -375,8 +375,8 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev,
i_ReturnValue = i_ReturnValue =
-7; -7;
} }
} // if (b_InputChannel == 5) } /* if (b_InputChannel == 5) */
} // if (b_InputChannel > 4) } /* if (b_InputChannel > 4) */
/***********************/ /***********************/
/* Test if error occur */ /* Test if error occur */
...@@ -387,11 +387,10 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, ...@@ -387,11 +387,10 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev,
/* Read all digital input */ /* Read all digital input */
/**************************/ /**************************/
//INPDW (ps_APCI1710Variable-> /*
// s_Board [b_BoardHandle]. * INPDW (ps_APCI1710Variable-> s_Board [b_BoardHandle].
// s_BoardInfos. * s_BoardInfos. ui_Address + (64 * b_ModulNbr), &dw_StatusReg);
// ui_Address + (64 * b_ModulNbr), */
// &dw_StatusReg);
dw_StatusReg = dw_StatusReg =
inl(devpriv-> inl(devpriv->
...@@ -404,7 +403,7 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, ...@@ -404,7 +403,7 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev,
0x1C) >> 0x1C) >>
b_InputChannel) & 1; b_InputChannel) & 1;
} // if (i_ReturnValue == 0) } /* if (i_ReturnValue == 0) */
} else { } else {
/*******************************/ /*******************************/
/* Digital I/O not initialised */ /* Digital I/O not initialised */
...@@ -478,9 +477,10 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, ...@@ -478,9 +477,10 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev,
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
//_INT_ i_APCI1710_SetDigitalIOChlOn (unsigned char_ b_BoardHandle, /*
// unsigned char_ b_ModulNbr, * _INT_ i_APCI1710_SetDigitalIOChlOn (unsigned char_ b_BoardHandle,
// unsigned char_ b_OutputChannel) * unsigned char_ b_ModulNbr, unsigned char_ b_OutputChannel)
*/
int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev, int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev,
struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data)
{ {
...@@ -602,7 +602,7 @@ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev, ...@@ -602,7 +602,7 @@ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev,
1 << 1 <<
b_OutputChannel; b_OutputChannel;
} }
} // set channel off } /* set channel off */
else { else {
if (devpriv-> if (devpriv->
s_ModuleInfo s_ModuleInfo
...@@ -630,7 +630,7 @@ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev, ...@@ -630,7 +630,7 @@ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev,
/*****************************/ /*****************************/
/* Digital Output Memory OFF */ /* Digital Output Memory OFF */
/*****************************/ /*****************************/
// +Use previously the function "i_APCI1710_SetDigitalIOMemoryOn" /* +Use previously the function "i_APCI1710_SetDigitalIOMemoryOn" */
i_ReturnValue = -8; i_ReturnValue = -8;
} }
...@@ -639,11 +639,12 @@ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev, ...@@ -639,11 +639,12 @@ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev,
/* Write the value */ /* Write the value */
/*******************/ /*******************/
//OUTPDW (ps_APCI1710Variable-> /* OUTPDW (ps_APCI1710Variable->
// s_Board [b_BoardHandle]. * s_Board [b_BoardHandle].
// s_BoardInfos. * s_BoardInfos. ui_Address + (64 * b_ModulNbr),
// ui_Address + (64 * b_ModulNbr), * dw_WriteValue);
// dw_WriteValue); */
*/
outl(dw_WriteValue, outl(dw_WriteValue,
devpriv->s_BoardInfos. devpriv->s_BoardInfos.
ui_Address + (64 * b_ModulNbr)); ui_Address + (64 * b_ModulNbr));
...@@ -725,9 +726,11 @@ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev, ...@@ -725,9 +726,11 @@ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev,
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
//_INT_ i_APCI1710_SetDigitalIOPortOn (unsigned char_ b_BoardHandle, /*
// unsigned char_ b_ModulNbr, * _INT_ i_APCI1710_SetDigitalIOPortOn (unsigned char_
// unsigned char_ b_PortValue) * b_BoardHandle, unsigned char_ b_ModulNbr, unsigned char_
* b_PortValue)
*/
int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev,
struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data)
{ {
...@@ -740,12 +743,12 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, ...@@ -740,12 +743,12 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev,
unsigned char * pb_PortValue; unsigned char * pb_PortValue;
b_ModulNbr = (unsigned char) CR_AREF(insn->chanspec); b_ModulNbr = (unsigned char) CR_AREF(insn->chanspec);
b_PortOperation = (unsigned char) data[0]; // Input or output b_PortOperation = (unsigned char) data[0]; /* Input or output */
b_PortOnOFF = (unsigned char) data[1]; // if output then On or Off b_PortOnOFF = (unsigned char) data[1]; /* if output then On or Off */
b_PortValue = (unsigned char) data[2]; // if out put then Value b_PortValue = (unsigned char) data[2]; /* if out put then Value */
i_ReturnValue = insn->n; i_ReturnValue = insn->n;
pb_PortValue = (unsigned char *) & data[0]; pb_PortValue = (unsigned char *) & data[0];
// if input then read value /* if input then read value */
switch (b_PortOperation) { switch (b_PortOperation) {
case APCI1710_INPUT: case APCI1710_INPUT:
...@@ -771,11 +774,12 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, ...@@ -771,11 +774,12 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev,
/* Read all digital input */ /* Read all digital input */
/**************************/ /**************************/
//INPDW (ps_APCI1710Variable-> /* INPDW (ps_APCI1710Variable->
// s_Board [b_BoardHandle]. * s_Board [b_BoardHandle].
// s_BoardInfos. * s_BoardInfos.
// ui_Address + (64 * b_ModulNbr), * ui_Address + (64 * b_ModulNbr),
// &dw_StatusReg); * &dw_StatusReg);
*/
dw_StatusReg = dw_StatusReg =
inl(devpriv->s_BoardInfos. inl(devpriv->s_BoardInfos.
...@@ -853,7 +857,7 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, ...@@ -853,7 +857,7 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev,
i_ReturnValue = i_ReturnValue =
-6; -6;
} }
} // if ((b_PortValue & 2) == 2) } /* if ((b_PortValue & 2) == 2) */
/**************************/ /**************************/
/* Test if channel B used */ /* Test if channel B used */
...@@ -873,7 +877,7 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, ...@@ -873,7 +877,7 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev,
i_ReturnValue = i_ReturnValue =
-7; -7;
} }
} // if ((b_PortValue & 4) == 4) } /* if ((b_PortValue & 4) == 4) */
/***********************/ /***********************/
/* Test if error occur */ /* Test if error occur */
...@@ -881,8 +885,8 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, ...@@ -881,8 +885,8 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev,
if (i_ReturnValue >= 0) { if (i_ReturnValue >= 0) {
//if(data[1]) /* if(data[1]) { */
//{
switch (b_PortOnOFF) { switch (b_PortOnOFF) {
/*********************************/ /*********************************/
/* Test if set Port ON */ /* Test if set Port ON */
...@@ -924,7 +928,7 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, ...@@ -924,7 +928,7 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev,
} }
break; break;
// If Set PORT OFF /* If Set PORT OFF */
case APCI1710_OFF: case APCI1710_OFF:
/*********************************/ /*********************************/
...@@ -965,17 +969,18 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, ...@@ -965,17 +969,18 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev,
= =
-8; -8;
} }
} // switch } /* switch */
/*******************/ /*******************/
/* Write the value */ /* Write the value */
/*******************/ /*******************/
// OUTPDW (ps_APCI1710Variable-> /* OUTPDW (ps_APCI1710Variable->
// s_Board [b_BoardHandle]. * s_Board [b_BoardHandle].
// s_BoardInfos. * s_BoardInfos.
// ui_Address + (64 * b_ModulNbr), * ui_Address + (64 * b_ModulNbr),
// dw_WriteValue); * dw_WriteValue); */
outl(dw_WriteValue, outl(dw_WriteValue,
devpriv-> devpriv->
s_BoardInfos. s_BoardInfos.
...@@ -1015,6 +1020,6 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, ...@@ -1015,6 +1020,6 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev,
default: default:
i_ReturnValue = -9; i_ReturnValue = -9;
DPRINTK("NO INPUT/OUTPUT specified\n"); DPRINTK("NO INPUT/OUTPUT specified\n");
} //switch INPUT / OUTPUT } /* switch INPUT / OUTPUT */
return (i_ReturnValue); return (i_ReturnValue);
} }
...@@ -515,7 +515,7 @@ int i_APCI1710_InsnWriteEnableDisablePulseEncoder(struct comedi_device * dev, ...@@ -515,7 +515,7 @@ int i_APCI1710_InsnWriteEnableDisablePulseEncoder(struct comedi_device * dev,
| (1UL | (1UL
<< <<
b_PulseEncoderNbr); b_PulseEncoderNbr);
devpriv->tsk_Current = current; // Save the current process task structure devpriv->tsk_Current = current; /* Save the current process task structure */
} }
...@@ -629,7 +629,7 @@ int i_APCI1710_InsnWriteEnableDisablePulseEncoder(struct comedi_device * dev, ...@@ -629,7 +629,7 @@ int i_APCI1710_InsnWriteEnableDisablePulseEncoder(struct comedi_device * dev,
(64 * b_ModulNbr)); (64 * b_ModulNbr));
break; break;
} // switch End } /* switch End */
} else { } else {
/*********************************/ /*********************************/
...@@ -805,7 +805,7 @@ int i_APCI1710_InsnBitsReadWritePulseEncoder(struct comedi_device * dev, ...@@ -805,7 +805,7 @@ int i_APCI1710_InsnBitsReadWritePulseEncoder(struct comedi_device * dev,
(4 * b_PulseEncoderNbr) + (4 * b_PulseEncoderNbr) +
(64 * b_ModulNbr)); (64 * b_ModulNbr));
} //end of switch } /* end of switch */
} else { } else {
/*********************************/ /*********************************/
/* Pulse encoder not initialised */ /* Pulse encoder not initialised */
......
...@@ -167,7 +167,7 @@ int i_APCI1710_InsnConfigInitSSI(struct comedi_device * dev, struct comedi_subde ...@@ -167,7 +167,7 @@ int i_APCI1710_InsnConfigInitSSI(struct comedi_device * dev, struct comedi_subde
/* Test the SSI profile length */ /* Test the SSI profile length */
/*******************************/ /*******************************/
// CG 22/03/00 b_SSIProfile >= 2 anstatt b_SSIProfile > 2 /* CG 22/03/00 b_SSIProfile >= 2 anstatt b_SSIProfile > 2 */
if (b_SSIProfile >= 2 && b_SSIProfile < 33) { if (b_SSIProfile >= 2 && b_SSIProfile < 33) {
/*************************************/ /*************************************/
/* Test the SSI position data length */ /* Test the SSI position data length */
...@@ -423,11 +423,11 @@ int i_APCI1710_InsnReadSSIValue(struct comedi_device * dev, struct comedi_subdev ...@@ -423,11 +423,11 @@ int i_APCI1710_InsnReadSSIValue(struct comedi_device * dev, struct comedi_subdev
i_ReturnValue = insn->n; i_ReturnValue = insn->n;
pul_Position1 = (unsigned int *) & data[0]; pul_Position1 = (unsigned int *) & data[0];
// For Read1 /* For Read1 */
pul_TurnCpt1 = (unsigned int *) & data[1]; pul_TurnCpt1 = (unsigned int *) & data[1];
// For Read all /* For Read all */
pul_Position = (unsigned int *) & data[0]; //0-2 pul_Position = (unsigned int *) & data[0]; /* 0-2 */
pul_TurnCpt = (unsigned int *) & data[3]; //3-5 pul_TurnCpt = (unsigned int *) & data[3]; /* 3-5 */
b_ModulNbr = (unsigned char) CR_AREF(insn->chanspec); b_ModulNbr = (unsigned char) CR_AREF(insn->chanspec);
b_SelectedSSI = (unsigned char) CR_CHAN(insn->chanspec); b_SelectedSSI = (unsigned char) CR_CHAN(insn->chanspec);
b_ReadType = (unsigned char) CR_RANGE(insn->chanspec); b_ReadType = (unsigned char) CR_RANGE(insn->chanspec);
...@@ -667,7 +667,7 @@ int i_APCI1710_InsnReadSSIValue(struct comedi_device * dev, struct comedi_subdev ...@@ -667,7 +667,7 @@ int i_APCI1710_InsnReadSSIValue(struct comedi_device * dev, struct comedi_subdev
default: default:
printk("Read Type Inputs Wrong\n"); printk("Read Type Inputs Wrong\n");
} // switch ending } /* switch ending */
} else { } else {
/***********************/ /***********************/
...@@ -826,7 +826,7 @@ int i_APCI1710_InsnBitsSSIDigitalIO(struct comedi_device * dev, struct comedi_su ...@@ -826,7 +826,7 @@ int i_APCI1710_InsnBitsSSIDigitalIO(struct comedi_device * dev, struct comedi_su
default: default:
printk("IO type wrong\n"); printk("IO type wrong\n");
} //switch end } /* switch end */
} else { } else {
/**********************************/ /**********************************/
/* The module is not a SSI module */ /* The module is not a SSI module */
......
...@@ -322,7 +322,7 @@ int i_APCI1710_InsnConfigInitTTLIO(struct comedi_device * dev, struct comedi_sub ...@@ -322,7 +322,7 @@ int i_APCI1710_InsnConfigInitTTLIO(struct comedi_device * dev, struct comedi_sub
DPRINTK("\n"); DPRINTK("\n");
default: default:
printk("Bad Config Type\n"); printk("Bad Config Type\n");
} // switch end } /* switch end */
} else { } else {
/**********************************/ /**********************************/
/* The module is not a TTL module */ /* The module is not a TTL module */
...@@ -610,7 +610,7 @@ int i_APCI1710_InsnBitsReadTTLIO(struct comedi_device * dev, struct comedi_subde ...@@ -610,7 +610,7 @@ int i_APCI1710_InsnBitsReadTTLIO(struct comedi_device * dev, struct comedi_subde
default: default:
printk("Bad ReadType\n"); printk("Bad ReadType\n");
} //End Switch } /* End Switch */
} else { } else {
/**********************************/ /**********************************/
/* The module is not a TTL module */ /* The module is not a TTL module */
...@@ -811,7 +811,7 @@ int i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device *dev,struct comedi ...@@ -811,7 +811,7 @@ int i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device *dev,struct comedi
b_ModulNbr = CR_AREF(insn->chanspec); b_ModulNbr = CR_AREF(insn->chanspec);
b_OutputChannel= CR_CHAN(insn->chanspec); b_OutputChannel= CR_CHAN(insn->chanspec);
ui_State = data[0]; // ON or OFF ui_State = data[0]; /* ON or OFF */
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
| Output Parameters : - | | Output Parameters : - |
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
...@@ -837,7 +837,7 @@ int i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device * dev, ...@@ -837,7 +837,7 @@ int i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device * dev,
i_ReturnValue = insn->n; i_ReturnValue = insn->n;
b_ModulNbr = CR_AREF(insn->chanspec); b_ModulNbr = CR_AREF(insn->chanspec);
b_OutputChannel = CR_CHAN(insn->chanspec); b_OutputChannel = CR_CHAN(insn->chanspec);
ui_State = data[0]; // ON or OFF ui_State = data[0]; /* ON or OFF */
/**************************/ /**************************/
/* Test the module number */ /* Test the module number */
...@@ -953,7 +953,7 @@ int i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device * dev, ...@@ -953,7 +953,7 @@ int i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device * dev,
ui_Address ui_Address
+ +
(64 * b_ModulNbr)); (64 * b_ModulNbr));
if (ui_State) // ON if (ui_State) /* ON */
{ {
dw_StatusReg dw_StatusReg
= =
...@@ -969,7 +969,7 @@ int i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device * dev, ...@@ -969,7 +969,7 @@ int i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device * dev,
(b_OutputChannel (b_OutputChannel
% %
8)); 8));
} else // Off } else /* Off */
{ {
dw_StatusReg dw_StatusReg
= =
......
...@@ -92,15 +92,15 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead, ...@@ -92,15 +92,15 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead,
while (dw_eeprom_busy == EEPROM_BUSY); while (dw_eeprom_busy == EEPROM_BUSY);
for (i_Counter = 0; i_Counter < 2; i_Counter++) { for (i_Counter = 0; i_Counter < 2; i_Counter++) {
b_SelectedAddressLow = (w_EepromStartAddress + i_Counter) % 256; //Read the low 8 bit part b_SelectedAddressLow = (w_EepromStartAddress + i_Counter) % 256; /* Read the low 8 bit part */
b_SelectedAddressHigh = (w_EepromStartAddress + i_Counter) / 256; //Read the high 8 bit part b_SelectedAddressHigh = (w_EepromStartAddress + i_Counter) / 256; /* Read the high 8 bit part */
//Select the load low address mode /* Select the load low address mode */
outb(NVCMD_LOAD_LOW, outb(NVCMD_LOAD_LOW,
dw_PCIBoardEepromAddress + AMCC_OP_REG_MCSR + dw_PCIBoardEepromAddress + AMCC_OP_REG_MCSR +
3); 3);
//Wait on busy /* Wait on busy */
do { do {
dw_eeprom_busy = dw_eeprom_busy =
inl(dw_PCIBoardEepromAddress + inl(dw_PCIBoardEepromAddress +
...@@ -109,12 +109,12 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead, ...@@ -109,12 +109,12 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead,
} }
while (dw_eeprom_busy == EEPROM_BUSY); while (dw_eeprom_busy == EEPROM_BUSY);
//Load the low address /* Load the low address */
outb(b_SelectedAddressLow, outb(b_SelectedAddressLow,
dw_PCIBoardEepromAddress + AMCC_OP_REG_MCSR + dw_PCIBoardEepromAddress + AMCC_OP_REG_MCSR +
2); 2);
//Wait on busy /* Wait on busy */
do { do {
dw_eeprom_busy = dw_eeprom_busy =
inl(dw_PCIBoardEepromAddress + inl(dw_PCIBoardEepromAddress +
...@@ -123,12 +123,12 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead, ...@@ -123,12 +123,12 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead,
} }
while (dw_eeprom_busy == EEPROM_BUSY); while (dw_eeprom_busy == EEPROM_BUSY);
//Select the load high address mode /* Select the load high address mode */
outb(NVCMD_LOAD_HIGH, outb(NVCMD_LOAD_HIGH,
dw_PCIBoardEepromAddress + AMCC_OP_REG_MCSR + dw_PCIBoardEepromAddress + AMCC_OP_REG_MCSR +
3); 3);
//Wait on busy /* Wait on busy */
do { do {
dw_eeprom_busy = dw_eeprom_busy =
inl(dw_PCIBoardEepromAddress + inl(dw_PCIBoardEepromAddress +
...@@ -137,12 +137,12 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead, ...@@ -137,12 +137,12 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead,
} }
while (dw_eeprom_busy == EEPROM_BUSY); while (dw_eeprom_busy == EEPROM_BUSY);
//Load the high address /* Load the high address */
outb(b_SelectedAddressHigh, outb(b_SelectedAddressHigh,
dw_PCIBoardEepromAddress + AMCC_OP_REG_MCSR + dw_PCIBoardEepromAddress + AMCC_OP_REG_MCSR +
2); 2);
//Wait on busy /* Wait on busy */
do { do {
dw_eeprom_busy = dw_eeprom_busy =
inl(dw_PCIBoardEepromAddress + inl(dw_PCIBoardEepromAddress +
...@@ -151,12 +151,12 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead, ...@@ -151,12 +151,12 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead,
} }
while (dw_eeprom_busy == EEPROM_BUSY); while (dw_eeprom_busy == EEPROM_BUSY);
//Select the READ mode /* Select the READ mode */
outb(NVCMD_BEGIN_READ, outb(NVCMD_BEGIN_READ,
dw_PCIBoardEepromAddress + AMCC_OP_REG_MCSR + dw_PCIBoardEepromAddress + AMCC_OP_REG_MCSR +
3); 3);
//Wait on busy /* Wait on busy */
do { do {
dw_eeprom_busy = dw_eeprom_busy =
inl(dw_PCIBoardEepromAddress + inl(dw_PCIBoardEepromAddress +
...@@ -165,12 +165,12 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead, ...@@ -165,12 +165,12 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead,
} }
while (dw_eeprom_busy == EEPROM_BUSY); while (dw_eeprom_busy == EEPROM_BUSY);
//Read data into the EEPROM /* Read data into the EEPROM */
*pb_ReadByte = *pb_ReadByte =
inb(dw_PCIBoardEepromAddress + inb(dw_PCIBoardEepromAddress +
AMCC_OP_REG_MCSR + 2); AMCC_OP_REG_MCSR + 2);
//Wait on busy /* Wait on busy */
do { do {
dw_eeprom_busy = dw_eeprom_busy =
inl(dw_PCIBoardEepromAddress + inl(dw_PCIBoardEepromAddress +
...@@ -179,14 +179,14 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead, ...@@ -179,14 +179,14 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead,
} }
while (dw_eeprom_busy == EEPROM_BUSY); while (dw_eeprom_busy == EEPROM_BUSY);
//Select the upper address part /* Select the upper address part */
if (i_Counter == 0) { if (i_Counter == 0) {
b_ReadLowByte = pb_ReadByte[0]; b_ReadLowByte = pb_ReadByte[0];
} else { } else {
b_ReadHighByte = pb_ReadByte[0]; b_ReadHighByte = pb_ReadByte[0];
} }
//Sleep /* Sleep */
for (i = 0; i < 10000; i++) ; for (i = 0; i < 10000; i++) ;
} }
...@@ -196,8 +196,8 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead, ...@@ -196,8 +196,8 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead,
pw_DataRead[i_WordCounter] = w_ReadWord; pw_DataRead[i_WordCounter] = w_ReadWord;
w_EepromStartAddress += 2; // to read the next word w_EepromStartAddress += 2; /* to read the next word */
} // for (...) i_NbOfWordsToRead } /* for (...) i_NbOfWordsToRead */
return (0); return (0);
} }
...@@ -68,25 +68,25 @@ You shoud also find the complete GPL in the COPYING file accompanying this sourc ...@@ -68,25 +68,25 @@ You shoud also find the complete GPL in the COPYING file accompanying this sourc
#include "addi_common.h" #include "addi_common.h"
#include "addi_amcc_s5933.h" #include "addi_amcc_s5933.h"
//Update-0.7.57->0.7.68MODULE_AUTHOR("ADDI-DATA GmbH <info@addi-data.com>"); /* Update-0.7.57->0.7.68MODULE_AUTHOR("ADDI-DATA GmbH <info@addi-data.com>"); */
//Update-0.7.57->0.7.68MODULE_DESCRIPTION("Comedi ADDI-DATA module"); /* Update-0.7.57->0.7.68MODULE_DESCRIPTION("Comedi ADDI-DATA module"); */
//Update-0.7.57->0.7.68MODULE_LICENSE("GPL"); /* Update-0.7.57->0.7.68MODULE_LICENSE("GPL"); */
#define devpriv ((struct addi_private *)dev->private) #define devpriv ((struct addi_private *)dev->private)
#define this_board ((struct addi_board *)dev->board_ptr) #define this_board ((struct addi_board *)dev->board_ptr)
#if defined(CONFIG_APCI_1710) || defined(CONFIG_APCI_3200) || defined(CONFIG_APCI_3300) #if defined(CONFIG_APCI_1710) || defined(CONFIG_APCI_3200) || defined(CONFIG_APCI_3300)
//BYTE b_SaveFPUReg [94]; /* BYTE b_SaveFPUReg [94]; */
void fpu_begin(void) void fpu_begin(void)
{ {
//asm ("fstenv b_SaveFPUReg"); /* asm ("fstenv b_SaveFPUReg"); */
kernel_fpu_begin(); kernel_fpu_begin();
} }
void fpu_end(void) void fpu_end(void)
{ {
// asm ("frstor b_SaveFPUReg"); /* asm ("frstor b_SaveFPUReg"); */
kernel_fpu_end(); kernel_fpu_end();
} }
#endif #endif
...@@ -901,7 +901,7 @@ static const struct addi_board boardtypes[] = { ...@@ -901,7 +901,7 @@ static const struct addi_board boardtypes[] = {
NULL}, NULL},
#endif #endif
#ifdef CONFIG_APCI_3300 #ifdef CONFIG_APCI_3300
//Begin JK 20.10.2004: APCI-3300 integration /* Begin JK 20.10.2004: APCI-3300 integration */
{"apci3300", {"apci3300",
APCI3200_BOARD_VENDOR_ID, APCI3200_BOARD_VENDOR_ID,
0x3007, 0x3007,
...@@ -2580,10 +2580,10 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i ...@@ -2580,10 +2580,10 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
} }
if (!pci_list_builded) { if (!pci_list_builded) {
v_pci_card_list_init(this_board->i_VendorId, 1); //1 for displaying the list.. v_pci_card_list_init(this_board->i_VendorId, 1); /* 1 for displaying the list.. */
pci_list_builded = 1; pci_list_builded = 1;
} }
//rt_printk("comedi%d: addi_common: board=%s",dev->minor,this_board->pc_DriverName); /* rt_printk("comedi%d: addi_common: board=%s",dev->minor,this_board->pc_DriverName); */
if ((this_board->i_Dma) && (it->options[2] == 0)) { if ((this_board->i_Dma) && (it->options[2] == 0)) {
i_Dma = 1; i_Dma = 1;
...@@ -2617,16 +2617,16 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i ...@@ -2617,16 +2617,16 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
/************************************/ /************************************/
if (this_board->i_IorangeBase1 != 0) { if (this_board->i_IorangeBase1 != 0) {
dev->iobase = (unsigned long)iobase_main; // DAQ base address... dev->iobase = (unsigned long)iobase_main; /* DAQ base address... */
} else { } else {
dev->iobase = (unsigned long)iobase_a; // DAQ base address... dev->iobase = (unsigned long)iobase_a; /* DAQ base address... */
} }
dev->board_name = this_board->pc_DriverName; dev->board_name = this_board->pc_DriverName;
devpriv->amcc = card; devpriv->amcc = card;
devpriv->iobase = (int) dev->iobase; devpriv->iobase = (int) dev->iobase;
devpriv->i_IobaseAmcc = (int) iobase_a; //AMCC base address... devpriv->i_IobaseAmcc = (int) iobase_a; /* AMCC base address... */
devpriv->i_IobaseAddon = (int) iobase_addon; //ADD ON base address.... devpriv->i_IobaseAddon = (int) iobase_addon; /* ADD ON base address.... */
devpriv->i_IobaseReserved = (int) iobase_reserved; devpriv->i_IobaseReserved = (int) iobase_reserved;
devpriv->ps_BoardInfo = this_board; devpriv->ps_BoardInfo = this_board;
} else { } else {
...@@ -2643,7 +2643,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i ...@@ -2643,7 +2643,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
printk("\nioremap end"); printk("\nioremap end");
} }
//## /* ## */
if (irq > 0) { if (irq > 0) {
if (comedi_request_irq(irq, v_ADDI_Interrupt, IRQF_SHARED, if (comedi_request_irq(irq, v_ADDI_Interrupt, IRQF_SHARED,
...@@ -2662,18 +2662,18 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i ...@@ -2662,18 +2662,18 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
it->options[2]); it->options[2]);
dev->irq = irq; dev->irq = irq;
// Read eepeom and fill addi_board Structure /* Read eepeom and fill addi_board Structure */
if (this_board->i_PCIEeprom) { if (this_board->i_PCIEeprom) {
printk("\nPCI Eeprom used"); printk("\nPCI Eeprom used");
if (!(strcmp(this_board->pc_EepromChip, "S5920"))) { if (!(strcmp(this_board->pc_EepromChip, "S5920"))) {
// Set 3 wait stait /* Set 3 wait stait */
if (!(strcmp(this_board->pc_DriverName, "apci035"))) { if (!(strcmp(this_board->pc_DriverName, "apci035"))) {
outl(0x80808082, devpriv->i_IobaseAmcc + 0x60); outl(0x80808082, devpriv->i_IobaseAmcc + 0x60);
} else { } else {
outl(0x83838383, devpriv->i_IobaseAmcc + 0x60); outl(0x83838383, devpriv->i_IobaseAmcc + 0x60);
} }
// Enable the interrupt for the controler /* Enable the interrupt for the controler */
dw_Dummy = inl(devpriv->i_IobaseAmcc + 0x38); dw_Dummy = inl(devpriv->i_IobaseAmcc + 0x38);
outl(dw_Dummy | 0x2000, devpriv->i_IobaseAmcc + 0x38); outl(dw_Dummy | 0x2000, devpriv->i_IobaseAmcc + 0x38);
printk("\nEnable the interrupt for the controler"); printk("\nEnable the interrupt for the controler");
...@@ -2694,7 +2694,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i ...@@ -2694,7 +2694,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
if (this_board->i_Dma) { if (this_board->i_Dma) {
printk("\nDMA used"); printk("\nDMA used");
if (devpriv->us_UseDma == ADDI_ENABLE) { if (devpriv->us_UseDma == ADDI_ENABLE) {
// alloc DMA buffers /* alloc DMA buffers */
devpriv->b_DmaDoubleBuffer = 0; devpriv->b_DmaDoubleBuffer = 0;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
for (pages = 4; pages >= 0; pages--) { for (pages = 4; pages >= 0; pages--) {
...@@ -2739,16 +2739,16 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i ...@@ -2739,16 +2739,16 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
#ifdef CONFIG_APCI_1710 #ifdef CONFIG_APCI_1710
i_ADDI_AttachPCI1710(dev); i_ADDI_AttachPCI1710(dev);
// save base address /* save base address */
devpriv->s_BoardInfos.ui_Address = io_addr[2]; devpriv->s_BoardInfos.ui_Address = io_addr[2];
#endif #endif
} else { } else {
//Update-0.7.57->0.7.68dev->n_subdevices = 7; /* Update-0.7.57->0.7.68dev->n_subdevices = 7; */
n_subdevices = 7; n_subdevices = 7;
if ((ret = alloc_subdevices(dev, n_subdevices)) < 0) if ((ret = alloc_subdevices(dev, n_subdevices)) < 0)
return ret; return ret;
// Allocate and Initialise AI Subdevice Structures /* Allocate and Initialise AI Subdevice Structures */
s = dev->subdevices + 0; s = dev->subdevices + 0;
if ((this_board->i_NbrAiChannel) if ((this_board->i_NbrAiChannel)
|| (this_board->i_NbrAiChannelDiff)) { || (this_board->i_NbrAiChannelDiff)) {
...@@ -2786,7 +2786,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i ...@@ -2786,7 +2786,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} }
// Allocate and Initialise AO Subdevice Structures /* Allocate and Initialise AO Subdevice Structures */
s = dev->subdevices + 1; s = dev->subdevices + 1;
if (this_board->i_NbrAoChannel) { if (this_board->i_NbrAoChannel) {
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
...@@ -2804,7 +2804,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i ...@@ -2804,7 +2804,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
} else { } else {
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} }
// Allocate and Initialise DI Subdevice Structures /* Allocate and Initialise DI Subdevice Structures */
s = dev->subdevices + 2; s = dev->subdevices + 2;
if (this_board->i_NbrDiChannel) { if (this_board->i_NbrDiChannel) {
s->type = COMEDI_SUBD_DI; s->type = COMEDI_SUBD_DI;
...@@ -2824,7 +2824,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i ...@@ -2824,7 +2824,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
} else { } else {
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} }
// Allocate and Initialise DO Subdevice Structures /* Allocate and Initialise DO Subdevice Structures */
s = dev->subdevices + 3; s = dev->subdevices + 3;
if (this_board->i_NbrDoChannel) { if (this_board->i_NbrDoChannel) {
s->type = COMEDI_SUBD_DO; s->type = COMEDI_SUBD_DO;
...@@ -2837,7 +2837,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i ...@@ -2837,7 +2837,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
s->range_table = &range_digital; s->range_table = &range_digital;
s->io_bits = 0xf; /* all bits output */ s->io_bits = 0xf; /* all bits output */
s->insn_config = this_board->i_hwdrv_InsnConfigDigitalOutput; //for digital output memory.. s->insn_config = this_board->i_hwdrv_InsnConfigDigitalOutput; /* for digital output memory.. */
s->insn_write = s->insn_write =
this_board->i_hwdrv_InsnWriteDigitalOutput; this_board->i_hwdrv_InsnWriteDigitalOutput;
s->insn_bits = s->insn_bits =
...@@ -2848,7 +2848,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i ...@@ -2848,7 +2848,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} }
// Allocate and Initialise Timer Subdevice Structures /* Allocate and Initialise Timer Subdevice Structures */
s = dev->subdevices + 4; s = dev->subdevices + 4;
if (this_board->i_Timer) { if (this_board->i_Timer) {
s->type = COMEDI_SUBD_TIMER; s->type = COMEDI_SUBD_TIMER;
...@@ -2868,7 +2868,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i ...@@ -2868,7 +2868,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
} }
// Allocate and Initialise TTL /* Allocate and Initialise TTL */
s = dev->subdevices + 5; s = dev->subdevices + 5;
if (this_board->i_NbrTTLChannel) { if (this_board->i_NbrTTLChannel) {
s->type = COMEDI_SUBD_TTLIO; s->type = COMEDI_SUBD_TTLIO;
...@@ -2965,7 +2965,7 @@ static int i_ADDI_Detach(struct comedi_device * dev) ...@@ -2965,7 +2965,7 @@ static int i_ADDI_Detach(struct comedi_device * dev)
} }
if (pci_list_builded) { if (pci_list_builded) {
//v_pci_card_list_cleanup(PCI_VENDOR_ID_AMCC); /* v_pci_card_list_cleanup(PCI_VENDOR_ID_AMCC); */
v_pci_card_list_cleanup(this_board->i_VendorId); v_pci_card_list_cleanup(this_board->i_VendorId);
pci_list_builded = 0; pci_list_builded = 0;
} }
...@@ -2999,7 +2999,7 @@ static int i_ADDI_Reset(struct comedi_device * dev) ...@@ -2999,7 +2999,7 @@ static int i_ADDI_Reset(struct comedi_device * dev)
return 0; return 0;
} }
// Interrupt function /* Interrupt function */
/* /*
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
| Function name : | | Function name : |
...@@ -3025,7 +3025,7 @@ static irqreturn_t v_ADDI_Interrupt(int irq, void *d) ...@@ -3025,7 +3025,7 @@ static irqreturn_t v_ADDI_Interrupt(int irq, void *d)
return IRQ_RETVAL(1); return IRQ_RETVAL(1);
} }
// EEPROM Read Function /* EEPROM Read Function */
/* /*
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
| Function name : | | Function name : |
...@@ -3051,12 +3051,12 @@ static int i_ADDIDATA_InsnReadEeprom(struct comedi_device * dev, struct comedi_s ...@@ -3051,12 +3051,12 @@ static int i_ADDIDATA_InsnReadEeprom(struct comedi_device * dev, struct comedi_s
{ {
unsigned short w_Data; unsigned short w_Data;
unsigned short w_Address; unsigned short w_Address;
w_Address = CR_CHAN(insn->chanspec); // address to be read as 0,1,2,3...255 w_Address = CR_CHAN(insn->chanspec); /* address to be read as 0,1,2,3...255 */
w_Data = w_EepromReadWord(devpriv->i_IobaseAmcc, w_Data = w_EepromReadWord(devpriv->i_IobaseAmcc,
this_board->pc_EepromChip, 0x100 + (2 * w_Address)); this_board->pc_EepromChip, 0x100 + (2 * w_Address));
data[0] = w_Data; data[0] = w_Data;
//multiplied by 2 bcozinput will be like 0,1,2...255 /* multiplied by 2 bcozinput will be like 0,1,2...255 */
return insn->n; return insn->n;
} }
...@@ -62,36 +62,36 @@ ...@@ -62,36 +62,36 @@
/* structure for the boardtype */ /* structure for the boardtype */
struct addi_board { struct addi_board {
const char *pc_DriverName; // driver name const char *pc_DriverName; /* driver name */
int i_VendorId; //PCI vendor a device ID of card int i_VendorId; /* PCI vendor a device ID of card */
int i_DeviceId; int i_DeviceId;
int i_IorangeBase0; int i_IorangeBase0;
int i_IorangeBase1; int i_IorangeBase1;
int i_IorangeBase2; // base 2 range int i_IorangeBase2; /* base 2 range */
int i_IorangeBase3; // base 3 range int i_IorangeBase3; /* base 3 range */
int i_PCIEeprom; // eeprom present or not int i_PCIEeprom; /* eeprom present or not */
char *pc_EepromChip; // type of chip char *pc_EepromChip; /* type of chip */
int i_NbrAiChannel; // num of A/D chans int i_NbrAiChannel; /* num of A/D chans */
int i_NbrAiChannelDiff; // num of A/D chans in diff mode int i_NbrAiChannelDiff; /* num of A/D chans in diff mode */
int i_AiChannelList; // len of chanlist int i_AiChannelList; /* len of chanlist */
int i_NbrAoChannel; // num of D/A chans int i_NbrAoChannel; /* num of D/A chans */
int i_AiMaxdata; // resolution of A/D int i_AiMaxdata; /* resolution of A/D */
int i_AoMaxdata; // resolution of D/A int i_AoMaxdata; /* resolution of D/A */
const struct comedi_lrange *pr_AiRangelist; /* rangelist for A/D */ const struct comedi_lrange *pr_AiRangelist; /* rangelist for A/D */
const struct comedi_lrange *pr_AoRangelist; /* rangelist for D/A */ const struct comedi_lrange *pr_AoRangelist; /* rangelist for D/A */
int i_NbrDiChannel; // Number of DI channels int i_NbrDiChannel; /* Number of DI channels */
int i_NbrDoChannel; // Number of DO channels int i_NbrDoChannel; /* Number of DO channels */
int i_DoMaxdata; // data to set all chanels high int i_DoMaxdata; /* data to set all chanels high */
int i_NbrTTLChannel; // Number of TTL channels int i_NbrTTLChannel; /* Number of TTL channels */
const struct comedi_lrange *pr_TTLRangelist; /* rangelist for TTL */ const struct comedi_lrange *pr_TTLRangelist; /* rangelist for TTL */
int i_Dma; // dma present or not int i_Dma; /* dma present or not */
int i_Timer; // timer subdevice present or not int i_Timer; /* timer subdevice present or not */
unsigned char b_AvailableConvertUnit; unsigned char b_AvailableConvertUnit;
unsigned int ui_MinAcquisitiontimeNs; // Minimum Acquisition in Nano secs unsigned int ui_MinAcquisitiontimeNs; /* Minimum Acquisition in Nano secs */
unsigned int ui_MinDelaytimeNs; // Minimum Delay in Nano secs unsigned int ui_MinDelaytimeNs; /* Minimum Delay in Nano secs */
/* interrupt and reset */ /* interrupt and reset */
void (*v_hwdrv_Interrupt)(int irq, void *d); void (*v_hwdrv_Interrupt)(int irq, void *d);
...@@ -348,57 +348,57 @@ union str_ModuleInfo { ...@@ -348,57 +348,57 @@ union str_ModuleInfo {
struct addi_private { struct addi_private {
int iobase; int iobase;
int i_IobaseAmcc; // base+size for AMCC chip int i_IobaseAmcc; /* base+size for AMCC chip */
int i_IobaseAddon; //addon base address int i_IobaseAddon; /* addon base address */
int i_IobaseReserved; int i_IobaseReserved;
unsigned long dw_AiBase; unsigned long dw_AiBase;
struct pcilst_struct *amcc; // ptr too AMCC data struct pcilst_struct *amcc; /* ptr too AMCC data */
unsigned char allocated; // we have blocked card unsigned char allocated; /* we have blocked card */
unsigned char b_ValidDriver; // driver is ok unsigned char b_ValidDriver; /* driver is ok */
unsigned char b_AiContinuous; // we do unlimited AI unsigned char b_AiContinuous; /* we do unlimited AI */
unsigned char b_AiInitialisation; unsigned char b_AiInitialisation;
unsigned int ui_AiActualScan; //how many scans we finished unsigned int ui_AiActualScan; /* how many scans we finished */
unsigned int ui_AiBufferPtr; // data buffer ptr in samples unsigned int ui_AiBufferPtr; /* data buffer ptr in samples */
unsigned int ui_AiNbrofChannels; // how many channels is measured unsigned int ui_AiNbrofChannels; /* how many channels is measured */
unsigned int ui_AiScanLength; // Length of actual scanlist unsigned int ui_AiScanLength; /* Length of actual scanlist */
unsigned int ui_AiActualScanPosition; // position in actual scan unsigned int ui_AiActualScanPosition; /* position in actual scan */
unsigned int * pui_AiChannelList; // actual chanlist unsigned int * pui_AiChannelList; /* actual chanlist */
unsigned int ui_AiChannelList[32]; // actual chanlist unsigned int ui_AiChannelList[32]; /* actual chanlist */
unsigned char b_AiChannelConfiguration[32]; // actual chanlist unsigned char b_AiChannelConfiguration[32]; /* actual chanlist */
unsigned int ui_AiReadData[32]; unsigned int ui_AiReadData[32];
unsigned int dw_AiInitialised; unsigned int dw_AiInitialised;
unsigned int ui_AiTimer0; //Timer Constant for Timer0 unsigned int ui_AiTimer0; /* Timer Constant for Timer0 */
unsigned int ui_AiTimer1; //Timer constant for Timer1 unsigned int ui_AiTimer1; /* Timer constant for Timer1 */
unsigned int ui_AiFlags; unsigned int ui_AiFlags;
unsigned int ui_AiDataLength; unsigned int ui_AiDataLength;
short *AiData; // Pointer to sample data short *AiData; /* Pointer to sample data */
unsigned int ui_AiNbrofScans; // number of scans to do unsigned int ui_AiNbrofScans; /* number of scans to do */
unsigned short us_UseDma; // To use Dma or not unsigned short us_UseDma; /* To use Dma or not */
unsigned char b_DmaDoubleBuffer; // we can use double buffering unsigned char b_DmaDoubleBuffer; /* we can use double buffering */
unsigned int ui_DmaActualBuffer; // which buffer is used now unsigned int ui_DmaActualBuffer; /* which buffer is used now */
/* UPDATE-0.7.57->0.7.68 */ /* UPDATE-0.7.57->0.7.68 */
/* unsigned int ul_DmaBufferVirtual[2]; pointers to begin of DMA buffer */ /* unsigned int ul_DmaBufferVirtual[2]; pointers to begin of DMA buffer */
short *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 ul_DmaBufferHw[2]; /* hw address of DMA buff */
unsigned int ui_DmaBufferSize[2]; // size of dma buffer in bytes 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_DmaBufferUsesize[2]; /* which size we may now used for transfer */
unsigned int ui_DmaBufferSamples[2]; // size in samples unsigned int ui_DmaBufferSamples[2]; /* size in samples */
unsigned int ui_DmaBufferPages[2]; // number of pages in buffer unsigned int ui_DmaBufferPages[2]; /* number of pages in buffer */
unsigned char b_DigitalOutputRegister; // Digital Output Register unsigned char b_DigitalOutputRegister; /* Digital Output Register */
unsigned char b_OutputMemoryStatus; unsigned char b_OutputMemoryStatus;
unsigned char b_AnalogInputChannelNbr; // Analog input channel Nbr unsigned char b_AnalogInputChannelNbr; /* Analog input channel Nbr */
unsigned char b_AnalogOutputChannelNbr; // Analog input Output Nbr unsigned char b_AnalogOutputChannelNbr; /* Analog input Output Nbr */
unsigned char b_TimerSelectMode; // Contain data written at iobase + 0C unsigned char b_TimerSelectMode; /* Contain data written at iobase + 0C */
unsigned char b_ModeSelectRegister; // Contain data written at iobase + 0E unsigned char b_ModeSelectRegister; /* Contain data written at iobase + 0E */
unsigned short us_OutputRegister; // Contain data written at iobase + 0 unsigned short us_OutputRegister; /* Contain data written at iobase + 0 */
unsigned char b_InterruptState; unsigned char b_InterruptState;
unsigned char b_TimerInit; // Specify if InitTimerWatchdog was load unsigned char b_TimerInit; /* Specify if InitTimerWatchdog was load */
unsigned char b_TimerStarted; // Specify if timer 2 is running or not unsigned char b_TimerStarted; /* Specify if timer 2 is running or not */
unsigned char b_Timer2Mode; // Specify the timer 2 mode unsigned char b_Timer2Mode; /* Specify the timer 2 mode */
unsigned char b_Timer2Interrupt; //Timer2 interrupt enable or disable unsigned char b_Timer2Interrupt; /* Timer2 interrupt enable or disable */
unsigned char b_AiCyclicAcquisition; // indicate cyclic acquisition unsigned char b_AiCyclicAcquisition; /* indicate cyclic acquisition */
unsigned char b_InterruptMode; // eoc eos or dma unsigned char b_InterruptMode; /* eoc eos or dma */
unsigned char b_EocEosInterrupt; // Enable disable eoc eos interrupt unsigned char b_EocEosInterrupt; /* Enable disable eoc eos interrupt */
unsigned int ui_EocEosConversionTime; unsigned int ui_EocEosConversionTime;
unsigned char b_EocEosConversionTimeBase; unsigned char b_EocEosConversionTimeBase;
unsigned char b_SingelDiff; unsigned char b_SingelDiff;
......
...@@ -45,11 +45,11 @@ You shoud also find the complete GPL in the COPYING file accompanying this sourc ...@@ -45,11 +45,11 @@ You shoud also find the complete GPL in the COPYING file accompanying this sourc
+----------+-----------+------------------------------------------------+ +----------+-----------+------------------------------------------------+
*/ */
#define NVCMD_BEGIN_READ (0x7 << 5 ) // nvRam begin read command #define NVCMD_BEGIN_READ (0x7 << 5 ) /* nvRam begin read command */
#define NVCMD_LOAD_LOW (0x4 << 5 ) // nvRam load low command #define NVCMD_LOAD_LOW (0x4 << 5 ) /* nvRam load low command */
#define NVCMD_LOAD_HIGH (0x5 << 5 ) // nvRam load high command #define NVCMD_LOAD_HIGH (0x5 << 5 ) /* nvRam load high command */
#define EE76_CMD_LEN 13 // bits in instructions #define EE76_CMD_LEN 13 /* bits in instructions */
#define EE_READ 0x0180 // 01 1000 0000 read instruction #define EE_READ 0x0180 /* 01 1000 0000 read instruction */
#define EEPROM_DIGITALINPUT 0 #define EEPROM_DIGITALINPUT 0
#define EEPROM_DIGITALOUTPUT 1 #define EEPROM_DIGITALOUTPUT 1
...@@ -82,13 +82,13 @@ struct str_DigitalOutputHeader { ...@@ -82,13 +82,13 @@ struct str_DigitalOutputHeader {
}; };
// used for timer as well as watchdog /* used for timer as well as watchdog */
struct str_TimerDetails { struct str_TimerDetails {
unsigned short w_HeaderSize; unsigned short w_HeaderSize;
unsigned char b_Resolution; unsigned char b_Resolution;
unsigned char b_Mode; // in case of Watchdog it is functionality unsigned char b_Mode; /* in case of Watchdog it is functionality */
unsigned short w_MinTiming; unsigned short w_MinTiming;
unsigned char b_TimeBase; unsigned char b_TimeBase;
}; };
...@@ -97,7 +97,7 @@ struct str_TimerMainHeader { ...@@ -97,7 +97,7 @@ struct str_TimerMainHeader {
unsigned short w_Ntimer; unsigned short w_Ntimer;
struct str_TimerDetails s_TimerDetails[4]; // supports 4 timers struct str_TimerDetails s_TimerDetails[4]; /* supports 4 timers */
}; };
...@@ -206,9 +206,9 @@ unsigned short w_EepromReadWord(unsigned short w_PCIBoardEepromAddress, char *pc ...@@ -206,9 +206,9 @@ unsigned short w_EepromReadWord(unsigned short w_PCIBoardEepromAddress, char *pc
for (b_Counter = 0; b_Counter < 2; b_Counter++) for (b_Counter = 0; b_Counter < 2; b_Counter++)
{ {
b_SelectedAddressLow = (w_EepromStartAddress + b_Counter) % 256; //Read the low 8 bit part b_SelectedAddressLow = (w_EepromStartAddress + b_Counter) % 256; /* Read the low 8 bit part */
b_SelectedAddressHigh = (w_EepromStartAddress + b_Counter) / 256; //Read the high 8 bit part b_SelectedAddressHigh = (w_EepromStartAddress + b_Counter) / 256; /* Read the high 8 bit part */
/************************************/ /************************************/
...@@ -319,20 +319,20 @@ unsigned short w_EepromReadWord(unsigned short w_PCIBoardEepromAddress, char *pc ...@@ -319,20 +319,20 @@ unsigned short w_EepromReadWord(unsigned short w_PCIBoardEepromAddress, char *pc
b_ReadLowByte = b_ReadByte; b_ReadLowByte = b_ReadByte;
} // if(b_Counter==0) } /* if(b_Counter==0) */
else else
{ {
b_ReadHighByte = b_ReadByte; b_ReadHighByte = b_ReadByte;
} // if(b_Counter==0) } /* if(b_Counter==0) */
} // for (b_Counter=0; b_Counter<2; b_Counter++) } /* for (b_Counter=0; b_Counter<2; b_Counter++) */
w_ReadWord = (b_ReadLowByte | (((unsigned short) b_ReadHighByte) * 256)); w_ReadWord = (b_ReadLowByte | (((unsigned short) b_ReadHighByte) * 256));
} // end of if ((!strcmp(pc_PCIChipInformation, "S5920")) || (!strcmp(pc_PCIChipInformation, "S5933"))) } /* end of if ((!strcmp(pc_PCIChipInformation, "S5920")) || (!strcmp(pc_PCIChipInformation, "S5933"))) */
if (!strcmp(pc_PCIChipInformation, "93C76")) if (!strcmp(pc_PCIChipInformation, "93C76"))
{ {
...@@ -902,15 +902,15 @@ int i_EepromReadMainHeader(unsigned short w_PCIBoardEepromAddress, ...@@ -902,15 +902,15 @@ int i_EepromReadMainHeader(unsigned short w_PCIBoardEepromAddress,
break; break;
case EEPROM_TIMER: case EEPROM_TIMER:
this_board->i_Timer = 1; //Timer subdevice present this_board->i_Timer = 1; /* Timer subdevice present */
break; break;
case EEPROM_WATCHDOG: case EEPROM_WATCHDOG:
this_board->i_Timer = 1; //Timer subdevice present this_board->i_Timer = 1; /* Timer subdevice present */
break; break;
case EEPROM_TIMER_WATCHDOG_COUNTER: case EEPROM_TIMER_WATCHDOG_COUNTER:
this_board->i_Timer = 1; //Timer subdevice present this_board->i_Timer = 1; /* Timer subdevice present */
} }
} }
...@@ -944,17 +944,17 @@ int i_EepromReadDigitalInputHeader(unsigned short w_PCIBoardEepromAddress, ...@@ -944,17 +944,17 @@ int i_EepromReadDigitalInputHeader(unsigned short w_PCIBoardEepromAddress,
{ {
unsigned short w_Temp; unsigned short w_Temp;
// read nbr of channels /* read nbr of channels */
s_Header->w_Nchannel = s_Header->w_Nchannel =
w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation, w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation,
0x100 + w_Address + 6); 0x100 + w_Address + 6);
// interruptible or not /* interruptible or not */
w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress, w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress,
pc_PCIChipInformation, 0x100 + w_Address + 8); pc_PCIChipInformation, 0x100 + w_Address + 8);
s_Header->b_Interruptible = (unsigned char) (w_Temp >> 7) & 0x01; s_Header->b_Interruptible = (unsigned char) (w_Temp >> 7) & 0x01;
// How many interruptible logic /* How many interruptible logic */
s_Header->w_NinterruptLogic = s_Header->w_NinterruptLogic =
w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation, w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation,
0x100 + w_Address + 10); 0x100 + w_Address + 10);
...@@ -987,7 +987,7 @@ int i_EepromReadDigitalOutputHeader(unsigned short w_PCIBoardEepromAddress, ...@@ -987,7 +987,7 @@ int i_EepromReadDigitalOutputHeader(unsigned short w_PCIBoardEepromAddress,
char *pc_PCIChipInformation, unsigned short w_Address, char *pc_PCIChipInformation, unsigned short w_Address,
struct str_DigitalOutputHeader * s_Header) struct str_DigitalOutputHeader * s_Header)
{ {
// Read Nbr channels /* Read Nbr channels */
s_Header->w_Nchannel = s_Header->w_Nchannel =
w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation, w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation,
0x100 + w_Address + 6); 0x100 + w_Address + 6);
...@@ -1021,11 +1021,11 @@ int i_EepromReadTimerHeader(unsigned short w_PCIBoardEepromAddress, ...@@ -1021,11 +1021,11 @@ int i_EepromReadTimerHeader(unsigned short w_PCIBoardEepromAddress,
unsigned short i, w_Size = 0, w_Temp; unsigned short i, w_Size = 0, w_Temp;
//Read No of Timer /* Read No of Timer */
s_Header->w_Ntimer = s_Header->w_Ntimer =
w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation, w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation,
0x100 + w_Address + 6); 0x100 + w_Address + 6);
//Read header size /* Read header size */
for (i = 0; i < s_Header->w_Ntimer; i++) { for (i = 0; i < s_Header->w_Ntimer; i++) {
s_Header->s_TimerDetails[i].w_HeaderSize = s_Header->s_TimerDetails[i].w_HeaderSize =
...@@ -1036,11 +1036,11 @@ int i_EepromReadTimerHeader(unsigned short w_PCIBoardEepromAddress, ...@@ -1036,11 +1036,11 @@ int i_EepromReadTimerHeader(unsigned short w_PCIBoardEepromAddress,
pc_PCIChipInformation, pc_PCIChipInformation,
0x100 + w_Address + 8 + w_Size + 2); 0x100 + w_Address + 8 + w_Size + 2);
//Read Resolution /* Read Resolution */
s_Header->s_TimerDetails[i].b_Resolution = s_Header->s_TimerDetails[i].b_Resolution =
(unsigned char) (w_Temp >> 10) & 0x3F; (unsigned char) (w_Temp >> 10) & 0x3F;
//Read Mode /* Read Mode */
s_Header->s_TimerDetails[i].b_Mode = s_Header->s_TimerDetails[i].b_Mode =
(unsigned char) (w_Temp >> 4) & 0x3F; (unsigned char) (w_Temp >> 4) & 0x3F;
...@@ -1048,10 +1048,10 @@ int i_EepromReadTimerHeader(unsigned short w_PCIBoardEepromAddress, ...@@ -1048,10 +1048,10 @@ int i_EepromReadTimerHeader(unsigned short w_PCIBoardEepromAddress,
pc_PCIChipInformation, pc_PCIChipInformation,
0x100 + w_Address + 8 + w_Size + 4); 0x100 + w_Address + 8 + w_Size + 4);
//Read MinTiming /* Read MinTiming */
s_Header->s_TimerDetails[i].w_MinTiming = (w_Temp >> 6) & 0x3FF; s_Header->s_TimerDetails[i].w_MinTiming = (w_Temp >> 6) & 0x3FF;
//Read Timebase /* Read Timebase */
s_Header->s_TimerDetails[i].b_TimeBase = (unsigned char) (w_Temp) & 0x3F; s_Header->s_TimerDetails[i].b_TimeBase = (unsigned char) (w_Temp) & 0x3F;
w_Size += s_Header->s_TimerDetails[i].w_HeaderSize; w_Size += s_Header->s_TimerDetails[i].w_HeaderSize;
} }
...@@ -1085,11 +1085,11 @@ int i_EepromReadAnlogOutputHeader(unsigned short w_PCIBoardEepromAddress, ...@@ -1085,11 +1085,11 @@ int i_EepromReadAnlogOutputHeader(unsigned short w_PCIBoardEepromAddress,
str_AnalogOutputHeader * s_Header) str_AnalogOutputHeader * s_Header)
{ {
unsigned short w_Temp; unsigned short w_Temp;
// No of channels for 1st hard component /* No of channels for 1st hard component */
w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress, w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress,
pc_PCIChipInformation, 0x100 + w_Address + 10); pc_PCIChipInformation, 0x100 + w_Address + 10);
s_Header->w_Nchannel = (w_Temp >> 4) & 0x03FF; s_Header->w_Nchannel = (w_Temp >> 4) & 0x03FF;
// Resolution for 1st hard component /* Resolution for 1st hard component */
w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress, w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress,
pc_PCIChipInformation, 0x100 + w_Address + 16); pc_PCIChipInformation, 0x100 + w_Address + 16);
s_Header->b_Resolution = (unsigned char) (w_Temp >> 8) & 0xFF; s_Header->b_Resolution = (unsigned char) (w_Temp >> 8) & 0xFF;
...@@ -1117,7 +1117,7 @@ int i_EepromReadAnlogOutputHeader(unsigned short w_PCIBoardEepromAddress, ...@@ -1117,7 +1117,7 @@ int i_EepromReadAnlogOutputHeader(unsigned short w_PCIBoardEepromAddress,
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
// Reads only for ONE hardware component /* Reads only for ONE hardware component */
int i_EepromReadAnlogInputHeader(unsigned short w_PCIBoardEepromAddress, int i_EepromReadAnlogInputHeader(unsigned short w_PCIBoardEepromAddress,
char *pc_PCIChipInformation, unsigned short w_Address, char *pc_PCIChipInformation, unsigned short w_Address,
struct str_AnalogInputHeader * s_Header) struct str_AnalogInputHeader * s_Header)
...@@ -1134,24 +1134,24 @@ int i_EepromReadAnlogInputHeader(unsigned short w_PCIBoardEepromAddress, ...@@ -1134,24 +1134,24 @@ int i_EepromReadAnlogInputHeader(unsigned short w_PCIBoardEepromAddress,
0x100 + w_Address + 30); 0x100 + w_Address + 30);
w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress, w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress,
pc_PCIChipInformation, 0x100 + w_Address + 20); pc_PCIChipInformation, 0x100 + w_Address + 20);
s_Header->b_HasDma = (w_Temp >> 13) & 0x01; // whether dma present or not s_Header->b_HasDma = (w_Temp >> 13) & 0x01; /* whether dma present or not */
w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation, 0x100 + w_Address + 72); // reading Y w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation, 0x100 + w_Address + 72); /* reading Y */
w_Temp = w_Temp & 0x00FF; w_Temp = w_Temp & 0x00FF;
if (w_Temp) //Y>0 if (w_Temp) /* Y>0 */
{ {
w_Offset = 74 + (2 * w_Temp) + (10 * (1 + (w_Temp / 16))); // offset of first analog input single header w_Offset = 74 + (2 * w_Temp) + (10 * (1 + (w_Temp / 16))); /* offset of first analog input single header */
w_Offset = w_Offset + 2; // resolution w_Offset = w_Offset + 2; /* resolution */
} else //Y=0 } else /* Y=0 */
{ {
w_Offset = 74; w_Offset = 74;
w_Offset = w_Offset + 2; // resolution w_Offset = w_Offset + 2; /* resolution */
} }
// read Resolution /* read Resolution */
w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress, w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress,
pc_PCIChipInformation, 0x100 + w_Address + w_Offset); pc_PCIChipInformation, 0x100 + w_Address + w_Offset);
s_Header->b_Resolution = w_Temp & 0x001F; // last 5 bits s_Header->b_Resolution = w_Temp & 0x001F; /* last 5 bits */
return 0; return 0;
} }
...@@ -31,15 +31,15 @@ ...@@ -31,15 +31,15 @@
*************************/ *************************/
#define FIFO_ADVANCE_ON_BYTE_2 0x20000000 // written on base0 #define FIFO_ADVANCE_ON_BYTE_2 0x20000000 /* written on base0 */
#define AMWEN_ENABLE 0x02 // added for step 6 dma written on base2 #define AMWEN_ENABLE 0x02 /* added for step 6 dma written on base2 */
#define A2P_FIFO_WRITE_ENABLE 0x01 #define A2P_FIFO_WRITE_ENABLE 0x01
#define AGCSTS_TC_ENABLE 0x10000000 // Added for transfer count enable bit #define AGCSTS_TC_ENABLE 0x10000000 /* Added for transfer count enable bit */
// ADDON RELATED ADDITIONS /* ADDON RELATED ADDITIONS */
// Constant /* Constant */
#define APCI3120_ENABLE_TRANSFER_ADD_ON_LOW 0x00 #define APCI3120_ENABLE_TRANSFER_ADD_ON_LOW 0x00
#define APCI3120_ENABLE_TRANSFER_ADD_ON_HIGH 0x1200 #define APCI3120_ENABLE_TRANSFER_ADD_ON_HIGH 0x1200
#define APCI3120_A2P_FIFO_MANAGEMENT 0x04000400L #define APCI3120_A2P_FIFO_MANAGEMENT 0x04000400L
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#define APCI3120_DISABLE_BUS_MASTER_ADD_ON 0x0 #define APCI3120_DISABLE_BUS_MASTER_ADD_ON 0x0
#define APCI3120_DISABLE_BUS_MASTER_PCI 0x0 #define APCI3120_DISABLE_BUS_MASTER_PCI 0x0
// ADD_ON ::: this needed since apci supports 16 bit interface to add on /* ADD_ON ::: this needed since apci supports 16 bit interface to add on */
#define APCI3120_ADD_ON_AGCSTS_LOW 0x3C #define APCI3120_ADD_ON_AGCSTS_LOW 0x3C
#define APCI3120_ADD_ON_AGCSTS_HIGH APCI3120_ADD_ON_AGCSTS_LOW + 2 #define APCI3120_ADD_ON_AGCSTS_HIGH APCI3120_ADD_ON_AGCSTS_LOW + 2
#define APCI3120_ADD_ON_MWAR_LOW 0x24 #define APCI3120_ADD_ON_MWAR_LOW 0x24
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
#define APCI3120_ADD_ON_MWTC_LOW 0x058 #define APCI3120_ADD_ON_MWTC_LOW 0x058
#define APCI3120_ADD_ON_MWTC_HIGH APCI3120_ADD_ON_MWTC_LOW + 2 #define APCI3120_ADD_ON_MWTC_HIGH APCI3120_ADD_ON_MWTC_LOW + 2
// AMCC /* AMCC */
#define APCI3120_AMCC_OP_MCSR 0x3C #define APCI3120_AMCC_OP_MCSR 0x3C
#define APCI3120_AMCC_OP_REG_INTCSR 0x38 #define APCI3120_AMCC_OP_REG_INTCSR 0x38
...@@ -212,7 +212,7 @@ struct pcilst_struct { ...@@ -212,7 +212,7 @@ struct pcilst_struct {
unsigned int irq; unsigned int irq;
}; };
struct pcilst_struct *amcc_devices; // ptr to root list of all amcc devices struct pcilst_struct *amcc_devices; /* ptr to root list of all amcc devices */
/****************************************************************************/ /****************************************************************************/
...@@ -267,7 +267,7 @@ void v_pci_card_list_init(unsigned short pci_vendor, char display) ...@@ -267,7 +267,7 @@ void v_pci_card_list_init(unsigned short pci_vendor, char display)
amcc->vendor = pcidev->vendor; amcc->vendor = pcidev->vendor;
amcc->device = pcidev->device; amcc->device = pcidev->device;
#if 0 #if 0
amcc->master = pcidev->master; // how get this information under 2.4 kernels? amcc->master = pcidev->master; /* how get this information under 2.4 kernels? */
#endif #endif
amcc->pci_bus = pcidev->bus->number; amcc->pci_bus = pcidev->bus->number;
amcc->pci_slot = PCI_SLOT(pcidev->devfn); amcc->pci_slot = PCI_SLOT(pcidev->devfn);
...@@ -333,17 +333,17 @@ int i_find_free_pci_card_by_position(unsigned short vendor_id, ...@@ -333,17 +333,17 @@ int i_find_free_pci_card_by_position(unsigned short vendor_id,
&& (amcc->pci_slot == pci_slot)) { && (amcc->pci_slot == pci_slot)) {
if (!(amcc->used)) { if (!(amcc->used)) {
*card = amcc; *card = amcc;
return 0; // ok, card is found return 0; /* ok, card is found */
} else { } else {
rt_printk rt_printk
(" - \nCard on requested position is used b:s %d:%d!\n", (" - \nCard on requested position is used b:s %d:%d!\n",
pci_bus, pci_slot); pci_bus, pci_slot);
return 2; // card exist but is used return 2; /* card exist but is used */
} }
} }
} }
return 1; // no card found return 1; /* no card found */
} }
/****************************************************************************/ /****************************************************************************/
...@@ -422,7 +422,7 @@ struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_id, ...@@ -422,7 +422,7 @@ struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_id,
{ {
struct pcilst_struct *card; struct pcilst_struct *card;
if ((pci_bus < 1) & (pci_slot < 1)) { // use autodetection if ((pci_bus < 1) & (pci_slot < 1)) { /* use autodetection */
if ((card = ptr_find_free_pci_card_by_device(vendor_id, if ((card = ptr_find_free_pci_card_by_device(vendor_id,
device_id)) == device_id)) ==
NULL) { NULL) {
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#define APCI1710_SYNCHRONOUS_MODE 1 #define APCI1710_SYNCHRONOUS_MODE 1
#define APCI1710_ASYNCHRONOUS_MODE 0 #define APCI1710_ASYNCHRONOUS_MODE 0
//MODULE INFO STRUCTURE /* MODULE INFO STRUCTURE */
static const struct comedi_lrange range_apci1710_ttl = { 4, { static const struct comedi_lrange range_apci1710_ttl = { 4, {
BIP_RANGE(10), BIP_RANGE(10),
......
...@@ -124,9 +124,9 @@ int i_APCI035_ConfigTimerWatchdog(struct comedi_device * dev, struct comedi_subd ...@@ -124,9 +124,9 @@ int i_APCI035_ConfigTimerWatchdog(struct comedi_device * dev, struct comedi_subd
} else { } else {
ui_Mode = 0; ui_Mode = 0;
} }
//ui_Command = inl(devpriv->iobase+((i_WatchdogNbr-1)*32)+12); /* ui_Command = inl(devpriv->iobase+((i_WatchdogNbr-1)*32)+12); */
ui_Command = 0; ui_Command = 0;
//ui_Command = ui_Command & 0xFFFFF9FEUL; /* ui_Command = ui_Command & 0xFFFFF9FEUL; */
outl(ui_Command, devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12); outl(ui_Command, devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12);
ui_Command = 0; ui_Command = 0;
ui_Command = inl(devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12); ui_Command = inl(devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12);
...@@ -153,7 +153,7 @@ int i_APCI035_ConfigTimerWatchdog(struct comedi_device * dev, struct comedi_subd ...@@ -153,7 +153,7 @@ int i_APCI035_ConfigTimerWatchdog(struct comedi_device * dev, struct comedi_subd
ui_Command = ui_Command =
(ui_Command & 0xFFF719E2UL) | ui_Mode << 13UL | 0x10UL; (ui_Command & 0xFFF719E2UL) | ui_Mode << 13UL | 0x10UL;
} //if (data[0] == ADDIDATA_TIMER) } /* if (data[0] == ADDIDATA_TIMER) */
else { else {
if (data[0] == ADDIDATA_WATCHDOG) { if (data[0] == ADDIDATA_WATCHDOG) {
...@@ -292,7 +292,7 @@ int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device * dev, ...@@ -292,7 +292,7 @@ int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device * dev,
ui_Command = (ui_Command & 0xFFFFF9FFUL) | 0x1UL; ui_Command = (ui_Command & 0xFFFFF9FFUL) | 0x1UL;
outl(ui_Command, outl(ui_Command,
devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12); devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12);
} // if (data[0]==1) } /* if (data[0]==1) */
if (data[0] == 2) { if (data[0] == 2) {
ui_Command = ui_Command =
inl(devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12); inl(devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12);
...@@ -304,16 +304,18 @@ int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device * dev, ...@@ -304,16 +304,18 @@ int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device * dev,
devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12); devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12);
} }
if (data[0] == 0) //Stop The Watchdog if (data[0] == 0) /* Stop The Watchdog */
{ {
//Stop The Watchdog /* Stop The Watchdog */
ui_Command = 0; ui_Command = 0;
//ui_Command = inl(devpriv->iobase+((i_WatchdogNbr-1)*32)+12); /*
//ui_Command = ui_Command & 0xFFFFF9FEUL; * ui_Command = inl(devpriv->iobase+((i_WatchdogNbr-1)*32)+12);
* ui_Command = ui_Command & 0xFFFFF9FEUL;
*/
outl(ui_Command, outl(ui_Command,
devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12); devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12);
} // if (data[1]==0) } /* if (data[1]==0) */
if (data[0] == 3) //stop all Watchdogs if (data[0] == 3) /* stop all Watchdogs */
{ {
ui_Command = 0; ui_Command = 0;
for (i_Count = 1; i_Count <= 4; i_Count++) { for (i_Count = 1; i_Count <= 4; i_Count++) {
...@@ -329,7 +331,7 @@ int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device * dev, ...@@ -329,7 +331,7 @@ int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device * dev,
} }
} }
if (data[0] == 4) //start all Watchdogs if (data[0] == 4) /* start all Watchdogs */
{ {
ui_Command = 0; ui_Command = 0;
for (i_Count = 1; i_Count <= 4; i_Count++) { for (i_Count = 1; i_Count <= 4; i_Count++) {
...@@ -344,7 +346,7 @@ int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device * dev, ...@@ -344,7 +346,7 @@ int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device * dev,
0); 0);
} }
} }
if (data[0] == 5) //trigger all Watchdogs if (data[0] == 5) /* trigger all Watchdogs */
{ {
ui_Command = 0; ui_Command = 0;
for (i_Count = 1; i_Count <= 4; i_Count++) { for (i_Count = 1; i_Count <= 4; i_Count++) {
...@@ -394,7 +396,7 @@ int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device * dev, ...@@ -394,7 +396,7 @@ int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device * dev,
int i_APCI035_ReadTimerWatchdog(struct comedi_device * dev, struct comedi_subdevice * s, int i_APCI035_ReadTimerWatchdog(struct comedi_device * dev, struct comedi_subdevice * s,
struct comedi_insn * insn, unsigned int * data) struct comedi_insn * insn, unsigned int * data)
{ {
unsigned int ui_Status = 0; // Status register unsigned int ui_Status = 0; /* Status register */
i_WatchdogNbr = insn->unused[0]; i_WatchdogNbr = insn->unused[0];
/******************/ /******************/
/* Get the status */ /* Get the status */
...@@ -419,7 +421,7 @@ int i_APCI035_ReadTimerWatchdog(struct comedi_device * dev, struct comedi_subdev ...@@ -419,7 +421,7 @@ int i_APCI035_ReadTimerWatchdog(struct comedi_device * dev, struct comedi_subdev
if (devpriv->b_TimerSelectMode == ADDIDATA_TIMER) { if (devpriv->b_TimerSelectMode == ADDIDATA_TIMER) {
data[4] = inl(devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 0); data[4] = inl(devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 0);
} // if (devpriv->b_TimerSelectMode==ADDIDATA_TIMER) } /* if (devpriv->b_TimerSelectMode==ADDIDATA_TIMER) */
return insn->n; return insn->n;
} }
...@@ -524,9 +526,9 @@ int i_APCI035_Reset(struct comedi_device * dev) ...@@ -524,9 +526,9 @@ int i_APCI035_Reset(struct comedi_device * dev)
int i_Count = 0; int i_Count = 0;
for (i_Count = 1; i_Count <= 4; i_Count++) { for (i_Count = 1; i_Count <= 4; i_Count++) {
i_WatchdogNbr = i_Count; i_WatchdogNbr = i_Count;
outl(0x0, devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 0); //stop all timers outl(0x0, devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 0); /* stop all timers */
} }
outl(0x0, devpriv->iobase + 128 + 12); //Disable the warning delay outl(0x0, devpriv->iobase + 128 + 12); /* Disable the warning delay */
return 0; return 0;
} }
...@@ -571,7 +573,7 @@ static void v_APCI035_Interrupt(int irq, void *d) ...@@ -571,7 +573,7 @@ static void v_APCI035_Interrupt(int irq, void *d)
ui_StatusRegister2 = ui_StatusRegister2 =
inl(devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 20); inl(devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 20);
if ((((ui_StatusRegister1) & 0x8) == 0x8)) //Test if warning relay interrupt if ((((ui_StatusRegister1) & 0x8) == 0x8)) /* Test if warning relay interrupt */
{ {
/**********************************/ /**********************************/
/* Disable the temperature warning */ /* Disable the temperature warning */
...@@ -587,14 +589,14 @@ static void v_APCI035_Interrupt(int irq, void *d) ...@@ -587,14 +589,14 @@ static void v_APCI035_Interrupt(int irq, void *d)
/* Read the digital temperature value */ /* Read the digital temperature value */
/**************************************/ /**************************************/
ui_DigitalTemperature = inl(devpriv->iobase + 128 + 60); ui_DigitalTemperature = inl(devpriv->iobase + 128 + 60);
send_sig(SIGIO, devpriv->tsk_Current, 0); // send signal to the sample send_sig(SIGIO, devpriv->tsk_Current, 0); /* send signal to the sample */
} //if (((ui_StatusRegister1 & 0x8) == 0x8)) } /* if (((ui_StatusRegister1 & 0x8) == 0x8)) */
else { else {
if ((ui_StatusRegister2 & 0x1) == 0x1) { if ((ui_StatusRegister2 & 0x1) == 0x1) {
send_sig(SIGIO, devpriv->tsk_Current, 0); // send signal to the sample send_sig(SIGIO, devpriv->tsk_Current, 0); /* send signal to the sample */
} }
} //else if (((ui_StatusRegister1 & 0x8) == 0x8)) } /* else if (((ui_StatusRegister1 & 0x8) == 0x8)) */
return; return;
} }
...@@ -53,7 +53,7 @@ You shoud also find the complete GPL in the COPYING file accompanying this sourc ...@@ -53,7 +53,7 @@ You shoud also find the complete GPL in the COPYING file accompanying this sourc
*/ */
#include "hwdrv_apci1032.h" #include "hwdrv_apci1032.h"
#include <linux/delay.h> #include <linux/delay.h>
//Global variables /* Global variables */
unsigned int ui_InterruptStatus = 0; unsigned int ui_InterruptStatus = 0;
/* /*
...@@ -107,11 +107,11 @@ int i_APCI1032_ConfigDigitalInput(struct comedi_device * dev, struct comedi_subd ...@@ -107,11 +107,11 @@ int i_APCI1032_ConfigDigitalInput(struct comedi_device * dev, struct comedi_subd
outl(0x4, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); outl(0x4, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
ui_TmpValue = ui_TmpValue =
inl(devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); inl(devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
} //if (data[1] == ADDIDATA_OR) } /* if (data[1] == ADDIDATA_OR) */
else { else {
outl(0x6, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); outl(0x6, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
} //else if(data[1] == ADDIDATA_OR) } /* else if(data[1] == ADDIDATA_OR) */
} // if( data[0] == ADDIDATA_ENABLE) } /* if( data[0] == ADDIDATA_ENABLE) */
else { else {
ul_Command1 = ul_Command1 & 0xFFFF0000; ul_Command1 = ul_Command1 & 0xFFFF0000;
ul_Command2 = ul_Command2 & 0xFFFF0000; ul_Command2 = ul_Command2 & 0xFFFF0000;
...@@ -120,7 +120,7 @@ int i_APCI1032_ConfigDigitalInput(struct comedi_device * dev, struct comedi_subd ...@@ -120,7 +120,7 @@ int i_APCI1032_ConfigDigitalInput(struct comedi_device * dev, struct comedi_subd
outl(ul_Command2, outl(ul_Command2,
devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_MODE2); devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_MODE2);
outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
} //else if ( data[0] == ADDIDATA_ENABLE) } /* else if ( data[0] == ADDIDATA_ENABLE) */
return insn->n; return insn->n;
} }
...@@ -152,14 +152,16 @@ int i_APCI1032_Read1DigitalInput(struct comedi_device * dev, struct comedi_subde ...@@ -152,14 +152,16 @@ int i_APCI1032_Read1DigitalInput(struct comedi_device * dev, struct comedi_subde
ui_Channel = CR_CHAN(insn->chanspec); ui_Channel = CR_CHAN(insn->chanspec);
if (ui_Channel >= 0 && ui_Channel <= 31) { if (ui_Channel >= 0 && ui_Channel <= 31) {
ui_TmpValue = (unsigned int) inl(devpriv->iobase + APCI1032_DIGITAL_IP); ui_TmpValue = (unsigned int) inl(devpriv->iobase + APCI1032_DIGITAL_IP);
// since only 1 channel reqd to bring it to last bit it is rotated /*
// 8 +(chan - 1) times then ANDed with 1 for last bit. * since only 1 channel reqd to bring it to last bit it is rotated 8
* +(chan - 1) times then ANDed with 1 for last bit.
*/
*data = (ui_TmpValue >> ui_Channel) & 0x1; *data = (ui_TmpValue >> ui_Channel) & 0x1;
} //if(ui_Channel >= 0 && ui_Channel <=31) } /* if(ui_Channel >= 0 && ui_Channel <=31) */
else { else {
//comedi_error(dev," \n chan spec wrong\n"); /* comedi_error(dev," \n chan spec wrong\n"); */
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
} //else if(ui_Channel >= 0 && ui_Channel <=31) } /* else if(ui_Channel >= 0 && ui_Channel <=31) */
return insn->n; return insn->n;
} }
...@@ -213,16 +215,16 @@ int i_APCI1032_ReadMoreDigitalInput(struct comedi_device * dev, struct comedi_su ...@@ -213,16 +215,16 @@ int i_APCI1032_ReadMoreDigitalInput(struct comedi_device * dev, struct comedi_su
case 31: case 31:
break; break;
default: default:
//comedi_error(dev," \nchan spec wrong\n"); /* comedi_error(dev," \nchan spec wrong\n"); */
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
break; break;
} //switch(ui_NoOfChannels) } /* switch(ui_NoOfChannels) */
} //if(data[1]==0) } /* if(data[1]==0) */
else { else {
if (data[1] == 1) { if (data[1] == 1) {
*data = ui_InterruptStatus; *data = ui_InterruptStatus;
} //if(data[1]==1) } /* if(data[1]==1) */
} //else if(data[1]==0) } /* else if(data[1]==0) */
return insn->n; return insn->n;
} }
...@@ -248,15 +250,15 @@ static void v_APCI1032_Interrupt(int irq, void *d) ...@@ -248,15 +250,15 @@ static void v_APCI1032_Interrupt(int irq, void *d)
struct comedi_device *dev = d; struct comedi_device *dev = d;
unsigned int ui_Temp; unsigned int ui_Temp;
//disable the interrupt /* disable the interrupt */
ui_Temp = inl(devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); ui_Temp = inl(devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
outl(ui_Temp & APCI1032_DIGITAL_IP_INTERRUPT_DISABLE, outl(ui_Temp & APCI1032_DIGITAL_IP_INTERRUPT_DISABLE,
devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
ui_InterruptStatus = ui_InterruptStatus =
inl(devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_STATUS); inl(devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_STATUS);
ui_InterruptStatus = ui_InterruptStatus & 0X0000FFFF; ui_InterruptStatus = ui_InterruptStatus & 0X0000FFFF;
send_sig(SIGIO, devpriv->tsk_Current, 0); // send signal to the sample send_sig(SIGIO, devpriv->tsk_Current, 0); /* send signal to the sample */
outl(ui_Temp, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); //enable the interrupt outl(ui_Temp, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); /* enable the interrupt */
return; return;
} }
...@@ -277,9 +279,9 @@ static void v_APCI1032_Interrupt(int irq, void *d) ...@@ -277,9 +279,9 @@ static void v_APCI1032_Interrupt(int irq, void *d)
int i_APCI1032_Reset(struct comedi_device * dev) int i_APCI1032_Reset(struct comedi_device * dev)
{ {
outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); //disable the interrupts outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); /* disable the interrupts */
inl(devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_STATUS); //Reset the interrupt status register inl(devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_STATUS); /* Reset the interrupt status register */
outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_MODE1); //Disable the and/or interrupt outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_MODE1); /* Disable the and/or interrupt */
outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_MODE2); outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_MODE2);
return 0; return 0;
} }
...@@ -19,33 +19,34 @@ ...@@ -19,33 +19,34 @@
#define APCI1032_BOARD_VENDOR_ID 0x15B8 #define APCI1032_BOARD_VENDOR_ID 0x15B8
#define APCI1032_ADDRESS_RANGE 20 #define APCI1032_ADDRESS_RANGE 20
//DIGITAL INPUT DEFINE /* DIGITAL INPUT DEFINE */
#define APCI1032_DIGITAL_IP 0 #define APCI1032_DIGITAL_IP 0
#define APCI1032_DIGITAL_IP_INTERRUPT_MODE1 4 #define APCI1032_DIGITAL_IP_INTERRUPT_MODE1 4
#define APCI1032_DIGITAL_IP_INTERRUPT_MODE2 8 #define APCI1032_DIGITAL_IP_INTERRUPT_MODE2 8
#define APCI1032_DIGITAL_IP_IRQ 16 #define APCI1032_DIGITAL_IP_IRQ 16
//Digital Input IRQ Function Selection /* Digital Input IRQ Function Selection */
#define ADDIDATA_OR 0 #define ADDIDATA_OR 0
#define ADDIDATA_AND 1 #define ADDIDATA_AND 1
//Digital Input Interrupt Status /* Digital Input Interrupt Status */
#define APCI1032_DIGITAL_IP_INTERRUPT_STATUS 12 #define APCI1032_DIGITAL_IP_INTERRUPT_STATUS 12
//Digital Input Interrupt Enable Disable. /* Digital Input Interrupt Enable Disable. */
#define APCI1032_DIGITAL_IP_INTERRUPT_ENABLE 0x4 #define APCI1032_DIGITAL_IP_INTERRUPT_ENABLE 0x4
#define APCI1032_DIGITAL_IP_INTERRUPT_DISABLE 0xFFFFFFFB #define APCI1032_DIGITAL_IP_INTERRUPT_DISABLE 0xFFFFFFFB
//ADDIDATA Enable Disable /* ADDIDATA Enable Disable */
#define ADDIDATA_ENABLE 1 #define ADDIDATA_ENABLE 1
#define ADDIDATA_DISABLE 0 #define ADDIDATA_DISABLE 0
// Hardware Layer functions for Apci1032 /* Hardware Layer functions for Apci1032 */
//DI /*
// for di read * DI for di read
*/
int i_APCI1032_ConfigDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1032_ConfigDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
...@@ -56,8 +57,8 @@ int i_APCI1032_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdev ...@@ -56,8 +57,8 @@ int i_APCI1032_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdev
int i_APCI1032_ReadMoreDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1032_ReadMoreDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
// Interrupt functions..... /* Interrupt functions..... */
static void v_APCI1032_Interrupt(int irq, void *d); static void v_APCI1032_Interrupt(int irq, void *d);
//Reset /* Reset */
int i_APCI1032_Reset(struct comedi_device *dev); int i_APCI1032_Reset(struct comedi_device *dev);
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
/********* Definitions for APCI-1500 card *****/ /********* Definitions for APCI-1500 card *****/
// Card Specific information /* Card Specific information */
#define APCI1500_BOARD_VENDOR_ID 0x10e8 #define APCI1500_BOARD_VENDOR_ID 0x10e8
#define APCI1500_ADDRESS_RANGE 4 #define APCI1500_ADDRESS_RANGE 4
//DIGITAL INPUT-OUTPUT DEFINE /* DIGITAL INPUT-OUTPUT DEFINE */
#define APCI1500_DIGITAL_OP 2 #define APCI1500_DIGITAL_OP 2
#define APCI1500_DIGITAL_IP 0 #define APCI1500_DIGITAL_IP 0
......
...@@ -81,14 +81,14 @@ int i_APCI1516_Read1DigitalInput(struct comedi_device * dev, struct comedi_subde ...@@ -81,14 +81,14 @@ int i_APCI1516_Read1DigitalInput(struct comedi_device * dev, struct comedi_subde
ui_Channel = CR_CHAN(insn->chanspec); ui_Channel = CR_CHAN(insn->chanspec);
if (ui_Channel >= 0 && ui_Channel <= 7) { if (ui_Channel >= 0 && ui_Channel <= 7) {
ui_TmpValue = (unsigned int) inw(devpriv->iobase + APCI1516_DIGITAL_IP); ui_TmpValue = (unsigned int) inw(devpriv->iobase + APCI1516_DIGITAL_IP);
// since only 1 channel reqd to bring it to last bit it is rotated /* since only 1 channel reqd to bring it to last bit it is rotated */
// 8 +(chan - 1) times then ANDed with 1 for last bit. /* 8 +(chan - 1) times then ANDed with 1 for last bit. */
*data = (ui_TmpValue >> ui_Channel) & 0x1; *data = (ui_TmpValue >> ui_Channel) & 0x1;
} //if(ui_Channel >= 0 && ui_Channel <=7) } /* if(ui_Channel >= 0 && ui_Channel <=7) */
else { else {
//comedi_error(dev," \n chan spec wrong\n"); /* comedi_error(dev," \n chan spec wrong\n"); */
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
} //else if(ui_Channel >= 0 && ui_Channel <=7) } /* else if(ui_Channel >= 0 && ui_Channel <=7) */
return insn->n; return insn->n;
} }
...@@ -139,9 +139,9 @@ int i_APCI1516_ReadMoreDigitalInput(struct comedi_device * dev, struct comedi_su ...@@ -139,9 +139,9 @@ int i_APCI1516_ReadMoreDigitalInput(struct comedi_device * dev, struct comedi_su
default: default:
printk("\nWrong parameters\n"); printk("\nWrong parameters\n");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
break; break;
} //switch(ui_NoOfChannels) } /* switch(ui_NoOfChannels) */
return insn->n; return insn->n;
} }
...@@ -203,17 +203,17 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -203,17 +203,17 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
struct comedi_insn * insn, unsigned int * data) struct comedi_insn * insn, unsigned int * data)
{ {
unsigned int ui_Temp, ui_Temp1; unsigned int ui_Temp, ui_Temp1;
unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); // get the channel unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); /* get the channel */
printk("EL311003 : @=%x\n", devpriv->iobase + APCI1516_DIGITAL_OP); printk("EL311003 : @=%x\n", devpriv->iobase + APCI1516_DIGITAL_OP);
if (devpriv->b_OutputMemoryStatus) { if (devpriv->b_OutputMemoryStatus) {
ui_Temp = inw(devpriv->iobase + APCI1516_DIGITAL_OP); ui_Temp = inw(devpriv->iobase + APCI1516_DIGITAL_OP);
} //if(devpriv->b_OutputMemoryStatus ) } /* if(devpriv->b_OutputMemoryStatus ) */
else { else {
ui_Temp = 0; ui_Temp = 0;
} //if(devpriv->b_OutputMemoryStatus ) } /* if(devpriv->b_OutputMemoryStatus ) */
if (data[3] == 0) { if (data[3] == 0) {
if (data[1] == 0) { if (data[1] == 0) {
data[0] = (data[0] << ui_NoOfChannel) | ui_Temp; data[0] = (data[0] << ui_NoOfChannel) | ui_Temp;
...@@ -222,7 +222,7 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -222,7 +222,7 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
printk("EL311003 : d=%d @=%x\n", data[0], printk("EL311003 : d=%d @=%x\n", data[0],
devpriv->iobase + APCI1516_DIGITAL_OP); devpriv->iobase + APCI1516_DIGITAL_OP);
} //if(data[1]==0) } /* if(data[1]==0) */
else { else {
if (data[1] == 1) { if (data[1] == 1) {
switch (ui_NoOfChannel) { switch (ui_NoOfChannel) {
...@@ -245,21 +245,21 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -245,21 +245,21 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
default: default:
comedi_error(dev, " chan spec wrong"); comedi_error(dev, " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannels) } /* switch(ui_NoOfChannels) */
outw(data[0], outw(data[0],
devpriv->iobase + APCI1516_DIGITAL_OP); devpriv->iobase + APCI1516_DIGITAL_OP);
printk("EL311003 : d=%d @=%x\n", data[0], printk("EL311003 : d=%d @=%x\n", data[0],
devpriv->iobase + APCI1516_DIGITAL_OP); devpriv->iobase + APCI1516_DIGITAL_OP);
} // if(data[1]==1) } /* if(data[1]==1) */
else { else {
printk("\nSpecified channel not supported\n"); printk("\nSpecified channel not supported\n");
} //else if(data[1]==1) } /* else if(data[1]==1) */
} //elseif(data[1]==0) } /* elseif(data[1]==0) */
} //if(data[3]==0) } /* if(data[3]==0) */
else { else {
if (data[3] == 1) { if (data[3] == 1) {
if (data[1] == 0) { if (data[1] == 0) {
...@@ -275,7 +275,7 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -275,7 +275,7 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
printk("EL311003 : d=%d @=%x\n", data[0], printk("EL311003 : d=%d @=%x\n", data[0],
devpriv->iobase + APCI1516_DIGITAL_OP); devpriv->iobase + APCI1516_DIGITAL_OP);
} //if(data[1]==0) } /* if(data[1]==0) */
else { else {
if (data[1] == 1) { if (data[1] == 1) {
switch (ui_NoOfChannel) { switch (ui_NoOfChannel) {
...@@ -312,9 +312,9 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -312,9 +312,9 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
default: default:
comedi_error(dev, comedi_error(dev,
" chan spec wrong"); " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannels) } /* switch(ui_NoOfChannels) */
outw(data[0], outw(data[0],
devpriv->iobase + devpriv->iobase +
...@@ -324,17 +324,17 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -324,17 +324,17 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
data[0], data[0],
devpriv->iobase + devpriv->iobase +
APCI1516_DIGITAL_OP); APCI1516_DIGITAL_OP);
} // if(data[1]==1) } /* if(data[1]==1) */
else { else {
printk("\nSpecified channel not supported\n"); printk("\nSpecified channel not supported\n");
} //else if(data[1]==1) } /* else if(data[1]==1) */
} //elseif(data[1]==0) } /* elseif(data[1]==0) */
} //if(data[3]==1); } /* if(data[3]==1); */
else { else {
printk("\nSpecified functionality does not exist\n"); printk("\nSpecified functionality does not exist\n");
return -EINVAL; return -EINVAL;
} //if else data[3]==1) } /* if else data[3]==1) */
} //if else data[3]==0) } /* if else data[3]==0) */
return (insn->n);; return (insn->n);;
} }
...@@ -364,12 +364,12 @@ int i_APCI1516_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde ...@@ -364,12 +364,12 @@ int i_APCI1516_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde
{ {
unsigned int ui_Temp; unsigned int ui_Temp;
unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); // get the channel unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); /* get the channel */
ui_Temp = data[0]; ui_Temp = data[0];
*data = inw(devpriv->iobase + APCI1516_DIGITAL_OP_RW); *data = inw(devpriv->iobase + APCI1516_DIGITAL_OP_RW);
if (ui_Temp == 0) { if (ui_Temp == 0) {
*data = (*data >> ui_NoOfChannel) & 0x1; *data = (*data >> ui_NoOfChannel) & 0x1;
} //if(ui_Temp==0) } /* if(ui_Temp==0) */
else { else {
if (ui_Temp == 1) { if (ui_Temp == 1) {
switch (ui_NoOfChannel) { switch (ui_NoOfChannel) {
...@@ -387,14 +387,14 @@ int i_APCI1516_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde ...@@ -387,14 +387,14 @@ int i_APCI1516_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde
default: default:
comedi_error(dev, " chan spec wrong"); comedi_error(dev, " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannels) } /* switch(ui_NoOfChannels) */
} //if(ui_Temp==1) } /* if(ui_Temp==1) */
else { else {
printk("\nSpecified channel not supported \n"); printk("\nSpecified channel not supported \n");
} //elseif(ui_Temp==1) } /* elseif(ui_Temp==1) */
} //elseif(ui_Temp==0) } /* elseif(ui_Temp==0) */
return insn->n; return insn->n;
} }
...@@ -423,11 +423,11 @@ int i_APCI1516_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic ...@@ -423,11 +423,11 @@ int i_APCI1516_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic
struct comedi_insn * insn, unsigned int * data) struct comedi_insn * insn, unsigned int * data)
{ {
if (data[0] == 0) { if (data[0] == 0) {
//Disable the watchdog /* Disable the watchdog */
outw(0x0, outw(0x0,
devpriv->i_IobaseAddon + devpriv->i_IobaseAddon +
APCI1516_WATCHDOG_ENABLEDISABLE); APCI1516_WATCHDOG_ENABLEDISABLE);
//Loading the Reload value /* Loading the Reload value */
outw(data[1], outw(data[1],
devpriv->i_IobaseAddon + devpriv->i_IobaseAddon +
APCI1516_WATCHDOG_RELOAD_VALUE); APCI1516_WATCHDOG_RELOAD_VALUE);
...@@ -435,11 +435,11 @@ int i_APCI1516_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic ...@@ -435,11 +435,11 @@ int i_APCI1516_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic
outw(data[1], outw(data[1],
devpriv->i_IobaseAddon + devpriv->i_IobaseAddon +
APCI1516_WATCHDOG_RELOAD_VALUE + 2); APCI1516_WATCHDOG_RELOAD_VALUE + 2);
} //if(data[0]==0) } /* if(data[0]==0) */
else { else {
printk("\nThe input parameters are wrong\n"); printk("\nThe input parameters are wrong\n");
return -EINVAL; return -EINVAL;
} //elseif(data[0]==0) } /* elseif(data[0]==0) */
return insn->n; return insn->n;
} }
...@@ -469,15 +469,15 @@ int i_APCI1516_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_ ...@@ -469,15 +469,15 @@ int i_APCI1516_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_
struct comedi_insn * insn, unsigned int * data) struct comedi_insn * insn, unsigned int * data)
{ {
switch (data[0]) { switch (data[0]) {
case 0: //stop the watchdog case 0: /* stop the watchdog */
outw(0x0, devpriv->i_IobaseAddon + APCI1516_WATCHDOG_ENABLEDISABLE); //disable the watchdog outw(0x0, devpriv->i_IobaseAddon + APCI1516_WATCHDOG_ENABLEDISABLE); /* disable the watchdog */
break; break;
case 1: //start the watchdog case 1: /* start the watchdog */
outw(0x0001, outw(0x0001,
devpriv->i_IobaseAddon + devpriv->i_IobaseAddon +
APCI1516_WATCHDOG_ENABLEDISABLE); APCI1516_WATCHDOG_ENABLEDISABLE);
break; break;
case 2: //Software trigger case 2: /* Software trigger */
outw(0x0201, outw(0x0201,
devpriv->i_IobaseAddon + devpriv->i_IobaseAddon +
APCI1516_WATCHDOG_ENABLEDISABLE); APCI1516_WATCHDOG_ENABLEDISABLE);
...@@ -485,7 +485,7 @@ int i_APCI1516_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_ ...@@ -485,7 +485,7 @@ int i_APCI1516_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_
default: default:
printk("\nSpecified functionality does not exist\n"); printk("\nSpecified functionality does not exist\n");
return -EINVAL; return -EINVAL;
} // switch(data[0]) } /* switch(data[0]) */
return insn->n; return insn->n;
} }
...@@ -534,7 +534,7 @@ int i_APCI1516_ReadWatchdog(struct comedi_device * dev, struct comedi_subdevice ...@@ -534,7 +534,7 @@ int i_APCI1516_ReadWatchdog(struct comedi_device * dev, struct comedi_subdevice
int i_APCI1516_Reset(struct comedi_device * dev) int i_APCI1516_Reset(struct comedi_device * dev)
{ {
outw(0x0, devpriv->iobase + APCI1516_DIGITAL_OP); //RESETS THE DIGITAL OUTPUTS outw(0x0, devpriv->iobase + APCI1516_DIGITAL_OP); /* RESETS THE DIGITAL OUTPUTS */
outw(0x0, devpriv->i_IobaseAddon + APCI1516_WATCHDOG_ENABLEDISABLE); outw(0x0, devpriv->i_IobaseAddon + APCI1516_WATCHDOG_ENABLEDISABLE);
outw(0x0, devpriv->i_IobaseAddon + APCI1516_WATCHDOG_RELOAD_VALUE); outw(0x0, devpriv->i_IobaseAddon + APCI1516_WATCHDOG_RELOAD_VALUE);
outw(0x0, devpriv->i_IobaseAddon + APCI1516_WATCHDOG_RELOAD_VALUE + 2); outw(0x0, devpriv->i_IobaseAddon + APCI1516_WATCHDOG_RELOAD_VALUE + 2);
......
...@@ -17,17 +17,17 @@ ...@@ -17,17 +17,17 @@
/********* Definitions for APCI-1516 card *****/ /********* Definitions for APCI-1516 card *****/
// Card Specific information /* Card Specific information */
#define APCI1516_BOARD_VENDOR_ID 0x15B8 #define APCI1516_BOARD_VENDOR_ID 0x15B8
#define APCI1516_ADDRESS_RANGE 8 #define APCI1516_ADDRESS_RANGE 8
//DIGITAL INPUT-OUTPUT DEFINE /* DIGITAL INPUT-OUTPUT DEFINE */
#define APCI1516_DIGITAL_OP 4 #define APCI1516_DIGITAL_OP 4
#define APCI1516_DIGITAL_OP_RW 4 #define APCI1516_DIGITAL_OP_RW 4
#define APCI1516_DIGITAL_IP 0 #define APCI1516_DIGITAL_IP 0
// TIMER COUNTER WATCHDOG DEFINES /* TIMER COUNTER WATCHDOG DEFINES */
#define ADDIDATA_WATCHDOG 2 #define ADDIDATA_WATCHDOG 2
#define APCI1516_DIGITAL_OP_WATCHDOG 0 #define APCI1516_DIGITAL_OP_WATCHDOG 0
...@@ -35,15 +35,15 @@ ...@@ -35,15 +35,15 @@
#define APCI1516_WATCHDOG_RELOAD_VALUE 4 #define APCI1516_WATCHDOG_RELOAD_VALUE 4
#define APCI1516_WATCHDOG_STATUS 16 #define APCI1516_WATCHDOG_STATUS 16
// Hardware Layer functions for Apci1516 /* Hardware Layer functions for Apci1516 */
//Digital Input /* Digital Input */
int i_APCI1516_ReadMoreDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1516_ReadMoreDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
int i_APCI1516_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1516_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
//Digital Output /* Digital Output */
int i_APCI1516_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1516_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
int i_APCI1516_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1516_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
...@@ -51,8 +51,9 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subde ...@@ -51,8 +51,9 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subde
int i_APCI1516_ReadDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1516_ReadDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
// TIMER /*
// timer value is passed as u seconds * TIMER timer value is passed as u seconds
*/
int i_APCI1516_ConfigWatchdog(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1516_ConfigWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
int i_APCI1516_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1516_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
...@@ -60,5 +61,5 @@ int i_APCI1516_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_s ...@@ -60,5 +61,5 @@ int i_APCI1516_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_s
int i_APCI1516_ReadWatchdog(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1516_ReadWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
//reset /* reset */
int i_APCI1516_Reset(struct comedi_device *dev); int i_APCI1516_Reset(struct comedi_device *dev);
...@@ -20,45 +20,45 @@ ...@@ -20,45 +20,45 @@
#define APCI1564_BOARD_VENDOR_ID 0x15B8 #define APCI1564_BOARD_VENDOR_ID 0x15B8
#define APCI1564_ADDRESS_RANGE 128 #define APCI1564_ADDRESS_RANGE 128
//DIGITAL INPUT-OUTPUT DEFINE /* DIGITAL INPUT-OUTPUT DEFINE */
// Input defines /* Input defines */
#define APCI1564_DIGITAL_IP 0x04 #define APCI1564_DIGITAL_IP 0x04
#define APCI1564_DIGITAL_IP_INTERRUPT_MODE1 4 #define APCI1564_DIGITAL_IP_INTERRUPT_MODE1 4
#define APCI1564_DIGITAL_IP_INTERRUPT_MODE2 8 #define APCI1564_DIGITAL_IP_INTERRUPT_MODE2 8
#define APCI1564_DIGITAL_IP_IRQ 16 #define APCI1564_DIGITAL_IP_IRQ 16
// Output defines /* Output defines */
#define APCI1564_DIGITAL_OP 0x18 #define APCI1564_DIGITAL_OP 0x18
#define APCI1564_DIGITAL_OP_RW 0 #define APCI1564_DIGITAL_OP_RW 0
#define APCI1564_DIGITAL_OP_INTERRUPT 4 #define APCI1564_DIGITAL_OP_INTERRUPT 4
#define APCI1564_DIGITAL_OP_IRQ 12 #define APCI1564_DIGITAL_OP_IRQ 12
//Digital Input IRQ Function Selection /* Digital Input IRQ Function Selection */
#define ADDIDATA_OR 0 #define ADDIDATA_OR 0
#define ADDIDATA_AND 1 #define ADDIDATA_AND 1
//Digital Input Interrupt Status /* Digital Input Interrupt Status */
#define APCI1564_DIGITAL_IP_INTERRUPT_STATUS 12 #define APCI1564_DIGITAL_IP_INTERRUPT_STATUS 12
//Digital Output Interrupt Status /* Digital Output Interrupt Status */
#define APCI1564_DIGITAL_OP_INTERRUPT_STATUS 8 #define APCI1564_DIGITAL_OP_INTERRUPT_STATUS 8
//Digital Input Interrupt Enable Disable. /* Digital Input Interrupt Enable Disable. */
#define APCI1564_DIGITAL_IP_INTERRUPT_ENABLE 0x4 #define APCI1564_DIGITAL_IP_INTERRUPT_ENABLE 0x4
#define APCI1564_DIGITAL_IP_INTERRUPT_DISABLE 0xFFFFFFFB #define APCI1564_DIGITAL_IP_INTERRUPT_DISABLE 0xFFFFFFFB
//Digital Output Interrupt Enable Disable. /* Digital Output Interrupt Enable Disable. */
#define APCI1564_DIGITAL_OP_VCC_INTERRUPT_ENABLE 0x1 #define APCI1564_DIGITAL_OP_VCC_INTERRUPT_ENABLE 0x1
#define APCI1564_DIGITAL_OP_VCC_INTERRUPT_DISABLE 0xFFFFFFFE #define APCI1564_DIGITAL_OP_VCC_INTERRUPT_DISABLE 0xFFFFFFFE
#define APCI1564_DIGITAL_OP_CC_INTERRUPT_ENABLE 0x2 #define APCI1564_DIGITAL_OP_CC_INTERRUPT_ENABLE 0x2
#define APCI1564_DIGITAL_OP_CC_INTERRUPT_DISABLE 0xFFFFFFFD #define APCI1564_DIGITAL_OP_CC_INTERRUPT_DISABLE 0xFFFFFFFD
//ADDIDATA Enable Disable /* ADDIDATA Enable Disable */
#define ADDIDATA_ENABLE 1 #define ADDIDATA_ENABLE 1
#define ADDIDATA_DISABLE 0 #define ADDIDATA_DISABLE 0
// TIMER COUNTER WATCHDOG DEFINES /* TIMER COUNTER WATCHDOG DEFINES */
#define ADDIDATA_TIMER 0 #define ADDIDATA_TIMER 0
#define ADDIDATA_COUNTER 1 #define ADDIDATA_COUNTER 1
...@@ -78,10 +78,11 @@ ...@@ -78,10 +78,11 @@
#define APCI1564_TCW_WARN_TIMEVAL 24 #define APCI1564_TCW_WARN_TIMEVAL 24
#define APCI1564_TCW_WARN_TIMEBASE 28 #define APCI1564_TCW_WARN_TIMEBASE 28
// Hardware Layer functions for Apci1564 /* Hardware Layer functions for Apci1564 */
//DI /*
// for di read * DI for di read
*/
int i_APCI1564_ConfigDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1564_ConfigDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
int i_APCI1564_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1564_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
...@@ -89,7 +90,7 @@ int i_APCI1564_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdev ...@@ -89,7 +90,7 @@ int i_APCI1564_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdev
int i_APCI1564_ReadMoreDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1564_ReadMoreDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
//DO /* DO */
int i_APCI1564_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1564_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
int i_APCI1564_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1564_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
...@@ -99,8 +100,9 @@ int i_APCI1564_ReadDigitalOutput(struct comedi_device *dev, struct comedi_subdev ...@@ -99,8 +100,9 @@ int i_APCI1564_ReadDigitalOutput(struct comedi_device *dev, struct comedi_subdev
int i_APCI1564_ReadInterruptStatus(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1564_ReadInterruptStatus(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
// TIMER /*
// timer value is passed as u seconds * TIMER timer value is passed as u seconds
*/
int i_APCI1564_ConfigTimerCounterWatchdog(struct comedi_device *dev, int i_APCI1564_ConfigTimerCounterWatchdog(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
...@@ -112,8 +114,8 @@ int i_APCI1564_ReadTimerCounterWatchdog(struct comedi_device *dev, ...@@ -112,8 +114,8 @@ int i_APCI1564_ReadTimerCounterWatchdog(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
// intERRUPT /* intERRUPT */
static void v_APCI1564_Interrupt(int irq, void *d); static void v_APCI1564_Interrupt(int irq, void *d);
// RESET /* RESET */
int i_APCI1564_Reset(struct comedi_device *dev); int i_APCI1564_Reset(struct comedi_device *dev);
...@@ -82,13 +82,13 @@ int i_APCI2016_ConfigDigitalOutput(struct comedi_device * dev, struct comedi_sub ...@@ -82,13 +82,13 @@ int i_APCI2016_ConfigDigitalOutput(struct comedi_device * dev, struct comedi_sub
comedi_error(dev, comedi_error(dev,
"Not a valid Data !!! ,Data should be 1 or 0\n"); "Not a valid Data !!! ,Data should be 1 or 0\n");
return -EINVAL; return -EINVAL;
} // if ((data[0]!=0) && (data[0]!=1)) } /* if ((data[0]!=0) && (data[0]!=1)) */
if (data[0]) { if (data[0]) {
devpriv->b_OutputMemoryStatus = ADDIDATA_ENABLE; devpriv->b_OutputMemoryStatus = ADDIDATA_ENABLE;
} // if (data[0] } /* if (data[0] */
else { else {
devpriv->b_OutputMemoryStatus = ADDIDATA_DISABLE; devpriv->b_OutputMemoryStatus = ADDIDATA_DISABLE;
} // else if (data[0] } /* else if (data[0] */
return insn->n; return insn->n;
} }
...@@ -121,24 +121,24 @@ int i_APCI2016_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -121,24 +121,24 @@ int i_APCI2016_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
comedi_error(dev, comedi_error(dev,
"Invalid Channel Numbers !!!, Channel Numbers must be between 0 and 15\n"); "Invalid Channel Numbers !!!, Channel Numbers must be between 0 and 15\n");
return -EINVAL; return -EINVAL;
} // if ((ui_NoOfChannel<0) || (ui_NoOfChannel>15)) } /* if ((ui_NoOfChannel<0) || (ui_NoOfChannel>15)) */
if (devpriv->b_OutputMemoryStatus) { if (devpriv->b_OutputMemoryStatus) {
ui_Temp = inw(devpriv->iobase + APCI2016_DIGITAL_OP); ui_Temp = inw(devpriv->iobase + APCI2016_DIGITAL_OP);
} // if (devpriv->b_OutputMemoryStatus ) } /* if (devpriv->b_OutputMemoryStatus ) */
else { else {
ui_Temp = 0; ui_Temp = 0;
} // else if (devpriv->b_OutputMemoryStatus ) } /* else if (devpriv->b_OutputMemoryStatus ) */
if ((data[1] != 0) && (data[1] != 1)) { if ((data[1] != 0) && (data[1] != 1)) {
comedi_error(dev, comedi_error(dev,
"Invalid Data[1] value !!!, Data[1] should be 0 or 1\n"); "Invalid Data[1] value !!!, Data[1] should be 0 or 1\n");
return -EINVAL; return -EINVAL;
} // if ((data[1]!=0) && (data[1]!=1)) } /* if ((data[1]!=0) && (data[1]!=1)) */
if (data[3] == 0) { if (data[3] == 0) {
if (data[1] == 0) { if (data[1] == 0) {
data[0] = (data[0] << ui_NoOfChannel) | ui_Temp; data[0] = (data[0] << ui_NoOfChannel) | ui_Temp;
outw(data[0], devpriv->iobase + APCI2016_DIGITAL_OP); outw(data[0], devpriv->iobase + APCI2016_DIGITAL_OP);
} // if (data[1]==0) } /* if (data[1]==0) */
else { else {
if (data[1] == 1) { if (data[1] == 1) {
switch (ui_NoOfChannel) { switch (ui_NoOfChannel) {
...@@ -162,16 +162,16 @@ int i_APCI2016_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -162,16 +162,16 @@ int i_APCI2016_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
break; break;
default: default:
comedi_error(dev, " chan spec wrong"); comedi_error(dev, " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannels) } /* switch(ui_NoOfChannels) */
outw(data[0], outw(data[0],
devpriv->iobase + APCI2016_DIGITAL_OP); devpriv->iobase + APCI2016_DIGITAL_OP);
} // if (data[1]==1) } /* if (data[1]==1) */
else { else {
printk("\nSpecified channel not supported\n"); printk("\nSpecified channel not supported\n");
} // else if (data[1]==1) } /* else if (data[1]==1) */
} // else if (data[1]==0) } /* else if (data[1]==0) */
} // if (data[3]==0) } /* if (data[3]==0) */
else { else {
if (data[3] == 1) { if (data[3] == 1) {
if (data[1] == 0) { if (data[1] == 0) {
...@@ -183,7 +183,7 @@ int i_APCI2016_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -183,7 +183,7 @@ int i_APCI2016_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
data[0] = data[0] & ui_Temp; data[0] = data[0] & ui_Temp;
outw(data[0], outw(data[0],
devpriv->iobase + APCI2016_DIGITAL_OP); devpriv->iobase + APCI2016_DIGITAL_OP);
} // if (data[1]==0) } /* if (data[1]==0) */
else { else {
if (data[1] == 1) { if (data[1] == 1) {
switch (ui_NoOfChannel) { switch (ui_NoOfChannel) {
...@@ -228,22 +228,22 @@ int i_APCI2016_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -228,22 +228,22 @@ int i_APCI2016_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
default: default:
comedi_error(dev, comedi_error(dev,
" chan spec wrong"); " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannels) } /* switch(ui_NoOfChannels) */
outw(data[0], outw(data[0],
devpriv->iobase + devpriv->iobase +
APCI2016_DIGITAL_OP); APCI2016_DIGITAL_OP);
} // if(data[1]==1) } /* if(data[1]==1) */
else { else {
printk("\nSpecified channel not supported\n"); printk("\nSpecified channel not supported\n");
} //else if(data[1]==1) } /* else if(data[1]==1) */
} //elseif(data[1]==0) } /* elseif(data[1]==0) */
} //if(data[3]==1); } /* if(data[3]==1); */
else { else {
printk("\nSpecified functionality does not exist\n"); printk("\nSpecified functionality does not exist\n");
return -EINVAL; return -EINVAL;
} //if else data[3]==1) } /* if else data[3]==1) */
} //if else data[3]==0) } /* if else data[3]==0) */
return insn->n; return insn->n;
} }
...@@ -276,17 +276,17 @@ int i_APCI2016_BitsDigitalOutput(struct comedi_device * dev, struct comedi_subde ...@@ -276,17 +276,17 @@ int i_APCI2016_BitsDigitalOutput(struct comedi_device * dev, struct comedi_subde
comedi_error(dev, comedi_error(dev,
"Invalid Channel Numbers !!!, Channel Numbers must be between 0 and 15\n"); "Invalid Channel Numbers !!!, Channel Numbers must be between 0 and 15\n");
return -EINVAL; return -EINVAL;
} // if ((ui_NoOfChannel<0) || (ui_NoOfChannel>15)) } /* if ((ui_NoOfChannel<0) || (ui_NoOfChannel>15)) */
if ((data[0] != 0) && (data[0] != 1)) { if ((data[0] != 0) && (data[0] != 1)) {
comedi_error(dev, comedi_error(dev,
"Invalid Data[0] value !!!, Data[0] should be 0 or 1\n"); "Invalid Data[0] value !!!, Data[0] should be 0 or 1\n");
return -EINVAL; return -EINVAL;
} // if ((data[0]!=0) && (data[0]!=1)) } /* if ((data[0]!=0) && (data[0]!=1)) */
ui_Temp = data[0]; ui_Temp = data[0];
*data = inw(devpriv->iobase + APCI2016_DIGITAL_OP_RW); *data = inw(devpriv->iobase + APCI2016_DIGITAL_OP_RW);
if (ui_Temp == 0) { if (ui_Temp == 0) {
*data = (*data >> ui_NoOfChannel) & 0x1; *data = (*data >> ui_NoOfChannel) & 0x1;
} // if (ui_Temp==0) } /* if (ui_Temp==0) */
else { else {
if (ui_Temp == 1) { if (ui_Temp == 1) {
switch (ui_NoOfChannel) { switch (ui_NoOfChannel) {
...@@ -307,13 +307,13 @@ int i_APCI2016_BitsDigitalOutput(struct comedi_device * dev, struct comedi_subde ...@@ -307,13 +307,13 @@ int i_APCI2016_BitsDigitalOutput(struct comedi_device * dev, struct comedi_subde
default: default:
comedi_error(dev, " chan spec wrong"); comedi_error(dev, " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannel) } /* switch(ui_NoOfChannel) */
} // if (ui_Temp==1) } /* if (ui_Temp==1) */
else { else {
printk("\nSpecified channel not supported \n"); printk("\nSpecified channel not supported \n");
} // else if (ui_Temp==1) } /* else if (ui_Temp==1) */
} // if (ui_Temp==0) } /* if (ui_Temp==0) */
return insn->n; return insn->n;
} }
...@@ -342,11 +342,11 @@ int i_APCI2016_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic ...@@ -342,11 +342,11 @@ int i_APCI2016_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic
{ {
if (data[0] == 0) { if (data[0] == 0) {
//Disable the watchdog /* Disable the watchdog */
outw(0x0, outw(0x0,
devpriv->i_IobaseAddon + devpriv->i_IobaseAddon +
APCI2016_WATCHDOG_ENABLEDISABLE); APCI2016_WATCHDOG_ENABLEDISABLE);
//Loading the Reload value /* Loading the Reload value */
outw(data[1], outw(data[1],
devpriv->i_IobaseAddon + devpriv->i_IobaseAddon +
APCI2016_WATCHDOG_RELOAD_VALUE); APCI2016_WATCHDOG_RELOAD_VALUE);
...@@ -385,15 +385,15 @@ int i_APCI2016_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_ ...@@ -385,15 +385,15 @@ int i_APCI2016_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_
{ {
switch (data[0]) { switch (data[0]) {
case 0: //stop the watchdog case 0: /* stop the watchdog */
outw(0x0, devpriv->i_IobaseAddon + APCI2016_WATCHDOG_ENABLEDISABLE); //disable the watchdog outw(0x0, devpriv->i_IobaseAddon + APCI2016_WATCHDOG_ENABLEDISABLE); /* disable the watchdog */
break; break;
case 1: //start the watchdog case 1: /* start the watchdog */
outw(0x0001, outw(0x0001,
devpriv->i_IobaseAddon + devpriv->i_IobaseAddon +
APCI2016_WATCHDOG_ENABLEDISABLE); APCI2016_WATCHDOG_ENABLEDISABLE);
break; break;
case 2: //Software trigger case 2: /* Software trigger */
outw(0x0201, outw(0x0201,
devpriv->i_IobaseAddon + devpriv->i_IobaseAddon +
APCI2016_WATCHDOG_ENABLEDISABLE); APCI2016_WATCHDOG_ENABLEDISABLE);
...@@ -401,7 +401,7 @@ int i_APCI2016_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_ ...@@ -401,7 +401,7 @@ int i_APCI2016_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_
default: default:
printk("\nSpecified functionality does not exist\n"); printk("\nSpecified functionality does not exist\n");
return -EINVAL; return -EINVAL;
} // switch(data[0]) } /* switch(data[0]) */
return insn->n; return insn->n;
} }
...@@ -452,7 +452,7 @@ int i_APCI2016_ReadWatchdog(struct comedi_device * dev, struct comedi_subdevice ...@@ -452,7 +452,7 @@ int i_APCI2016_ReadWatchdog(struct comedi_device * dev, struct comedi_subdevice
int i_APCI2016_Reset(struct comedi_device * dev) int i_APCI2016_Reset(struct comedi_device * dev)
{ {
outw(0x0, devpriv->iobase + APCI2016_DIGITAL_OP); // Resets the digital output channels outw(0x0, devpriv->iobase + APCI2016_DIGITAL_OP); /* Resets the digital output channels */
outw(0x0, devpriv->i_IobaseAddon + APCI2016_WATCHDOG_ENABLEDISABLE); outw(0x0, devpriv->i_IobaseAddon + APCI2016_WATCHDOG_ENABLEDISABLE);
outw(0x0, devpriv->i_IobaseAddon + APCI2016_WATCHDOG_RELOAD_VALUE); outw(0x0, devpriv->i_IobaseAddon + APCI2016_WATCHDOG_RELOAD_VALUE);
outw(0x0, devpriv->i_IobaseAddon + APCI2016_WATCHDOG_RELOAD_VALUE + 2); outw(0x0, devpriv->i_IobaseAddon + APCI2016_WATCHDOG_RELOAD_VALUE + 2);
......
...@@ -19,17 +19,17 @@ ...@@ -19,17 +19,17 @@
#define APCI2016_BOARD_VENDOR_ID 0x15B8 #define APCI2016_BOARD_VENDOR_ID 0x15B8
#define APCI2016_ADDRESS_RANGE 8 #define APCI2016_ADDRESS_RANGE 8
//DIGITAL INPUT-OUTPUT DEFINE /* DIGITAL INPUT-OUTPUT DEFINE */
#define APCI2016_DIGITAL_OP 0x04 #define APCI2016_DIGITAL_OP 0x04
#define APCI2016_DIGITAL_OP_RW 4 #define APCI2016_DIGITAL_OP_RW 4
//ADDIDATA Enable Disable /* ADDIDATA Enable Disable */
#define ADDIDATA_ENABLE 1 #define ADDIDATA_ENABLE 1
#define ADDIDATA_DISABLE 0 #define ADDIDATA_DISABLE 0
// TIMER COUNTER WATCHDOG DEFINES /* TIMER COUNTER WATCHDOG DEFINES */
#define ADDIDATA_WATCHDOG 2 #define ADDIDATA_WATCHDOG 2
#define APCI2016_DIGITAL_OP_WATCHDOG 0 #define APCI2016_DIGITAL_OP_WATCHDOG 0
...@@ -37,9 +37,9 @@ ...@@ -37,9 +37,9 @@
#define APCI2016_WATCHDOG_RELOAD_VALUE 4 #define APCI2016_WATCHDOG_RELOAD_VALUE 4
#define APCI2016_WATCHDOG_STATUS 16 #define APCI2016_WATCHDOG_STATUS 16
// Hardware Layer functions for Apci2016 /* Hardware Layer functions for Apci2016 */
//DO /* DO */
int i_APCI2016_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2016_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
...@@ -49,8 +49,10 @@ int i_APCI2016_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subde ...@@ -49,8 +49,10 @@ int i_APCI2016_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subde
int i_APCI2016_BitsDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2016_BitsDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
// TIMER /*
// timer value is passed as u seconds * TIMER
* timer value is passed as u seconds
*/
int i_APCI2016_ConfigWatchdog(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2016_ConfigWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
...@@ -61,10 +63,10 @@ int i_APCI2016_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_s ...@@ -61,10 +63,10 @@ int i_APCI2016_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_s
int i_APCI2016_ReadWatchdog(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2016_ReadWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
// Interrupt functions..... /* Interrupt functions..... */
// void v_APCI2016_Interrupt(int irq, void *d) ; /* void v_APCI2016_Interrupt(int irq, void *d); */
//void v_APCI2016_Interrupt(int irq, void *d); /* void v_APCI2016_Interrupt(int irq, void *d); */
// RESET /* RESET */
int i_APCI2016_Reset(struct comedi_device *dev); int i_APCI2016_Reset(struct comedi_device *dev);
...@@ -89,26 +89,26 @@ int i_APCI2032_ConfigDigitalOutput(struct comedi_device * dev, struct comedi_sub ...@@ -89,26 +89,26 @@ int i_APCI2032_ConfigDigitalOutput(struct comedi_device * dev, struct comedi_sub
comedi_error(dev, comedi_error(dev,
"Not a valid Data !!! ,Data should be 1 or 0\n"); "Not a valid Data !!! ,Data should be 1 or 0\n");
return -EINVAL; return -EINVAL;
} //if ( (data[0]!=0) && (data[0]!=1) ) } /* if ( (data[0]!=0) && (data[0]!=1) ) */
if (data[0]) { if (data[0]) {
devpriv->b_OutputMemoryStatus = ADDIDATA_ENABLE; devpriv->b_OutputMemoryStatus = ADDIDATA_ENABLE;
} // if (data[0]) } /* if (data[0]) */
else { else {
devpriv->b_OutputMemoryStatus = ADDIDATA_DISABLE; devpriv->b_OutputMemoryStatus = ADDIDATA_DISABLE;
} //else if (data[0]) } /* else if (data[0]) */
if (data[1] == ADDIDATA_ENABLE) { if (data[1] == ADDIDATA_ENABLE) {
ul_Command = ul_Command | 0x1; ul_Command = ul_Command | 0x1;
} //if (data[1] == ADDIDATA_ENABLE) } /* if (data[1] == ADDIDATA_ENABLE) */
else { else {
ul_Command = ul_Command & 0xFFFFFFFE; ul_Command = ul_Command & 0xFFFFFFFE;
} //elseif (data[1] == ADDIDATA_ENABLE) } /* elseif (data[1] == ADDIDATA_ENABLE) */
if (data[2] == ADDIDATA_ENABLE) { if (data[2] == ADDIDATA_ENABLE) {
ul_Command = ul_Command | 0x2; ul_Command = ul_Command | 0x2;
} //if (data[2] == ADDIDATA_ENABLE) } /* if (data[2] == ADDIDATA_ENABLE) */
else { else {
ul_Command = ul_Command & 0xFFFFFFFD; ul_Command = ul_Command & 0xFFFFFFFD;
} //elseif (data[2] == ADDIDATA_ENABLE) } /* elseif (data[2] == ADDIDATA_ENABLE) */
outl(ul_Command, devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT); outl(ul_Command, devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT);
ui_InterruptData = inl(devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT); ui_InterruptData = inl(devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT);
return insn->n; return insn->n;
...@@ -138,19 +138,19 @@ int i_APCI2032_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -138,19 +138,19 @@ int i_APCI2032_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
struct comedi_insn * insn, unsigned int * data) struct comedi_insn * insn, unsigned int * data)
{ {
unsigned int ui_Temp, ui_Temp1; unsigned int ui_Temp, ui_Temp1;
unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); // get the channel unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); /* get the channel */
if (devpriv->b_OutputMemoryStatus) { if (devpriv->b_OutputMemoryStatus) {
ui_Temp = inl(devpriv->iobase + APCI2032_DIGITAL_OP); ui_Temp = inl(devpriv->iobase + APCI2032_DIGITAL_OP);
} //if(devpriv->b_OutputMemoryStatus ) } /* if(devpriv->b_OutputMemoryStatus ) */
else { else {
ui_Temp = 0; ui_Temp = 0;
} //if(devpriv->b_OutputMemoryStatus ) } /* if(devpriv->b_OutputMemoryStatus ) */
if (data[3] == 0) { if (data[3] == 0) {
if (data[1] == 0) { if (data[1] == 0) {
data[0] = (data[0] << ui_NoOfChannel) | ui_Temp; data[0] = (data[0] << ui_NoOfChannel) | ui_Temp;
outl(data[0], devpriv->iobase + APCI2032_DIGITAL_OP); outl(data[0], devpriv->iobase + APCI2032_DIGITAL_OP);
} //if(data[1]==0) } /* if(data[1]==0) */
else { else {
if (data[1] == 1) { if (data[1] == 1) {
switch (ui_NoOfChannel) { switch (ui_NoOfChannel) {
...@@ -184,18 +184,18 @@ int i_APCI2032_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -184,18 +184,18 @@ int i_APCI2032_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
default: default:
comedi_error(dev, " chan spec wrong"); comedi_error(dev, " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannels) } /* switch(ui_NoOfChannels) */
outl(data[0], outl(data[0],
devpriv->iobase + APCI2032_DIGITAL_OP); devpriv->iobase + APCI2032_DIGITAL_OP);
} // if(data[1]==1) } /* if(data[1]==1) */
else { else {
printk("\nSpecified channel not supported\n"); printk("\nSpecified channel not supported\n");
} //else if(data[1]==1) } /* else if(data[1]==1) */
} //elseif(data[1]==0) } /* elseif(data[1]==0) */
} //if(data[3]==0) } /* if(data[3]==0) */
else { else {
if (data[3] == 1) { if (data[3] == 1) {
if (data[1] == 0) { if (data[1] == 0) {
...@@ -209,7 +209,7 @@ int i_APCI2032_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -209,7 +209,7 @@ int i_APCI2032_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
data[0] = data[0] & ui_Temp; data[0] = data[0] & ui_Temp;
outl(data[0], outl(data[0],
devpriv->iobase + APCI2032_DIGITAL_OP); devpriv->iobase + APCI2032_DIGITAL_OP);
} //if(data[1]==0) } /* if(data[1]==0) */
else { else {
if (data[1] == 1) { if (data[1] == 1) {
switch (ui_NoOfChannel) { switch (ui_NoOfChannel) {
...@@ -272,24 +272,24 @@ int i_APCI2032_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -272,24 +272,24 @@ int i_APCI2032_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
default: default:
comedi_error(dev, comedi_error(dev,
" chan spec wrong"); " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannels) } /* switch(ui_NoOfChannels) */
outl(data[0], outl(data[0],
devpriv->iobase + devpriv->iobase +
APCI2032_DIGITAL_OP); APCI2032_DIGITAL_OP);
} // if(data[1]==1) } /* if(data[1]==1) */
else { else {
printk("\nSpecified channel not supported\n"); printk("\nSpecified channel not supported\n");
} //else if(data[1]==1) } /* else if(data[1]==1) */
} //elseif(data[1]==0) } /* elseif(data[1]==0) */
} //if(data[3]==1); } /* if(data[3]==1); */
else { else {
printk("\nSpecified functionality does not exist\n"); printk("\nSpecified functionality does not exist\n");
return -EINVAL; return -EINVAL;
} //if else data[3]==1) } /* if else data[3]==1) */
} //if else data[3]==0) } /* if else data[3]==0) */
return (insn->n);; return (insn->n);;
} }
...@@ -323,7 +323,7 @@ int i_APCI2032_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde ...@@ -323,7 +323,7 @@ int i_APCI2032_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde
*data = inl(devpriv->iobase + APCI2032_DIGITAL_OP_RW); *data = inl(devpriv->iobase + APCI2032_DIGITAL_OP_RW);
if (ui_Temp == 0) { if (ui_Temp == 0) {
*data = (*data >> ui_NoOfChannel) & 0x1; *data = (*data >> ui_NoOfChannel) & 0x1;
} //if (ui_Temp==0) } /* if (ui_Temp==0) */
else { else {
if (ui_Temp == 1) { if (ui_Temp == 1) {
switch (ui_NoOfChannel) { switch (ui_NoOfChannel) {
...@@ -349,13 +349,13 @@ int i_APCI2032_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde ...@@ -349,13 +349,13 @@ int i_APCI2032_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde
default: default:
comedi_error(dev, " chan spec wrong"); comedi_error(dev, " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannels) } /* switch(ui_NoOfChannels) */
} //if (ui_Temp==1) } /* if (ui_Temp==1) */
else { else {
printk("\nSpecified channel not supported \n"); printk("\nSpecified channel not supported \n");
} //elseif (ui_Temp==1) } /* elseif (ui_Temp==1) */
} }
return insn->n; return insn->n;
} }
...@@ -384,11 +384,11 @@ int i_APCI2032_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic ...@@ -384,11 +384,11 @@ int i_APCI2032_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic
struct comedi_insn * insn, unsigned int * data) struct comedi_insn * insn, unsigned int * data)
{ {
if (data[0] == 0) { if (data[0] == 0) {
//Disable the watchdog /* Disable the watchdog */
outl(0x0, outl(0x0,
devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
APCI2032_TCW_PROG); APCI2032_TCW_PROG);
//Loading the Reload value /* Loading the Reload value */
outl(data[1], outl(data[1],
devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
APCI2032_TCW_RELOAD_VALUE); APCI2032_TCW_RELOAD_VALUE);
...@@ -425,15 +425,15 @@ int i_APCI2032_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_ ...@@ -425,15 +425,15 @@ int i_APCI2032_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_
struct comedi_insn * insn, unsigned int * data) struct comedi_insn * insn, unsigned int * data)
{ {
switch (data[0]) { switch (data[0]) {
case 0: //stop the watchdog case 0: /* stop the watchdog */
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG); //disable the watchdog outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG); /* disable the watchdog */
break; break;
case 1: //start the watchdog case 1: /* start the watchdog */
outl(0x0001, outl(0x0001,
devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
APCI2032_TCW_PROG); APCI2032_TCW_PROG);
break; break;
case 2: //Software trigger case 2: /* Software trigger */
outl(0x0201, outl(0x0201,
devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
APCI2032_TCW_PROG); APCI2032_TCW_PROG);
...@@ -498,13 +498,13 @@ void v_APCI2032_Interrupt(int irq, void *d) ...@@ -498,13 +498,13 @@ void v_APCI2032_Interrupt(int irq, void *d)
struct comedi_device *dev = d; struct comedi_device *dev = d;
unsigned int ui_DO; unsigned int ui_DO;
ui_DO = inl(devpriv->iobase + APCI2032_DIGITAL_OP_IRQ) & 0x1; //Check if VCC OR CC interrupt has occured. ui_DO = inl(devpriv->iobase + APCI2032_DIGITAL_OP_IRQ) & 0x1; /* Check if VCC OR CC interrupt has occured. */
if (ui_DO == 0) { if (ui_DO == 0) {
printk("\nInterrupt from unKnown source\n"); printk("\nInterrupt from unKnown source\n");
} // if(ui_DO==0) } /* if(ui_DO==0) */
if (ui_DO) { if (ui_DO) {
// Check for Digital Output interrupt Type - 1: Vcc interrupt 2: CC interrupt. /* Check for Digital Output interrupt Type - 1: Vcc interrupt 2: CC interrupt. */
ui_Type = ui_Type =
inl(devpriv->iobase + inl(devpriv->iobase +
APCI2032_DIGITAL_OP_INTERRUPT_STATUS) & 0x3; APCI2032_DIGITAL_OP_INTERRUPT_STATUS) & 0x3;
...@@ -512,16 +512,16 @@ void v_APCI2032_Interrupt(int irq, void *d) ...@@ -512,16 +512,16 @@ void v_APCI2032_Interrupt(int irq, void *d)
devpriv->iobase + APCI2032_DIGITAL_OP + devpriv->iobase + APCI2032_DIGITAL_OP +
APCI2032_DIGITAL_OP_INTERRUPT); APCI2032_DIGITAL_OP_INTERRUPT);
if (ui_Type == 1) { if (ui_Type == 1) {
//Sends signal to user space /* Sends signal to user space */
send_sig(SIGIO, devpriv->tsk_Current, 0); send_sig(SIGIO, devpriv->tsk_Current, 0);
} // if (ui_Type==1) } /* if (ui_Type==1) */
else { else {
if (ui_Type == 2) { if (ui_Type == 2) {
// Sends signal to user space /* Sends signal to user space */
send_sig(SIGIO, devpriv->tsk_Current, 0); send_sig(SIGIO, devpriv->tsk_Current, 0);
} //if (ui_Type==2) } /* if (ui_Type==2) */
} //else if (ui_Type==1) } /* else if (ui_Type==1) */
} //if(ui_DO) } /* if(ui_DO) */
return; return;
...@@ -571,9 +571,9 @@ int i_APCI2032_Reset(struct comedi_device * dev) ...@@ -571,9 +571,9 @@ int i_APCI2032_Reset(struct comedi_device * dev)
{ {
devpriv->b_DigitalOutputRegister = 0; devpriv->b_DigitalOutputRegister = 0;
ui_Type = 0; ui_Type = 0;
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP); //Resets the output channels outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP); /* Resets the output channels */
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT); //Disables the interrupt. outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT); /* Disables the interrupt. */
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG); //disable the watchdog outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG); /* disable the watchdog */
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_RELOAD_VALUE); //reload=0 outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_RELOAD_VALUE); /* reload=0 */
return 0; return 0;
} }
...@@ -17,32 +17,32 @@ ...@@ -17,32 +17,32 @@
/********* Definitions for APCI-2032 card *****/ /********* Definitions for APCI-2032 card *****/
// Card Specific information /* Card Specific information */
#define APCI2032_BOARD_VENDOR_ID 0x15B8 #define APCI2032_BOARD_VENDOR_ID 0x15B8
#define APCI2032_ADDRESS_RANGE 63 #define APCI2032_ADDRESS_RANGE 63
//DIGITAL INPUT-OUTPUT DEFINE /* DIGITAL INPUT-OUTPUT DEFINE */
#define APCI2032_DIGITAL_OP 0 #define APCI2032_DIGITAL_OP 0
#define APCI2032_DIGITAL_OP_RW 0 #define APCI2032_DIGITAL_OP_RW 0
#define APCI2032_DIGITAL_OP_INTERRUPT 4 #define APCI2032_DIGITAL_OP_INTERRUPT 4
#define APCI2032_DIGITAL_OP_IRQ 12 #define APCI2032_DIGITAL_OP_IRQ 12
//Digital Output Interrupt Status /* Digital Output Interrupt Status */
#define APCI2032_DIGITAL_OP_INTERRUPT_STATUS 8 #define APCI2032_DIGITAL_OP_INTERRUPT_STATUS 8
//Digital Output Interrupt Enable Disable. /* Digital Output Interrupt Enable Disable. */
#define APCI2032_DIGITAL_OP_VCC_INTERRUPT_ENABLE 0x1 #define APCI2032_DIGITAL_OP_VCC_INTERRUPT_ENABLE 0x1
#define APCI2032_DIGITAL_OP_VCC_INTERRUPT_DISABLE 0xFFFFFFFE #define APCI2032_DIGITAL_OP_VCC_INTERRUPT_DISABLE 0xFFFFFFFE
#define APCI2032_DIGITAL_OP_CC_INTERRUPT_ENABLE 0x2 #define APCI2032_DIGITAL_OP_CC_INTERRUPT_ENABLE 0x2
#define APCI2032_DIGITAL_OP_CC_INTERRUPT_DISABLE 0xFFFFFFFD #define APCI2032_DIGITAL_OP_CC_INTERRUPT_DISABLE 0xFFFFFFFD
//ADDIDATA Enable Disable /* ADDIDATA Enable Disable */
#define ADDIDATA_ENABLE 1 #define ADDIDATA_ENABLE 1
#define ADDIDATA_DISABLE 0 #define ADDIDATA_DISABLE 0
// TIMER COUNTER WATCHDOG DEFINES /* TIMER COUNTER WATCHDOG DEFINES */
#define ADDIDATA_WATCHDOG 2 #define ADDIDATA_WATCHDOG 2
#define APCI2032_DIGITAL_OP_WATCHDOG 16 #define APCI2032_DIGITAL_OP_WATCHDOG 16
...@@ -52,9 +52,9 @@ ...@@ -52,9 +52,9 @@
#define APCI2032_TCW_TRIG_STATUS 16 #define APCI2032_TCW_TRIG_STATUS 16
#define APCI2032_TCW_IRQ 20 #define APCI2032_TCW_IRQ 20
// Hardware Layer functions for Apci2032 /* Hardware Layer functions for Apci2032 */
//DO /* DO */
int i_APCI2032_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2032_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
int i_APCI2032_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2032_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
...@@ -64,8 +64,10 @@ int i_APCI2032_ReadDigitalOutput(struct comedi_device *dev, struct comedi_subdev ...@@ -64,8 +64,10 @@ int i_APCI2032_ReadDigitalOutput(struct comedi_device *dev, struct comedi_subdev
int i_APCI2032_ReadInterruptStatus(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2032_ReadInterruptStatus(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
// TIMER /* TIMER
// timer value is passed as u seconds * timer value is passed as u seconds
*/
int i_APCI2032_ConfigWatchdog(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2032_ConfigWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
int i_APCI2032_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2032_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
...@@ -73,9 +75,9 @@ int i_APCI2032_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_s ...@@ -73,9 +75,9 @@ int i_APCI2032_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_s
int i_APCI2032_ReadWatchdog(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2032_ReadWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
// Interrupt functions..... /* Interrupt functions..... */
void v_APCI2032_Interrupt(int irq, void *d); void v_APCI2032_Interrupt(int irq, void *d);
//Reset functions /* Reset functions */
int i_APCI2032_Reset(struct comedi_device *dev); int i_APCI2032_Reset(struct comedi_device *dev);
...@@ -82,11 +82,11 @@ int i_APCI2200_Read1DigitalInput(struct comedi_device * dev, struct comedi_subde ...@@ -82,11 +82,11 @@ int i_APCI2200_Read1DigitalInput(struct comedi_device * dev, struct comedi_subde
if (ui_Channel >= 0 && ui_Channel <= 7) { if (ui_Channel >= 0 && ui_Channel <= 7) {
ui_TmpValue = (unsigned int) inw(devpriv->iobase + APCI2200_DIGITAL_IP); ui_TmpValue = (unsigned int) inw(devpriv->iobase + APCI2200_DIGITAL_IP);
*data = (ui_TmpValue >> ui_Channel) & 0x1; *data = (ui_TmpValue >> ui_Channel) & 0x1;
} //if(ui_Channel >= 0 && ui_Channel <=7) } /* if(ui_Channel >= 0 && ui_Channel <=7) */
else { else {
printk("\nThe specified channel does not exist\n"); printk("\nThe specified channel does not exist\n");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
} //else if(ui_Channel >= 0 && ui_Channel <=7) } /* else if(ui_Channel >= 0 && ui_Channel <=7) */
return insn->n; return insn->n;
} }
...@@ -137,9 +137,9 @@ int i_APCI2200_ReadMoreDigitalInput(struct comedi_device * dev, struct comedi_su ...@@ -137,9 +137,9 @@ int i_APCI2200_ReadMoreDigitalInput(struct comedi_device * dev, struct comedi_su
default: default:
printk("\nWrong parameters\n"); printk("\nWrong parameters\n");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
break; break;
} //switch(ui_NoOfChannels) } /* switch(ui_NoOfChannels) */
return insn->n; return insn->n;
} }
...@@ -201,19 +201,19 @@ int i_APCI2200_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -201,19 +201,19 @@ int i_APCI2200_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
struct comedi_insn * insn, unsigned int * data) struct comedi_insn * insn, unsigned int * data)
{ {
unsigned int ui_Temp, ui_Temp1; unsigned int ui_Temp, ui_Temp1;
unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); // get the channel unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); /* get the channel */
if (devpriv->b_OutputMemoryStatus) { if (devpriv->b_OutputMemoryStatus) {
ui_Temp = inw(devpriv->iobase + APCI2200_DIGITAL_OP); ui_Temp = inw(devpriv->iobase + APCI2200_DIGITAL_OP);
} //if(devpriv->b_OutputMemoryStatus ) } /* if(devpriv->b_OutputMemoryStatus ) */
else { else {
ui_Temp = 0; ui_Temp = 0;
} //if(devpriv->b_OutputMemoryStatus ) } /* if(devpriv->b_OutputMemoryStatus ) */
if (data[3] == 0) { if (data[3] == 0) {
if (data[1] == 0) { if (data[1] == 0) {
data[0] = (data[0] << ui_NoOfChannel) | ui_Temp; data[0] = (data[0] << ui_NoOfChannel) | ui_Temp;
outw(data[0], devpriv->iobase + APCI2200_DIGITAL_OP); outw(data[0], devpriv->iobase + APCI2200_DIGITAL_OP);
} //if(data[1]==0) } /* if(data[1]==0) */
else { else {
if (data[1] == 1) { if (data[1] == 1) {
switch (ui_NoOfChannel) { switch (ui_NoOfChannel) {
...@@ -240,18 +240,18 @@ int i_APCI2200_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -240,18 +240,18 @@ int i_APCI2200_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
break; break;
default: default:
comedi_error(dev, " chan spec wrong"); comedi_error(dev, " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannels) } /* switch(ui_NoOfChannels) */
outw(data[0], outw(data[0],
devpriv->iobase + APCI2200_DIGITAL_OP); devpriv->iobase + APCI2200_DIGITAL_OP);
} // if(data[1]==1) } /* if(data[1]==1) */
else { else {
printk("\nSpecified channel not supported\n"); printk("\nSpecified channel not supported\n");
} //else if(data[1]==1) } /* else if(data[1]==1) */
} //elseif(data[1]==0) } /* elseif(data[1]==0) */
} //if(data[3]==0) } /* if(data[3]==0) */
else { else {
if (data[3] == 1) { if (data[3] == 1) {
if (data[1] == 0) { if (data[1] == 0) {
...@@ -263,7 +263,7 @@ int i_APCI2200_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -263,7 +263,7 @@ int i_APCI2200_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
data[0] = data[0] & ui_Temp; data[0] = data[0] & ui_Temp;
outw(data[0], outw(data[0],
devpriv->iobase + APCI2200_DIGITAL_OP); devpriv->iobase + APCI2200_DIGITAL_OP);
} //if(data[1]==0) } /* if(data[1]==0) */
else { else {
if (data[1] == 1) { if (data[1] == 1) {
switch (ui_NoOfChannel) { switch (ui_NoOfChannel) {
...@@ -312,24 +312,24 @@ int i_APCI2200_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -312,24 +312,24 @@ int i_APCI2200_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
default: default:
comedi_error(dev, comedi_error(dev,
" chan spec wrong"); " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannels) } /* switch(ui_NoOfChannels) */
outw(data[0], outw(data[0],
devpriv->iobase + devpriv->iobase +
APCI2200_DIGITAL_OP); APCI2200_DIGITAL_OP);
} // if(data[1]==1) } /* if(data[1]==1) */
else { else {
printk("\nSpecified channel not supported\n"); printk("\nSpecified channel not supported\n");
} //else if(data[1]==1) } /* else if(data[1]==1) */
} //elseif(data[1]==0) } /* elseif(data[1]==0) */
} //if(data[3]==1); } /* if(data[3]==1); */
else { else {
printk("\nSpecified functionality does not exist\n"); printk("\nSpecified functionality does not exist\n");
return -EINVAL; return -EINVAL;
} //if else data[3]==1) } /* if else data[3]==1) */
} //if else data[3]==0) } /* if else data[3]==0) */
return (insn->n);; return (insn->n);;
} }
...@@ -359,12 +359,12 @@ int i_APCI2200_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde ...@@ -359,12 +359,12 @@ int i_APCI2200_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde
{ {
unsigned int ui_Temp; unsigned int ui_Temp;
unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); // get the channel unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); /* get the channel */
ui_Temp = data[0]; ui_Temp = data[0];
*data = inw(devpriv->iobase + APCI2200_DIGITAL_OP); *data = inw(devpriv->iobase + APCI2200_DIGITAL_OP);
if (ui_Temp == 0) { if (ui_Temp == 0) {
*data = (*data >> ui_NoOfChannel) & 0x1; *data = (*data >> ui_NoOfChannel) & 0x1;
} //if(ui_Temp==0) } /* if(ui_Temp==0) */
else { else {
if (ui_Temp == 1) { if (ui_Temp == 1) {
switch (ui_NoOfChannel) { switch (ui_NoOfChannel) {
...@@ -386,14 +386,14 @@ int i_APCI2200_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde ...@@ -386,14 +386,14 @@ int i_APCI2200_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde
default: default:
comedi_error(dev, " chan spec wrong"); comedi_error(dev, " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannels) } /* switch(ui_NoOfChannels) */
} //if(ui_Temp==1) } /* if(ui_Temp==1) */
else { else {
printk("\nSpecified channel not supported \n"); printk("\nSpecified channel not supported \n");
} //elseif(ui_Temp==1) } /* elseif(ui_Temp==1) */
} //elseif(ui_Temp==0) } /* elseif(ui_Temp==0) */
return insn->n; return insn->n;
} }
...@@ -422,11 +422,11 @@ int i_APCI2200_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic ...@@ -422,11 +422,11 @@ int i_APCI2200_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic
struct comedi_insn * insn, unsigned int * data) struct comedi_insn * insn, unsigned int * data)
{ {
if (data[0] == 0) { if (data[0] == 0) {
//Disable the watchdog /* Disable the watchdog */
outw(0x0, outw(0x0,
devpriv->iobase + APCI2200_WATCHDOG + devpriv->iobase + APCI2200_WATCHDOG +
APCI2200_WATCHDOG_ENABLEDISABLE); APCI2200_WATCHDOG_ENABLEDISABLE);
//Loading the Reload value /* Loading the Reload value */
outw(data[1], outw(data[1],
devpriv->iobase + APCI2200_WATCHDOG + devpriv->iobase + APCI2200_WATCHDOG +
APCI2200_WATCHDOG_RELOAD_VALUE); APCI2200_WATCHDOG_RELOAD_VALUE);
...@@ -434,11 +434,11 @@ int i_APCI2200_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic ...@@ -434,11 +434,11 @@ int i_APCI2200_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic
outw(data[1], outw(data[1],
devpriv->iobase + APCI2200_WATCHDOG + devpriv->iobase + APCI2200_WATCHDOG +
APCI2200_WATCHDOG_RELOAD_VALUE + 2); APCI2200_WATCHDOG_RELOAD_VALUE + 2);
} //if(data[0]==0) } /* if(data[0]==0) */
else { else {
printk("\nThe input parameters are wrong\n"); printk("\nThe input parameters are wrong\n");
return -EINVAL; return -EINVAL;
} //elseif(data[0]==0) } /* elseif(data[0]==0) */
return insn->n; return insn->n;
} }
...@@ -468,15 +468,15 @@ int i_APCI2200_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_ ...@@ -468,15 +468,15 @@ int i_APCI2200_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_
struct comedi_insn * insn, unsigned int * data) struct comedi_insn * insn, unsigned int * data)
{ {
switch (data[0]) { switch (data[0]) {
case 0: //stop the watchdog case 0: /* stop the watchdog */
outw(0x0, devpriv->iobase + APCI2200_WATCHDOG + APCI2200_WATCHDOG_ENABLEDISABLE); //disable the watchdog outw(0x0, devpriv->iobase + APCI2200_WATCHDOG + APCI2200_WATCHDOG_ENABLEDISABLE); /* disable the watchdog */
break; break;
case 1: //start the watchdog case 1: /* start the watchdog */
outw(0x0001, outw(0x0001,
devpriv->iobase + APCI2200_WATCHDOG + devpriv->iobase + APCI2200_WATCHDOG +
APCI2200_WATCHDOG_ENABLEDISABLE); APCI2200_WATCHDOG_ENABLEDISABLE);
break; break;
case 2: //Software trigger case 2: /* Software trigger */
outw(0x0201, outw(0x0201,
devpriv->iobase + APCI2200_WATCHDOG + devpriv->iobase + APCI2200_WATCHDOG +
APCI2200_WATCHDOG_ENABLEDISABLE); APCI2200_WATCHDOG_ENABLEDISABLE);
...@@ -484,7 +484,7 @@ int i_APCI2200_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_ ...@@ -484,7 +484,7 @@ int i_APCI2200_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_
default: default:
printk("\nSpecified functionality does not exist\n"); printk("\nSpecified functionality does not exist\n");
return -EINVAL; return -EINVAL;
} // switch(data[0]) } /* switch(data[0]) */
return insn->n; return insn->n;
} }
...@@ -535,7 +535,7 @@ int i_APCI2200_ReadWatchdog(struct comedi_device * dev, struct comedi_subdevice ...@@ -535,7 +535,7 @@ int i_APCI2200_ReadWatchdog(struct comedi_device * dev, struct comedi_subdevice
int i_APCI2200_Reset(struct comedi_device * dev) int i_APCI2200_Reset(struct comedi_device * dev)
{ {
outw(0x0, devpriv->iobase + APCI2200_DIGITAL_OP); //RESETS THE DIGITAL OUTPUTS outw(0x0, devpriv->iobase + APCI2200_DIGITAL_OP); /* RESETS THE DIGITAL OUTPUTS */
outw(0x0, outw(0x0,
devpriv->iobase + APCI2200_WATCHDOG + devpriv->iobase + APCI2200_WATCHDOG +
APCI2200_WATCHDOG_ENABLEDISABLE); APCI2200_WATCHDOG_ENABLEDISABLE);
......
...@@ -17,31 +17,31 @@ ...@@ -17,31 +17,31 @@
/********* Definitions for APCI-2200 card *****/ /********* Definitions for APCI-2200 card *****/
// Card Specific information /* Card Specific information */
#define APCI2200_BOARD_VENDOR_ID 0x15b8 #define APCI2200_BOARD_VENDOR_ID 0x15b8
#define APCI2200_ADDRESS_RANGE 64 #define APCI2200_ADDRESS_RANGE 64
//DIGITAL INPUT-OUTPUT DEFINE /* DIGITAL INPUT-OUTPUT DEFINE */
#define APCI2200_DIGITAL_OP 4 #define APCI2200_DIGITAL_OP 4
#define APCI2200_DIGITAL_IP 0 #define APCI2200_DIGITAL_IP 0
// TIMER COUNTER WATCHDOG DEFINES /* TIMER COUNTER WATCHDOG DEFINES */
#define APCI2200_WATCHDOG 0x08 #define APCI2200_WATCHDOG 0x08
#define APCI2200_WATCHDOG_ENABLEDISABLE 12 #define APCI2200_WATCHDOG_ENABLEDISABLE 12
#define APCI2200_WATCHDOG_RELOAD_VALUE 4 #define APCI2200_WATCHDOG_RELOAD_VALUE 4
#define APCI2200_WATCHDOG_STATUS 16 #define APCI2200_WATCHDOG_STATUS 16
// Hardware Layer functions for Apci2200 /* Hardware Layer functions for Apci2200 */
//Digital Input /* Digital Input */
int i_APCI2200_ReadMoreDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2200_ReadMoreDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
int i_APCI2200_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2200_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
//Digital Output /* Digital Output */
int i_APCI2200_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2200_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
int i_APCI2200_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2200_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
...@@ -49,7 +49,7 @@ int i_APCI2200_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subde ...@@ -49,7 +49,7 @@ int i_APCI2200_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subde
int i_APCI2200_ReadDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2200_ReadDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
// TIMER /* TIMER */
int i_APCI2200_ConfigWatchdog(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2200_ConfigWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
int i_APCI2200_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2200_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
...@@ -57,5 +57,5 @@ int i_APCI2200_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_s ...@@ -57,5 +57,5 @@ int i_APCI2200_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_s
int i_APCI2200_ReadWatchdog(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI2200_ReadWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
//reset /* reset */
int i_APCI2200_Reset(struct comedi_device *dev); int i_APCI2200_Reset(struct comedi_device *dev);
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
* any later version. * any later version.
*/ */
// Card Specific information /* Card Specific information */
#define APCI3200_BOARD_VENDOR_ID 0x15B8 #define APCI3200_BOARD_VENDOR_ID 0x15B8
//#define APCI3200_ADDRESS_RANGE 264 /* #define APCI3200_ADDRESS_RANGE 264 */
int MODULE_NO; int MODULE_NO;
struct { struct {
...@@ -34,7 +34,7 @@ struct { ...@@ -34,7 +34,7 @@ struct {
} Config_Parameters_Module1, Config_Parameters_Module2, } Config_Parameters_Module1, Config_Parameters_Module2,
Config_Parameters_Module3, Config_Parameters_Module4; Config_Parameters_Module3, Config_Parameters_Module4;
//ANALOG INPUT RANGE /* ANALOG INPUT RANGE */
static const struct comedi_lrange range_apci3200_ai = { 8, { static const struct comedi_lrange range_apci3200_ai = { 8, {
BIP_RANGE(10), BIP_RANGE(10),
BIP_RANGE(5), BIP_RANGE(5),
...@@ -55,7 +55,7 @@ static const struct comedi_lrange range_apci3300_ai = { 4, { ...@@ -55,7 +55,7 @@ static const struct comedi_lrange range_apci3300_ai = { 4, {
} }
}; };
//Analog Input related Defines /* Analog Input related Defines */
#define APCI3200_AI_OFFSET_GAIN 0 #define APCI3200_AI_OFFSET_GAIN 0
#define APCI3200_AI_SC_TEST 4 #define APCI3200_AI_SC_TEST 4
#define APCI3200_AI_IRQ 8 #define APCI3200_AI_IRQ 8
...@@ -89,9 +89,9 @@ static const struct comedi_lrange range_apci3300_ai = { 4, { ...@@ -89,9 +89,9 @@ static const struct comedi_lrange range_apci3300_ai = { 4, {
#define ADDIDATA_UNIPOLAR 1 #define ADDIDATA_UNIPOLAR 1
#define ADDIDATA_BIPOLAR 2 #define ADDIDATA_BIPOLAR 2
//BEGIN JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values /* BEGIN JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values */
#define MAX_MODULE 4 #define MAX_MODULE 4
//END JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values /* END JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values */
struct str_ADDIDATA_RTDStruct { struct str_ADDIDATA_RTDStruct {
unsigned int ul_NumberOfValue; unsigned int ul_NumberOfValue;
...@@ -99,23 +99,23 @@ struct str_ADDIDATA_RTDStruct { ...@@ -99,23 +99,23 @@ struct str_ADDIDATA_RTDStruct {
unsigned int *pul_TemperatureValue; unsigned int *pul_TemperatureValue;
}; };
//BEGIN JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values /* BEGIN JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values */
struct str_Module { struct str_Module {
// Begin JK 05/08/2003 change for Linux /* Begin JK 05/08/2003 change for Linux */
unsigned long ul_CurrentSourceCJC; unsigned long ul_CurrentSourceCJC;
unsigned long ul_CurrentSource[5]; unsigned long ul_CurrentSource[5];
// End JK 05/08/2003 change for Linux /* End JK 05/08/2003 change for Linux */
// Begin CG 15/02/02 Rev 1.0 -> Rev 1.1 : Add Header Type 1 /* Begin CG 15/02/02 Rev 1.0 -> Rev 1.1 : Add Header Type 1 */
unsigned long ul_GainFactor[8]; // Gain Factor unsigned long ul_GainFactor[8]; /* Gain Factor */
unsigned int w_GainValue[10]; unsigned int w_GainValue[10];
// End CG 15/02/02 Rev 1.0 -> Rev 1.1 : Add Header Type 1 /* End CG 15/02/02 Rev 1.0 -> Rev 1.1 : Add Header Type 1 */
}; };
//END JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values /* END JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values */
//BEGIN JK 06.07.04: Management of sevrals boards /* BEGIN JK 06.07.04: Management of sevrals boards */
struct str_BoardInfos { struct str_BoardInfos {
int i_CJCAvailable; int i_CJCAvailable;
...@@ -138,25 +138,25 @@ struct str_BoardInfos { ...@@ -138,25 +138,25 @@ struct str_BoardInfos {
unsigned int ui_Channel_num; unsigned int ui_Channel_num;
int i_Count; int i_Count;
int i_Initialised; int i_Initialised;
//UINT ui_InterruptChannelValue[96]; //Buffer /* UINT ui_InterruptChannelValue[96]; //Buffer */
unsigned int ui_InterruptChannelValue[144]; //Buffer unsigned int ui_InterruptChannelValue[144]; /* Buffer */
unsigned char b_StructInitialized; unsigned char b_StructInitialized;
//Begin JK 19.10.2004: APCI-3200 Driver update 0.7.57 -> 0.7.68 /* Begin JK 19.10.2004: APCI-3200 Driver update 0.7.57 -> 0.7.68 */
unsigned int ui_ScanValueArray[7 + 12]; // 7 is the maximal number of channels unsigned int ui_ScanValueArray[7 + 12]; /* 7 is the maximal number of channels */
//End JK 19.10.2004: APCI-3200 Driver update 0.7.57 -> 0.7.68 /* End JK 19.10.2004: APCI-3200 Driver update 0.7.57 -> 0.7.68 */
//Begin JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values /* Begin JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values */
int i_ConnectionType; int i_ConnectionType;
int i_NbrOfModule; int i_NbrOfModule;
struct str_Module s_Module[MAX_MODULE]; struct str_Module s_Module[MAX_MODULE];
//End JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values /* End JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values */
}; };
//END JK 06.07.04: Management of sevrals boards /* END JK 06.07.04: Management of sevrals boards */
// Hardware Layer functions for Apci3200 /* Hardware Layer functions for Apci3200 */
//AI /* AI */
int i_APCI3200_ConfigAnalogInput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI3200_ConfigAnalogInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
...@@ -175,10 +175,10 @@ int i_APCI3200_CommandTestAnalogInput(struct comedi_device *dev, struct comedi_s ...@@ -175,10 +175,10 @@ int i_APCI3200_CommandTestAnalogInput(struct comedi_device *dev, struct comedi_s
int i_APCI3200_CommandAnalogInput(struct comedi_device *dev, struct comedi_subdevice *s); int i_APCI3200_CommandAnalogInput(struct comedi_device *dev, struct comedi_subdevice *s);
int i_APCI3200_ReadDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI3200_ReadDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
//Interrupt /* Interrupt */
void v_APCI3200_Interrupt(int irq, void *d); void v_APCI3200_Interrupt(int irq, void *d);
int i_APCI3200_InterruptHandleEos(struct comedi_device *dev); int i_APCI3200_InterruptHandleEos(struct comedi_device *dev);
//Reset functions /* Reset functions */
int i_APCI3200_Reset(struct comedi_device *dev); int i_APCI3200_Reset(struct comedi_device *dev);
int i_APCI3200_ReadCJCCalOffset(struct comedi_device *dev, unsigned int *data); int i_APCI3200_ReadCJCCalOffset(struct comedi_device *dev, unsigned int *data);
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* any later version. * any later version.
*/ */
// Card Specific information /* Card Specific information */
#define APCI3501_BOARD_VENDOR_ID 0x15B8 #define APCI3501_BOARD_VENDOR_ID 0x15B8
#define APCI3501_ADDRESS_RANGE 255 #define APCI3501_ADDRESS_RANGE 255
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define APCI3501_DIGITAL_OP 0x40 #define APCI3501_DIGITAL_OP 0x40
#define APCI3501_ANALOG_OUTPUT 0x00 #define APCI3501_ANALOG_OUTPUT 0x00
//Analog Output related Defines /* Analog Output related Defines */
#define APCI3501_AO_VOLT_MODE 0 #define APCI3501_AO_VOLT_MODE 0
#define APCI3501_AO_PROG 4 #define APCI3501_AO_PROG 4
#define APCI3501_AO_TRIG_SCS 8 #define APCI3501_AO_TRIG_SCS 8
...@@ -31,14 +31,14 @@ ...@@ -31,14 +31,14 @@
#define BIPOLAR 1 #define BIPOLAR 1
#define MODE0 0 #define MODE0 0
#define MODE1 1 #define MODE1 1
// ANALOG OUTPUT RANGE /* ANALOG OUTPUT RANGE */
struct comedi_lrange range_apci3501_ao = { 2, { struct comedi_lrange range_apci3501_ao = { 2, {
BIP_RANGE(10), BIP_RANGE(10),
UNI_RANGE(10) UNI_RANGE(10)
} }
}; };
//Watchdog Related Defines /* Watchdog Related Defines */
#define APCI3501_WATCHDOG 0x20 #define APCI3501_WATCHDOG 0x20
#define APCI3501_TCW_SYNC_ENABLEDISABLE 0 #define APCI3501_TCW_SYNC_ENABLEDISABLE 0
...@@ -52,22 +52,24 @@ struct comedi_lrange range_apci3501_ao = { 2, { ...@@ -52,22 +52,24 @@ struct comedi_lrange range_apci3501_ao = { 2, {
#define ADDIDATA_TIMER 0 #define ADDIDATA_TIMER 0
#define ADDIDATA_WATCHDOG 2 #define ADDIDATA_WATCHDOG 2
// Hardware Layer functions for Apci3501 /* Hardware Layer functions for Apci3501 */
//AO /* AO */
int i_APCI3501_ConfigAnalogOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI3501_ConfigAnalogOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
int i_APCI3501_WriteAnalogOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI3501_WriteAnalogOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
//DI /*
// for di read * DI for di read INT i_APCI3501_ReadDigitalInput(struct
//INT i_APCI3501_ReadDigitalInput(struct comedi_device *dev,struct comedi_subdevice *s,struct comedi_insn *insn,unsigned int *data); * comedi_device *dev,struct comedi_subdevice *s,struct comedi_insn
* *insn,unsigned int *data);
*/
int i_APCI3501_ReadDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI3501_ReadDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
//DO /* DO */
int i_APCI3501_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI3501_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
int i_APCI3501_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI3501_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
...@@ -75,8 +77,10 @@ int i_APCI3501_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subde ...@@ -75,8 +77,10 @@ int i_APCI3501_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subde
int i_APCI3501_ReadDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI3501_ReadDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
// TIMER /* TIMER
// timer value is passed as u seconds * timer value is passed as u seconds
*/
int i_APCI3501_ConfigTimerCounterWatchdog(struct comedi_device *dev, int i_APCI3501_ConfigTimerCounterWatchdog(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
...@@ -87,8 +91,8 @@ int i_APCI3501_StartStopWriteTimerCounterWatchdog(struct comedi_device *dev, ...@@ -87,8 +91,8 @@ int i_APCI3501_StartStopWriteTimerCounterWatchdog(struct comedi_device *dev,
int i_APCI3501_ReadTimerCounterWatchdog(struct comedi_device *dev, int i_APCI3501_ReadTimerCounterWatchdog(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
//Interrupt /* Interrupt */
void v_APCI3501_Interrupt(int irq, void *d); void v_APCI3501_Interrupt(int irq, void *d);
//Reset functions /* Reset functions */
int i_APCI3501_Reset(struct comedi_device *dev); int i_APCI3501_Reset(struct comedi_device *dev);
#define CONFIG_APCI_035 1 #define CONFIG_APCI_035 1
#define ADDIDATA_WATCHDOG 2 // Or shold it be something else #define ADDIDATA_WATCHDOG 2 /* Or shold it be something else */
#include "addi-data/addi_common.c" #include "addi-data/addi_common.c"
...@@ -39,7 +39,7 @@ Configuration Options: ...@@ -39,7 +39,7 @@ Configuration Options:
#include "comedi_pci.h" #include "comedi_pci.h"
#include "8255.h" #include "8255.h"
// #include "8253.h" /* #include "8253.h" */
#define PORT1A 0 #define PORT1A 0
#define PORT2A 4 #define PORT2A 4
...@@ -115,7 +115,7 @@ static int adl_pci7296_attach(struct comedi_device * dev, struct comedi_devconfi ...@@ -115,7 +115,7 @@ static int adl_pci7296_attach(struct comedi_device * dev, struct comedi_devconfi
dev->iobase = pci_resource_start(pcidev, 2); dev->iobase = pci_resource_start(pcidev, 2);
printk("comedi: base addr %4lx\n", dev->iobase); printk("comedi: base addr %4lx\n", dev->iobase);
// four 8255 digital io subdevices /* four 8255 digital io subdevices */
s = dev->subdevices + 0; s = dev->subdevices + 0;
subdev_8255_init(dev, s, NULL, subdev_8255_init(dev, s, NULL,
(unsigned long)(dev->iobase)); (unsigned long)(dev->iobase));
...@@ -159,7 +159,7 @@ static int adl_pci7296_detach(struct comedi_device * dev) ...@@ -159,7 +159,7 @@ static int adl_pci7296_detach(struct comedi_device * dev)
} }
pci_dev_put(devpriv->pci_dev); pci_dev_put(devpriv->pci_dev);
} }
// detach four 8255 digital io subdevices /* detach four 8255 digital io subdevices */
if (dev->subdevices) { if (dev->subdevices) {
subdev_8255_cleanup(dev, dev->subdevices + 0); subdev_8255_cleanup(dev, dev->subdevices + 0);
subdev_8255_cleanup(dev, dev->subdevices + 1); subdev_8255_cleanup(dev, dev->subdevices + 1);
......
...@@ -149,7 +149,7 @@ static int adl_pci8164_attach(struct comedi_device * dev, struct comedi_devconfi ...@@ -149,7 +149,7 @@ static int adl_pci8164_attach(struct comedi_device * dev, struct comedi_devconfi
s->n_chan = 4; s->n_chan = 4;
s->maxdata = 0xffff; s->maxdata = 0xffff;
s->len_chanlist = 4; s->len_chanlist = 4;
//s->range_table = &range_axis; /* s->range_table = &range_axis; */
s->insn_read = adl_pci8164_insn_read_msts; s->insn_read = adl_pci8164_insn_read_msts;
s->insn_write = adl_pci8164_insn_write_cmd; s->insn_write = adl_pci8164_insn_write_cmd;
...@@ -159,7 +159,7 @@ static int adl_pci8164_attach(struct comedi_device * dev, struct comedi_devconfi ...@@ -159,7 +159,7 @@ static int adl_pci8164_attach(struct comedi_device * dev, struct comedi_devconfi
s->n_chan = 4; s->n_chan = 4;
s->maxdata = 0xffff; s->maxdata = 0xffff;
s->len_chanlist = 4; s->len_chanlist = 4;
//s->range_table = &range_axis; /* s->range_table = &range_axis; */
s->insn_read = adl_pci8164_insn_read_ssts; s->insn_read = adl_pci8164_insn_read_ssts;
s->insn_write = adl_pci8164_insn_write_otp; s->insn_write = adl_pci8164_insn_write_otp;
...@@ -169,7 +169,7 @@ static int adl_pci8164_attach(struct comedi_device * dev, struct comedi_devconfi ...@@ -169,7 +169,7 @@ static int adl_pci8164_attach(struct comedi_device * dev, struct comedi_devconfi
s->n_chan = 4; s->n_chan = 4;
s->maxdata = 0xffff; s->maxdata = 0xffff;
s->len_chanlist = 4; s->len_chanlist = 4;
//s->range_table = &range_axis; /* s->range_table = &range_axis; */
s->insn_read = adl_pci8164_insn_read_buf0; s->insn_read = adl_pci8164_insn_read_buf0;
s->insn_write = adl_pci8164_insn_write_buf0; s->insn_write = adl_pci8164_insn_write_buf0;
...@@ -179,7 +179,7 @@ static int adl_pci8164_attach(struct comedi_device * dev, struct comedi_devconfi ...@@ -179,7 +179,7 @@ static int adl_pci8164_attach(struct comedi_device * dev, struct comedi_devconfi
s->n_chan = 4; s->n_chan = 4;
s->maxdata = 0xffff; s->maxdata = 0xffff;
s->len_chanlist = 4; s->len_chanlist = 4;
//s->range_table = &range_axis; /* s->range_table = &range_axis; */
s->insn_read = adl_pci8164_insn_read_buf1; s->insn_read = adl_pci8164_insn_read_buf1;
s->insn_write = adl_pci8164_insn_write_buf1; s->insn_write = adl_pci8164_insn_write_buf1;
......
...@@ -96,16 +96,16 @@ static int aio_aio12_8_ai_read(struct comedi_device * dev, struct comedi_subdevi ...@@ -96,16 +96,16 @@ static int aio_aio12_8_ai_read(struct comedi_device * dev, struct comedi_subdevi
ADC_MODE_NORMAL | ADC_MODE_NORMAL |
(CR_RANGE(insn->chanspec) << 3) | CR_CHAN(insn->chanspec); (CR_RANGE(insn->chanspec) << 3) | CR_CHAN(insn->chanspec);
//read status to clear EOC latch /* read status to clear EOC latch */
inb(dev->iobase + AIO12_8_STATUS); inb(dev->iobase + AIO12_8_STATUS);
for (n = 0; n < insn->n; n++) { for (n = 0; n < insn->n; n++) {
int timeout = 5; int timeout = 5;
// Setup and start conversion /* Setup and start conversion */
outb(control, dev->iobase + AIO12_8_ADC); outb(control, dev->iobase + AIO12_8_ADC);
// Wait for conversion to complete /* Wait for conversion to complete */
while (timeout && while (timeout &&
!(inb(dev->iobase + AIO12_8_STATUS) & STATUS_ADC_EOC)) { !(inb(dev->iobase + AIO12_8_STATUS) & STATUS_ADC_EOC)) {
timeout--; timeout--;
...@@ -140,12 +140,12 @@ static int aio_aio12_8_ao_write(struct comedi_device * dev, struct comedi_subdev ...@@ -140,12 +140,12 @@ static int aio_aio12_8_ao_write(struct comedi_device * dev, struct comedi_subdev
int chan = CR_CHAN(insn->chanspec); int chan = CR_CHAN(insn->chanspec);
unsigned long port = dev->iobase + AIO12_8_DAC_0 + (2 * chan); unsigned long port = dev->iobase + AIO12_8_DAC_0 + (2 * chan);
//enable DACs /* enable DACs */
outb(0x01, dev->iobase + DAC_ENABLE); outb(0x01, dev->iobase + DAC_ENABLE);
for (i = 0; i < insn->n; i++) { for (i = 0; i < insn->n; i++) {
outb(data[i] & 0xFF, port); // LSB outb(data[i] & 0xFF, port); /* LSB */
outb((data[i] >> 8) & 0x0F, port + 1); // MSB outb((data[i] >> 8) & 0x0F, port + 1); /* MSB */
devpriv->ao_readback[chan] = data[i]; devpriv->ao_readback[chan] = data[i];
} }
return insn->n; return insn->n;
......
This diff is collapsed.
...@@ -278,7 +278,7 @@ static int das16cs_detach(struct comedi_device * dev) ...@@ -278,7 +278,7 @@ static int das16cs_detach(struct comedi_device * dev)
static irqreturn_t das16cs_interrupt(int irq, void *d) static irqreturn_t das16cs_interrupt(int irq, void *d)
{ {
//struct comedi_device *dev = d; /* struct comedi_device *dev = d; */
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -973,4 +973,4 @@ void __exit cleanup_module(void) ...@@ -973,4 +973,4 @@ void __exit cleanup_module(void)
#else #else
COMEDI_INITCLEANUP(driver_das16cs); COMEDI_INITCLEANUP(driver_das16cs);
#endif //CONFIG_PCMCIA #endif /* CONFIG_PCMCIA */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -342,7 +342,7 @@ static int das6402_attach(struct comedi_device * dev, struct comedi_devconfig * ...@@ -342,7 +342,7 @@ static int das6402_attach(struct comedi_device * dev, struct comedi_devconfig *
s->type = COMEDI_SUBD_AI; s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_GROUND; s->subdev_flags = SDF_READABLE | SDF_GROUND;
s->n_chan = 8; s->n_chan = 8;
//s->trig[2]=das6402_ai_mode2; /* s->trig[2]=das6402_ai_mode2; */
s->cancel = das6402_ai_cancel; s->cancel = das6402_ai_cancel;
s->maxdata = (1 << 12) - 1; s->maxdata = (1 << 12) - 1;
s->len_chanlist = 16; /* ? */ s->len_chanlist = 16; /* ? */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment