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

Staging: comedi: remove C99 comments in hwdrv_apci1500.c

Signed-off-by: default avatarBill Pemberton <wfp5p@virginia.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0109253d
...@@ -157,16 +157,16 @@ int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev, ...@@ -157,16 +157,16 @@ int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev,
if (data[0] == 1) { if (data[0] == 1) {
i_MaxChannel = 8; i_MaxChannel = 8;
} // if (data[0] == 1) } /* if (data[0] == 1) */
else { else {
if (data[0] == 2) { if (data[0] == 2) {
i_MaxChannel = 6; i_MaxChannel = 6;
} // if(data[0]==2) } /* if(data[0]==2) */
else { else {
printk("\nThe specified port event does not exist\n"); printk("\nThe specified port event does not exist\n");
return -EINVAL; return -EINVAL;
} //else if(data[0]==2) } /* else if(data[0]==2) */
} //else if (data[0] == 1) } /* else if (data[0] == 1) */
switch (data[1]) { switch (data[1]) {
case 0: case 0:
data[1] = APCI1500_AND; data[1] = APCI1500_AND;
...@@ -180,7 +180,7 @@ int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev, ...@@ -180,7 +180,7 @@ int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev,
default: default:
printk("\nThe specified interrupt logic does not exist\n"); printk("\nThe specified interrupt logic does not exist\n");
return -EINVAL; return -EINVAL;
} //switch(data[1]); } /* switch(data[1]); */
i_Logic = data[1]; i_Logic = data[1];
for (i_Count = i_MaxChannel, i = 0; i_Count > 0; i_Count--, i++) { for (i_Count = i_MaxChannel, i = 0; i_Count > 0; i_Count--, i++) {
...@@ -224,8 +224,8 @@ int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev, ...@@ -224,8 +224,8 @@ int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev,
default: default:
printk("\nThe option indicated in the event mask does not exist\n"); printk("\nThe option indicated in the event mask does not exist\n");
return -EINVAL; return -EINVAL;
} // switch(i_EventMask) } /* switch(i_EventMask) */
} //for (i_Count = i_MaxChannel; i_Count >0;i_Count --) } /* for (i_Count = i_MaxChannel; i_Count >0;i_Count --) */
if (data[0] == 1) { if (data[0] == 1) {
/****************************/ /****************************/
...@@ -247,7 +247,7 @@ int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev, ...@@ -247,7 +247,7 @@ int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev,
/********************************************/ /********************************************/
printk("\nTransition error on an OR PRIORITY logic\n"); printk("\nTransition error on an OR PRIORITY logic\n");
return -EINVAL; return -EINVAL;
} // if (data[1]== APCI1500_OR_PRIORITY && i_PatternTransition != 0) } /* if (data[1]== APCI1500_OR_PRIORITY && i_PatternTransition != 0) */
/*************************************/ /*************************************/
/* Tests if more than one transition */ /* Tests if more than one transition */
...@@ -261,7 +261,7 @@ int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev, ...@@ -261,7 +261,7 @@ int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev,
((i_PatternTransition >> ((i_PatternTransition >>
i_Count) & 0x1); i_Count) & 0x1);
} //for (i_Count = 0; i_Count < 8; i_Count++) } /* for (i_Count = 0; i_Count < 8; i_Count++) */
if (i_PatternTransitionCount > 1) { if (i_PatternTransitionCount > 1) {
/****************************************/ /****************************************/
...@@ -269,8 +269,8 @@ int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev, ...@@ -269,8 +269,8 @@ int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev,
/****************************************/ /****************************************/
printk("\n Transition error on an AND logic\n"); printk("\n Transition error on an AND logic\n");
return -EINVAL; return -EINVAL;
} // if (i_PatternTransitionCount > 1) } /* if (i_PatternTransitionCount > 1) */
} // if (data[1]== APCI1500_AND) } /* if (data[1]== APCI1500_AND) */
/*****************************************************************/ /*****************************************************************/
/* Selects the APCI1500_RW_MASTER_CONFIGURATION_CONTROL register */ /* Selects the APCI1500_RW_MASTER_CONFIGURATION_CONTROL register */
...@@ -359,12 +359,12 @@ int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev, ...@@ -359,12 +359,12 @@ int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev,
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} // if(data[1]==APCI1500_AND||data[1]==APCI1500_OR||data[1]==APCI1500_OR_PRIORITY) } /* if(data[1]==APCI1500_AND||data[1]==APCI1500_OR||data[1]==APCI1500_OR_PRIORITY) */
else { else {
printk("\nThe choice for interrupt logic does not exist\n"); printk("\nThe choice for interrupt logic does not exist\n");
return -EINVAL; return -EINVAL;
} // else }// if(data[1]==APCI1500_AND||data[1]==APCI1500_OR||data[1]==APCI1500_OR_PRIORITY) } /* else }// if(data[1]==APCI1500_AND||data[1]==APCI1500_OR||data[1]==APCI1500_OR_PRIORITY) */
} // if (data[0]== 1) } /* if (data[0]== 1) */
/************************************/ /************************************/
/* Test if event setting for port 2 */ /* Test if event setting for port 2 */
...@@ -487,12 +487,12 @@ int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev, ...@@ -487,12 +487,12 @@ int i_APCI1500_ConfigDigitalInputEvent(struct comedi_device * dev,
outb(0xF4, outb(0xF4,
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} // if (data[1] == APCI1500_OR) } /* if (data[1] == APCI1500_OR) */
else { else {
printk("\nThe choice for interrupt logic does not exist\n"); printk("\nThe choice for interrupt logic does not exist\n");
return -EINVAL; return -EINVAL;
} //elseif (data[1] == APCI1500_OR) } /* elseif (data[1] == APCI1500_OR) */
} //if(data[0]==2) } /* if(data[0]==2) */
return insn->n; return insn->n;
} }
...@@ -589,12 +589,12 @@ int i_APCI1500_StartStopInputEvent(struct comedi_device * dev, struct comedi_sub ...@@ -589,12 +589,12 @@ int i_APCI1500_StartStopInputEvent(struct comedi_device * dev, struct comedi_sub
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} // if(i_Event1Status==1) } /* if(i_Event1Status==1) */
else { else {
printk("\nEvent 1 not initialised\n"); printk("\nEvent 1 not initialised\n");
return -EINVAL; return -EINVAL;
} //else if(i_Event1Status==1) } /* else if(i_Event1Status==1) */
} //if (data[1]==1) } /* if (data[1]==1) */
if (data[1] == 2) { if (data[1] == 2) {
if (i_Event2Status == 1) { if (i_Event2Status == 1) {
...@@ -640,17 +640,17 @@ int i_APCI1500_StartStopInputEvent(struct comedi_device * dev, struct comedi_sub ...@@ -640,17 +640,17 @@ int i_APCI1500_StartStopInputEvent(struct comedi_device * dev, struct comedi_sub
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
i_Event2InterruptStatus = 1; i_Event2InterruptStatus = 1;
} // if(i_Event2Status==1) } /* if(i_Event2Status==1) */
else { else {
printk("\nEvent 2 not initialised\n"); printk("\nEvent 2 not initialised\n");
return -EINVAL; return -EINVAL;
} //else if(i_Event2Status==1) } /* else if(i_Event2Status==1) */
} // if(data[1]==2) } /* if(data[1]==2) */
} // if (data[1] == 1 || data[0] == 2) } /* if (data[1] == 1 || data[0] == 2) */
else { else {
printk("\nThe port parameter is in error\n"); printk("\nThe port parameter is in error\n");
return -EINVAL; return -EINVAL;
} //else if (data[1] == 1 || data[0] == 2) } /* else if (data[1] == 1 || data[0] == 2) */
break; break;
...@@ -701,12 +701,12 @@ int i_APCI1500_StartStopInputEvent(struct comedi_device * dev, struct comedi_sub ...@@ -701,12 +701,12 @@ int i_APCI1500_StartStopInputEvent(struct comedi_device * dev, struct comedi_sub
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
i_Event1InterruptStatus = 0; i_Event1InterruptStatus = 0;
} // if(i_Event1Status==1) } /* if(i_Event1Status==1) */
else { else {
printk("\nEvent 1 not initialised\n"); printk("\nEvent 1 not initialised\n");
return -EINVAL; return -EINVAL;
} //else if(i_Event1Status==1) } /* else if(i_Event1Status==1) */
} //if (data[1]==1) } /* if (data[1]==1) */
if (data[1] == 2) { if (data[1] == 2) {
/*****************************/ /*****************************/
/* Test if event initialised */ /* Test if event initialised */
...@@ -744,23 +744,23 @@ int i_APCI1500_StartStopInputEvent(struct comedi_device * dev, struct comedi_sub ...@@ -744,23 +744,23 @@ int i_APCI1500_StartStopInputEvent(struct comedi_device * dev, struct comedi_sub
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
i_Event2InterruptStatus = 0; i_Event2InterruptStatus = 0;
} // if(i_Event2Status==1) } /* if(i_Event2Status==1) */
else { else {
printk("\nEvent 2 not initialised\n"); printk("\nEvent 2 not initialised\n");
return -EINVAL; return -EINVAL;
} //else if(i_Event2Status==1) } /* else if(i_Event2Status==1) */
} //if(data[1]==2) } /* if(data[1]==2) */
} // if (data[1] == 1 || data[1] == 2) } /* if (data[1] == 1 || data[1] == 2) */
else { else {
printk("\nThe port parameter is in error\n"); printk("\nThe port parameter is in error\n");
return -EINVAL; return -EINVAL;
} //else if (data[1] == 1 || data[1] == 2) } /* else if (data[1] == 1 || data[1] == 2) */
break; break;
default: default:
printk("\nThe option of START/STOP logic does not exist\n"); printk("\nThe option of START/STOP logic does not exist\n");
return -EINVAL; return -EINVAL;
} //switch(data[0]) } /* switch(data[0]) */
return insn->n; return insn->n;
} }
...@@ -973,11 +973,11 @@ int i_APCI1500_ReadMoreDigitalInput(struct comedi_device * dev, struct comedi_su ...@@ -973,11 +973,11 @@ int i_APCI1500_ReadMoreDigitalInput(struct comedi_device * dev, struct comedi_su
(unsigned int) inw(devpriv->i_IobaseAddon + (unsigned int) inw(devpriv->i_IobaseAddon +
APCI1500_DIGITAL_IP); APCI1500_DIGITAL_IP);
*data = (ui_TmpValue >> ui_Channel) & 0x1; *data = (ui_TmpValue >> ui_Channel) & 0x1;
} //if(ui_Channel >= 0 && ui_Channel <=15) } /* if(ui_Channel >= 0 && ui_Channel <=15) */
else { else {
printk("\nThe channel specification are in error\n"); printk("\nThe channel specification are in error\n");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
} //else if(ui_Channel >= 0 && ui_Channel <=15) } /* else if(ui_Channel >= 0 && ui_Channel <=15) */
break; break;
case 1: case 1:
...@@ -1001,14 +1001,14 @@ int i_APCI1500_ReadMoreDigitalInput(struct comedi_device * dev, struct comedi_su ...@@ -1001,14 +1001,14 @@ int i_APCI1500_ReadMoreDigitalInput(struct comedi_device * dev, struct comedi_su
default: default:
printk("\nSpecified channel cannot be read \n"); printk("\nSpecified channel cannot be read \n");
return -EINVAL; // "sorry channel spec wrong " return -EINVAL; /* "sorry channel spec wrong " */
break; break;
} //switch(ui_Channel) } /* switch(ui_Channel) */
break; break;
default: default:
printk("\nThe specified functionality does not exist\n"); printk("\nThe specified functionality does not exist\n");
return -EINVAL; return -EINVAL;
} //switch(data[0]) } /* switch(data[0]) */
return insn->n; return insn->n;
} }
...@@ -1073,18 +1073,18 @@ int i_APCI1500_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -1073,18 +1073,18 @@ int i_APCI1500_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
static unsigned int ui_Temp = 0; static unsigned int ui_Temp = 0;
unsigned int ui_Temp1; unsigned int 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 = 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], outw(data[0],
devpriv->i_IobaseAddon + APCI1500_DIGITAL_OP); devpriv->i_IobaseAddon + APCI1500_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) {
...@@ -1113,19 +1113,19 @@ int i_APCI1500_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -1113,19 +1113,19 @@ int i_APCI1500_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->i_IobaseAddon + devpriv->i_IobaseAddon +
APCI1500_DIGITAL_OP); APCI1500_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) {
...@@ -1140,7 +1140,7 @@ int i_APCI1500_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -1140,7 +1140,7 @@ int i_APCI1500_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
outw(data[0], outw(data[0],
devpriv->i_IobaseAddon + devpriv->i_IobaseAddon +
APCI1500_DIGITAL_OP); APCI1500_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) {
...@@ -1190,24 +1190,24 @@ int i_APCI1500_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd ...@@ -1190,24 +1190,24 @@ int i_APCI1500_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->i_IobaseAddon + devpriv->i_IobaseAddon +
APCI1500_DIGITAL_OP); APCI1500_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) */
ui_Temp = data[0]; ui_Temp = data[0];
return (insn->n);; return (insn->n);;
} }
...@@ -1268,20 +1268,20 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev, ...@@ -1268,20 +1268,20 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev,
devpriv->tsk_Current = current; devpriv->tsk_Current = current;
//Selection of the input clock /* Selection of the input clock */
if (data[0] == 0 || data[0] == 1 || data[0] == 2) { if (data[0] == 0 || data[0] == 1 || data[0] == 2) {
outw(data[0], devpriv->i_IobaseAddon + APCI1500_CLK_SELECT); outw(data[0], devpriv->i_IobaseAddon + APCI1500_CLK_SELECT);
} // if(data[0]==0||data[0]==1||data[0]==2) } /* if(data[0]==0||data[0]==1||data[0]==2) */
else { else {
if (data[0] != 3) { if (data[0] != 3) {
printk("\nThe option for input clock selection does not exist\n"); printk("\nThe option for input clock selection does not exist\n");
return -EINVAL; return -EINVAL;
} // if(data[0]!=3) } /* if(data[0]!=3) */
} //elseif(data[0]==0||data[0]==1||data[0]==2) } /* elseif(data[0]==0||data[0]==1||data[0]==2) */
//Select the counter/timer /* Select the counter/timer */
switch (data[1]) { switch (data[1]) {
case COUNTER1: case COUNTER1:
//selecting counter or timer /* selecting counter or timer */
switch (data[2]) { switch (data[2]) {
case 0: case 0:
data[2] = APCI1500_COUNTER; data[2] = APCI1500_COUNTER;
...@@ -1292,9 +1292,9 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev, ...@@ -1292,9 +1292,9 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev,
default: default:
printk("\nThis choice is not a timer nor a counter\n"); printk("\nThis choice is not a timer nor a counter\n");
return -EINVAL; return -EINVAL;
} // switch(data[2]) } /* switch(data[2]) */
//Selecting single or continuous mode /* Selecting single or continuous mode */
switch (data[4]) { switch (data[4]) {
case 0: case 0:
data[4] = APCI1500_CONTINUOUS; data[4] = APCI1500_CONTINUOUS;
...@@ -1305,7 +1305,7 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev, ...@@ -1305,7 +1305,7 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev,
default: default:
printk("\nThis option for single/continuous mode does not exist\n"); printk("\nThis option for single/continuous mode does not exist\n");
return -EINVAL; return -EINVAL;
} // switch(data[4]) } /* switch(data[4]) */
i_TimerCounterMode = data[2] | data[4] | 7; i_TimerCounterMode = data[2] | data[4] | 7;
/*************************/ /*************************/
...@@ -1428,21 +1428,21 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev, ...@@ -1428,21 +1428,21 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev,
outb(0x2, outb(0x2,
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} //if(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) } /* if(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */
else { else {
printk("\nError in selection of interrupt enable or disable\n"); printk("\nError in selection of interrupt enable or disable\n");
return -EINVAL; return -EINVAL;
} //elseif(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) } /* elseif(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */
} // if ((data[3]>= 0) && (data[3] <= 65535)) } /* if ((data[3]>= 0) && (data[3] <= 65535)) */
else { else {
printk("\nError in selection of reload value\n"); printk("\nError in selection of reload value\n");
return -EINVAL; return -EINVAL;
} //else if ((data[3]>= 0) && (data[3] <= 65535)) } /* else if ((data[3]>= 0) && (data[3] <= 65535)) */
i_TimerCounterWatchdogInterrupt = data[7]; i_TimerCounterWatchdogInterrupt = data[7];
i_TimerCounter1Init = 1; i_TimerCounter1Init = 1;
break; break;
case COUNTER2: //selecting counter or timer case COUNTER2: /* selecting counter or timer */
switch (data[2]) { switch (data[2]) {
case 0: case 0:
data[2] = APCI1500_COUNTER; data[2] = APCI1500_COUNTER;
...@@ -1453,9 +1453,9 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev, ...@@ -1453,9 +1453,9 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev,
default: default:
printk("\nThis choice is not a timer nor a counter\n"); printk("\nThis choice is not a timer nor a counter\n");
return -EINVAL; return -EINVAL;
} // switch(data[2]) } /* switch(data[2]) */
//Selecting single or continuous mode /* Selecting single or continuous mode */
switch (data[4]) { switch (data[4]) {
case 0: case 0:
data[4] = APCI1500_CONTINUOUS; data[4] = APCI1500_CONTINUOUS;
...@@ -1466,9 +1466,9 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev, ...@@ -1466,9 +1466,9 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev,
default: default:
printk("\nThis option for single/continuous mode does not exist\n"); printk("\nThis option for single/continuous mode does not exist\n");
return -EINVAL; return -EINVAL;
} // switch(data[4]) } /* switch(data[4]) */
//Selecting software or hardware trigger /* Selecting software or hardware trigger */
switch (data[5]) { switch (data[5]) {
case 0: case 0:
data[5] = APCI1500_SOFTWARE_TRIGGER; data[5] = APCI1500_SOFTWARE_TRIGGER;
...@@ -1479,9 +1479,9 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev, ...@@ -1479,9 +1479,9 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev,
default: default:
printk("\nThis choice for software or hardware trigger does not exist\n"); printk("\nThis choice for software or hardware trigger does not exist\n");
return -EINVAL; return -EINVAL;
} // switch(data[5]) } /* switch(data[5]) */
//Selecting software or hardware gate /* Selecting software or hardware gate */
switch (data[6]) { switch (data[6]) {
case 0: case 0:
data[6] = APCI1500_SOFTWARE_GATE; data[6] = APCI1500_SOFTWARE_GATE;
...@@ -1492,7 +1492,7 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev, ...@@ -1492,7 +1492,7 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev,
default: default:
printk("\nThis choice for software or hardware gate does not exist\n"); printk("\nThis choice for software or hardware gate does not exist\n");
return -EINVAL; return -EINVAL;
} // switch(data[6]) } /* switch(data[6]) */
i_TimerCounterMode = data[2] | data[4] | data[5] | data[6] | 7; i_TimerCounterMode = data[2] | data[4] | data[5] | data[6] | 7;
...@@ -1616,21 +1616,21 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev, ...@@ -1616,21 +1616,21 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev,
outb(0x2, outb(0x2,
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} //if(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) } /* if(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */
else { else {
printk("\nError in selection of interrupt enable or disable\n"); printk("\nError in selection of interrupt enable or disable\n");
return -EINVAL; return -EINVAL;
} //elseif(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) } /* elseif(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */
} // if ((data[3]>= 0) && (data[3] <= 65535)) } /* if ((data[3]>= 0) && (data[3] <= 65535)) */
else { else {
printk("\nError in selection of reload value\n"); printk("\nError in selection of reload value\n");
return -EINVAL; return -EINVAL;
} //else if ((data[3]>= 0) && (data[3] <= 65535)) } /* else if ((data[3]>= 0) && (data[3] <= 65535)) */
i_TimerCounterWatchdogInterrupt = data[7]; i_TimerCounterWatchdogInterrupt = data[7];
i_TimerCounter2Init = 1; i_TimerCounter2Init = 1;
break; break;
case COUNTER3: //selecting counter or watchdog case COUNTER3: /* selecting counter or watchdog */
switch (data[2]) { switch (data[2]) {
case 0: case 0:
data[2] = APCI1500_COUNTER; data[2] = APCI1500_COUNTER;
...@@ -1641,9 +1641,9 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev, ...@@ -1641,9 +1641,9 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev,
default: default:
printk("\nThis choice is not a watchdog nor a counter\n"); printk("\nThis choice is not a watchdog nor a counter\n");
return -EINVAL; return -EINVAL;
} // switch(data[2]) } /* switch(data[2]) */
//Selecting single or continuous mode /* Selecting single or continuous mode */
switch (data[4]) { switch (data[4]) {
case 0: case 0:
data[4] = APCI1500_CONTINUOUS; data[4] = APCI1500_CONTINUOUS;
...@@ -1654,9 +1654,9 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev, ...@@ -1654,9 +1654,9 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev,
default: default:
printk("\nThis option for single/continuous mode does not exist\n"); printk("\nThis option for single/continuous mode does not exist\n");
return -EINVAL; return -EINVAL;
} // switch(data[4]) } /* switch(data[4]) */
//Selecting software or hardware gate /* Selecting software or hardware gate */
switch (data[6]) { switch (data[6]) {
case 0: case 0:
data[6] = APCI1500_SOFTWARE_GATE; data[6] = APCI1500_SOFTWARE_GATE;
...@@ -1667,7 +1667,7 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev, ...@@ -1667,7 +1667,7 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev,
default: default:
printk("\nThis choice for software or hardware gate does not exist\n"); printk("\nThis choice for software or hardware gate does not exist\n");
return -EINVAL; return -EINVAL;
} // switch(data[6]) } /* switch(data[6]) */
/*****************************/ /*****************************/
/* Test if used for watchdog */ /* Test if used for watchdog */
...@@ -1680,10 +1680,10 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev, ...@@ -1680,10 +1680,10 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev,
/* - Pulses output */ /* - Pulses output */
/*****************************/ /*****************************/
i_TimerCounterMode = data[2] | data[4] | 0x54; i_TimerCounterMode = data[2] | data[4] | 0x54;
} //if (data[2] == APCI1500_WATCHDOG) } /* if (data[2] == APCI1500_WATCHDOG) */
else { else {
i_TimerCounterMode = data[2] | data[4] | data[6] | 7; i_TimerCounterMode = data[2] | data[4] | data[6] | 7;
} //elseif (data[2] == APCI1500_WATCHDOG) } /* elseif (data[2] == APCI1500_WATCHDOG) */
/*************************/ /*************************/
/* Test the reload value */ /* Test the reload value */
/*************************/ /*************************/
...@@ -1809,25 +1809,25 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev, ...@@ -1809,25 +1809,25 @@ int i_APCI1500_ConfigCounterTimerWatchdog(struct comedi_device * dev,
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} //elseif(data[2]==APCI1500_COUNTER) } /* elseif(data[2]==APCI1500_COUNTER) */
} //if(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) } /* if(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */
else { else {
printk("\nError in selection of interrupt enable or disable\n"); printk("\nError in selection of interrupt enable or disable\n");
return -EINVAL; return -EINVAL;
} //elseif(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) } /* elseif(data[7]== APCI1500_ENABLE ||data[7]== APCI1500_DISABLE) */
} // if ((data[3]>= 0) && (data[3] <= 65535)) } /* if ((data[3]>= 0) && (data[3] <= 65535)) */
else { else {
printk("\nError in selection of reload value\n"); printk("\nError in selection of reload value\n");
return -EINVAL; return -EINVAL;
} //else if ((data[3]>= 0) && (data[3] <= 65535)) } /* else if ((data[3]>= 0) && (data[3] <= 65535)) */
i_TimerCounterWatchdogInterrupt = data[7]; i_TimerCounterWatchdogInterrupt = data[7];
i_WatchdogCounter3Init = 1; i_WatchdogCounter3Init = 1;
break; break;
default: default:
printk("\nThe specified counter\timer option does not exist\n"); printk("\nThe specified counter\timer option does not exist\n");
} //switch(data[1]) } /* switch(data[1]) */
i_CounterLogic = data[2]; i_CounterLogic = data[2];
return insn->n; return insn->n;
} }
...@@ -1871,11 +1871,11 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -1871,11 +1871,11 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
case START: case START:
if (i_TimerCounter1Init == 1) { if (i_TimerCounter1Init == 1) {
if (i_TimerCounterWatchdogInterrupt == 1) { if (i_TimerCounterWatchdogInterrupt == 1) {
i_CommandAndStatusValue = 0xC4; //Enable the interrupt i_CommandAndStatusValue = 0xC4; /* Enable the interrupt */
} // if(i_TimerCounterWatchdogInterrupt==1) } /* if(i_TimerCounterWatchdogInterrupt==1) */
else { else {
i_CommandAndStatusValue = 0xE4; //disable the interrupt i_CommandAndStatusValue = 0xE4; /* disable the interrupt */
} //elseif(i_TimerCounterWatchdogInterrupt==1) } /* elseif(i_TimerCounterWatchdogInterrupt==1) */
/**************************/ /**************************/
/* Starts timer/counter 1 */ /* Starts timer/counter 1 */
/**************************/ /**************************/
...@@ -1889,7 +1889,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -1889,7 +1889,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
outb(i_CommandAndStatusValue, outb(i_CommandAndStatusValue,
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} //if( i_TimerCounter1Init==1) } /* if( i_TimerCounter1Init==1) */
else { else {
printk("\nCounter/Timer1 not configured\n"); printk("\nCounter/Timer1 not configured\n");
return -EINVAL; return -EINVAL;
...@@ -1922,14 +1922,14 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -1922,14 +1922,14 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
/************************/ /************************/
i_CommandAndStatusValue = 0x6; i_CommandAndStatusValue = 0x6;
} //if( i_TimerCounter1Enabled==1) } /* if( i_TimerCounter1Enabled==1) */
else { else {
/***************/ /***************/
/* Set Trigger */ /* Set Trigger */
/***************/ /***************/
i_CommandAndStatusValue = 0x2; i_CommandAndStatusValue = 0x2;
} //elseif(i_TimerCounter1Enabled==1) } /* elseif(i_TimerCounter1Enabled==1) */
/********************************************/ /********************************************/
/* Selects the commands and status register */ /* Selects the commands and status register */
...@@ -1940,7 +1940,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -1940,7 +1940,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
outb(i_CommandAndStatusValue, outb(i_CommandAndStatusValue,
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} //if( i_TimerCounter1Init==1) } /* if( i_TimerCounter1Init==1) */
else { else {
printk("\nCounter/Timer1 not configured\n"); printk("\nCounter/Timer1 not configured\n");
return -EINVAL; return -EINVAL;
...@@ -1950,7 +1950,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -1950,7 +1950,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
default: default:
printk("\nThe specified option for start/stop/trigger does not exist\n"); printk("\nThe specified option for start/stop/trigger does not exist\n");
return -EINVAL; return -EINVAL;
} //switch(data[1]) } /* switch(data[1]) */
break; break;
case COUNTER2: case COUNTER2:
...@@ -1958,11 +1958,11 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -1958,11 +1958,11 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
case START: case START:
if (i_TimerCounter2Init == 1) { if (i_TimerCounter2Init == 1) {
if (i_TimerCounterWatchdogInterrupt == 1) { if (i_TimerCounterWatchdogInterrupt == 1) {
i_CommandAndStatusValue = 0xC4; //Enable the interrupt i_CommandAndStatusValue = 0xC4; /* Enable the interrupt */
} // if(i_TimerCounterWatchdogInterrupt==1) } /* if(i_TimerCounterWatchdogInterrupt==1) */
else { else {
i_CommandAndStatusValue = 0xE4; //disable the interrupt i_CommandAndStatusValue = 0xE4; /* disable the interrupt */
} //elseif(i_TimerCounterWatchdogInterrupt==1) } /* elseif(i_TimerCounterWatchdogInterrupt==1) */
/**************************/ /**************************/
/* Starts timer/counter 2 */ /* Starts timer/counter 2 */
/**************************/ /**************************/
...@@ -1976,7 +1976,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -1976,7 +1976,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
outb(i_CommandAndStatusValue, outb(i_CommandAndStatusValue,
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} //if( i_TimerCounter2Init==1) } /* if( i_TimerCounter2Init==1) */
else { else {
printk("\nCounter/Timer2 not configured\n"); printk("\nCounter/Timer2 not configured\n");
return -EINVAL; return -EINVAL;
...@@ -2008,14 +2008,14 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -2008,14 +2008,14 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
/************************/ /************************/
i_CommandAndStatusValue = 0x6; i_CommandAndStatusValue = 0x6;
} //if( i_TimerCounter2Enabled==1) } /* if( i_TimerCounter2Enabled==1) */
else { else {
/***************/ /***************/
/* Set Trigger */ /* Set Trigger */
/***************/ /***************/
i_CommandAndStatusValue = 0x2; i_CommandAndStatusValue = 0x2;
} //elseif(i_TimerCounter2Enabled==1) } /* elseif(i_TimerCounter2Enabled==1) */
/********************************************/ /********************************************/
/* Selects the commands and status register */ /* Selects the commands and status register */
...@@ -2026,7 +2026,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -2026,7 +2026,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
outb(i_CommandAndStatusValue, outb(i_CommandAndStatusValue,
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} //if( i_TimerCounter2Init==1) } /* if( i_TimerCounter2Init==1) */
else { else {
printk("\nCounter/Timer2 not configured\n"); printk("\nCounter/Timer2 not configured\n");
return -EINVAL; return -EINVAL;
...@@ -2035,7 +2035,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -2035,7 +2035,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
default: default:
printk("\nThe specified option for start/stop/trigger does not exist\n"); printk("\nThe specified option for start/stop/trigger does not exist\n");
return -EINVAL; return -EINVAL;
} //switch(data[1]) } /* switch(data[1]) */
break; break;
case COUNTER3: case COUNTER3:
switch (data[1]) { switch (data[1]) {
...@@ -2043,11 +2043,11 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -2043,11 +2043,11 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
if (i_WatchdogCounter3Init == 1) { if (i_WatchdogCounter3Init == 1) {
if (i_TimerCounterWatchdogInterrupt == 1) { if (i_TimerCounterWatchdogInterrupt == 1) {
i_CommandAndStatusValue = 0xC4; //Enable the interrupt i_CommandAndStatusValue = 0xC4; /* Enable the interrupt */
} // if(i_TimerCounterWatchdogInterrupt==1) } /* if(i_TimerCounterWatchdogInterrupt==1) */
else { else {
i_CommandAndStatusValue = 0xE4; //disable the interrupt i_CommandAndStatusValue = 0xE4; /* disable the interrupt */
} //elseif(i_TimerCounterWatchdogInterrupt==1) } /* elseif(i_TimerCounterWatchdogInterrupt==1) */
/**************************/ /**************************/
/* Starts Watchdog/counter 3 */ /* Starts Watchdog/counter 3 */
/**************************/ /**************************/
...@@ -2062,7 +2062,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -2062,7 +2062,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} // if( i_WatchdogCounter3init==1) } /* if( i_WatchdogCounter3init==1) */
else { else {
printk("\nWatchdog/Counter3 not configured\n"); printk("\nWatchdog/Counter3 not configured\n");
return -EINVAL; return -EINVAL;
...@@ -2089,7 +2089,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -2089,7 +2089,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
case TRIGGER: case TRIGGER:
switch (data[2]) { switch (data[2]) {
case 0: //triggering counter 3 case 0: /* triggering counter 3 */
if (i_WatchdogCounter3Init == 1) { if (i_WatchdogCounter3Init == 1) {
if (i_WatchdogCounter3Enabled == 1) { if (i_WatchdogCounter3Enabled == 1) {
/************************/ /************************/
...@@ -2097,14 +2097,14 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -2097,14 +2097,14 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
/************************/ /************************/
i_CommandAndStatusValue = 0x6; i_CommandAndStatusValue = 0x6;
} //if( i_WatchdogCounter3Enabled==1) } /* if( i_WatchdogCounter3Enabled==1) */
else { else {
/***************/ /***************/
/* Set Trigger */ /* Set Trigger */
/***************/ /***************/
i_CommandAndStatusValue = 0x2; i_CommandAndStatusValue = 0x2;
} //elseif(i_WatchdogCounter3Enabled==1) } /* elseif(i_WatchdogCounter3Enabled==1) */
/********************************************/ /********************************************/
/* Selects the commands and status register */ /* Selects the commands and status register */
...@@ -2115,14 +2115,14 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -2115,14 +2115,14 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
outb(i_CommandAndStatusValue, outb(i_CommandAndStatusValue,
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} //if( i_WatchdogCounter3Init==1) } /* if( i_WatchdogCounter3Init==1) */
else { else {
printk("\nCounter3 not configured\n"); printk("\nCounter3 not configured\n");
return -EINVAL; return -EINVAL;
} }
break; break;
case 1: case 1:
//triggering Watchdog 3 /* triggering Watchdog 3 */
if (i_WatchdogCounter3Init == 1) { if (i_WatchdogCounter3Init == 1) {
/********************************************/ /********************************************/
...@@ -2134,7 +2134,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -2134,7 +2134,7 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
outb(0x6, outb(0x6,
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} //if( i_WatchdogCounter3Init==1) } /* if( i_WatchdogCounter3Init==1) */
else { else {
printk("\nWatchdog 3 not configured\n"); printk("\nWatchdog 3 not configured\n");
return -EINVAL; return -EINVAL;
...@@ -2143,17 +2143,17 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev, ...@@ -2143,17 +2143,17 @@ int i_APCI1500_StartStopTriggerTimerCounterWatchdog(struct comedi_device * dev,
default: default:
printk("\nWrong choice of watchdog/counter3\n"); printk("\nWrong choice of watchdog/counter3\n");
return -EINVAL; return -EINVAL;
} //switch(data[2]) } /* switch(data[2]) */
break; break;
default: default:
printk("\nThe specified option for start/stop/trigger does not exist\n"); printk("\nThe specified option for start/stop/trigger does not exist\n");
return -EINVAL; return -EINVAL;
} //switch(data[1]) } /* switch(data[1]) */
break; break;
default: default:
printk("\nThe specified choice for counter/watchdog/timer does not exist\n"); printk("\nThe specified choice for counter/watchdog/timer does not exist\n");
return -EINVAL; return -EINVAL;
} //switch(data[0]) } /* switch(data[0]) */
return insn->n; return insn->n;
} }
...@@ -2188,7 +2188,7 @@ int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device * dev, ...@@ -2188,7 +2188,7 @@ int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device * dev,
int i_CommandAndStatusValue; int i_CommandAndStatusValue;
switch (data[0]) { switch (data[0]) {
case COUNTER1: case COUNTER1:
//Read counter/timer1 /* Read counter/timer1 */
if (i_TimerCounter1Init == 1) { if (i_TimerCounter1Init == 1) {
if (i_TimerCounter1Enabled == 1) { if (i_TimerCounter1Enabled == 1) {
/************************/ /************************/
...@@ -2196,14 +2196,14 @@ int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device * dev, ...@@ -2196,14 +2196,14 @@ int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device * dev,
/************************/ /************************/
i_CommandAndStatusValue = 0xC; i_CommandAndStatusValue = 0xC;
} //if( i_TimerCounter1Init==1) } /* if( i_TimerCounter1Init==1) */
else { else {
/***************/ /***************/
/* Set RCC */ /* Set RCC */
/***************/ /***************/
i_CommandAndStatusValue = 0x8; i_CommandAndStatusValue = 0x8;
} //elseif(i_TimerCounter1Init==1) } /* elseif(i_TimerCounter1Init==1) */
/********************************************/ /********************************************/
/* Selects the commands and status register */ /* Selects the commands and status register */
...@@ -2232,14 +2232,14 @@ int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device * dev, ...@@ -2232,14 +2232,14 @@ int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device * dev,
data[0] = data[0] =
data[0] | inb(devpriv->iobase + data[0] | inb(devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} //if( i_TimerCounter1Init==1) } /* if( i_TimerCounter1Init==1) */
else { else {
printk("\nTimer/Counter1 not configured\n"); printk("\nTimer/Counter1 not configured\n");
return -EINVAL; return -EINVAL;
} //elseif( i_TimerCounter1Init==1) } /* elseif( i_TimerCounter1Init==1) */
break; break;
case COUNTER2: case COUNTER2:
//Read counter/timer2 /* Read counter/timer2 */
if (i_TimerCounter2Init == 1) { if (i_TimerCounter2Init == 1) {
if (i_TimerCounter2Enabled == 1) { if (i_TimerCounter2Enabled == 1) {
/************************/ /************************/
...@@ -2247,14 +2247,14 @@ int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device * dev, ...@@ -2247,14 +2247,14 @@ int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device * dev,
/************************/ /************************/
i_CommandAndStatusValue = 0xC; i_CommandAndStatusValue = 0xC;
} //if( i_TimerCounter2Init==1) } /* if( i_TimerCounter2Init==1) */
else { else {
/***************/ /***************/
/* Set RCC */ /* Set RCC */
/***************/ /***************/
i_CommandAndStatusValue = 0x8; i_CommandAndStatusValue = 0x8;
} //elseif(i_TimerCounter2Init==1) } /* elseif(i_TimerCounter2Init==1) */
/********************************************/ /********************************************/
/* Selects the commands and status register */ /* Selects the commands and status register */
...@@ -2283,14 +2283,14 @@ int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device * dev, ...@@ -2283,14 +2283,14 @@ int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device * dev,
data[0] = data[0] =
data[0] | inb(devpriv->iobase + data[0] | inb(devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} //if( i_TimerCounter2Init==1) } /* if( i_TimerCounter2Init==1) */
else { else {
printk("\nTimer/Counter2 not configured\n"); printk("\nTimer/Counter2 not configured\n");
return -EINVAL; return -EINVAL;
} //elseif( i_TimerCounter2Init==1) } /* elseif( i_TimerCounter2Init==1) */
break; break;
case COUNTER3: case COUNTER3:
//Read counter/watchdog2 /* Read counter/watchdog2 */
if (i_WatchdogCounter3Init == 1) { if (i_WatchdogCounter3Init == 1) {
if (i_WatchdogCounter3Enabled == 1) { if (i_WatchdogCounter3Enabled == 1) {
/************************/ /************************/
...@@ -2298,14 +2298,14 @@ int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device * dev, ...@@ -2298,14 +2298,14 @@ int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device * dev,
/************************/ /************************/
i_CommandAndStatusValue = 0xC; i_CommandAndStatusValue = 0xC;
} //if( i_TimerCounter2Init==1) } /* if( i_TimerCounter2Init==1) */
else { else {
/***************/ /***************/
/* Set RCC */ /* Set RCC */
/***************/ /***************/
i_CommandAndStatusValue = 0x8; i_CommandAndStatusValue = 0x8;
} //elseif(i_WatchdogCounter3Init==1) } /* elseif(i_WatchdogCounter3Init==1) */
/********************************************/ /********************************************/
/* Selects the commands and status register */ /* Selects the commands and status register */
...@@ -2334,16 +2334,16 @@ int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device * dev, ...@@ -2334,16 +2334,16 @@ int i_APCI1500_ReadCounterTimerWatchdog(struct comedi_device * dev,
data[0] = data[0] =
data[0] | inb(devpriv->iobase + data[0] | inb(devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
} //if( i_WatchdogCounter3Init==1) } /* if( i_WatchdogCounter3Init==1) */
else { else {
printk("\nWatchdogCounter3 not configured\n"); printk("\nWatchdogCounter3 not configured\n");
return -EINVAL; return -EINVAL;
} //elseif( i_WatchdogCounter3Init==1) } /* elseif( i_WatchdogCounter3Init==1) */
break; break;
default: default:
printk("\nThe choice of timer/counter/watchdog does not exist\n"); printk("\nThe choice of timer/counter/watchdog does not exist\n");
return -EINVAL; return -EINVAL;
} //switch(data[0]) } /* switch(data[0]) */
return insn->n; return insn->n;
} }
...@@ -2411,16 +2411,16 @@ int i_APCI1500_ConfigureInterrupt(struct comedi_device * dev, struct comedi_subd ...@@ -2411,16 +2411,16 @@ int i_APCI1500_ConfigureInterrupt(struct comedi_device * dev, struct comedi_subd
outl(0x0, devpriv->i_IobaseAmcc + 0x38); outl(0x0, devpriv->i_IobaseAmcc + 0x38);
if (data[0] == 1) { if (data[0] == 1) {
i_Constant = 0xC0; i_Constant = 0xC0;
} //if(data[0]==1) } /* if(data[0]==1) */
else { else {
if (data[0] == 0) { if (data[0] == 0) {
i_Constant = 0x00; i_Constant = 0x00;
} //if{data[0]==0) } /* if{data[0]==0) */
else { else {
printk("\nThe parameter passed to driver is in error for enabling the voltage interrupt\n"); printk("\nThe parameter passed to driver is in error for enabling the voltage interrupt\n");
return -EINVAL; return -EINVAL;
} //else if(data[0]==0) } /* else if(data[0]==0) */
} //elseif(data[0]==1) } /* elseif(data[0]==1) */
/*****************************************************/ /*****************************************************/
/* Selects the mode specification register of port B */ /* Selects the mode specification register of port B */
...@@ -2599,11 +2599,11 @@ static void v_APCI1500_Interrupt(int irq, void *d) ...@@ -2599,11 +2599,11 @@ static void v_APCI1500_Interrupt(int irq, void *d)
/*************************************************/ /*************************************************/
/* Selects the master interrupt control register */ /* Selects the master interrupt control register */
/*************************************************/ /*************************************************/
//outb(APCI1500_RW_MASTER_INTERRUPT_CONTROL,devpriv->iobase+APCI1500_Z8536_CONTROL_REGISTER); /* outb(APCI1500_RW_MASTER_INTERRUPT_CONTROL,devpriv->iobase+APCI1500_Z8536_CONTROL_REGISTER); */
/**********************************************/ /**********************************************/
/* Disables the main interrupt on the board */ /* Disables the main interrupt on the board */
/**********************************************/ /**********************************************/
//outb(0x00,devpriv->iobase+APCI1500_Z8536_CONTROL_REGISTER); /* outb(0x00,devpriv->iobase+APCI1500_Z8536_CONTROL_REGISTER); */
/*****************************************************/ /*****************************************************/
/* Selects the command and status register of port A */ /* Selects the command and status register of port A */
...@@ -2647,11 +2647,11 @@ static void v_APCI1500_Interrupt(int irq, void *d) ...@@ -2647,11 +2647,11 @@ static void v_APCI1500_Interrupt(int irq, void *d)
i_InputChannel = 1 + (i_RegValue >> 1); i_InputChannel = 1 + (i_RegValue >> 1);
} // if(i_Logic==APCI1500_OR_PRIORITY) } /* if(i_Logic==APCI1500_OR_PRIORITY) */
else { else {
i_InputChannel = 0; i_InputChannel = 0;
} //elseif(i_Logic==APCI1500_OR_PRIORITY) } /* elseif(i_Logic==APCI1500_OR_PRIORITY) */
} // if ((i_RegValue & 0x60) == 0x60) } /* if ((i_RegValue & 0x60) == 0x60) */
/*****************************************************/ /*****************************************************/
/* Selects the command and status register of port B */ /* Selects the command and status register of port B */
...@@ -2688,7 +2688,7 @@ static void v_APCI1500_Interrupt(int irq, void *d) ...@@ -2688,7 +2688,7 @@ static void v_APCI1500_Interrupt(int irq, void *d)
/**************************************/ /**************************************/
if (i_RegValue) { if (i_RegValue) {
//Disable the interrupt /* Disable the interrupt */
/*****************************************************/ /*****************************************************/
/* Selects the command and status register of port B */ /* Selects the command and status register of port B */
/*****************************************************/ /*****************************************************/
...@@ -2697,17 +2697,17 @@ static void v_APCI1500_Interrupt(int irq, void *d) ...@@ -2697,17 +2697,17 @@ static void v_APCI1500_Interrupt(int irq, void *d)
if (i_RegValue & 0x80) { if (i_RegValue & 0x80) {
i_InterruptMask = i_InterruptMask =
i_InterruptMask | 0x40; i_InterruptMask | 0x40;
} //if (i_RegValue & 0x80) } /* if (i_RegValue & 0x80) */
if (i_RegValue & 0x40) { if (i_RegValue & 0x40) {
i_InterruptMask = i_InterruptMask =
i_InterruptMask | 0x80; i_InterruptMask | 0x80;
} //if (i_RegValue & 0x40) } /* if (i_RegValue & 0x40) */
} // if (i_RegValue) } /* if (i_RegValue) */
else { else {
i_InterruptMask = i_InterruptMask | 2; i_InterruptMask = i_InterruptMask | 2;
} // if (i_RegValue) } /* if (i_RegValue) */
} //if ((i_RegValue & 0x60) == 0x60) } /* if ((i_RegValue & 0x60) == 0x60) */
/*****************************************************/ /*****************************************************/
/* Selects the command and status register of timer 1 */ /* Selects the command and status register of timer 1 */
...@@ -2731,7 +2731,7 @@ static void v_APCI1500_Interrupt(int irq, void *d) ...@@ -2731,7 +2731,7 @@ static void v_APCI1500_Interrupt(int irq, void *d)
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
i_InterruptMask = i_InterruptMask | 4; i_InterruptMask = i_InterruptMask | 4;
} // if ((i_RegValue & 0x60) == 0x60) } /* if ((i_RegValue & 0x60) == 0x60) */
/*****************************************************/ /*****************************************************/
/* Selects the command and status register of timer 2 */ /* Selects the command and status register of timer 2 */
/*****************************************************/ /*****************************************************/
...@@ -2754,7 +2754,7 @@ static void v_APCI1500_Interrupt(int irq, void *d) ...@@ -2754,7 +2754,7 @@ static void v_APCI1500_Interrupt(int irq, void *d)
devpriv->iobase + devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
i_InterruptMask = i_InterruptMask | 8; i_InterruptMask = i_InterruptMask | 8;
} // if ((i_RegValue & 0x60) == 0x60) } /* if ((i_RegValue & 0x60) == 0x60) */
/*****************************************************/ /*****************************************************/
/* Selects the command and status register of timer 3 */ /* Selects the command and status register of timer 3 */
...@@ -2779,13 +2779,13 @@ static void v_APCI1500_Interrupt(int irq, void *d) ...@@ -2779,13 +2779,13 @@ static void v_APCI1500_Interrupt(int irq, void *d)
APCI1500_Z8536_CONTROL_REGISTER); APCI1500_Z8536_CONTROL_REGISTER);
if (i_CounterLogic == APCI1500_COUNTER) { if (i_CounterLogic == APCI1500_COUNTER) {
i_InterruptMask = i_InterruptMask | 0x10; i_InterruptMask = i_InterruptMask | 0x10;
} //if(i_CounterLogic==APCI1500_COUNTER) } /* if(i_CounterLogic==APCI1500_COUNTER) */
else { else {
i_InterruptMask = i_InterruptMask | 0x20; i_InterruptMask = i_InterruptMask | 0x20;
} }
} // if ((i_RegValue & 0x60) == 0x60) } /* if ((i_RegValue & 0x60) == 0x60) */
send_sig(SIGIO, devpriv->tsk_Current, 0); // send signal to the sample send_sig(SIGIO, devpriv->tsk_Current, 0); /* send signal to the sample */
/***********************/ /***********************/
/* Enable all Interrupts */ /* Enable all Interrupts */
/***********************/ /***********************/
...@@ -2799,11 +2799,11 @@ static void v_APCI1500_Interrupt(int irq, void *d) ...@@ -2799,11 +2799,11 @@ static void v_APCI1500_Interrupt(int irq, void *d)
/* Authorizes the main interrupt on the board */ /* Authorizes the main interrupt on the board */
/**********************************************/ /**********************************************/
outb(0xD0, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); outb(0xD0, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER);
} // if ((ui_InterruptStatus & 0x800000) == 0x800000) } /* if ((ui_InterruptStatus & 0x800000) == 0x800000) */
else { else {
printk("\nInterrupt from unknown source\n"); printk("\nInterrupt from unknown source\n");
} //else if ((ui_InterruptStatus & 0x800000) == 0x800000) } /* else if ((ui_InterruptStatus & 0x800000) == 0x800000) */
return; return;
} }
...@@ -2982,7 +2982,7 @@ int i_APCI1500_Reset(struct comedi_device * dev) ...@@ -2982,7 +2982,7 @@ int i_APCI1500_Reset(struct comedi_device * dev)
devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER);
/* Deletes all interrupts */ /* Deletes all interrupts */
outb(0, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); outb(0, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER);
//reset all the digital outputs /* reset all the digital outputs */
outw(0x0, devpriv->i_IobaseAddon + APCI1500_DIGITAL_OP); outw(0x0, devpriv->i_IobaseAddon + APCI1500_DIGITAL_OP);
/*******************************/ /*******************************/
/* Disable the board interrupt */ /* Disable the board interrupt */
......
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