Loading drivers/staging/comedi/drivers/addi-data/APCI1710_Chrono.c +31 −31 Original line number Diff line number Diff line Loading @@ -736,7 +736,7 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su DPRINTK("Base timing selection is wrong\n"); i_ReturnValue = -7; } } // if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4)) } /* if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4)) */ else { /***********************************/ /* Timing unity selection is wrong */ Loading @@ -744,8 +744,8 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su DPRINTK("Timing unity selection is wrong\n"); i_ReturnValue = -6; } // if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4)) } // if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) } /* if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4)) */ } /* if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) */ else { /*****************************************/ /* The selected PCI input clock is wrong */ Loading @@ -753,8 +753,8 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su DPRINTK("The selected PCI input clock is wrong\n"); i_ReturnValue = -5; } // if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) } // if (b_ChronoMode >= 0 && b_ChronoMode <= 7) } /* if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) */ } /* if (b_ChronoMode >= 0 && b_ChronoMode <= 7) */ else { /***************************************/ /* Chronometer mode selection is wrong */ Loading @@ -762,7 +762,7 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su DPRINTK("Chronometer mode selection is wrong\n"); i_ReturnValue = -4; } // if (b_ChronoMode >= 0 && b_ChronoMode <= 7) } /* if (b_ChronoMode >= 0 && b_ChronoMode <= 7) */ } else { /******************************************/ /* The module is not a Chronometer module */ Loading Loading @@ -951,7 +951,7 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev, ui_Address + 32 + (64 * b_ModulNbr)); devpriv->tsk_Current = current; // Save the current process task structure devpriv->tsk_Current = current; /* Save the current process task structure */ } /***********************************/ Loading Loading @@ -980,7 +980,7 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev, 36 + (64 * b_ModulNbr)); } // if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) } /* if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) */ else { /********************************/ /* Interrupt parameter is wrong */ Loading @@ -988,8 +988,8 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev, DPRINTK("Interrupt parameter is wrong\n"); i_ReturnValue = -6; } // if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) } // if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) } /* if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) */ } /* if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) */ else { /***********************************************/ /* Chronometer acquisition mode cycle is wrong */ Loading @@ -997,7 +997,7 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev, DPRINTK("Chronometer acquisition mode cycle is wrong\n"); i_ReturnValue = -5; } // if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) } /* if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) */ break; case APCI1710_DISABLE: Loading Loading @@ -1046,7 +1046,7 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev, default: DPRINTK("Inputs wrong! Enable or Disable chrono\n"); i_ReturnValue = -8; } // switch ENABLE/DISABLE } /* switch ENABLE/DISABLE */ } else { /*******************************/ /* Chronometer not initialised */ Loading Loading @@ -1233,7 +1233,7 @@ int i_APCI1710_GetChronoProgressStatus(struct comedi_device * dev, /******************/ *pb_ChronoStatus = 3; } // if ((dw_Status & 8) == 8) } /* if ((dw_Status & 8) == 8) */ else { /*******************************/ /* Test if measurement stopped */ Loading @@ -1245,7 +1245,7 @@ int i_APCI1710_GetChronoProgressStatus(struct comedi_device * dev, /***********************/ *pb_ChronoStatus = 2; } // if ((dw_Status & 2) == 2) } /* if ((dw_Status & 2) == 2) */ else { /*******************************/ /* Test if measurement started */ Loading @@ -1257,16 +1257,16 @@ int i_APCI1710_GetChronoProgressStatus(struct comedi_device * dev, /************************/ *pb_ChronoStatus = 1; } // if ((dw_Status & 1) == 1) } /* if ((dw_Status & 1) == 1) */ else { /***************************/ /* Measurement not started */ /***************************/ *pb_ChronoStatus = 0; } // if ((dw_Status & 1) == 1) } // if ((dw_Status & 2) == 2) } // if ((dw_Status & 8) == 8) } /* if ((dw_Status & 1) == 1) */ } /* if ((dw_Status & 2) == 2) */ } /* if ((dw_Status & 8) == 8) */ } else { /*******************************/ /* Chronometer not initialised */ Loading Loading @@ -1430,7 +1430,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev, } break; } // if ((dw_Status & 8) == 8) } /* if ((dw_Status & 8) == 8) */ else { /*******************************/ /* Test if measurement stopped */ Loading Loading @@ -1464,7 +1464,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev, outl(0, devpriv->s_BoardInfos.ui_Address + 36 + (64 * b_ModulNbr)); } break; } // if ((dw_Status & 2) == 2) } /* if ((dw_Status & 2) == 2) */ else { /*******************************/ /* Test if measurement started */ Loading @@ -1478,7 +1478,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev, *pb_ChronoStatus = 1; } // if ((dw_Status & 1) == 1) } /* if ((dw_Status & 1) == 1) */ else { /***************************/ /* Measurement not started */ Loading @@ -1487,9 +1487,9 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev, *pb_ChronoStatus = 0; } // if ((dw_Status & 1) == 1) } // if ((dw_Status & 2) == 2) } // if ((dw_Status & 8) == 8) } /* if ((dw_Status & 1) == 1) */ } /* if ((dw_Status & 2) == 2) */ } /* if ((dw_Status & 8) == 8) */ if (dw_TimeOut == ui_TimeOut) { /*****************/ Loading @@ -1507,7 +1507,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev, mdelay(1000); } } // for (;;) } /* for (;;) */ /*****************************/ /* Test if stop signal occur */ Loading Loading @@ -1922,7 +1922,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, ui_Address + 20 + (b_OutputChannel * 4) + (64 * b_ModulNbr)); } // if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) } /* if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) */ else { /****************************************/ /* The selected digital output is wrong */ Loading @@ -1931,7 +1931,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, DPRINTK("The selected digital output is wrong\n"); i_ReturnValue = -4; } // if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) } /* if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) */ break; Loading @@ -1945,7 +1945,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, ui_Address + 20 + (b_OutputChannel * 4) + (64 * b_ModulNbr)); } // if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) } /* if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) */ else { /****************************************/ /* The selected digital output is wrong */ Loading @@ -1954,7 +1954,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, DPRINTK("The selected digital output is wrong\n"); i_ReturnValue = -4; } // if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) } /* if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) */ break; Loading @@ -1978,7 +1978,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, (unsigned char) (((dw_Status >> b_InputChannel) & 1) ^ 1); } // if ((b_InputChannel >= 0) && (b_InputChannel <= 2)) } /* if ((b_InputChannel >= 0) && (b_InputChannel <= 2)) */ else { /***************************************/ /* The selected digital input is wrong */ Loading @@ -1986,7 +1986,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, DPRINTK("The selected digital input is wrong\n"); i_ReturnValue = -4; } // if ((b_InputChannel >= 0) && (b_InputChannel <= 2)) } /* if ((b_InputChannel >= 0) && (b_InputChannel <= 2)) */ break; Loading drivers/staging/comedi/drivers/addi-data/APCI1710_Dig_io.c +92 −87 Original line number Diff line number Diff line Loading @@ -108,10 +108,10 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub unsigned int dw_WriteConfig = 0; 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_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; /**************************/ Loading @@ -126,7 +126,7 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub switch (b_ConfigType) { case APCI1710_DIGIO_MEMORYONOFF: if (b_MemoryOnOff) // If Memory ON if (b_MemoryOnOff) /* If Memory ON */ { /****************************/ /* Set the output memory on */ Loading @@ -140,7 +140,7 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub /***************************/ devpriv->s_ModuleInfo[b_ModulNbr]. s_DigitalIOInfo.dw_OutputMemory = 0; } else // If memory off } else /* If memory off */ { /*****************************/ /* Set the output memory off */ Loading Loading @@ -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"); i_ReturnValue = -3; } } // end of Switch } /* end of Switch */ printk("Return Value %d\n", i_ReturnValue); return i_ReturnValue; } Loading Loading @@ -288,11 +288,11 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub +----------------------------------------------------------------------------+ */ //_INT_ i_APCI1710_ReadDigitalIOChlValue (unsigned char_ b_BoardHandle, // unsigned char_ b_ModulNbr, // unsigned char_ b_InputChannel, // // unsigned char *_ pb_ChannelStatus) /* _INT_ i_APCI1710_ReadDigitalIOChlValue (unsigned char_ b_BoardHandle, */ /* * unsigned char_ b_ModulNbr, unsigned char_ b_InputChannel, * unsigned char *_ pb_ChannelStatus) */ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) { Loading Loading @@ -356,7 +356,7 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, i_ReturnValue = -6; } } // if (b_InputChannel == 5) } /* if (b_InputChannel == 5) */ else { /***************************/ /* Test the channel B mode */ Loading @@ -375,8 +375,8 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, i_ReturnValue = -7; } } // if (b_InputChannel == 5) } // if (b_InputChannel > 4) } /* if (b_InputChannel == 5) */ } /* if (b_InputChannel > 4) */ /***********************/ /* Test if error occur */ Loading @@ -387,11 +387,10 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, /* Read all digital input */ /**************************/ //INPDW (ps_APCI1710Variable-> // s_Board [b_BoardHandle]. // s_BoardInfos. // ui_Address + (64 * b_ModulNbr), // &dw_StatusReg); /* * INPDW (ps_APCI1710Variable-> s_Board [b_BoardHandle]. * s_BoardInfos. ui_Address + (64 * b_ModulNbr), &dw_StatusReg); */ dw_StatusReg = inl(devpriv-> Loading @@ -404,7 +403,7 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, 0x1C) >> b_InputChannel) & 1; } // if (i_ReturnValue == 0) } /* if (i_ReturnValue == 0) */ } else { /*******************************/ /* Digital I/O not initialised */ Loading Loading @@ -478,9 +477,10 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, +----------------------------------------------------------------------------+ */ //_INT_ i_APCI1710_SetDigitalIOChlOn (unsigned char_ b_BoardHandle, // unsigned char_ b_ModulNbr, // unsigned char_ b_OutputChannel) /* * _INT_ i_APCI1710_SetDigitalIOChlOn (unsigned char_ b_BoardHandle, * unsigned char_ b_ModulNbr, unsigned char_ b_OutputChannel) */ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev, struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) { Loading Loading @@ -602,7 +602,7 @@ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev, 1 << b_OutputChannel; } } // set channel off } /* set channel off */ else { if (devpriv-> s_ModuleInfo Loading Loading @@ -630,7 +630,7 @@ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev, /*****************************/ /* Digital Output Memory OFF */ /*****************************/ // +Use previously the function "i_APCI1710_SetDigitalIOMemoryOn" /* +Use previously the function "i_APCI1710_SetDigitalIOMemoryOn" */ i_ReturnValue = -8; } Loading @@ -639,11 +639,12 @@ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev, /* Write the value */ /*******************/ //OUTPDW (ps_APCI1710Variable-> // s_Board [b_BoardHandle]. // s_BoardInfos. // ui_Address + (64 * b_ModulNbr), // dw_WriteValue); /* OUTPDW (ps_APCI1710Variable-> * s_Board [b_BoardHandle]. * s_BoardInfos. ui_Address + (64 * b_ModulNbr), * dw_WriteValue); */ */ outl(dw_WriteValue, devpriv->s_BoardInfos. ui_Address + (64 * b_ModulNbr)); Loading Loading @@ -725,9 +726,11 @@ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev, +----------------------------------------------------------------------------+ */ //_INT_ i_APCI1710_SetDigitalIOPortOn (unsigned char_ b_BoardHandle, // unsigned char_ b_ModulNbr, // unsigned char_ b_PortValue) /* * _INT_ i_APCI1710_SetDigitalIOPortOn (unsigned char_ * b_BoardHandle, unsigned char_ b_ModulNbr, unsigned char_ * b_PortValue) */ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) { Loading @@ -740,12 +743,12 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, unsigned char * pb_PortValue; b_ModulNbr = (unsigned char) CR_AREF(insn->chanspec); b_PortOperation = (unsigned char) data[0]; // Input or output b_PortOnOFF = (unsigned char) data[1]; // if output then On or Off b_PortValue = (unsigned char) data[2]; // if out put then Value b_PortOperation = (unsigned char) data[0]; /* Input or output */ b_PortOnOFF = (unsigned char) data[1]; /* if output then On or Off */ b_PortValue = (unsigned char) data[2]; /* if out put then Value */ i_ReturnValue = insn->n; pb_PortValue = (unsigned char *) & data[0]; // if input then read value /* if input then read value */ switch (b_PortOperation) { case APCI1710_INPUT: Loading @@ -771,11 +774,12 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, /* Read all digital input */ /**************************/ //INPDW (ps_APCI1710Variable-> // s_Board [b_BoardHandle]. // s_BoardInfos. // ui_Address + (64 * b_ModulNbr), // &dw_StatusReg); /* INPDW (ps_APCI1710Variable-> * s_Board [b_BoardHandle]. * s_BoardInfos. * ui_Address + (64 * b_ModulNbr), * &dw_StatusReg); */ dw_StatusReg = inl(devpriv->s_BoardInfos. Loading Loading @@ -853,7 +857,7 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, i_ReturnValue = -6; } } // if ((b_PortValue & 2) == 2) } /* if ((b_PortValue & 2) == 2) */ /**************************/ /* Test if channel B used */ Loading @@ -873,7 +877,7 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, i_ReturnValue = -7; } } // if ((b_PortValue & 4) == 4) } /* if ((b_PortValue & 4) == 4) */ /***********************/ /* Test if error occur */ Loading @@ -881,8 +885,8 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, if (i_ReturnValue >= 0) { //if(data[1]) //{ /* if(data[1]) { */ switch (b_PortOnOFF) { /*********************************/ /* Test if set Port ON */ Loading Loading @@ -924,7 +928,7 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, } break; // If Set PORT OFF /* If Set PORT OFF */ case APCI1710_OFF: /*********************************/ Loading Loading @@ -965,17 +969,18 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, = -8; } } // switch } /* switch */ /*******************/ /* Write the value */ /*******************/ // OUTPDW (ps_APCI1710Variable-> // s_Board [b_BoardHandle]. // s_BoardInfos. // ui_Address + (64 * b_ModulNbr), // dw_WriteValue); /* OUTPDW (ps_APCI1710Variable-> * s_Board [b_BoardHandle]. * s_BoardInfos. * ui_Address + (64 * b_ModulNbr), * dw_WriteValue); */ outl(dw_WriteValue, devpriv-> s_BoardInfos. Loading Loading @@ -1015,6 +1020,6 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, default: i_ReturnValue = -9; DPRINTK("NO INPUT/OUTPUT specified\n"); } //switch INPUT / OUTPUT } /* switch INPUT / OUTPUT */ return (i_ReturnValue); } drivers/staging/comedi/drivers/addi-data/APCI1710_INCCPT.c +35 −35 File changed.Preview size limit exceeded, changes collapsed. Show changes drivers/staging/comedi/drivers/addi-data/APCI1710_Inp_cpt.c +3 −3 Original line number Diff line number Diff line Loading @@ -515,7 +515,7 @@ int i_APCI1710_InsnWriteEnableDisablePulseEncoder(struct comedi_device * dev, | (1UL << b_PulseEncoderNbr); devpriv->tsk_Current = current; // Save the current process task structure devpriv->tsk_Current = current; /* Save the current process task structure */ } Loading Loading @@ -629,7 +629,7 @@ int i_APCI1710_InsnWriteEnableDisablePulseEncoder(struct comedi_device * dev, (64 * b_ModulNbr)); break; } // switch End } /* switch End */ } else { /*********************************/ Loading Loading @@ -805,7 +805,7 @@ int i_APCI1710_InsnBitsReadWritePulseEncoder(struct comedi_device * dev, (4 * b_PulseEncoderNbr) + (64 * b_ModulNbr)); } //end of switch } /* end of switch */ } else { /*********************************/ /* Pulse encoder not initialised */ Loading drivers/staging/comedi/drivers/addi-data/APCI1710_Ssi.c +7 −7 Original line number Diff line number Diff line Loading @@ -167,7 +167,7 @@ int i_APCI1710_InsnConfigInitSSI(struct comedi_device * dev, struct comedi_subde /* 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) { /*************************************/ /* Test the SSI position data length */ Loading Loading @@ -423,11 +423,11 @@ int i_APCI1710_InsnReadSSIValue(struct comedi_device * dev, struct comedi_subdev i_ReturnValue = insn->n; pul_Position1 = (unsigned int *) & data[0]; // For Read1 /* For Read1 */ pul_TurnCpt1 = (unsigned int *) & data[1]; // For Read all pul_Position = (unsigned int *) & data[0]; //0-2 pul_TurnCpt = (unsigned int *) & data[3]; //3-5 /* For Read all */ pul_Position = (unsigned int *) & data[0]; /* 0-2 */ pul_TurnCpt = (unsigned int *) & data[3]; /* 3-5 */ b_ModulNbr = (unsigned char) CR_AREF(insn->chanspec); b_SelectedSSI = (unsigned char) CR_CHAN(insn->chanspec); b_ReadType = (unsigned char) CR_RANGE(insn->chanspec); Loading Loading @@ -667,7 +667,7 @@ int i_APCI1710_InsnReadSSIValue(struct comedi_device * dev, struct comedi_subdev default: printk("Read Type Inputs Wrong\n"); } // switch ending } /* switch ending */ } else { /***********************/ Loading Loading @@ -826,7 +826,7 @@ int i_APCI1710_InsnBitsSSIDigitalIO(struct comedi_device * dev, struct comedi_su default: printk("IO type wrong\n"); } //switch end } /* switch end */ } else { /**********************************/ /* The module is not a SSI module */ Loading Loading
drivers/staging/comedi/drivers/addi-data/APCI1710_Chrono.c +31 −31 Original line number Diff line number Diff line Loading @@ -736,7 +736,7 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su DPRINTK("Base timing selection is wrong\n"); i_ReturnValue = -7; } } // if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4)) } /* if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4)) */ else { /***********************************/ /* Timing unity selection is wrong */ Loading @@ -744,8 +744,8 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su DPRINTK("Timing unity selection is wrong\n"); i_ReturnValue = -6; } // if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4)) } // if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) } /* if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4)) */ } /* if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) */ else { /*****************************************/ /* The selected PCI input clock is wrong */ Loading @@ -753,8 +753,8 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su DPRINTK("The selected PCI input clock is wrong\n"); i_ReturnValue = -5; } // if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) } // if (b_ChronoMode >= 0 && b_ChronoMode <= 7) } /* if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) */ } /* if (b_ChronoMode >= 0 && b_ChronoMode <= 7) */ else { /***************************************/ /* Chronometer mode selection is wrong */ Loading @@ -762,7 +762,7 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su DPRINTK("Chronometer mode selection is wrong\n"); i_ReturnValue = -4; } // if (b_ChronoMode >= 0 && b_ChronoMode <= 7) } /* if (b_ChronoMode >= 0 && b_ChronoMode <= 7) */ } else { /******************************************/ /* The module is not a Chronometer module */ Loading Loading @@ -951,7 +951,7 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev, ui_Address + 32 + (64 * b_ModulNbr)); devpriv->tsk_Current = current; // Save the current process task structure devpriv->tsk_Current = current; /* Save the current process task structure */ } /***********************************/ Loading Loading @@ -980,7 +980,7 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev, 36 + (64 * b_ModulNbr)); } // if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) } /* if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) */ else { /********************************/ /* Interrupt parameter is wrong */ Loading @@ -988,8 +988,8 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev, DPRINTK("Interrupt parameter is wrong\n"); i_ReturnValue = -6; } // if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) } // if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) } /* if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) */ } /* if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) */ else { /***********************************************/ /* Chronometer acquisition mode cycle is wrong */ Loading @@ -997,7 +997,7 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev, DPRINTK("Chronometer acquisition mode cycle is wrong\n"); i_ReturnValue = -5; } // if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) } /* if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) */ break; case APCI1710_DISABLE: Loading Loading @@ -1046,7 +1046,7 @@ int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device * dev, default: DPRINTK("Inputs wrong! Enable or Disable chrono\n"); i_ReturnValue = -8; } // switch ENABLE/DISABLE } /* switch ENABLE/DISABLE */ } else { /*******************************/ /* Chronometer not initialised */ Loading Loading @@ -1233,7 +1233,7 @@ int i_APCI1710_GetChronoProgressStatus(struct comedi_device * dev, /******************/ *pb_ChronoStatus = 3; } // if ((dw_Status & 8) == 8) } /* if ((dw_Status & 8) == 8) */ else { /*******************************/ /* Test if measurement stopped */ Loading @@ -1245,7 +1245,7 @@ int i_APCI1710_GetChronoProgressStatus(struct comedi_device * dev, /***********************/ *pb_ChronoStatus = 2; } // if ((dw_Status & 2) == 2) } /* if ((dw_Status & 2) == 2) */ else { /*******************************/ /* Test if measurement started */ Loading @@ -1257,16 +1257,16 @@ int i_APCI1710_GetChronoProgressStatus(struct comedi_device * dev, /************************/ *pb_ChronoStatus = 1; } // if ((dw_Status & 1) == 1) } /* if ((dw_Status & 1) == 1) */ else { /***************************/ /* Measurement not started */ /***************************/ *pb_ChronoStatus = 0; } // if ((dw_Status & 1) == 1) } // if ((dw_Status & 2) == 2) } // if ((dw_Status & 8) == 8) } /* if ((dw_Status & 1) == 1) */ } /* if ((dw_Status & 2) == 2) */ } /* if ((dw_Status & 8) == 8) */ } else { /*******************************/ /* Chronometer not initialised */ Loading Loading @@ -1430,7 +1430,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev, } break; } // if ((dw_Status & 8) == 8) } /* if ((dw_Status & 8) == 8) */ else { /*******************************/ /* Test if measurement stopped */ Loading Loading @@ -1464,7 +1464,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev, outl(0, devpriv->s_BoardInfos.ui_Address + 36 + (64 * b_ModulNbr)); } break; } // if ((dw_Status & 2) == 2) } /* if ((dw_Status & 2) == 2) */ else { /*******************************/ /* Test if measurement started */ Loading @@ -1478,7 +1478,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev, *pb_ChronoStatus = 1; } // if ((dw_Status & 1) == 1) } /* if ((dw_Status & 1) == 1) */ else { /***************************/ /* Measurement not started */ Loading @@ -1487,9 +1487,9 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev, *pb_ChronoStatus = 0; } // if ((dw_Status & 1) == 1) } // if ((dw_Status & 2) == 2) } // if ((dw_Status & 8) == 8) } /* if ((dw_Status & 1) == 1) */ } /* if ((dw_Status & 2) == 2) */ } /* if ((dw_Status & 8) == 8) */ if (dw_TimeOut == ui_TimeOut) { /*****************/ Loading @@ -1507,7 +1507,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev, mdelay(1000); } } // for (;;) } /* for (;;) */ /*****************************/ /* Test if stop signal occur */ Loading Loading @@ -1922,7 +1922,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, ui_Address + 20 + (b_OutputChannel * 4) + (64 * b_ModulNbr)); } // if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) } /* if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) */ else { /****************************************/ /* The selected digital output is wrong */ Loading @@ -1931,7 +1931,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, DPRINTK("The selected digital output is wrong\n"); i_ReturnValue = -4; } // if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) } /* if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) */ break; Loading @@ -1945,7 +1945,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, ui_Address + 20 + (b_OutputChannel * 4) + (64 * b_ModulNbr)); } // if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) } /* if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) */ else { /****************************************/ /* The selected digital output is wrong */ Loading @@ -1954,7 +1954,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, DPRINTK("The selected digital output is wrong\n"); i_ReturnValue = -4; } // if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) } /* if ((b_OutputChannel >= 0) && (b_OutputChannel <= 2)) */ break; Loading @@ -1978,7 +1978,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, (unsigned char) (((dw_Status >> b_InputChannel) & 1) ^ 1); } // if ((b_InputChannel >= 0) && (b_InputChannel <= 2)) } /* if ((b_InputChannel >= 0) && (b_InputChannel <= 2)) */ else { /***************************************/ /* The selected digital input is wrong */ Loading @@ -1986,7 +1986,7 @@ int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device * dev, DPRINTK("The selected digital input is wrong\n"); i_ReturnValue = -4; } // if ((b_InputChannel >= 0) && (b_InputChannel <= 2)) } /* if ((b_InputChannel >= 0) && (b_InputChannel <= 2)) */ break; Loading
drivers/staging/comedi/drivers/addi-data/APCI1710_Dig_io.c +92 −87 Original line number Diff line number Diff line Loading @@ -108,10 +108,10 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub unsigned int dw_WriteConfig = 0; 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_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; /**************************/ Loading @@ -126,7 +126,7 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub switch (b_ConfigType) { case APCI1710_DIGIO_MEMORYONOFF: if (b_MemoryOnOff) // If Memory ON if (b_MemoryOnOff) /* If Memory ON */ { /****************************/ /* Set the output memory on */ Loading @@ -140,7 +140,7 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub /***************************/ devpriv->s_ModuleInfo[b_ModulNbr]. s_DigitalIOInfo.dw_OutputMemory = 0; } else // If memory off } else /* If memory off */ { /*****************************/ /* Set the output memory off */ Loading Loading @@ -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"); i_ReturnValue = -3; } } // end of Switch } /* end of Switch */ printk("Return Value %d\n", i_ReturnValue); return i_ReturnValue; } Loading Loading @@ -288,11 +288,11 @@ int i_APCI1710_InsnConfigDigitalIO(struct comedi_device * dev, struct comedi_sub +----------------------------------------------------------------------------+ */ //_INT_ i_APCI1710_ReadDigitalIOChlValue (unsigned char_ b_BoardHandle, // unsigned char_ b_ModulNbr, // unsigned char_ b_InputChannel, // // unsigned char *_ pb_ChannelStatus) /* _INT_ i_APCI1710_ReadDigitalIOChlValue (unsigned char_ b_BoardHandle, */ /* * unsigned char_ b_ModulNbr, unsigned char_ b_InputChannel, * unsigned char *_ pb_ChannelStatus) */ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) { Loading Loading @@ -356,7 +356,7 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, i_ReturnValue = -6; } } // if (b_InputChannel == 5) } /* if (b_InputChannel == 5) */ else { /***************************/ /* Test the channel B mode */ Loading @@ -375,8 +375,8 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, i_ReturnValue = -7; } } // if (b_InputChannel == 5) } // if (b_InputChannel > 4) } /* if (b_InputChannel == 5) */ } /* if (b_InputChannel > 4) */ /***********************/ /* Test if error occur */ Loading @@ -387,11 +387,10 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, /* Read all digital input */ /**************************/ //INPDW (ps_APCI1710Variable-> // s_Board [b_BoardHandle]. // s_BoardInfos. // ui_Address + (64 * b_ModulNbr), // &dw_StatusReg); /* * INPDW (ps_APCI1710Variable-> s_Board [b_BoardHandle]. * s_BoardInfos. ui_Address + (64 * b_ModulNbr), &dw_StatusReg); */ dw_StatusReg = inl(devpriv-> Loading @@ -404,7 +403,7 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, 0x1C) >> b_InputChannel) & 1; } // if (i_ReturnValue == 0) } /* if (i_ReturnValue == 0) */ } else { /*******************************/ /* Digital I/O not initialised */ Loading Loading @@ -478,9 +477,10 @@ int i_APCI1710_InsnReadDigitalIOChlValue(struct comedi_device * dev, +----------------------------------------------------------------------------+ */ //_INT_ i_APCI1710_SetDigitalIOChlOn (unsigned char_ b_BoardHandle, // unsigned char_ b_ModulNbr, // unsigned char_ b_OutputChannel) /* * _INT_ i_APCI1710_SetDigitalIOChlOn (unsigned char_ b_BoardHandle, * unsigned char_ b_ModulNbr, unsigned char_ b_OutputChannel) */ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev, struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) { Loading Loading @@ -602,7 +602,7 @@ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev, 1 << b_OutputChannel; } } // set channel off } /* set channel off */ else { if (devpriv-> s_ModuleInfo Loading Loading @@ -630,7 +630,7 @@ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev, /*****************************/ /* Digital Output Memory OFF */ /*****************************/ // +Use previously the function "i_APCI1710_SetDigitalIOMemoryOn" /* +Use previously the function "i_APCI1710_SetDigitalIOMemoryOn" */ i_ReturnValue = -8; } Loading @@ -639,11 +639,12 @@ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev, /* Write the value */ /*******************/ //OUTPDW (ps_APCI1710Variable-> // s_Board [b_BoardHandle]. // s_BoardInfos. // ui_Address + (64 * b_ModulNbr), // dw_WriteValue); /* OUTPDW (ps_APCI1710Variable-> * s_Board [b_BoardHandle]. * s_BoardInfos. ui_Address + (64 * b_ModulNbr), * dw_WriteValue); */ */ outl(dw_WriteValue, devpriv->s_BoardInfos. ui_Address + (64 * b_ModulNbr)); Loading Loading @@ -725,9 +726,11 @@ int i_APCI1710_InsnWriteDigitalIOChlOnOff(struct comedi_device * dev, +----------------------------------------------------------------------------+ */ //_INT_ i_APCI1710_SetDigitalIOPortOn (unsigned char_ b_BoardHandle, // unsigned char_ b_ModulNbr, // unsigned char_ b_PortValue) /* * _INT_ i_APCI1710_SetDigitalIOPortOn (unsigned char_ * b_BoardHandle, unsigned char_ b_ModulNbr, unsigned char_ * b_PortValue) */ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) { Loading @@ -740,12 +743,12 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, unsigned char * pb_PortValue; b_ModulNbr = (unsigned char) CR_AREF(insn->chanspec); b_PortOperation = (unsigned char) data[0]; // Input or output b_PortOnOFF = (unsigned char) data[1]; // if output then On or Off b_PortValue = (unsigned char) data[2]; // if out put then Value b_PortOperation = (unsigned char) data[0]; /* Input or output */ b_PortOnOFF = (unsigned char) data[1]; /* if output then On or Off */ b_PortValue = (unsigned char) data[2]; /* if out put then Value */ i_ReturnValue = insn->n; pb_PortValue = (unsigned char *) & data[0]; // if input then read value /* if input then read value */ switch (b_PortOperation) { case APCI1710_INPUT: Loading @@ -771,11 +774,12 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, /* Read all digital input */ /**************************/ //INPDW (ps_APCI1710Variable-> // s_Board [b_BoardHandle]. // s_BoardInfos. // ui_Address + (64 * b_ModulNbr), // &dw_StatusReg); /* INPDW (ps_APCI1710Variable-> * s_Board [b_BoardHandle]. * s_BoardInfos. * ui_Address + (64 * b_ModulNbr), * &dw_StatusReg); */ dw_StatusReg = inl(devpriv->s_BoardInfos. Loading Loading @@ -853,7 +857,7 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, i_ReturnValue = -6; } } // if ((b_PortValue & 2) == 2) } /* if ((b_PortValue & 2) == 2) */ /**************************/ /* Test if channel B used */ Loading @@ -873,7 +877,7 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, i_ReturnValue = -7; } } // if ((b_PortValue & 4) == 4) } /* if ((b_PortValue & 4) == 4) */ /***********************/ /* Test if error occur */ Loading @@ -881,8 +885,8 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, if (i_ReturnValue >= 0) { //if(data[1]) //{ /* if(data[1]) { */ switch (b_PortOnOFF) { /*********************************/ /* Test if set Port ON */ Loading Loading @@ -924,7 +928,7 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, } break; // If Set PORT OFF /* If Set PORT OFF */ case APCI1710_OFF: /*********************************/ Loading Loading @@ -965,17 +969,18 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, = -8; } } // switch } /* switch */ /*******************/ /* Write the value */ /*******************/ // OUTPDW (ps_APCI1710Variable-> // s_Board [b_BoardHandle]. // s_BoardInfos. // ui_Address + (64 * b_ModulNbr), // dw_WriteValue); /* OUTPDW (ps_APCI1710Variable-> * s_Board [b_BoardHandle]. * s_BoardInfos. * ui_Address + (64 * b_ModulNbr), * dw_WriteValue); */ outl(dw_WriteValue, devpriv-> s_BoardInfos. Loading Loading @@ -1015,6 +1020,6 @@ int i_APCI1710_InsnBitsDigitalIOPortOnOff(struct comedi_device * dev, default: i_ReturnValue = -9; DPRINTK("NO INPUT/OUTPUT specified\n"); } //switch INPUT / OUTPUT } /* switch INPUT / OUTPUT */ return (i_ReturnValue); }
drivers/staging/comedi/drivers/addi-data/APCI1710_INCCPT.c +35 −35 File changed.Preview size limit exceeded, changes collapsed. Show changes
drivers/staging/comedi/drivers/addi-data/APCI1710_Inp_cpt.c +3 −3 Original line number Diff line number Diff line Loading @@ -515,7 +515,7 @@ int i_APCI1710_InsnWriteEnableDisablePulseEncoder(struct comedi_device * dev, | (1UL << b_PulseEncoderNbr); devpriv->tsk_Current = current; // Save the current process task structure devpriv->tsk_Current = current; /* Save the current process task structure */ } Loading Loading @@ -629,7 +629,7 @@ int i_APCI1710_InsnWriteEnableDisablePulseEncoder(struct comedi_device * dev, (64 * b_ModulNbr)); break; } // switch End } /* switch End */ } else { /*********************************/ Loading Loading @@ -805,7 +805,7 @@ int i_APCI1710_InsnBitsReadWritePulseEncoder(struct comedi_device * dev, (4 * b_PulseEncoderNbr) + (64 * b_ModulNbr)); } //end of switch } /* end of switch */ } else { /*********************************/ /* Pulse encoder not initialised */ Loading
drivers/staging/comedi/drivers/addi-data/APCI1710_Ssi.c +7 −7 Original line number Diff line number Diff line Loading @@ -167,7 +167,7 @@ int i_APCI1710_InsnConfigInitSSI(struct comedi_device * dev, struct comedi_subde /* 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) { /*************************************/ /* Test the SSI position data length */ Loading Loading @@ -423,11 +423,11 @@ int i_APCI1710_InsnReadSSIValue(struct comedi_device * dev, struct comedi_subdev i_ReturnValue = insn->n; pul_Position1 = (unsigned int *) & data[0]; // For Read1 /* For Read1 */ pul_TurnCpt1 = (unsigned int *) & data[1]; // For Read all pul_Position = (unsigned int *) & data[0]; //0-2 pul_TurnCpt = (unsigned int *) & data[3]; //3-5 /* For Read all */ pul_Position = (unsigned int *) & data[0]; /* 0-2 */ pul_TurnCpt = (unsigned int *) & data[3]; /* 3-5 */ b_ModulNbr = (unsigned char) CR_AREF(insn->chanspec); b_SelectedSSI = (unsigned char) CR_CHAN(insn->chanspec); b_ReadType = (unsigned char) CR_RANGE(insn->chanspec); Loading Loading @@ -667,7 +667,7 @@ int i_APCI1710_InsnReadSSIValue(struct comedi_device * dev, struct comedi_subdev default: printk("Read Type Inputs Wrong\n"); } // switch ending } /* switch ending */ } else { /***********************/ Loading Loading @@ -826,7 +826,7 @@ int i_APCI1710_InsnBitsSSIDigitalIO(struct comedi_device * dev, struct comedi_su default: printk("IO type wrong\n"); } //switch end } /* switch end */ } else { /**********************************/ /* The module is not a SSI module */ Loading