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

Staging: comedi: Remove C99 comments

Signed-off-by: default avatarBill Pemberton <wfp5p@virginia.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 70265d24
......@@ -736,7 +736,7 @@ int i_APCI1710_InsnConfigInitChrono(struct comedi_device * dev, struct comedi_su
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 */
......@@ -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 */
......@@ -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 */
......@@ -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 */
......@@ -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 */
}
/***********************************/
......@@ -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 */
......@@ -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 */
......@@ -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:
......@@ -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 */
......@@ -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 */
......@@ -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 */
......@@ -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 */
......@@ -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 */
......@@ -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 */
......@@ -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 */
......@@ -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) {
/*****************/
......@@ -1507,7 +1507,7 @@ int i_APCI1710_ReadChronoValue(struct comedi_device * dev,
mdelay(1000);
}
} // for (;;)
} /* for (;;) */
/*****************************/
/* Test if stop signal occur */
......@@ -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 */
......@@ -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;
......@@ -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 */
......@@ -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;
......@@ -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 */
......@@ -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;
......
......@@ -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 */
}
......@@ -629,7 +629,7 @@ int i_APCI1710_InsnWriteEnableDisablePulseEncoder(struct comedi_device * dev,
(64 * b_ModulNbr));
break;
} // switch End
} /* switch End */
} else {
/*********************************/
......@@ -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 */
......
......@@ -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 */
......@@ -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);
......@@ -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 {
/***********************/
......@@ -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 */
......
......@@ -322,7 +322,7 @@ int i_APCI1710_InsnConfigInitTTLIO(struct comedi_device * dev, struct comedi_sub
DPRINTK("\n");
default:
printk("Bad Config Type\n");
} // switch end
} /* switch end */
} else {
/**********************************/
/* The module is not a TTL module */
......@@ -610,7 +610,7 @@ int i_APCI1710_InsnBitsReadTTLIO(struct comedi_device * dev, struct comedi_subde
default:
printk("Bad ReadType\n");
} //End Switch
} /* End Switch */
} else {
/**********************************/
/* The module is not a TTL module */
......@@ -811,7 +811,7 @@ int i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device *dev,struct comedi
b_ModulNbr = CR_AREF(insn->chanspec);
b_OutputChannel= CR_CHAN(insn->chanspec);
ui_State = data[0]; // ON or OFF
ui_State = data[0]; /* ON or OFF */
+----------------------------------------------------------------------------+
| Output Parameters : - |
+----------------------------------------------------------------------------+
......@@ -837,7 +837,7 @@ int i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device * dev,
i_ReturnValue = insn->n;
b_ModulNbr = CR_AREF(insn->chanspec);
b_OutputChannel = CR_CHAN(insn->chanspec);
ui_State = data[0]; // ON or OFF
ui_State = data[0]; /* ON or OFF */
/**************************/
/* Test the module number */
......@@ -953,7 +953,7 @@ int i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device * dev,
ui_Address
+
(64 * b_ModulNbr));
if (ui_State) // ON
if (ui_State) /* ON */
{
dw_StatusReg
=
......@@ -969,7 +969,7 @@ int i_APCI1710_InsnWriteSetTTLIOChlOnOff(struct comedi_device * dev,
(b_OutputChannel
%
8));
} else // Off
} else /* Off */
{
dw_StatusReg
=
......
......@@ -92,15 +92,15 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead,
while (dw_eeprom_busy == EEPROM_BUSY);
for (i_Counter = 0; i_Counter < 2; i_Counter++) {
b_SelectedAddressLow = (w_EepromStartAddress + i_Counter) % 256; //Read the low 8 bit part
b_SelectedAddressHigh = (w_EepromStartAddress + i_Counter) / 256; //Read the high 8 bit part
b_SelectedAddressLow = (w_EepromStartAddress + i_Counter) % 256; /* Read the low 8 bit part */
b_SelectedAddressHigh = (w_EepromStartAddress + i_Counter) / 256; /* Read the high 8 bit part */
//Select the load low address mode
/* Select the load low address mode */
outb(NVCMD_LOAD_LOW,
dw_PCIBoardEepromAddress + AMCC_OP_REG_MCSR +
3);
//Wait on busy
/* Wait on busy */
do {
dw_eeprom_busy =
inl(dw_PCIBoardEepromAddress +
......@@ -109,12 +109,12 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead,
}
while (dw_eeprom_busy == EEPROM_BUSY);
//Load the low address
/* Load the low address */
outb(b_SelectedAddressLow,
dw_PCIBoardEepromAddress + AMCC_OP_REG_MCSR +
2);
//Wait on busy
/* Wait on busy */
do {
dw_eeprom_busy =
inl(dw_PCIBoardEepromAddress +
......@@ -123,12 +123,12 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead,
}
while (dw_eeprom_busy == EEPROM_BUSY);
//Select the load high address mode
/* Select the load high address mode */
outb(NVCMD_LOAD_HIGH,
dw_PCIBoardEepromAddress + AMCC_OP_REG_MCSR +
3);
//Wait on busy
/* Wait on busy */
do {
dw_eeprom_busy =
inl(dw_PCIBoardEepromAddress +
......@@ -137,12 +137,12 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead,
}
while (dw_eeprom_busy == EEPROM_BUSY);
//Load the high address
/* Load the high address */
outb(b_SelectedAddressHigh,
dw_PCIBoardEepromAddress + AMCC_OP_REG_MCSR +
2);
//Wait on busy
/* Wait on busy */
do {
dw_eeprom_busy =
inl(dw_PCIBoardEepromAddress +
......@@ -151,12 +151,12 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead,
}
while (dw_eeprom_busy == EEPROM_BUSY);
//Select the READ mode
/* Select the READ mode */
outb(NVCMD_BEGIN_READ,
dw_PCIBoardEepromAddress + AMCC_OP_REG_MCSR +
3);
//Wait on busy
/* Wait on busy */
do {
dw_eeprom_busy =
inl(dw_PCIBoardEepromAddress +
......@@ -165,12 +165,12 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead,
}
while (dw_eeprom_busy == EEPROM_BUSY);
//Read data into the EEPROM
/* Read data into the EEPROM */
*pb_ReadByte =
inb(dw_PCIBoardEepromAddress +
AMCC_OP_REG_MCSR + 2);
//Wait on busy
/* Wait on busy */
do {
dw_eeprom_busy =
inl(dw_PCIBoardEepromAddress +
......@@ -179,14 +179,14 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead,
}
while (dw_eeprom_busy == EEPROM_BUSY);
//Select the upper address part
/* Select the upper address part */
if (i_Counter == 0) {
b_ReadLowByte = pb_ReadByte[0];
} else {
b_ReadHighByte = pb_ReadByte[0];
}
//Sleep
/* Sleep */
for (i = 0; i < 10000; i++) ;
}
......@@ -196,8 +196,8 @@ int i_AddiHeaderRW_ReadEeprom(int i_NbOfWordsToRead,
pw_DataRead[i_WordCounter] = w_ReadWord;
w_EepromStartAddress += 2; // to read the next word
w_EepromStartAddress += 2; /* to read the next word */
} // for (...) i_NbOfWordsToRead
} /* for (...) i_NbOfWordsToRead */
return (0);
}
......@@ -68,25 +68,25 @@ You shoud also find the complete GPL in the COPYING file accompanying this sourc
#include "addi_common.h"
#include "addi_amcc_s5933.h"
//Update-0.7.57->0.7.68MODULE_AUTHOR("ADDI-DATA GmbH <info@addi-data.com>");
//Update-0.7.57->0.7.68MODULE_DESCRIPTION("Comedi ADDI-DATA module");
//Update-0.7.57->0.7.68MODULE_LICENSE("GPL");
/* Update-0.7.57->0.7.68MODULE_AUTHOR("ADDI-DATA GmbH <info@addi-data.com>"); */
/* Update-0.7.57->0.7.68MODULE_DESCRIPTION("Comedi ADDI-DATA module"); */
/* Update-0.7.57->0.7.68MODULE_LICENSE("GPL"); */
#define devpriv ((struct addi_private *)dev->private)
#define this_board ((struct addi_board *)dev->board_ptr)
#if defined(CONFIG_APCI_1710) || defined(CONFIG_APCI_3200) || defined(CONFIG_APCI_3300)
//BYTE b_SaveFPUReg [94];
/* BYTE b_SaveFPUReg [94]; */
void fpu_begin(void)
{
//asm ("fstenv b_SaveFPUReg");
/* asm ("fstenv b_SaveFPUReg"); */
kernel_fpu_begin();
}
void fpu_end(void)
{
// asm ("frstor b_SaveFPUReg");
/* asm ("frstor b_SaveFPUReg"); */
kernel_fpu_end();
}
#endif
......@@ -901,7 +901,7 @@ static const struct addi_board boardtypes[] = {
NULL},
#endif
#ifdef CONFIG_APCI_3300
//Begin JK 20.10.2004: APCI-3300 integration
/* Begin JK 20.10.2004: APCI-3300 integration */
{"apci3300",
APCI3200_BOARD_VENDOR_ID,
0x3007,
......@@ -2580,10 +2580,10 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
}
if (!pci_list_builded) {
v_pci_card_list_init(this_board->i_VendorId, 1); //1 for displaying the list..
v_pci_card_list_init(this_board->i_VendorId, 1); /* 1 for displaying the list.. */
pci_list_builded = 1;
}
//rt_printk("comedi%d: addi_common: board=%s",dev->minor,this_board->pc_DriverName);
/* rt_printk("comedi%d: addi_common: board=%s",dev->minor,this_board->pc_DriverName); */
if ((this_board->i_Dma) && (it->options[2] == 0)) {
i_Dma = 1;
......@@ -2617,16 +2617,16 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
/************************************/
if (this_board->i_IorangeBase1 != 0) {
dev->iobase = (unsigned long)iobase_main; // DAQ base address...
dev->iobase = (unsigned long)iobase_main; /* DAQ base address... */
} else {
dev->iobase = (unsigned long)iobase_a; // DAQ base address...
dev->iobase = (unsigned long)iobase_a; /* DAQ base address... */
}
dev->board_name = this_board->pc_DriverName;
devpriv->amcc = card;
devpriv->iobase = (int) dev->iobase;
devpriv->i_IobaseAmcc = (int) iobase_a; //AMCC base address...
devpriv->i_IobaseAddon = (int) iobase_addon; //ADD ON base address....
devpriv->i_IobaseAmcc = (int) iobase_a; /* AMCC base address... */
devpriv->i_IobaseAddon = (int) iobase_addon; /* ADD ON base address.... */
devpriv->i_IobaseReserved = (int) iobase_reserved;
devpriv->ps_BoardInfo = this_board;
} else {
......@@ -2643,7 +2643,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
printk("\nioremap end");
}
//##
/* ## */
if (irq > 0) {
if (comedi_request_irq(irq, v_ADDI_Interrupt, IRQF_SHARED,
......@@ -2662,18 +2662,18 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
it->options[2]);
dev->irq = irq;
// Read eepeom and fill addi_board Structure
/* Read eepeom and fill addi_board Structure */
if (this_board->i_PCIEeprom) {
printk("\nPCI Eeprom used");
if (!(strcmp(this_board->pc_EepromChip, "S5920"))) {
// Set 3 wait stait
/* Set 3 wait stait */
if (!(strcmp(this_board->pc_DriverName, "apci035"))) {
outl(0x80808082, devpriv->i_IobaseAmcc + 0x60);
} else {
outl(0x83838383, devpriv->i_IobaseAmcc + 0x60);
}
// Enable the interrupt for the controler
/* Enable the interrupt for the controler */
dw_Dummy = inl(devpriv->i_IobaseAmcc + 0x38);
outl(dw_Dummy | 0x2000, devpriv->i_IobaseAmcc + 0x38);
printk("\nEnable the interrupt for the controler");
......@@ -2694,7 +2694,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
if (this_board->i_Dma) {
printk("\nDMA used");
if (devpriv->us_UseDma == ADDI_ENABLE) {
// alloc DMA buffers
/* alloc DMA buffers */
devpriv->b_DmaDoubleBuffer = 0;
for (i = 0; i < 2; i++) {
for (pages = 4; pages >= 0; pages--) {
......@@ -2739,16 +2739,16 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
#ifdef CONFIG_APCI_1710
i_ADDI_AttachPCI1710(dev);
// save base address
/* save base address */
devpriv->s_BoardInfos.ui_Address = io_addr[2];
#endif
} else {
//Update-0.7.57->0.7.68dev->n_subdevices = 7;
/* Update-0.7.57->0.7.68dev->n_subdevices = 7; */
n_subdevices = 7;
if ((ret = alloc_subdevices(dev, n_subdevices)) < 0)
return ret;
// Allocate and Initialise AI Subdevice Structures
/* Allocate and Initialise AI Subdevice Structures */
s = dev->subdevices + 0;
if ((this_board->i_NbrAiChannel)
|| (this_board->i_NbrAiChannelDiff)) {
......@@ -2786,7 +2786,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
s->type = COMEDI_SUBD_UNUSED;
}
// Allocate and Initialise AO Subdevice Structures
/* Allocate and Initialise AO Subdevice Structures */
s = dev->subdevices + 1;
if (this_board->i_NbrAoChannel) {
s->type = COMEDI_SUBD_AO;
......@@ -2804,7 +2804,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
} else {
s->type = COMEDI_SUBD_UNUSED;
}
// Allocate and Initialise DI Subdevice Structures
/* Allocate and Initialise DI Subdevice Structures */
s = dev->subdevices + 2;
if (this_board->i_NbrDiChannel) {
s->type = COMEDI_SUBD_DI;
......@@ -2824,7 +2824,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
} else {
s->type = COMEDI_SUBD_UNUSED;
}
// Allocate and Initialise DO Subdevice Structures
/* Allocate and Initialise DO Subdevice Structures */
s = dev->subdevices + 3;
if (this_board->i_NbrDoChannel) {
s->type = COMEDI_SUBD_DO;
......@@ -2837,7 +2837,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
s->range_table = &range_digital;
s->io_bits = 0xf; /* all bits output */
s->insn_config = this_board->i_hwdrv_InsnConfigDigitalOutput; //for digital output memory..
s->insn_config = this_board->i_hwdrv_InsnConfigDigitalOutput; /* for digital output memory.. */
s->insn_write =
this_board->i_hwdrv_InsnWriteDigitalOutput;
s->insn_bits =
......@@ -2848,7 +2848,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
s->type = COMEDI_SUBD_UNUSED;
}
// Allocate and Initialise Timer Subdevice Structures
/* Allocate and Initialise Timer Subdevice Structures */
s = dev->subdevices + 4;
if (this_board->i_Timer) {
s->type = COMEDI_SUBD_TIMER;
......@@ -2868,7 +2868,7 @@ static int i_ADDI_Attach(struct comedi_device * dev, struct comedi_devconfig * i
s->type = COMEDI_SUBD_UNUSED;
}
// Allocate and Initialise TTL
/* Allocate and Initialise TTL */
s = dev->subdevices + 5;
if (this_board->i_NbrTTLChannel) {
s->type = COMEDI_SUBD_TTLIO;
......@@ -2965,7 +2965,7 @@ static int i_ADDI_Detach(struct comedi_device * dev)
}
if (pci_list_builded) {
//v_pci_card_list_cleanup(PCI_VENDOR_ID_AMCC);
/* v_pci_card_list_cleanup(PCI_VENDOR_ID_AMCC); */
v_pci_card_list_cleanup(this_board->i_VendorId);
pci_list_builded = 0;
}
......@@ -2999,7 +2999,7 @@ static int i_ADDI_Reset(struct comedi_device * dev)
return 0;
}
// Interrupt function
/* Interrupt function */
/*
+----------------------------------------------------------------------------+
| Function name : |
......@@ -3025,7 +3025,7 @@ static irqreturn_t v_ADDI_Interrupt(int irq, void *d)
return IRQ_RETVAL(1);
}
// EEPROM Read Function
/* EEPROM Read Function */
/*
+----------------------------------------------------------------------------+
| Function name : |
......@@ -3051,12 +3051,12 @@ static int i_ADDIDATA_InsnReadEeprom(struct comedi_device * dev, struct comedi_s
{
unsigned short w_Data;
unsigned short w_Address;
w_Address = CR_CHAN(insn->chanspec); // address to be read as 0,1,2,3...255
w_Address = CR_CHAN(insn->chanspec); /* address to be read as 0,1,2,3...255 */
w_Data = w_EepromReadWord(devpriv->i_IobaseAmcc,
this_board->pc_EepromChip, 0x100 + (2 * w_Address));
data[0] = w_Data;
//multiplied by 2 bcozinput will be like 0,1,2...255
/* multiplied by 2 bcozinput will be like 0,1,2...255 */
return insn->n;
}
......@@ -62,36 +62,36 @@
/* structure for the boardtype */
struct addi_board {
const char *pc_DriverName; // driver name
int i_VendorId; //PCI vendor a device ID of card
const char *pc_DriverName; /* driver name */
int i_VendorId; /* PCI vendor a device ID of card */
int i_DeviceId;
int i_IorangeBase0;
int i_IorangeBase1;
int i_IorangeBase2; // base 2 range
int i_IorangeBase3; // base 3 range
int i_PCIEeprom; // eeprom present or not
char *pc_EepromChip; // type of chip
int i_NbrAiChannel; // num of A/D chans
int i_NbrAiChannelDiff; // num of A/D chans in diff mode
int i_AiChannelList; // len of chanlist
int i_NbrAoChannel; // num of D/A chans
int i_AiMaxdata; // resolution of A/D
int i_AoMaxdata; // resolution of D/A
int i_IorangeBase2; /* base 2 range */
int i_IorangeBase3; /* base 3 range */
int i_PCIEeprom; /* eeprom present or not */
char *pc_EepromChip; /* type of chip */
int i_NbrAiChannel; /* num of A/D chans */
int i_NbrAiChannelDiff; /* num of A/D chans in diff mode */
int i_AiChannelList; /* len of chanlist */
int i_NbrAoChannel; /* num of D/A chans */
int i_AiMaxdata; /* resolution of A/D */
int i_AoMaxdata; /* resolution of D/A */
const struct comedi_lrange *pr_AiRangelist; /* rangelist for A/D */
const struct comedi_lrange *pr_AoRangelist; /* rangelist for D/A */
int i_NbrDiChannel; // Number of DI channels
int i_NbrDoChannel; // Number of DO channels
int i_DoMaxdata; // data to set all chanels high
int i_NbrDiChannel; /* Number of DI channels */
int i_NbrDoChannel; /* Number of DO channels */
int i_DoMaxdata; /* data to set all chanels high */
int i_NbrTTLChannel; // Number of TTL channels
int i_NbrTTLChannel; /* Number of TTL channels */
const struct comedi_lrange *pr_TTLRangelist; /* rangelist for TTL */
int i_Dma; // dma present or not
int i_Timer; // timer subdevice present or not
int i_Dma; /* dma present or not */
int i_Timer; /* timer subdevice present or not */
unsigned char b_AvailableConvertUnit;
unsigned int ui_MinAcquisitiontimeNs; // Minimum Acquisition in Nano secs
unsigned int ui_MinDelaytimeNs; // Minimum Delay in Nano secs
unsigned int ui_MinAcquisitiontimeNs; /* Minimum Acquisition in Nano secs */
unsigned int ui_MinDelaytimeNs; /* Minimum Delay in Nano secs */
/* interrupt and reset */
void (*v_hwdrv_Interrupt)(int irq, void *d);
......@@ -348,57 +348,57 @@ union str_ModuleInfo {
struct addi_private {
int iobase;
int i_IobaseAmcc; // base+size for AMCC chip
int i_IobaseAddon; //addon base address
int i_IobaseAmcc; /* base+size for AMCC chip */
int i_IobaseAddon; /* addon base address */
int i_IobaseReserved;
unsigned long dw_AiBase;
struct pcilst_struct *amcc; // ptr too AMCC data
unsigned char allocated; // we have blocked card
unsigned char b_ValidDriver; // driver is ok
unsigned char b_AiContinuous; // we do unlimited AI
struct pcilst_struct *amcc; /* ptr too AMCC data */
unsigned char allocated; /* we have blocked card */
unsigned char b_ValidDriver; /* driver is ok */
unsigned char b_AiContinuous; /* we do unlimited AI */
unsigned char b_AiInitialisation;
unsigned int ui_AiActualScan; //how many scans we finished
unsigned int ui_AiBufferPtr; // data buffer ptr in samples
unsigned int ui_AiNbrofChannels; // how many channels is measured
unsigned int ui_AiScanLength; // Length of actual scanlist
unsigned int ui_AiActualScanPosition; // position in actual scan
unsigned int * pui_AiChannelList; // actual chanlist
unsigned int ui_AiChannelList[32]; // actual chanlist
unsigned char b_AiChannelConfiguration[32]; // actual chanlist
unsigned int ui_AiActualScan; /* how many scans we finished */
unsigned int ui_AiBufferPtr; /* data buffer ptr in samples */
unsigned int ui_AiNbrofChannels; /* how many channels is measured */
unsigned int ui_AiScanLength; /* Length of actual scanlist */
unsigned int ui_AiActualScanPosition; /* position in actual scan */
unsigned int * pui_AiChannelList; /* actual chanlist */
unsigned int ui_AiChannelList[32]; /* actual chanlist */
unsigned char b_AiChannelConfiguration[32]; /* actual chanlist */
unsigned int ui_AiReadData[32];
unsigned int dw_AiInitialised;
unsigned int ui_AiTimer0; //Timer Constant for Timer0
unsigned int ui_AiTimer1; //Timer constant for Timer1
unsigned int ui_AiTimer0; /* Timer Constant for Timer0 */
unsigned int ui_AiTimer1; /* Timer constant for Timer1 */
unsigned int ui_AiFlags;
unsigned int ui_AiDataLength;
short *AiData; // Pointer to sample data
unsigned int ui_AiNbrofScans; // number of scans to do
unsigned short us_UseDma; // To use Dma or not
unsigned char b_DmaDoubleBuffer; // we can use double buffering
unsigned int ui_DmaActualBuffer; // which buffer is used now
short *AiData; /* Pointer to sample data */
unsigned int ui_AiNbrofScans; /* number of scans to do */
unsigned short us_UseDma; /* To use Dma or not */
unsigned char b_DmaDoubleBuffer; /* we can use double buffering */
unsigned int ui_DmaActualBuffer; /* which buffer is used now */
/* UPDATE-0.7.57->0.7.68 */
/* unsigned int ul_DmaBufferVirtual[2]; pointers to begin of DMA buffer */
short *ul_DmaBufferVirtual[2]; // pointers to begin of DMA buffer
unsigned int ul_DmaBufferHw[2]; // hw address of DMA buff
unsigned int ui_DmaBufferSize[2]; // size of dma buffer in bytes
unsigned int ui_DmaBufferUsesize[2]; // which size we may now used for transfer
unsigned int ui_DmaBufferSamples[2]; // size in samples
unsigned int ui_DmaBufferPages[2]; // number of pages in buffer
unsigned char b_DigitalOutputRegister; // Digital Output Register
short *ul_DmaBufferVirtual[2]; /* pointers to begin of DMA buffer */
unsigned int ul_DmaBufferHw[2]; /* hw address of DMA buff */
unsigned int ui_DmaBufferSize[2]; /* size of dma buffer in bytes */
unsigned int ui_DmaBufferUsesize[2]; /* which size we may now used for transfer */
unsigned int ui_DmaBufferSamples[2]; /* size in samples */
unsigned int ui_DmaBufferPages[2]; /* number of pages in buffer */
unsigned char b_DigitalOutputRegister; /* Digital Output Register */
unsigned char b_OutputMemoryStatus;
unsigned char b_AnalogInputChannelNbr; // Analog input channel Nbr
unsigned char b_AnalogOutputChannelNbr; // Analog input Output Nbr
unsigned char b_TimerSelectMode; // Contain data written at iobase + 0C
unsigned char b_ModeSelectRegister; // Contain data written at iobase + 0E
unsigned short us_OutputRegister; // Contain data written at iobase + 0
unsigned char b_AnalogInputChannelNbr; /* Analog input channel Nbr */
unsigned char b_AnalogOutputChannelNbr; /* Analog input Output Nbr */
unsigned char b_TimerSelectMode; /* Contain data written at iobase + 0C */
unsigned char b_ModeSelectRegister; /* Contain data written at iobase + 0E */
unsigned short us_OutputRegister; /* Contain data written at iobase + 0 */
unsigned char b_InterruptState;
unsigned char b_TimerInit; // Specify if InitTimerWatchdog was load
unsigned char b_TimerStarted; // Specify if timer 2 is running or not
unsigned char b_Timer2Mode; // Specify the timer 2 mode
unsigned char b_Timer2Interrupt; //Timer2 interrupt enable or disable
unsigned char b_AiCyclicAcquisition; // indicate cyclic acquisition
unsigned char b_InterruptMode; // eoc eos or dma
unsigned char b_EocEosInterrupt; // Enable disable eoc eos interrupt
unsigned char b_TimerInit; /* Specify if InitTimerWatchdog was load */
unsigned char b_TimerStarted; /* Specify if timer 2 is running or not */
unsigned char b_Timer2Mode; /* Specify the timer 2 mode */
unsigned char b_Timer2Interrupt; /* Timer2 interrupt enable or disable */
unsigned char b_AiCyclicAcquisition; /* indicate cyclic acquisition */
unsigned char b_InterruptMode; /* eoc eos or dma */
unsigned char b_EocEosInterrupt; /* Enable disable eoc eos interrupt */
unsigned int ui_EocEosConversionTime;
unsigned char b_EocEosConversionTimeBase;
unsigned char b_SingelDiff;
......
......@@ -45,11 +45,11 @@ You shoud also find the complete GPL in the COPYING file accompanying this sourc
+----------+-----------+------------------------------------------------+
*/
#define NVCMD_BEGIN_READ (0x7 << 5 ) // nvRam begin read command
#define NVCMD_LOAD_LOW (0x4 << 5 ) // nvRam load low command
#define NVCMD_LOAD_HIGH (0x5 << 5 ) // nvRam load high command
#define EE76_CMD_LEN 13 // bits in instructions
#define EE_READ 0x0180 // 01 1000 0000 read instruction
#define NVCMD_BEGIN_READ (0x7 << 5 ) /* nvRam begin read command */
#define NVCMD_LOAD_LOW (0x4 << 5 ) /* nvRam load low command */
#define NVCMD_LOAD_HIGH (0x5 << 5 ) /* nvRam load high command */
#define EE76_CMD_LEN 13 /* bits in instructions */
#define EE_READ 0x0180 /* 01 1000 0000 read instruction */
#define EEPROM_DIGITALINPUT 0
#define EEPROM_DIGITALOUTPUT 1
......@@ -82,13 +82,13 @@ struct str_DigitalOutputHeader {
};
// used for timer as well as watchdog
/* used for timer as well as watchdog */
struct str_TimerDetails {
unsigned short w_HeaderSize;
unsigned char b_Resolution;
unsigned char b_Mode; // in case of Watchdog it is functionality
unsigned char b_Mode; /* in case of Watchdog it is functionality */
unsigned short w_MinTiming;
unsigned char b_TimeBase;
};
......@@ -97,7 +97,7 @@ struct str_TimerMainHeader {
unsigned short w_Ntimer;
struct str_TimerDetails s_TimerDetails[4]; // supports 4 timers
struct str_TimerDetails s_TimerDetails[4]; /* supports 4 timers */
};
......@@ -206,9 +206,9 @@ unsigned short w_EepromReadWord(unsigned short w_PCIBoardEepromAddress, char *pc
for (b_Counter = 0; b_Counter < 2; b_Counter++)
{
b_SelectedAddressLow = (w_EepromStartAddress + b_Counter) % 256; //Read the low 8 bit part
b_SelectedAddressLow = (w_EepromStartAddress + b_Counter) % 256; /* Read the low 8 bit part */
b_SelectedAddressHigh = (w_EepromStartAddress + b_Counter) / 256; //Read the high 8 bit part
b_SelectedAddressHigh = (w_EepromStartAddress + b_Counter) / 256; /* Read the high 8 bit part */
/************************************/
......@@ -319,20 +319,20 @@ unsigned short w_EepromReadWord(unsigned short w_PCIBoardEepromAddress, char *pc
b_ReadLowByte = b_ReadByte;
} // if(b_Counter==0)
} /* if(b_Counter==0) */
else
{
b_ReadHighByte = b_ReadByte;
} // if(b_Counter==0)
} /* if(b_Counter==0) */
} // for (b_Counter=0; b_Counter<2; b_Counter++)
} /* for (b_Counter=0; b_Counter<2; b_Counter++) */
w_ReadWord = (b_ReadLowByte | (((unsigned short) b_ReadHighByte) * 256));
} // end of if ((!strcmp(pc_PCIChipInformation, "S5920")) || (!strcmp(pc_PCIChipInformation, "S5933")))
} /* end of if ((!strcmp(pc_PCIChipInformation, "S5920")) || (!strcmp(pc_PCIChipInformation, "S5933"))) */
if (!strcmp(pc_PCIChipInformation, "93C76"))
{
......@@ -902,15 +902,15 @@ int i_EepromReadMainHeader(unsigned short w_PCIBoardEepromAddress,
break;
case EEPROM_TIMER:
this_board->i_Timer = 1; //Timer subdevice present
this_board->i_Timer = 1; /* Timer subdevice present */
break;
case EEPROM_WATCHDOG:
this_board->i_Timer = 1; //Timer subdevice present
this_board->i_Timer = 1; /* Timer subdevice present */
break;
case EEPROM_TIMER_WATCHDOG_COUNTER:
this_board->i_Timer = 1; //Timer subdevice present
this_board->i_Timer = 1; /* Timer subdevice present */
}
}
......@@ -944,17 +944,17 @@ int i_EepromReadDigitalInputHeader(unsigned short w_PCIBoardEepromAddress,
{
unsigned short w_Temp;
// read nbr of channels
/* read nbr of channels */
s_Header->w_Nchannel =
w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation,
0x100 + w_Address + 6);
// interruptible or not
/* interruptible or not */
w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress,
pc_PCIChipInformation, 0x100 + w_Address + 8);
s_Header->b_Interruptible = (unsigned char) (w_Temp >> 7) & 0x01;
// How many interruptible logic
/* How many interruptible logic */
s_Header->w_NinterruptLogic =
w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation,
0x100 + w_Address + 10);
......@@ -987,7 +987,7 @@ int i_EepromReadDigitalOutputHeader(unsigned short w_PCIBoardEepromAddress,
char *pc_PCIChipInformation, unsigned short w_Address,
struct str_DigitalOutputHeader * s_Header)
{
// Read Nbr channels
/* Read Nbr channels */
s_Header->w_Nchannel =
w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation,
0x100 + w_Address + 6);
......@@ -1021,11 +1021,11 @@ int i_EepromReadTimerHeader(unsigned short w_PCIBoardEepromAddress,
unsigned short i, w_Size = 0, w_Temp;
//Read No of Timer
/* Read No of Timer */
s_Header->w_Ntimer =
w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation,
0x100 + w_Address + 6);
//Read header size
/* Read header size */
for (i = 0; i < s_Header->w_Ntimer; i++) {
s_Header->s_TimerDetails[i].w_HeaderSize =
......@@ -1036,11 +1036,11 @@ int i_EepromReadTimerHeader(unsigned short w_PCIBoardEepromAddress,
pc_PCIChipInformation,
0x100 + w_Address + 8 + w_Size + 2);
//Read Resolution
/* Read Resolution */
s_Header->s_TimerDetails[i].b_Resolution =
(unsigned char) (w_Temp >> 10) & 0x3F;
//Read Mode
/* Read Mode */
s_Header->s_TimerDetails[i].b_Mode =
(unsigned char) (w_Temp >> 4) & 0x3F;
......@@ -1048,10 +1048,10 @@ int i_EepromReadTimerHeader(unsigned short w_PCIBoardEepromAddress,
pc_PCIChipInformation,
0x100 + w_Address + 8 + w_Size + 4);
//Read MinTiming
/* Read MinTiming */
s_Header->s_TimerDetails[i].w_MinTiming = (w_Temp >> 6) & 0x3FF;
//Read Timebase
/* Read Timebase */
s_Header->s_TimerDetails[i].b_TimeBase = (unsigned char) (w_Temp) & 0x3F;
w_Size += s_Header->s_TimerDetails[i].w_HeaderSize;
}
......@@ -1085,11 +1085,11 @@ int i_EepromReadAnlogOutputHeader(unsigned short w_PCIBoardEepromAddress,
str_AnalogOutputHeader * s_Header)
{
unsigned short w_Temp;
// No of channels for 1st hard component
/* No of channels for 1st hard component */
w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress,
pc_PCIChipInformation, 0x100 + w_Address + 10);
s_Header->w_Nchannel = (w_Temp >> 4) & 0x03FF;
// Resolution for 1st hard component
/* Resolution for 1st hard component */
w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress,
pc_PCIChipInformation, 0x100 + w_Address + 16);
s_Header->b_Resolution = (unsigned char) (w_Temp >> 8) & 0xFF;
......@@ -1117,7 +1117,7 @@ int i_EepromReadAnlogOutputHeader(unsigned short w_PCIBoardEepromAddress,
+----------------------------------------------------------------------------+
*/
// Reads only for ONE hardware component
/* Reads only for ONE hardware component */
int i_EepromReadAnlogInputHeader(unsigned short w_PCIBoardEepromAddress,
char *pc_PCIChipInformation, unsigned short w_Address,
struct str_AnalogInputHeader * s_Header)
......@@ -1134,24 +1134,24 @@ int i_EepromReadAnlogInputHeader(unsigned short w_PCIBoardEepromAddress,
0x100 + w_Address + 30);
w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress,
pc_PCIChipInformation, 0x100 + w_Address + 20);
s_Header->b_HasDma = (w_Temp >> 13) & 0x01; // whether dma present or not
s_Header->b_HasDma = (w_Temp >> 13) & 0x01; /* whether dma present or not */
w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation, 0x100 + w_Address + 72); // reading Y
w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress, pc_PCIChipInformation, 0x100 + w_Address + 72); /* reading Y */
w_Temp = w_Temp & 0x00FF;
if (w_Temp) //Y>0
if (w_Temp) /* Y>0 */
{
w_Offset = 74 + (2 * w_Temp) + (10 * (1 + (w_Temp / 16))); // offset of first analog input single header
w_Offset = w_Offset + 2; // resolution
} else //Y=0
w_Offset = 74 + (2 * w_Temp) + (10 * (1 + (w_Temp / 16))); /* offset of first analog input single header */
w_Offset = w_Offset + 2; /* resolution */
} else /* Y=0 */
{
w_Offset = 74;
w_Offset = w_Offset + 2; // resolution
w_Offset = w_Offset + 2; /* resolution */
}
// read Resolution
/* read Resolution */
w_Temp = w_EepromReadWord(w_PCIBoardEepromAddress,
pc_PCIChipInformation, 0x100 + w_Address + w_Offset);
s_Header->b_Resolution = w_Temp & 0x001F; // last 5 bits
s_Header->b_Resolution = w_Temp & 0x001F; /* last 5 bits */
return 0;
}
......@@ -31,15 +31,15 @@
*************************/
#define FIFO_ADVANCE_ON_BYTE_2 0x20000000 // written on base0
#define FIFO_ADVANCE_ON_BYTE_2 0x20000000 /* written on base0 */
#define AMWEN_ENABLE 0x02 // added for step 6 dma written on base2
#define AMWEN_ENABLE 0x02 /* added for step 6 dma written on base2 */
#define A2P_FIFO_WRITE_ENABLE 0x01
#define AGCSTS_TC_ENABLE 0x10000000 // Added for transfer count enable bit
#define AGCSTS_TC_ENABLE 0x10000000 /* Added for transfer count enable bit */
// ADDON RELATED ADDITIONS
// Constant
/* ADDON RELATED ADDITIONS */
/* Constant */
#define APCI3120_ENABLE_TRANSFER_ADD_ON_LOW 0x00
#define APCI3120_ENABLE_TRANSFER_ADD_ON_HIGH 0x1200
#define APCI3120_A2P_FIFO_MANAGEMENT 0x04000400L
......@@ -52,7 +52,7 @@
#define APCI3120_DISABLE_BUS_MASTER_ADD_ON 0x0
#define APCI3120_DISABLE_BUS_MASTER_PCI 0x0
// ADD_ON ::: this needed since apci supports 16 bit interface to add on
/* ADD_ON ::: this needed since apci supports 16 bit interface to add on */
#define APCI3120_ADD_ON_AGCSTS_LOW 0x3C
#define APCI3120_ADD_ON_AGCSTS_HIGH APCI3120_ADD_ON_AGCSTS_LOW + 2
#define APCI3120_ADD_ON_MWAR_LOW 0x24
......@@ -60,7 +60,7 @@
#define APCI3120_ADD_ON_MWTC_LOW 0x058
#define APCI3120_ADD_ON_MWTC_HIGH APCI3120_ADD_ON_MWTC_LOW + 2
// AMCC
/* AMCC */
#define APCI3120_AMCC_OP_MCSR 0x3C
#define APCI3120_AMCC_OP_REG_INTCSR 0x38
......@@ -212,7 +212,7 @@ struct pcilst_struct {
unsigned int irq;
};
struct pcilst_struct *amcc_devices; // ptr to root list of all amcc devices
struct pcilst_struct *amcc_devices; /* ptr to root list of all amcc devices */
/****************************************************************************/
......@@ -267,7 +267,7 @@ void v_pci_card_list_init(unsigned short pci_vendor, char display)
amcc->vendor = pcidev->vendor;
amcc->device = pcidev->device;
#if 0
amcc->master = pcidev->master; // how get this information under 2.4 kernels?
amcc->master = pcidev->master; /* how get this information under 2.4 kernels? */
#endif
amcc->pci_bus = pcidev->bus->number;
amcc->pci_slot = PCI_SLOT(pcidev->devfn);
......@@ -333,17 +333,17 @@ int i_find_free_pci_card_by_position(unsigned short vendor_id,
&& (amcc->pci_slot == pci_slot)) {
if (!(amcc->used)) {
*card = amcc;
return 0; // ok, card is found
return 0; /* ok, card is found */
} else {
rt_printk
(" - \nCard on requested position is used b:s %d:%d!\n",
pci_bus, pci_slot);
return 2; // card exist but is used
return 2; /* card exist but is used */
}
}
}
return 1; // no card found
return 1; /* no card found */
}
/****************************************************************************/
......@@ -422,7 +422,7 @@ struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_id,
{
struct pcilst_struct *card;
if ((pci_bus < 1) & (pci_slot < 1)) { // use autodetection
if ((pci_bus < 1) & (pci_slot < 1)) { /* use autodetection */
if ((card = ptr_find_free_pci_card_by_device(vendor_id,
device_id)) ==
NULL) {
......
......@@ -44,7 +44,7 @@
#define APCI1710_SYNCHRONOUS_MODE 1
#define APCI1710_ASYNCHRONOUS_MODE 0
//MODULE INFO STRUCTURE
/* MODULE INFO STRUCTURE */
static const struct comedi_lrange range_apci1710_ttl = { 4, {
BIP_RANGE(10),
......
......@@ -124,9 +124,9 @@ int i_APCI035_ConfigTimerWatchdog(struct comedi_device * dev, struct comedi_subd
} else {
ui_Mode = 0;
}
//ui_Command = inl(devpriv->iobase+((i_WatchdogNbr-1)*32)+12);
/* ui_Command = inl(devpriv->iobase+((i_WatchdogNbr-1)*32)+12); */
ui_Command = 0;
//ui_Command = ui_Command & 0xFFFFF9FEUL;
/* ui_Command = ui_Command & 0xFFFFF9FEUL; */
outl(ui_Command, devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12);
ui_Command = 0;
ui_Command = inl(devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12);
......@@ -153,7 +153,7 @@ int i_APCI035_ConfigTimerWatchdog(struct comedi_device * dev, struct comedi_subd
ui_Command =
(ui_Command & 0xFFF719E2UL) | ui_Mode << 13UL | 0x10UL;
} //if (data[0] == ADDIDATA_TIMER)
} /* if (data[0] == ADDIDATA_TIMER) */
else {
if (data[0] == ADDIDATA_WATCHDOG) {
......@@ -292,7 +292,7 @@ int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device * dev,
ui_Command = (ui_Command & 0xFFFFF9FFUL) | 0x1UL;
outl(ui_Command,
devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12);
} // if (data[0]==1)
} /* if (data[0]==1) */
if (data[0] == 2) {
ui_Command =
inl(devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12);
......@@ -304,16 +304,18 @@ int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device * dev,
devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12);
}
if (data[0] == 0) //Stop The Watchdog
if (data[0] == 0) /* Stop The Watchdog */
{
//Stop The Watchdog
/* Stop The Watchdog */
ui_Command = 0;
//ui_Command = inl(devpriv->iobase+((i_WatchdogNbr-1)*32)+12);
//ui_Command = ui_Command & 0xFFFFF9FEUL;
/*
* ui_Command = inl(devpriv->iobase+((i_WatchdogNbr-1)*32)+12);
* ui_Command = ui_Command & 0xFFFFF9FEUL;
*/
outl(ui_Command,
devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 12);
} // if (data[1]==0)
if (data[0] == 3) //stop all Watchdogs
} /* if (data[1]==0) */
if (data[0] == 3) /* stop all Watchdogs */
{
ui_Command = 0;
for (i_Count = 1; i_Count <= 4; i_Count++) {
......@@ -329,7 +331,7 @@ int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device * dev,
}
}
if (data[0] == 4) //start all Watchdogs
if (data[0] == 4) /* start all Watchdogs */
{
ui_Command = 0;
for (i_Count = 1; i_Count <= 4; i_Count++) {
......@@ -344,7 +346,7 @@ int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device * dev,
0);
}
}
if (data[0] == 5) //trigger all Watchdogs
if (data[0] == 5) /* trigger all Watchdogs */
{
ui_Command = 0;
for (i_Count = 1; i_Count <= 4; i_Count++) {
......@@ -394,7 +396,7 @@ int i_APCI035_StartStopWriteTimerWatchdog(struct comedi_device * dev,
int i_APCI035_ReadTimerWatchdog(struct comedi_device * dev, struct comedi_subdevice * s,
struct comedi_insn * insn, unsigned int * data)
{
unsigned int ui_Status = 0; // Status register
unsigned int ui_Status = 0; /* Status register */
i_WatchdogNbr = insn->unused[0];
/******************/
/* Get the status */
......@@ -419,7 +421,7 @@ int i_APCI035_ReadTimerWatchdog(struct comedi_device * dev, struct comedi_subdev
if (devpriv->b_TimerSelectMode == ADDIDATA_TIMER) {
data[4] = inl(devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 0);
} // if (devpriv->b_TimerSelectMode==ADDIDATA_TIMER)
} /* if (devpriv->b_TimerSelectMode==ADDIDATA_TIMER) */
return insn->n;
}
......@@ -524,9 +526,9 @@ int i_APCI035_Reset(struct comedi_device * dev)
int i_Count = 0;
for (i_Count = 1; i_Count <= 4; i_Count++) {
i_WatchdogNbr = i_Count;
outl(0x0, devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 0); //stop all timers
outl(0x0, devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 0); /* stop all timers */
}
outl(0x0, devpriv->iobase + 128 + 12); //Disable the warning delay
outl(0x0, devpriv->iobase + 128 + 12); /* Disable the warning delay */
return 0;
}
......@@ -571,7 +573,7 @@ static void v_APCI035_Interrupt(int irq, void *d)
ui_StatusRegister2 =
inl(devpriv->iobase + ((i_WatchdogNbr - 1) * 32) + 20);
if ((((ui_StatusRegister1) & 0x8) == 0x8)) //Test if warning relay interrupt
if ((((ui_StatusRegister1) & 0x8) == 0x8)) /* Test if warning relay interrupt */
{
/**********************************/
/* Disable the temperature warning */
......@@ -587,14 +589,14 @@ static void v_APCI035_Interrupt(int irq, void *d)
/* Read the digital temperature value */
/**************************************/
ui_DigitalTemperature = inl(devpriv->iobase + 128 + 60);
send_sig(SIGIO, devpriv->tsk_Current, 0); // send signal to the sample
} //if (((ui_StatusRegister1 & 0x8) == 0x8))
send_sig(SIGIO, devpriv->tsk_Current, 0); /* send signal to the sample */
} /* if (((ui_StatusRegister1 & 0x8) == 0x8)) */
else {
if ((ui_StatusRegister2 & 0x1) == 0x1) {
send_sig(SIGIO, devpriv->tsk_Current, 0); // send signal to the sample
send_sig(SIGIO, devpriv->tsk_Current, 0); /* send signal to the sample */
}
} //else if (((ui_StatusRegister1 & 0x8) == 0x8))
} /* else if (((ui_StatusRegister1 & 0x8) == 0x8)) */
return;
}
......@@ -53,7 +53,7 @@ You shoud also find the complete GPL in the COPYING file accompanying this sourc
*/
#include "hwdrv_apci1032.h"
#include <linux/delay.h>
//Global variables
/* Global variables */
unsigned int ui_InterruptStatus = 0;
/*
......@@ -107,11 +107,11 @@ int i_APCI1032_ConfigDigitalInput(struct comedi_device * dev, struct comedi_subd
outl(0x4, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
ui_TmpValue =
inl(devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
} //if (data[1] == ADDIDATA_OR)
} /* if (data[1] == ADDIDATA_OR) */
else {
outl(0x6, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
} //else if(data[1] == ADDIDATA_OR)
} // if( data[0] == ADDIDATA_ENABLE)
} /* else if(data[1] == ADDIDATA_OR) */
} /* if( data[0] == ADDIDATA_ENABLE) */
else {
ul_Command1 = ul_Command1 & 0xFFFF0000;
ul_Command2 = ul_Command2 & 0xFFFF0000;
......@@ -120,7 +120,7 @@ int i_APCI1032_ConfigDigitalInput(struct comedi_device * dev, struct comedi_subd
outl(ul_Command2,
devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_MODE2);
outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
} //else if ( data[0] == ADDIDATA_ENABLE)
} /* else if ( data[0] == ADDIDATA_ENABLE) */
return insn->n;
}
......@@ -152,14 +152,16 @@ int i_APCI1032_Read1DigitalInput(struct comedi_device * dev, struct comedi_subde
ui_Channel = CR_CHAN(insn->chanspec);
if (ui_Channel >= 0 && ui_Channel <= 31) {
ui_TmpValue = (unsigned int) inl(devpriv->iobase + APCI1032_DIGITAL_IP);
// since only 1 channel reqd to bring it to last bit it is rotated
// 8 +(chan - 1) times then ANDed with 1 for last bit.
/*
* since only 1 channel reqd to bring it to last bit it is rotated 8
* +(chan - 1) times then ANDed with 1 for last bit.
*/
*data = (ui_TmpValue >> ui_Channel) & 0x1;
} //if(ui_Channel >= 0 && ui_Channel <=31)
} /* if(ui_Channel >= 0 && ui_Channel <=31) */
else {
//comedi_error(dev," \n chan spec wrong\n");
return -EINVAL; // "sorry channel spec wrong "
} //else if(ui_Channel >= 0 && ui_Channel <=31)
/* comedi_error(dev," \n chan spec wrong\n"); */
return -EINVAL; /* "sorry channel spec wrong " */
} /* else if(ui_Channel >= 0 && ui_Channel <=31) */
return insn->n;
}
......@@ -213,16 +215,16 @@ int i_APCI1032_ReadMoreDigitalInput(struct comedi_device * dev, struct comedi_su
case 31:
break;
default:
//comedi_error(dev," \nchan spec wrong\n");
return -EINVAL; // "sorry channel spec wrong "
/* comedi_error(dev," \nchan spec wrong\n"); */
return -EINVAL; /* "sorry channel spec wrong " */
break;
} //switch(ui_NoOfChannels)
} //if(data[1]==0)
} /* switch(ui_NoOfChannels) */
} /* if(data[1]==0) */
else {
if (data[1] == 1) {
*data = ui_InterruptStatus;
} //if(data[1]==1)
} //else if(data[1]==0)
} /* if(data[1]==1) */
} /* else if(data[1]==0) */
return insn->n;
}
......@@ -248,15 +250,15 @@ static void v_APCI1032_Interrupt(int irq, void *d)
struct comedi_device *dev = d;
unsigned int ui_Temp;
//disable the interrupt
/* disable the interrupt */
ui_Temp = inl(devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
outl(ui_Temp & APCI1032_DIGITAL_IP_INTERRUPT_DISABLE,
devpriv->iobase + APCI1032_DIGITAL_IP_IRQ);
ui_InterruptStatus =
inl(devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_STATUS);
ui_InterruptStatus = ui_InterruptStatus & 0X0000FFFF;
send_sig(SIGIO, devpriv->tsk_Current, 0); // send signal to the sample
outl(ui_Temp, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); //enable the interrupt
send_sig(SIGIO, devpriv->tsk_Current, 0); /* send signal to the sample */
outl(ui_Temp, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); /* enable the interrupt */
return;
}
......@@ -277,9 +279,9 @@ static void v_APCI1032_Interrupt(int irq, void *d)
int i_APCI1032_Reset(struct comedi_device * dev)
{
outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); //disable the interrupts
inl(devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_STATUS); //Reset the interrupt status register
outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_MODE1); //Disable the and/or interrupt
outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_IRQ); /* disable the interrupts */
inl(devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_STATUS); /* Reset the interrupt status register */
outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_MODE1); /* Disable the and/or interrupt */
outl(0x0, devpriv->iobase + APCI1032_DIGITAL_IP_INTERRUPT_MODE2);
return 0;
}
......@@ -19,33 +19,34 @@
#define APCI1032_BOARD_VENDOR_ID 0x15B8
#define APCI1032_ADDRESS_RANGE 20
//DIGITAL INPUT DEFINE
/* DIGITAL INPUT DEFINE */
#define APCI1032_DIGITAL_IP 0
#define APCI1032_DIGITAL_IP_INTERRUPT_MODE1 4
#define APCI1032_DIGITAL_IP_INTERRUPT_MODE2 8
#define APCI1032_DIGITAL_IP_IRQ 16
//Digital Input IRQ Function Selection
/* Digital Input IRQ Function Selection */
#define ADDIDATA_OR 0
#define ADDIDATA_AND 1
//Digital Input Interrupt Status
/* Digital Input Interrupt Status */
#define APCI1032_DIGITAL_IP_INTERRUPT_STATUS 12
//Digital Input Interrupt Enable Disable.
/* Digital Input Interrupt Enable Disable. */
#define APCI1032_DIGITAL_IP_INTERRUPT_ENABLE 0x4
#define APCI1032_DIGITAL_IP_INTERRUPT_DISABLE 0xFFFFFFFB
//ADDIDATA Enable Disable
/* ADDIDATA Enable Disable */
#define ADDIDATA_ENABLE 1
#define ADDIDATA_DISABLE 0
// Hardware Layer functions for Apci1032
/* Hardware Layer functions for Apci1032 */
//DI
// for di read
/*
* DI for di read
*/
int i_APCI1032_ConfigDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
......@@ -56,8 +57,8 @@ int i_APCI1032_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdev
int i_APCI1032_ReadMoreDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
// Interrupt functions.....
/* Interrupt functions..... */
static void v_APCI1032_Interrupt(int irq, void *d);
//Reset
/* Reset */
int i_APCI1032_Reset(struct comedi_device *dev);
......@@ -17,11 +17,11 @@
/********* Definitions for APCI-1500 card *****/
// Card Specific information
/* Card Specific information */
#define APCI1500_BOARD_VENDOR_ID 0x10e8
#define APCI1500_ADDRESS_RANGE 4
//DIGITAL INPUT-OUTPUT DEFINE
/* DIGITAL INPUT-OUTPUT DEFINE */
#define APCI1500_DIGITAL_OP 2
#define APCI1500_DIGITAL_IP 0
......
......@@ -81,14 +81,14 @@ int i_APCI1516_Read1DigitalInput(struct comedi_device * dev, struct comedi_subde
ui_Channel = CR_CHAN(insn->chanspec);
if (ui_Channel >= 0 && ui_Channel <= 7) {
ui_TmpValue = (unsigned int) inw(devpriv->iobase + APCI1516_DIGITAL_IP);
// since only 1 channel reqd to bring it to last bit it is rotated
// 8 +(chan - 1) times then ANDed with 1 for last bit.
/* since only 1 channel reqd to bring it to last bit it is rotated */
/* 8 +(chan - 1) times then ANDed with 1 for last bit. */
*data = (ui_TmpValue >> ui_Channel) & 0x1;
} //if(ui_Channel >= 0 && ui_Channel <=7)
} /* if(ui_Channel >= 0 && ui_Channel <=7) */
else {
//comedi_error(dev," \n chan spec wrong\n");
return -EINVAL; // "sorry channel spec wrong "
} //else if(ui_Channel >= 0 && ui_Channel <=7)
/* comedi_error(dev," \n chan spec wrong\n"); */
return -EINVAL; /* "sorry channel spec wrong " */
} /* else if(ui_Channel >= 0 && ui_Channel <=7) */
return insn->n;
}
......@@ -139,9 +139,9 @@ int i_APCI1516_ReadMoreDigitalInput(struct comedi_device * dev, struct comedi_su
default:
printk("\nWrong parameters\n");
return -EINVAL; // "sorry channel spec wrong "
return -EINVAL; /* "sorry channel spec wrong " */
break;
} //switch(ui_NoOfChannels)
} /* switch(ui_NoOfChannels) */
return insn->n;
}
......@@ -203,17 +203,17 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
struct comedi_insn * insn, unsigned int * data)
{
unsigned int ui_Temp, ui_Temp1;
unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); // get the channel
unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); /* get the channel */
printk("EL311003 : @=%x\n", devpriv->iobase + APCI1516_DIGITAL_OP);
if (devpriv->b_OutputMemoryStatus) {
ui_Temp = inw(devpriv->iobase + APCI1516_DIGITAL_OP);
} //if(devpriv->b_OutputMemoryStatus )
} /* if(devpriv->b_OutputMemoryStatus ) */
else {
ui_Temp = 0;
} //if(devpriv->b_OutputMemoryStatus )
} /* if(devpriv->b_OutputMemoryStatus ) */
if (data[3] == 0) {
if (data[1] == 0) {
data[0] = (data[0] << ui_NoOfChannel) | ui_Temp;
......@@ -222,7 +222,7 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
printk("EL311003 : d=%d @=%x\n", data[0],
devpriv->iobase + APCI1516_DIGITAL_OP);
} //if(data[1]==0)
} /* if(data[1]==0) */
else {
if (data[1] == 1) {
switch (ui_NoOfChannel) {
......@@ -245,21 +245,21 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
default:
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],
devpriv->iobase + APCI1516_DIGITAL_OP);
printk("EL311003 : d=%d @=%x\n", data[0],
devpriv->iobase + APCI1516_DIGITAL_OP);
} // if(data[1]==1)
} /* if(data[1]==1) */
else {
printk("\nSpecified channel not supported\n");
} //else if(data[1]==1)
} //elseif(data[1]==0)
} //if(data[3]==0)
} /* else if(data[1]==1) */
} /* elseif(data[1]==0) */
} /* if(data[3]==0) */
else {
if (data[3] == 1) {
if (data[1] == 0) {
......@@ -275,7 +275,7 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
printk("EL311003 : d=%d @=%x\n", data[0],
devpriv->iobase + APCI1516_DIGITAL_OP);
} //if(data[1]==0)
} /* if(data[1]==0) */
else {
if (data[1] == 1) {
switch (ui_NoOfChannel) {
......@@ -312,9 +312,9 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
default:
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],
devpriv->iobase +
......@@ -324,17 +324,17 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
data[0],
devpriv->iobase +
APCI1516_DIGITAL_OP);
} // if(data[1]==1)
} /* if(data[1]==1) */
else {
printk("\nSpecified channel not supported\n");
} //else if(data[1]==1)
} //elseif(data[1]==0)
} //if(data[3]==1);
} /* else if(data[1]==1) */
} /* elseif(data[1]==0) */
} /* if(data[3]==1); */
else {
printk("\nSpecified functionality does not exist\n");
return -EINVAL;
} //if else data[3]==1)
} //if else data[3]==0)
} /* if else data[3]==1) */
} /* if else data[3]==0) */
return (insn->n);;
}
......@@ -364,12 +364,12 @@ int i_APCI1516_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde
{
unsigned int ui_Temp;
unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); // get the channel
unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); /* get the channel */
ui_Temp = data[0];
*data = inw(devpriv->iobase + APCI1516_DIGITAL_OP_RW);
if (ui_Temp == 0) {
*data = (*data >> ui_NoOfChannel) & 0x1;
} //if(ui_Temp==0)
} /* if(ui_Temp==0) */
else {
if (ui_Temp == 1) {
switch (ui_NoOfChannel) {
......@@ -387,14 +387,14 @@ int i_APCI1516_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde
default:
comedi_error(dev, " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong "
return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannels)
} //if(ui_Temp==1)
} /* switch(ui_NoOfChannels) */
} /* if(ui_Temp==1) */
else {
printk("\nSpecified channel not supported \n");
} //elseif(ui_Temp==1)
} //elseif(ui_Temp==0)
} /* elseif(ui_Temp==1) */
} /* elseif(ui_Temp==0) */
return insn->n;
}
......@@ -423,11 +423,11 @@ int i_APCI1516_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic
struct comedi_insn * insn, unsigned int * data)
{
if (data[0] == 0) {
//Disable the watchdog
/* Disable the watchdog */
outw(0x0,
devpriv->i_IobaseAddon +
APCI1516_WATCHDOG_ENABLEDISABLE);
//Loading the Reload value
/* Loading the Reload value */
outw(data[1],
devpriv->i_IobaseAddon +
APCI1516_WATCHDOG_RELOAD_VALUE);
......@@ -435,11 +435,11 @@ int i_APCI1516_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic
outw(data[1],
devpriv->i_IobaseAddon +
APCI1516_WATCHDOG_RELOAD_VALUE + 2);
} //if(data[0]==0)
} /* if(data[0]==0) */
else {
printk("\nThe input parameters are wrong\n");
return -EINVAL;
} //elseif(data[0]==0)
} /* elseif(data[0]==0) */
return insn->n;
}
......@@ -469,15 +469,15 @@ int i_APCI1516_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_
struct comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
case 0: //stop the watchdog
outw(0x0, devpriv->i_IobaseAddon + APCI1516_WATCHDOG_ENABLEDISABLE); //disable the watchdog
case 0: /* stop the watchdog */
outw(0x0, devpriv->i_IobaseAddon + APCI1516_WATCHDOG_ENABLEDISABLE); /* disable the watchdog */
break;
case 1: //start the watchdog
case 1: /* start the watchdog */
outw(0x0001,
devpriv->i_IobaseAddon +
APCI1516_WATCHDOG_ENABLEDISABLE);
break;
case 2: //Software trigger
case 2: /* Software trigger */
outw(0x0201,
devpriv->i_IobaseAddon +
APCI1516_WATCHDOG_ENABLEDISABLE);
......@@ -485,7 +485,7 @@ int i_APCI1516_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_
default:
printk("\nSpecified functionality does not exist\n");
return -EINVAL;
} // switch(data[0])
} /* switch(data[0]) */
return insn->n;
}
......@@ -534,7 +534,7 @@ int i_APCI1516_ReadWatchdog(struct comedi_device * dev, struct comedi_subdevice
int i_APCI1516_Reset(struct comedi_device * dev)
{
outw(0x0, devpriv->iobase + APCI1516_DIGITAL_OP); //RESETS THE DIGITAL OUTPUTS
outw(0x0, devpriv->iobase + APCI1516_DIGITAL_OP); /* RESETS THE DIGITAL OUTPUTS */
outw(0x0, devpriv->i_IobaseAddon + APCI1516_WATCHDOG_ENABLEDISABLE);
outw(0x0, devpriv->i_IobaseAddon + APCI1516_WATCHDOG_RELOAD_VALUE);
outw(0x0, devpriv->i_IobaseAddon + APCI1516_WATCHDOG_RELOAD_VALUE + 2);
......
......@@ -17,17 +17,17 @@
/********* Definitions for APCI-1516 card *****/
// Card Specific information
/* Card Specific information */
#define APCI1516_BOARD_VENDOR_ID 0x15B8
#define APCI1516_ADDRESS_RANGE 8
//DIGITAL INPUT-OUTPUT DEFINE
/* DIGITAL INPUT-OUTPUT DEFINE */
#define APCI1516_DIGITAL_OP 4
#define APCI1516_DIGITAL_OP_RW 4
#define APCI1516_DIGITAL_IP 0
// TIMER COUNTER WATCHDOG DEFINES
/* TIMER COUNTER WATCHDOG DEFINES */
#define ADDIDATA_WATCHDOG 2
#define APCI1516_DIGITAL_OP_WATCHDOG 0
......@@ -35,15 +35,15 @@
#define APCI1516_WATCHDOG_RELOAD_VALUE 4
#define APCI1516_WATCHDOG_STATUS 16
// Hardware Layer functions for Apci1516
/* Hardware Layer functions for Apci1516 */
//Digital Input
/* Digital Input */
int i_APCI1516_ReadMoreDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
int i_APCI1516_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
//Digital Output
/* Digital Output */
int i_APCI1516_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
int i_APCI1516_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
......@@ -51,8 +51,9 @@ int i_APCI1516_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subde
int i_APCI1516_ReadDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
// TIMER
// timer value is passed as u seconds
/*
* TIMER timer value is passed as u seconds
*/
int i_APCI1516_ConfigWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
int i_APCI1516_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
......@@ -60,5 +61,5 @@ int i_APCI1516_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_s
int i_APCI1516_ReadWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
//reset
/* reset */
int i_APCI1516_Reset(struct comedi_device *dev);
......@@ -20,45 +20,45 @@
#define APCI1564_BOARD_VENDOR_ID 0x15B8
#define APCI1564_ADDRESS_RANGE 128
//DIGITAL INPUT-OUTPUT DEFINE
// Input defines
/* DIGITAL INPUT-OUTPUT DEFINE */
/* Input defines */
#define APCI1564_DIGITAL_IP 0x04
#define APCI1564_DIGITAL_IP_INTERRUPT_MODE1 4
#define APCI1564_DIGITAL_IP_INTERRUPT_MODE2 8
#define APCI1564_DIGITAL_IP_IRQ 16
// Output defines
/* Output defines */
#define APCI1564_DIGITAL_OP 0x18
#define APCI1564_DIGITAL_OP_RW 0
#define APCI1564_DIGITAL_OP_INTERRUPT 4
#define APCI1564_DIGITAL_OP_IRQ 12
//Digital Input IRQ Function Selection
/* Digital Input IRQ Function Selection */
#define ADDIDATA_OR 0
#define ADDIDATA_AND 1
//Digital Input Interrupt Status
/* Digital Input Interrupt Status */
#define APCI1564_DIGITAL_IP_INTERRUPT_STATUS 12
//Digital Output Interrupt Status
/* Digital Output Interrupt Status */
#define APCI1564_DIGITAL_OP_INTERRUPT_STATUS 8
//Digital Input Interrupt Enable Disable.
/* Digital Input Interrupt Enable Disable. */
#define APCI1564_DIGITAL_IP_INTERRUPT_ENABLE 0x4
#define APCI1564_DIGITAL_IP_INTERRUPT_DISABLE 0xFFFFFFFB
//Digital Output Interrupt Enable Disable.
/* Digital Output Interrupt Enable Disable. */
#define APCI1564_DIGITAL_OP_VCC_INTERRUPT_ENABLE 0x1
#define APCI1564_DIGITAL_OP_VCC_INTERRUPT_DISABLE 0xFFFFFFFE
#define APCI1564_DIGITAL_OP_CC_INTERRUPT_ENABLE 0x2
#define APCI1564_DIGITAL_OP_CC_INTERRUPT_DISABLE 0xFFFFFFFD
//ADDIDATA Enable Disable
/* ADDIDATA Enable Disable */
#define ADDIDATA_ENABLE 1
#define ADDIDATA_DISABLE 0
// TIMER COUNTER WATCHDOG DEFINES
/* TIMER COUNTER WATCHDOG DEFINES */
#define ADDIDATA_TIMER 0
#define ADDIDATA_COUNTER 1
......@@ -78,10 +78,11 @@
#define APCI1564_TCW_WARN_TIMEVAL 24
#define APCI1564_TCW_WARN_TIMEBASE 28
// Hardware Layer functions for Apci1564
/* Hardware Layer functions for Apci1564 */
//DI
// for di read
/*
* DI for di read
*/
int i_APCI1564_ConfigDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
int i_APCI1564_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
......@@ -89,7 +90,7 @@ int i_APCI1564_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdev
int i_APCI1564_ReadMoreDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
//DO
/* DO */
int i_APCI1564_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
int i_APCI1564_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
......@@ -99,8 +100,9 @@ int i_APCI1564_ReadDigitalOutput(struct comedi_device *dev, struct comedi_subdev
int i_APCI1564_ReadInterruptStatus(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
// TIMER
// timer value is passed as u seconds
/*
* TIMER timer value is passed as u seconds
*/
int i_APCI1564_ConfigTimerCounterWatchdog(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
......@@ -112,8 +114,8 @@ int i_APCI1564_ReadTimerCounterWatchdog(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
// intERRUPT
/* intERRUPT */
static void v_APCI1564_Interrupt(int irq, void *d);
// RESET
/* RESET */
int i_APCI1564_Reset(struct comedi_device *dev);
......@@ -82,13 +82,13 @@ int i_APCI2016_ConfigDigitalOutput(struct comedi_device * dev, struct comedi_sub
comedi_error(dev,
"Not a valid Data !!! ,Data should be 1 or 0\n");
return -EINVAL;
} // if ((data[0]!=0) && (data[0]!=1))
} /* if ((data[0]!=0) && (data[0]!=1)) */
if (data[0]) {
devpriv->b_OutputMemoryStatus = ADDIDATA_ENABLE;
} // if (data[0]
} /* if (data[0] */
else {
devpriv->b_OutputMemoryStatus = ADDIDATA_DISABLE;
} // else if (data[0]
} /* else if (data[0] */
return insn->n;
}
......@@ -121,24 +121,24 @@ int i_APCI2016_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
comedi_error(dev,
"Invalid Channel Numbers !!!, Channel Numbers must be between 0 and 15\n");
return -EINVAL;
} // if ((ui_NoOfChannel<0) || (ui_NoOfChannel>15))
} /* if ((ui_NoOfChannel<0) || (ui_NoOfChannel>15)) */
if (devpriv->b_OutputMemoryStatus) {
ui_Temp = inw(devpriv->iobase + APCI2016_DIGITAL_OP);
} // if (devpriv->b_OutputMemoryStatus )
} /* if (devpriv->b_OutputMemoryStatus ) */
else {
ui_Temp = 0;
} // else if (devpriv->b_OutputMemoryStatus )
} /* else if (devpriv->b_OutputMemoryStatus ) */
if ((data[1] != 0) && (data[1] != 1)) {
comedi_error(dev,
"Invalid Data[1] value !!!, Data[1] should be 0 or 1\n");
return -EINVAL;
} // if ((data[1]!=0) && (data[1]!=1))
} /* if ((data[1]!=0) && (data[1]!=1)) */
if (data[3] == 0) {
if (data[1] == 0) {
data[0] = (data[0] << ui_NoOfChannel) | ui_Temp;
outw(data[0], devpriv->iobase + APCI2016_DIGITAL_OP);
} // if (data[1]==0)
} /* if (data[1]==0) */
else {
if (data[1] == 1) {
switch (ui_NoOfChannel) {
......@@ -162,16 +162,16 @@ int i_APCI2016_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
break;
default:
comedi_error(dev, " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong "
} //switch(ui_NoOfChannels)
return -EINVAL; /* "sorry channel spec wrong " */
} /* switch(ui_NoOfChannels) */
outw(data[0],
devpriv->iobase + APCI2016_DIGITAL_OP);
} // if (data[1]==1)
} /* if (data[1]==1) */
else {
printk("\nSpecified channel not supported\n");
} // else if (data[1]==1)
} // else if (data[1]==0)
} // if (data[3]==0)
} /* else if (data[1]==1) */
} /* else if (data[1]==0) */
} /* if (data[3]==0) */
else {
if (data[3] == 1) {
if (data[1] == 0) {
......@@ -183,7 +183,7 @@ int i_APCI2016_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
data[0] = data[0] & ui_Temp;
outw(data[0],
devpriv->iobase + APCI2016_DIGITAL_OP);
} // if (data[1]==0)
} /* if (data[1]==0) */
else {
if (data[1] == 1) {
switch (ui_NoOfChannel) {
......@@ -228,22 +228,22 @@ int i_APCI2016_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
default:
comedi_error(dev,
" chan spec wrong");
return -EINVAL; // "sorry channel spec wrong "
} //switch(ui_NoOfChannels)
return -EINVAL; /* "sorry channel spec wrong " */
} /* switch(ui_NoOfChannels) */
outw(data[0],
devpriv->iobase +
APCI2016_DIGITAL_OP);
} // if(data[1]==1)
} /* if(data[1]==1) */
else {
printk("\nSpecified channel not supported\n");
} //else if(data[1]==1)
} //elseif(data[1]==0)
} //if(data[3]==1);
} /* else if(data[1]==1) */
} /* elseif(data[1]==0) */
} /* if(data[3]==1); */
else {
printk("\nSpecified functionality does not exist\n");
return -EINVAL;
} //if else data[3]==1)
} //if else data[3]==0)
} /* if else data[3]==1) */
} /* if else data[3]==0) */
return insn->n;
}
......@@ -276,17 +276,17 @@ int i_APCI2016_BitsDigitalOutput(struct comedi_device * dev, struct comedi_subde
comedi_error(dev,
"Invalid Channel Numbers !!!, Channel Numbers must be between 0 and 15\n");
return -EINVAL;
} // if ((ui_NoOfChannel<0) || (ui_NoOfChannel>15))
} /* if ((ui_NoOfChannel<0) || (ui_NoOfChannel>15)) */
if ((data[0] != 0) && (data[0] != 1)) {
comedi_error(dev,
"Invalid Data[0] value !!!, Data[0] should be 0 or 1\n");
return -EINVAL;
} // if ((data[0]!=0) && (data[0]!=1))
} /* if ((data[0]!=0) && (data[0]!=1)) */
ui_Temp = data[0];
*data = inw(devpriv->iobase + APCI2016_DIGITAL_OP_RW);
if (ui_Temp == 0) {
*data = (*data >> ui_NoOfChannel) & 0x1;
} // if (ui_Temp==0)
} /* if (ui_Temp==0) */
else {
if (ui_Temp == 1) {
switch (ui_NoOfChannel) {
......@@ -307,13 +307,13 @@ int i_APCI2016_BitsDigitalOutput(struct comedi_device * dev, struct comedi_subde
default:
comedi_error(dev, " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong "
} //switch(ui_NoOfChannel)
} // if (ui_Temp==1)
return -EINVAL; /* "sorry channel spec wrong " */
} /* switch(ui_NoOfChannel) */
} /* if (ui_Temp==1) */
else {
printk("\nSpecified channel not supported \n");
} // else if (ui_Temp==1)
} // if (ui_Temp==0)
} /* else if (ui_Temp==1) */
} /* if (ui_Temp==0) */
return insn->n;
}
......@@ -342,11 +342,11 @@ int i_APCI2016_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic
{
if (data[0] == 0) {
//Disable the watchdog
/* Disable the watchdog */
outw(0x0,
devpriv->i_IobaseAddon +
APCI2016_WATCHDOG_ENABLEDISABLE);
//Loading the Reload value
/* Loading the Reload value */
outw(data[1],
devpriv->i_IobaseAddon +
APCI2016_WATCHDOG_RELOAD_VALUE);
......@@ -385,15 +385,15 @@ int i_APCI2016_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_
{
switch (data[0]) {
case 0: //stop the watchdog
outw(0x0, devpriv->i_IobaseAddon + APCI2016_WATCHDOG_ENABLEDISABLE); //disable the watchdog
case 0: /* stop the watchdog */
outw(0x0, devpriv->i_IobaseAddon + APCI2016_WATCHDOG_ENABLEDISABLE); /* disable the watchdog */
break;
case 1: //start the watchdog
case 1: /* start the watchdog */
outw(0x0001,
devpriv->i_IobaseAddon +
APCI2016_WATCHDOG_ENABLEDISABLE);
break;
case 2: //Software trigger
case 2: /* Software trigger */
outw(0x0201,
devpriv->i_IobaseAddon +
APCI2016_WATCHDOG_ENABLEDISABLE);
......@@ -401,7 +401,7 @@ int i_APCI2016_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_
default:
printk("\nSpecified functionality does not exist\n");
return -EINVAL;
} // switch(data[0])
} /* switch(data[0]) */
return insn->n;
}
......@@ -452,7 +452,7 @@ int i_APCI2016_ReadWatchdog(struct comedi_device * dev, struct comedi_subdevice
int i_APCI2016_Reset(struct comedi_device * dev)
{
outw(0x0, devpriv->iobase + APCI2016_DIGITAL_OP); // Resets the digital output channels
outw(0x0, devpriv->iobase + APCI2016_DIGITAL_OP); /* Resets the digital output channels */
outw(0x0, devpriv->i_IobaseAddon + APCI2016_WATCHDOG_ENABLEDISABLE);
outw(0x0, devpriv->i_IobaseAddon + APCI2016_WATCHDOG_RELOAD_VALUE);
outw(0x0, devpriv->i_IobaseAddon + APCI2016_WATCHDOG_RELOAD_VALUE + 2);
......
......@@ -19,17 +19,17 @@
#define APCI2016_BOARD_VENDOR_ID 0x15B8
#define APCI2016_ADDRESS_RANGE 8
//DIGITAL INPUT-OUTPUT DEFINE
/* DIGITAL INPUT-OUTPUT DEFINE */
#define APCI2016_DIGITAL_OP 0x04
#define APCI2016_DIGITAL_OP_RW 4
//ADDIDATA Enable Disable
/* ADDIDATA Enable Disable */
#define ADDIDATA_ENABLE 1
#define ADDIDATA_DISABLE 0
// TIMER COUNTER WATCHDOG DEFINES
/* TIMER COUNTER WATCHDOG DEFINES */
#define ADDIDATA_WATCHDOG 2
#define APCI2016_DIGITAL_OP_WATCHDOG 0
......@@ -37,9 +37,9 @@
#define APCI2016_WATCHDOG_RELOAD_VALUE 4
#define APCI2016_WATCHDOG_STATUS 16
// Hardware Layer functions for Apci2016
/* Hardware Layer functions for Apci2016 */
//DO
/* DO */
int i_APCI2016_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
......@@ -49,8 +49,10 @@ int i_APCI2016_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subde
int i_APCI2016_BitsDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
// TIMER
// timer value is passed as u seconds
/*
* TIMER
* timer value is passed as u seconds
*/
int i_APCI2016_ConfigWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
......@@ -61,10 +63,10 @@ int i_APCI2016_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_s
int i_APCI2016_ReadWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
// Interrupt functions.....
/* Interrupt functions..... */
// void v_APCI2016_Interrupt(int irq, void *d) ;
/* void v_APCI2016_Interrupt(int irq, void *d); */
//void v_APCI2016_Interrupt(int irq, void *d);
// RESET
/* void v_APCI2016_Interrupt(int irq, void *d); */
/* RESET */
int i_APCI2016_Reset(struct comedi_device *dev);
......@@ -89,26 +89,26 @@ int i_APCI2032_ConfigDigitalOutput(struct comedi_device * dev, struct comedi_sub
comedi_error(dev,
"Not a valid Data !!! ,Data should be 1 or 0\n");
return -EINVAL;
} //if ( (data[0]!=0) && (data[0]!=1) )
} /* if ( (data[0]!=0) && (data[0]!=1) ) */
if (data[0]) {
devpriv->b_OutputMemoryStatus = ADDIDATA_ENABLE;
} // if (data[0])
} /* if (data[0]) */
else {
devpriv->b_OutputMemoryStatus = ADDIDATA_DISABLE;
} //else if (data[0])
} /* else if (data[0]) */
if (data[1] == ADDIDATA_ENABLE) {
ul_Command = ul_Command | 0x1;
} //if (data[1] == ADDIDATA_ENABLE)
} /* if (data[1] == ADDIDATA_ENABLE) */
else {
ul_Command = ul_Command & 0xFFFFFFFE;
} //elseif (data[1] == ADDIDATA_ENABLE)
} /* elseif (data[1] == ADDIDATA_ENABLE) */
if (data[2] == ADDIDATA_ENABLE) {
ul_Command = ul_Command | 0x2;
} //if (data[2] == ADDIDATA_ENABLE)
} /* if (data[2] == ADDIDATA_ENABLE) */
else {
ul_Command = ul_Command & 0xFFFFFFFD;
} //elseif (data[2] == ADDIDATA_ENABLE)
} /* elseif (data[2] == ADDIDATA_ENABLE) */
outl(ul_Command, devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT);
ui_InterruptData = inl(devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT);
return insn->n;
......@@ -138,19 +138,19 @@ int i_APCI2032_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
struct comedi_insn * insn, unsigned int * data)
{
unsigned int ui_Temp, ui_Temp1;
unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); // get the channel
unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); /* get the channel */
if (devpriv->b_OutputMemoryStatus) {
ui_Temp = inl(devpriv->iobase + APCI2032_DIGITAL_OP);
} //if(devpriv->b_OutputMemoryStatus )
} /* if(devpriv->b_OutputMemoryStatus ) */
else {
ui_Temp = 0;
} //if(devpriv->b_OutputMemoryStatus )
} /* if(devpriv->b_OutputMemoryStatus ) */
if (data[3] == 0) {
if (data[1] == 0) {
data[0] = (data[0] << ui_NoOfChannel) | ui_Temp;
outl(data[0], devpriv->iobase + APCI2032_DIGITAL_OP);
} //if(data[1]==0)
} /* if(data[1]==0) */
else {
if (data[1] == 1) {
switch (ui_NoOfChannel) {
......@@ -184,18 +184,18 @@ int i_APCI2032_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
default:
comedi_error(dev, " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong "
return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannels)
} /* switch(ui_NoOfChannels) */
outl(data[0],
devpriv->iobase + APCI2032_DIGITAL_OP);
} // if(data[1]==1)
} /* if(data[1]==1) */
else {
printk("\nSpecified channel not supported\n");
} //else if(data[1]==1)
} //elseif(data[1]==0)
} //if(data[3]==0)
} /* else if(data[1]==1) */
} /* elseif(data[1]==0) */
} /* if(data[3]==0) */
else {
if (data[3] == 1) {
if (data[1] == 0) {
......@@ -209,7 +209,7 @@ int i_APCI2032_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
data[0] = data[0] & ui_Temp;
outl(data[0],
devpriv->iobase + APCI2032_DIGITAL_OP);
} //if(data[1]==0)
} /* if(data[1]==0) */
else {
if (data[1] == 1) {
switch (ui_NoOfChannel) {
......@@ -272,24 +272,24 @@ int i_APCI2032_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
default:
comedi_error(dev,
" chan spec wrong");
return -EINVAL; // "sorry channel spec wrong "
return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannels)
} /* switch(ui_NoOfChannels) */
outl(data[0],
devpriv->iobase +
APCI2032_DIGITAL_OP);
} // if(data[1]==1)
} /* if(data[1]==1) */
else {
printk("\nSpecified channel not supported\n");
} //else if(data[1]==1)
} //elseif(data[1]==0)
} //if(data[3]==1);
} /* else if(data[1]==1) */
} /* elseif(data[1]==0) */
} /* if(data[3]==1); */
else {
printk("\nSpecified functionality does not exist\n");
return -EINVAL;
} //if else data[3]==1)
} //if else data[3]==0)
} /* if else data[3]==1) */
} /* if else data[3]==0) */
return (insn->n);;
}
......@@ -323,7 +323,7 @@ int i_APCI2032_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde
*data = inl(devpriv->iobase + APCI2032_DIGITAL_OP_RW);
if (ui_Temp == 0) {
*data = (*data >> ui_NoOfChannel) & 0x1;
} //if (ui_Temp==0)
} /* if (ui_Temp==0) */
else {
if (ui_Temp == 1) {
switch (ui_NoOfChannel) {
......@@ -349,13 +349,13 @@ int i_APCI2032_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde
default:
comedi_error(dev, " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong "
return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannels)
} //if (ui_Temp==1)
} /* switch(ui_NoOfChannels) */
} /* if (ui_Temp==1) */
else {
printk("\nSpecified channel not supported \n");
} //elseif (ui_Temp==1)
} /* elseif (ui_Temp==1) */
}
return insn->n;
}
......@@ -384,11 +384,11 @@ int i_APCI2032_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic
struct comedi_insn * insn, unsigned int * data)
{
if (data[0] == 0) {
//Disable the watchdog
/* Disable the watchdog */
outl(0x0,
devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
APCI2032_TCW_PROG);
//Loading the Reload value
/* Loading the Reload value */
outl(data[1],
devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
APCI2032_TCW_RELOAD_VALUE);
......@@ -425,15 +425,15 @@ int i_APCI2032_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_
struct comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
case 0: //stop the watchdog
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG); //disable the watchdog
case 0: /* stop the watchdog */
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG); /* disable the watchdog */
break;
case 1: //start the watchdog
case 1: /* start the watchdog */
outl(0x0001,
devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
APCI2032_TCW_PROG);
break;
case 2: //Software trigger
case 2: /* Software trigger */
outl(0x0201,
devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG +
APCI2032_TCW_PROG);
......@@ -498,13 +498,13 @@ void v_APCI2032_Interrupt(int irq, void *d)
struct comedi_device *dev = d;
unsigned int ui_DO;
ui_DO = inl(devpriv->iobase + APCI2032_DIGITAL_OP_IRQ) & 0x1; //Check if VCC OR CC interrupt has occured.
ui_DO = inl(devpriv->iobase + APCI2032_DIGITAL_OP_IRQ) & 0x1; /* Check if VCC OR CC interrupt has occured. */
if (ui_DO == 0) {
printk("\nInterrupt from unKnown source\n");
} // if(ui_DO==0)
} /* if(ui_DO==0) */
if (ui_DO) {
// Check for Digital Output interrupt Type - 1: Vcc interrupt 2: CC interrupt.
/* Check for Digital Output interrupt Type - 1: Vcc interrupt 2: CC interrupt. */
ui_Type =
inl(devpriv->iobase +
APCI2032_DIGITAL_OP_INTERRUPT_STATUS) & 0x3;
......@@ -512,16 +512,16 @@ void v_APCI2032_Interrupt(int irq, void *d)
devpriv->iobase + APCI2032_DIGITAL_OP +
APCI2032_DIGITAL_OP_INTERRUPT);
if (ui_Type == 1) {
//Sends signal to user space
/* Sends signal to user space */
send_sig(SIGIO, devpriv->tsk_Current, 0);
} // if (ui_Type==1)
} /* if (ui_Type==1) */
else {
if (ui_Type == 2) {
// Sends signal to user space
/* Sends signal to user space */
send_sig(SIGIO, devpriv->tsk_Current, 0);
} //if (ui_Type==2)
} //else if (ui_Type==1)
} //if(ui_DO)
} /* if (ui_Type==2) */
} /* else if (ui_Type==1) */
} /* if(ui_DO) */
return;
......@@ -571,9 +571,9 @@ int i_APCI2032_Reset(struct comedi_device * dev)
{
devpriv->b_DigitalOutputRegister = 0;
ui_Type = 0;
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP); //Resets the output channels
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT); //Disables the interrupt.
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG); //disable the watchdog
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_RELOAD_VALUE); //reload=0
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP); /* Resets the output channels */
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_INTERRUPT); /* Disables the interrupt. */
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_PROG); /* disable the watchdog */
outl(0x0, devpriv->iobase + APCI2032_DIGITAL_OP_WATCHDOG + APCI2032_TCW_RELOAD_VALUE); /* reload=0 */
return 0;
}
......@@ -17,32 +17,32 @@
/********* Definitions for APCI-2032 card *****/
// Card Specific information
/* Card Specific information */
#define APCI2032_BOARD_VENDOR_ID 0x15B8
#define APCI2032_ADDRESS_RANGE 63
//DIGITAL INPUT-OUTPUT DEFINE
/* DIGITAL INPUT-OUTPUT DEFINE */
#define APCI2032_DIGITAL_OP 0
#define APCI2032_DIGITAL_OP_RW 0
#define APCI2032_DIGITAL_OP_INTERRUPT 4
#define APCI2032_DIGITAL_OP_IRQ 12
//Digital Output Interrupt Status
/* Digital Output Interrupt Status */
#define APCI2032_DIGITAL_OP_INTERRUPT_STATUS 8
//Digital Output Interrupt Enable Disable.
/* Digital Output Interrupt Enable Disable. */
#define APCI2032_DIGITAL_OP_VCC_INTERRUPT_ENABLE 0x1
#define APCI2032_DIGITAL_OP_VCC_INTERRUPT_DISABLE 0xFFFFFFFE
#define APCI2032_DIGITAL_OP_CC_INTERRUPT_ENABLE 0x2
#define APCI2032_DIGITAL_OP_CC_INTERRUPT_DISABLE 0xFFFFFFFD
//ADDIDATA Enable Disable
/* ADDIDATA Enable Disable */
#define ADDIDATA_ENABLE 1
#define ADDIDATA_DISABLE 0
// TIMER COUNTER WATCHDOG DEFINES
/* TIMER COUNTER WATCHDOG DEFINES */
#define ADDIDATA_WATCHDOG 2
#define APCI2032_DIGITAL_OP_WATCHDOG 16
......@@ -52,9 +52,9 @@
#define APCI2032_TCW_TRIG_STATUS 16
#define APCI2032_TCW_IRQ 20
// Hardware Layer functions for Apci2032
/* Hardware Layer functions for Apci2032 */
//DO
/* DO */
int i_APCI2032_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
int i_APCI2032_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
......@@ -64,8 +64,10 @@ int i_APCI2032_ReadDigitalOutput(struct comedi_device *dev, struct comedi_subdev
int i_APCI2032_ReadInterruptStatus(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
// TIMER
// timer value is passed as u seconds
/* TIMER
* timer value is passed as u seconds
*/
int i_APCI2032_ConfigWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
int i_APCI2032_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
......@@ -73,9 +75,9 @@ int i_APCI2032_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_s
int i_APCI2032_ReadWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
// Interrupt functions.....
/* Interrupt functions..... */
void v_APCI2032_Interrupt(int irq, void *d);
//Reset functions
/* Reset functions */
int i_APCI2032_Reset(struct comedi_device *dev);
......@@ -82,11 +82,11 @@ int i_APCI2200_Read1DigitalInput(struct comedi_device * dev, struct comedi_subde
if (ui_Channel >= 0 && ui_Channel <= 7) {
ui_TmpValue = (unsigned int) inw(devpriv->iobase + APCI2200_DIGITAL_IP);
*data = (ui_TmpValue >> ui_Channel) & 0x1;
} //if(ui_Channel >= 0 && ui_Channel <=7)
} /* if(ui_Channel >= 0 && ui_Channel <=7) */
else {
printk("\nThe specified channel does not exist\n");
return -EINVAL; // "sorry channel spec wrong "
} //else if(ui_Channel >= 0 && ui_Channel <=7)
return -EINVAL; /* "sorry channel spec wrong " */
} /* else if(ui_Channel >= 0 && ui_Channel <=7) */
return insn->n;
}
......@@ -137,9 +137,9 @@ int i_APCI2200_ReadMoreDigitalInput(struct comedi_device * dev, struct comedi_su
default:
printk("\nWrong parameters\n");
return -EINVAL; // "sorry channel spec wrong "
return -EINVAL; /* "sorry channel spec wrong " */
break;
} //switch(ui_NoOfChannels)
} /* switch(ui_NoOfChannels) */
return insn->n;
}
......@@ -201,19 +201,19 @@ int i_APCI2200_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
struct comedi_insn * insn, unsigned int * data)
{
unsigned int ui_Temp, ui_Temp1;
unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); // get the channel
unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); /* get the channel */
if (devpriv->b_OutputMemoryStatus) {
ui_Temp = inw(devpriv->iobase + APCI2200_DIGITAL_OP);
} //if(devpriv->b_OutputMemoryStatus )
} /* if(devpriv->b_OutputMemoryStatus ) */
else {
ui_Temp = 0;
} //if(devpriv->b_OutputMemoryStatus )
} /* if(devpriv->b_OutputMemoryStatus ) */
if (data[3] == 0) {
if (data[1] == 0) {
data[0] = (data[0] << ui_NoOfChannel) | ui_Temp;
outw(data[0], devpriv->iobase + APCI2200_DIGITAL_OP);
} //if(data[1]==0)
} /* if(data[1]==0) */
else {
if (data[1] == 1) {
switch (ui_NoOfChannel) {
......@@ -240,18 +240,18 @@ int i_APCI2200_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
break;
default:
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],
devpriv->iobase + APCI2200_DIGITAL_OP);
} // if(data[1]==1)
} /* if(data[1]==1) */
else {
printk("\nSpecified channel not supported\n");
} //else if(data[1]==1)
} //elseif(data[1]==0)
} //if(data[3]==0)
} /* else if(data[1]==1) */
} /* elseif(data[1]==0) */
} /* if(data[3]==0) */
else {
if (data[3] == 1) {
if (data[1] == 0) {
......@@ -263,7 +263,7 @@ int i_APCI2200_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
data[0] = data[0] & ui_Temp;
outw(data[0],
devpriv->iobase + APCI2200_DIGITAL_OP);
} //if(data[1]==0)
} /* if(data[1]==0) */
else {
if (data[1] == 1) {
switch (ui_NoOfChannel) {
......@@ -312,24 +312,24 @@ int i_APCI2200_WriteDigitalOutput(struct comedi_device * dev, struct comedi_subd
default:
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],
devpriv->iobase +
APCI2200_DIGITAL_OP);
} // if(data[1]==1)
} /* if(data[1]==1) */
else {
printk("\nSpecified channel not supported\n");
} //else if(data[1]==1)
} //elseif(data[1]==0)
} //if(data[3]==1);
} /* else if(data[1]==1) */
} /* elseif(data[1]==0) */
} /* if(data[3]==1); */
else {
printk("\nSpecified functionality does not exist\n");
return -EINVAL;
} //if else data[3]==1)
} //if else data[3]==0)
} /* if else data[3]==1) */
} /* if else data[3]==0) */
return (insn->n);;
}
......@@ -359,12 +359,12 @@ int i_APCI2200_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde
{
unsigned int ui_Temp;
unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); // get the channel
unsigned int ui_NoOfChannel = CR_CHAN(insn->chanspec); /* get the channel */
ui_Temp = data[0];
*data = inw(devpriv->iobase + APCI2200_DIGITAL_OP);
if (ui_Temp == 0) {
*data = (*data >> ui_NoOfChannel) & 0x1;
} //if(ui_Temp==0)
} /* if(ui_Temp==0) */
else {
if (ui_Temp == 1) {
switch (ui_NoOfChannel) {
......@@ -386,14 +386,14 @@ int i_APCI2200_ReadDigitalOutput(struct comedi_device * dev, struct comedi_subde
default:
comedi_error(dev, " chan spec wrong");
return -EINVAL; // "sorry channel spec wrong "
return -EINVAL; /* "sorry channel spec wrong " */
} //switch(ui_NoOfChannels)
} //if(ui_Temp==1)
} /* switch(ui_NoOfChannels) */
} /* if(ui_Temp==1) */
else {
printk("\nSpecified channel not supported \n");
} //elseif(ui_Temp==1)
} //elseif(ui_Temp==0)
} /* elseif(ui_Temp==1) */
} /* elseif(ui_Temp==0) */
return insn->n;
}
......@@ -422,11 +422,11 @@ int i_APCI2200_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic
struct comedi_insn * insn, unsigned int * data)
{
if (data[0] == 0) {
//Disable the watchdog
/* Disable the watchdog */
outw(0x0,
devpriv->iobase + APCI2200_WATCHDOG +
APCI2200_WATCHDOG_ENABLEDISABLE);
//Loading the Reload value
/* Loading the Reload value */
outw(data[1],
devpriv->iobase + APCI2200_WATCHDOG +
APCI2200_WATCHDOG_RELOAD_VALUE);
......@@ -434,11 +434,11 @@ int i_APCI2200_ConfigWatchdog(struct comedi_device * dev, struct comedi_subdevic
outw(data[1],
devpriv->iobase + APCI2200_WATCHDOG +
APCI2200_WATCHDOG_RELOAD_VALUE + 2);
} //if(data[0]==0)
} /* if(data[0]==0) */
else {
printk("\nThe input parameters are wrong\n");
return -EINVAL;
} //elseif(data[0]==0)
} /* elseif(data[0]==0) */
return insn->n;
}
......@@ -468,15 +468,15 @@ int i_APCI2200_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_
struct comedi_insn * insn, unsigned int * data)
{
switch (data[0]) {
case 0: //stop the watchdog
outw(0x0, devpriv->iobase + APCI2200_WATCHDOG + APCI2200_WATCHDOG_ENABLEDISABLE); //disable the watchdog
case 0: /* stop the watchdog */
outw(0x0, devpriv->iobase + APCI2200_WATCHDOG + APCI2200_WATCHDOG_ENABLEDISABLE); /* disable the watchdog */
break;
case 1: //start the watchdog
case 1: /* start the watchdog */
outw(0x0001,
devpriv->iobase + APCI2200_WATCHDOG +
APCI2200_WATCHDOG_ENABLEDISABLE);
break;
case 2: //Software trigger
case 2: /* Software trigger */
outw(0x0201,
devpriv->iobase + APCI2200_WATCHDOG +
APCI2200_WATCHDOG_ENABLEDISABLE);
......@@ -484,7 +484,7 @@ int i_APCI2200_StartStopWriteWatchdog(struct comedi_device * dev, struct comedi_
default:
printk("\nSpecified functionality does not exist\n");
return -EINVAL;
} // switch(data[0])
} /* switch(data[0]) */
return insn->n;
}
......@@ -535,7 +535,7 @@ int i_APCI2200_ReadWatchdog(struct comedi_device * dev, struct comedi_subdevice
int i_APCI2200_Reset(struct comedi_device * dev)
{
outw(0x0, devpriv->iobase + APCI2200_DIGITAL_OP); //RESETS THE DIGITAL OUTPUTS
outw(0x0, devpriv->iobase + APCI2200_DIGITAL_OP); /* RESETS THE DIGITAL OUTPUTS */
outw(0x0,
devpriv->iobase + APCI2200_WATCHDOG +
APCI2200_WATCHDOG_ENABLEDISABLE);
......
......@@ -17,31 +17,31 @@
/********* Definitions for APCI-2200 card *****/
// Card Specific information
/* Card Specific information */
#define APCI2200_BOARD_VENDOR_ID 0x15b8
#define APCI2200_ADDRESS_RANGE 64
//DIGITAL INPUT-OUTPUT DEFINE
/* DIGITAL INPUT-OUTPUT DEFINE */
#define APCI2200_DIGITAL_OP 4
#define APCI2200_DIGITAL_IP 0
// TIMER COUNTER WATCHDOG DEFINES
/* TIMER COUNTER WATCHDOG DEFINES */
#define APCI2200_WATCHDOG 0x08
#define APCI2200_WATCHDOG_ENABLEDISABLE 12
#define APCI2200_WATCHDOG_RELOAD_VALUE 4
#define APCI2200_WATCHDOG_STATUS 16
// Hardware Layer functions for Apci2200
/* Hardware Layer functions for Apci2200 */
//Digital Input
/* Digital Input */
int i_APCI2200_ReadMoreDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
int i_APCI2200_Read1DigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
//Digital Output
/* Digital Output */
int i_APCI2200_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
int i_APCI2200_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
......@@ -49,7 +49,7 @@ int i_APCI2200_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subde
int i_APCI2200_ReadDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
// TIMER
/* TIMER */
int i_APCI2200_ConfigWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
int i_APCI2200_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
......@@ -57,5 +57,5 @@ int i_APCI2200_StartStopWriteWatchdog(struct comedi_device *dev, struct comedi_s
int i_APCI2200_ReadWatchdog(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
//reset
/* reset */
int i_APCI2200_Reset(struct comedi_device *dev);
......@@ -15,9 +15,9 @@
* any later version.
*/
// Card Specific information
/* Card Specific information */
#define APCI3200_BOARD_VENDOR_ID 0x15B8
//#define APCI3200_ADDRESS_RANGE 264
/* #define APCI3200_ADDRESS_RANGE 264 */
int MODULE_NO;
struct {
......@@ -34,7 +34,7 @@ struct {
} Config_Parameters_Module1, Config_Parameters_Module2,
Config_Parameters_Module3, Config_Parameters_Module4;
//ANALOG INPUT RANGE
/* ANALOG INPUT RANGE */
static const struct comedi_lrange range_apci3200_ai = { 8, {
BIP_RANGE(10),
BIP_RANGE(5),
......@@ -55,7 +55,7 @@ static const struct comedi_lrange range_apci3300_ai = { 4, {
}
};
//Analog Input related Defines
/* Analog Input related Defines */
#define APCI3200_AI_OFFSET_GAIN 0
#define APCI3200_AI_SC_TEST 4
#define APCI3200_AI_IRQ 8
......@@ -89,9 +89,9 @@ static const struct comedi_lrange range_apci3300_ai = { 4, {
#define ADDIDATA_UNIPOLAR 1
#define ADDIDATA_BIPOLAR 2
//BEGIN JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values
/* BEGIN JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values */
#define MAX_MODULE 4
//END JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values
/* END JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values */
struct str_ADDIDATA_RTDStruct {
unsigned int ul_NumberOfValue;
......@@ -99,23 +99,23 @@ struct str_ADDIDATA_RTDStruct {
unsigned int *pul_TemperatureValue;
};
//BEGIN JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values
/* BEGIN JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values */
struct str_Module {
// Begin JK 05/08/2003 change for Linux
/* Begin JK 05/08/2003 change for Linux */
unsigned long ul_CurrentSourceCJC;
unsigned long ul_CurrentSource[5];
// End JK 05/08/2003 change for Linux
/* End JK 05/08/2003 change for Linux */
// Begin CG 15/02/02 Rev 1.0 -> Rev 1.1 : Add Header Type 1
unsigned long ul_GainFactor[8]; // Gain Factor
/* Begin CG 15/02/02 Rev 1.0 -> Rev 1.1 : Add Header Type 1 */
unsigned long ul_GainFactor[8]; /* Gain Factor */
unsigned int w_GainValue[10];
// End CG 15/02/02 Rev 1.0 -> Rev 1.1 : Add Header Type 1
/* End CG 15/02/02 Rev 1.0 -> Rev 1.1 : Add Header Type 1 */
};
//END JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values
/* END JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values */
//BEGIN JK 06.07.04: Management of sevrals boards
/* BEGIN JK 06.07.04: Management of sevrals boards */
struct str_BoardInfos {
int i_CJCAvailable;
......@@ -138,25 +138,25 @@ struct str_BoardInfos {
unsigned int ui_Channel_num;
int i_Count;
int i_Initialised;
//UINT ui_InterruptChannelValue[96]; //Buffer
unsigned int ui_InterruptChannelValue[144]; //Buffer
/* UINT ui_InterruptChannelValue[96]; //Buffer */
unsigned int ui_InterruptChannelValue[144]; /* Buffer */
unsigned char b_StructInitialized;
//Begin JK 19.10.2004: APCI-3200 Driver update 0.7.57 -> 0.7.68
unsigned int ui_ScanValueArray[7 + 12]; // 7 is the maximal number of channels
//End JK 19.10.2004: APCI-3200 Driver update 0.7.57 -> 0.7.68
/* Begin JK 19.10.2004: APCI-3200 Driver update 0.7.57 -> 0.7.68 */
unsigned int ui_ScanValueArray[7 + 12]; /* 7 is the maximal number of channels */
/* End JK 19.10.2004: APCI-3200 Driver update 0.7.57 -> 0.7.68 */
//Begin JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values
/* Begin JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values */
int i_ConnectionType;
int i_NbrOfModule;
struct str_Module s_Module[MAX_MODULE];
//End JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values
/* End JK 21.10.2004: APCI-3200 / APCI-3300 Reading of EEPROM values */
};
//END JK 06.07.04: Management of sevrals boards
/* END JK 06.07.04: Management of sevrals boards */
// Hardware Layer functions for Apci3200
/* Hardware Layer functions for Apci3200 */
//AI
/* AI */
int i_APCI3200_ConfigAnalogInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
......@@ -175,10 +175,10 @@ int i_APCI3200_CommandTestAnalogInput(struct comedi_device *dev, struct comedi_s
int i_APCI3200_CommandAnalogInput(struct comedi_device *dev, struct comedi_subdevice *s);
int i_APCI3200_ReadDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
//Interrupt
/* Interrupt */
void v_APCI3200_Interrupt(int irq, void *d);
int i_APCI3200_InterruptHandleEos(struct comedi_device *dev);
//Reset functions
/* Reset functions */
int i_APCI3200_Reset(struct comedi_device *dev);
int i_APCI3200_ReadCJCCalOffset(struct comedi_device *dev, unsigned int *data);
......
......@@ -15,7 +15,7 @@
* any later version.
*/
// Card Specific information
/* Card Specific information */
#define APCI3501_BOARD_VENDOR_ID 0x15B8
#define APCI3501_ADDRESS_RANGE 255
......@@ -23,7 +23,7 @@
#define APCI3501_DIGITAL_OP 0x40
#define APCI3501_ANALOG_OUTPUT 0x00
//Analog Output related Defines
/* Analog Output related Defines */
#define APCI3501_AO_VOLT_MODE 0
#define APCI3501_AO_PROG 4
#define APCI3501_AO_TRIG_SCS 8
......@@ -31,14 +31,14 @@
#define BIPOLAR 1
#define MODE0 0
#define MODE1 1
// ANALOG OUTPUT RANGE
/* ANALOG OUTPUT RANGE */
struct comedi_lrange range_apci3501_ao = { 2, {
BIP_RANGE(10),
UNI_RANGE(10)
}
};
//Watchdog Related Defines
/* Watchdog Related Defines */
#define APCI3501_WATCHDOG 0x20
#define APCI3501_TCW_SYNC_ENABLEDISABLE 0
......@@ -52,22 +52,24 @@ struct comedi_lrange range_apci3501_ao = { 2, {
#define ADDIDATA_TIMER 0
#define ADDIDATA_WATCHDOG 2
// Hardware Layer functions for Apci3501
/* Hardware Layer functions for Apci3501 */
//AO
/* AO */
int i_APCI3501_ConfigAnalogOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
int i_APCI3501_WriteAnalogOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
//DI
// for di read
//INT i_APCI3501_ReadDigitalInput(struct comedi_device *dev,struct comedi_subdevice *s,struct comedi_insn *insn,unsigned int *data);
/*
* DI for di read INT i_APCI3501_ReadDigitalInput(struct
* comedi_device *dev,struct comedi_subdevice *s,struct comedi_insn
* *insn,unsigned int *data);
*/
int i_APCI3501_ReadDigitalInput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
//DO
/* DO */
int i_APCI3501_ConfigDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
int i_APCI3501_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
......@@ -75,8 +77,10 @@ int i_APCI3501_WriteDigitalOutput(struct comedi_device *dev, struct comedi_subde
int i_APCI3501_ReadDigitalOutput(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
// TIMER
// timer value is passed as u seconds
/* TIMER
* timer value is passed as u seconds
*/
int i_APCI3501_ConfigTimerCounterWatchdog(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
......@@ -87,8 +91,8 @@ int i_APCI3501_StartStopWriteTimerCounterWatchdog(struct comedi_device *dev,
int i_APCI3501_ReadTimerCounterWatchdog(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
//Interrupt
/* Interrupt */
void v_APCI3501_Interrupt(int irq, void *d);
//Reset functions
/* Reset functions */
int i_APCI3501_Reset(struct comedi_device *dev);
#define CONFIG_APCI_035 1
#define ADDIDATA_WATCHDOG 2 // Or shold it be something else
#define ADDIDATA_WATCHDOG 2 /* Or shold it be something else */
#include "addi-data/addi_common.c"
......@@ -39,7 +39,7 @@ Configuration Options:
#include "comedi_pci.h"
#include "8255.h"
// #include "8253.h"
/* #include "8253.h" */
#define PORT1A 0
#define PORT2A 4
......@@ -115,7 +115,7 @@ static int adl_pci7296_attach(struct comedi_device * dev, struct comedi_devconfi
dev->iobase = pci_resource_start(pcidev, 2);
printk("comedi: base addr %4lx\n", dev->iobase);
// four 8255 digital io subdevices
/* four 8255 digital io subdevices */
s = dev->subdevices + 0;
subdev_8255_init(dev, s, NULL,
(unsigned long)(dev->iobase));
......@@ -159,7 +159,7 @@ static int adl_pci7296_detach(struct comedi_device * dev)
}
pci_dev_put(devpriv->pci_dev);
}
// detach four 8255 digital io subdevices
/* detach four 8255 digital io subdevices */
if (dev->subdevices) {
subdev_8255_cleanup(dev, dev->subdevices + 0);
subdev_8255_cleanup(dev, dev->subdevices + 1);
......
......@@ -149,7 +149,7 @@ static int adl_pci8164_attach(struct comedi_device * dev, struct comedi_devconfi
s->n_chan = 4;
s->maxdata = 0xffff;
s->len_chanlist = 4;
//s->range_table = &range_axis;
/* s->range_table = &range_axis; */
s->insn_read = adl_pci8164_insn_read_msts;
s->insn_write = adl_pci8164_insn_write_cmd;
......@@ -159,7 +159,7 @@ static int adl_pci8164_attach(struct comedi_device * dev, struct comedi_devconfi
s->n_chan = 4;
s->maxdata = 0xffff;
s->len_chanlist = 4;
//s->range_table = &range_axis;
/* s->range_table = &range_axis; */
s->insn_read = adl_pci8164_insn_read_ssts;
s->insn_write = adl_pci8164_insn_write_otp;
......@@ -169,7 +169,7 @@ static int adl_pci8164_attach(struct comedi_device * dev, struct comedi_devconfi
s->n_chan = 4;
s->maxdata = 0xffff;
s->len_chanlist = 4;
//s->range_table = &range_axis;
/* s->range_table = &range_axis; */
s->insn_read = adl_pci8164_insn_read_buf0;
s->insn_write = adl_pci8164_insn_write_buf0;
......@@ -179,7 +179,7 @@ static int adl_pci8164_attach(struct comedi_device * dev, struct comedi_devconfi
s->n_chan = 4;
s->maxdata = 0xffff;
s->len_chanlist = 4;
//s->range_table = &range_axis;
/* s->range_table = &range_axis; */
s->insn_read = adl_pci8164_insn_read_buf1;
s->insn_write = adl_pci8164_insn_write_buf1;
......
......@@ -96,16 +96,16 @@ static int aio_aio12_8_ai_read(struct comedi_device * dev, struct comedi_subdevi
ADC_MODE_NORMAL |
(CR_RANGE(insn->chanspec) << 3) | CR_CHAN(insn->chanspec);
//read status to clear EOC latch
/* read status to clear EOC latch */
inb(dev->iobase + AIO12_8_STATUS);
for (n = 0; n < insn->n; n++) {
int timeout = 5;
// Setup and start conversion
/* Setup and start conversion */
outb(control, dev->iobase + AIO12_8_ADC);
// Wait for conversion to complete
/* Wait for conversion to complete */
while (timeout &&
!(inb(dev->iobase + AIO12_8_STATUS) & STATUS_ADC_EOC)) {
timeout--;
......@@ -140,12 +140,12 @@ static int aio_aio12_8_ao_write(struct comedi_device * dev, struct comedi_subdev
int chan = CR_CHAN(insn->chanspec);
unsigned long port = dev->iobase + AIO12_8_DAC_0 + (2 * chan);
//enable DACs
/* enable DACs */
outb(0x01, dev->iobase + DAC_ENABLE);
for (i = 0; i < insn->n; i++) {
outb(data[i] & 0xFF, port); // LSB
outb((data[i] >> 8) & 0x0F, port + 1); // MSB
outb(data[i] & 0xFF, port); /* LSB */
outb((data[i] >> 8) & 0x0F, port + 1); /* MSB */
devpriv->ao_readback[chan] = data[i];
}
return insn->n;
......
......@@ -48,12 +48,12 @@
/****************************************************************************/
#define INTCSR_OUTBOX_BYTE(x) ((x) & 0x3)
#define INTCSR_OUTBOX_SELECT(x) (((x) & 0x3) << 2)
#define INTCSR_OUTBOX_EMPTY_INT 0x10 // enable outbox empty interrupt
#define INTCSR_OUTBOX_EMPTY_INT 0x10 /* enable outbox empty interrupt */
#define INTCSR_INBOX_BYTE(x) (((x) & 0x3) << 8)
#define INTCSR_INBOX_SELECT(x) (((x) & 0x3) << 10)
#define INTCSR_INBOX_FULL_INT 0x1000 // enable inbox full interrupt
#define INTCSR_INBOX_INTR_STATUS 0x20000 // read, or write clear inbox full interrupt
#define INTCSR_INTR_ASSERTED 0x800000 // read only, interrupt asserted
#define INTCSR_INBOX_FULL_INT 0x1000 /* enable inbox full interrupt */
#define INTCSR_INBOX_INTR_STATUS 0x20000 /* read, or write clear inbox full interrupt */
#define INTCSR_INTR_ASSERTED 0x800000 /* read only, interrupt asserted */
/****************************************************************************/
/* AMCC - PCI non-volatile ram command register (byte 3 of master control/status register) */
......@@ -153,7 +153,7 @@
#define AINT_IMB_SELECT 0x0000000c
#define AINT_IMB_BYTE 0x00000003
// these are bits from various different registers, needs cleanup XXX
/* these are bits from various different registers, needs cleanup XXX */
/* Enable Bus Mastering */
#define EN_A2P_TRANSFERS 0x00000400
/* FIFO Flag Reset */
......
......@@ -278,7 +278,7 @@ static int das16cs_detach(struct comedi_device * dev)
static irqreturn_t das16cs_interrupt(int irq, void *d)
{
//struct comedi_device *dev = d;
/* struct comedi_device *dev = d; */
return IRQ_HANDLED;
}
......@@ -973,4 +973,4 @@ void __exit cleanup_module(void)
#else
COMEDI_INITCLEANUP(driver_das16cs);
#endif //CONFIG_PCMCIA
#endif /* CONFIG_PCMCIA */
This diff is collapsed.
......@@ -53,10 +53,10 @@ Passing a zero for an option is the same as leaving it unspecified.
* Some drivers use arrays such as this, other do not.
*/
struct pcidio_board {
const char *name; // anme of the board
int n_8255; // number of 8255 chips on board
const char *name; /* anme of the board */
int n_8255; /* number of 8255 chips on board */
// indices of base address regions
/* indices of base address regions */
int pcicontroler_badrindex;
int dioregs_badrindex;
};
......@@ -104,7 +104,7 @@ MODULE_DEVICE_TABLE(pci, pcidio_pci_table);
several hardware drivers keep similar information in this structure,
feel free to suggest moving the variable to the struct comedi_device struct. */
struct pcidio_private {
int data; // curently unused
int data; /* curently unused */
/* would be useful for a PCI device */
struct pci_dev *pci_dev;
......@@ -112,7 +112,7 @@ struct pcidio_private {
/* used for DO readback, curently unused */
unsigned int do_readback[4]; /* up to 4 unsigned int suffice to hold 96 bits for PCI-DIO96 */
unsigned long dio_reg_base; // address of port A of the first 8255 chip on board
unsigned long dio_reg_base; /* address of port A of the first 8255 chip on board */
};
/*
......@@ -134,8 +134,10 @@ static struct comedi_driver driver_cb_pcidio = {
module:THIS_MODULE,
attach:pcidio_attach,
detach:pcidio_detach,
/* It is not necessary to implement the following members if you are
* writing a driver for a ISA PnP or PCI card */
/* Most drivers will support multiple types of boards by
* having an array of board structures. These were defined
* in pcidio_boards[] above. Note that the element 'name'
......@@ -152,10 +154,15 @@ static struct comedi_driver driver_cb_pcidio = {
* the type of board in software. ISA PnP, PCI, and PCMCIA
* devices are such boards.
*/
// The following fields should NOT be initialized if you are dealing with PCI devices
// board_name: pcidio_boards,
// offset: sizeof(struct pcidio_board),
// num_names: sizeof(pcidio_boards) / sizeof(struct pcidio_board),
/* The following fields should NOT be initialized if you are dealing
* with PCI devices
*
* board_name: pcidio_boards,
* offset: sizeof(struct pcidio_board),
* num_names: sizeof(pcidio_boards) / sizeof(structpcidio_board),
*/
};
/*------------------------------- FUNCTIONS -----------------------------------*/
......@@ -192,19 +199,19 @@ static int pcidio_attach(struct comedi_device * dev, struct comedi_devconfig * i
for (pcidev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL);
pcidev != NULL;
pcidev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pcidev)) {
// is it not a computer boards card?
/* is it not a computer boards card? */
if (pcidev->vendor != PCI_VENDOR_ID_CB)
continue;
// loop through cards supported by this driver
/* loop through cards supported by this driver */
for (index = 0;
index < sizeof pcidio_boards / sizeof(struct pcidio_board);
index++) {
if (pcidio_pci_table[index].device != pcidev->device)
continue;
// was a particular bus/slot requested?
/* was a particular bus/slot requested? */
if (it->options[0] || it->options[1]) {
// are we on the wrong bus/slot?
/* are we on the wrong bus/slot? */
if (pcidev->bus->number != it->options[0] ||
PCI_SLOT(pcidev->devfn) !=
it->options[1]) {
......
......@@ -434,16 +434,16 @@ static int probe(struct comedi_device * dev, const struct comedi_devconfig * it)
for (pcidev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL);
pcidev != NULL;
pcidev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pcidev)) {
// is it not a computer boards card?
/* is it not a computer boards card? */
if (pcidev->vendor != PCI_VENDOR_ID_COMPUTERBOARDS)
continue;
// loop through cards supported by this driver
/* loop through cards supported by this driver */
for (index = 0; index < N_BOARDS; index++) {
if (boards[index].device_id != pcidev->device)
continue;
// was a particular bus/slot requested?
/* was a particular bus/slot requested? */
if (it->options[0] || it->options[1]) {
// are we on the wrong bus/slot?
/* are we on the wrong bus/slot? */
if (pcidev->bus->number != it->options[0] ||
PCI_SLOT(pcidev->devfn) !=
it->options[1]) {
......
This diff is collapsed.
......@@ -25,14 +25,14 @@
#define _DAS08_H
enum das08_bustype { isa, pci, pcmcia, pc104 };
// different ways ai data is encoded in first two registers
/* different ways ai data is encoded in first two registers */
enum das08_ai_encoding { das08_encode12, das08_encode16, das08_pcm_encode12 };
enum das08_lrange { das08_pg_none, das08_bipolar5, das08_pgh, das08_pgl,
das08_pgm };
struct das08_board_struct {
const char *name;
unsigned int id; // id for pci/pcmcia boards
unsigned int id; /* id for pci/pcmcia boards */
enum das08_bustype bustype;
void *ai;
unsigned int ai_nbits;
......@@ -45,13 +45,13 @@ struct das08_board_struct {
unsigned int do_nchan;
unsigned int i8255_offset;
unsigned int i8254_offset;
unsigned int iosize; // number of ioports used
unsigned int iosize; /* number of ioports used */
};
struct i8254_struct {
int channels; // available channels. Some could be used internally.
int logic2phys[3]; // to know which physical channel is.
int mode[3]; // the index is the real counter.
int channels; /* available channels. Some could be used internally. */
int logic2phys[3]; /* to know which physical channel is. */
int mode[3]; /* the index is the real counter. */
unsigned int iobase;
};
......@@ -61,11 +61,11 @@ struct i8254_struct {
#define I8254_CTRL 3
struct das08_private_struct {
unsigned int do_mux_bits; // bits for do/mux register on boards without seperate do register
unsigned int do_bits; // bits for do register on boards with register dedicated to digital out only
unsigned int do_mux_bits; /* bits for do/mux register on boards without seperate do register */
unsigned int do_bits; /* bits for do register on boards with register dedicated to digital out only */
const unsigned int *pg_gainlist;
struct pci_dev *pdev; // struct for pci-das08
unsigned int pci_iobase; // additional base address for pci-das08
struct pci_dev *pdev; /* struct for pci-das08 */
unsigned int pci_iobase; /* additional base address for pci-das08 */
struct i8254_struct i8254;
};
......
......@@ -46,7 +46,7 @@ Command support does not exist, but could be added for this board.
#include "das08.h"
// pcmcia includes
/* pcmcia includes */
#include <pcmcia/cs_types.h>
#include <pcmcia/cs.h>
#include <pcmcia/cistpl.h>
......@@ -73,13 +73,13 @@ static int das08_cs_attach(struct comedi_device * dev, struct comedi_devconfig *
{
int ret;
unsigned long iobase;
struct pcmcia_device *link = cur_dev; // XXX hack
struct pcmcia_device *link = cur_dev; /* XXX hack */
if ((ret = alloc_private(dev, sizeof(struct das08_private_struct))) < 0)
return ret;
printk("comedi%d: das08_cs: ", dev->minor);
// deal with a pci board
/* deal with a pci board */
if (thisboard->bustype == pcmcia) {
if (link == NULL) {
......
This diff is collapsed.
This diff is collapsed.
......@@ -342,7 +342,7 @@ static int das6402_attach(struct comedi_device * dev, struct comedi_devconfig *
s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_GROUND;
s->n_chan = 8;
//s->trig[2]=das6402_ai_mode2;
/* s->trig[2]=das6402_ai_mode2; */
s->cancel = das6402_ai_cancel;
s->maxdata = (1 << 12) - 1;
s->len_chanlist = 16; /* ? */
......
......@@ -72,7 +72,7 @@ cmd triggers supported:
#define DAS800_SIZE 8
#define TIMER_BASE 1000
#define N_CHAN_AI 8 // number of analog input channels
#define N_CHAN_AI 8 /* number of analog input channels */
/* Registers for the das800 */
......@@ -94,8 +94,8 @@ cmd triggers supported:
#define IRQ 0x8
#define BUSY 0x80
#define DAS800_GAIN 3
#define CIO_FFOV 0x8 // fifo overflow for cio-das802/16
#define CIO_ENHF 0x90 // interrupt fifo half full for cio-das802/16
#define CIO_FFOV 0x8 /* fifo overflow for cio-das802/16 */
#define CIO_ENHF 0x90 /* interrupt fifo half full for cio-das802/16 */
#define CONTROL1 0x80
#define CONV_CONTROL 0xa0
#define SCAN_LIMITS 0xc0
......@@ -113,7 +113,7 @@ struct das800_board {
int resolution;
};
//analog input ranges
/* analog input ranges */
static const struct comedi_lrange range_das800_ai = {
1,
{
......@@ -278,7 +278,7 @@ static int das800_probe(struct comedi_device * dev)
unsigned long irq_flags;
int board;
// 'comedi spin lock irqsave' disables even rt interrupts, we use them to protect indirect addressing
/* 'comedi spin lock irqsave' disables even rt interrupts, we use them to protect indirect addressing */
comedi_spin_lock_irqsave(&dev->spinlock, irq_flags);
outb(ID, dev->iobase + DAS800_GAIN); /* select base address + 7 to be ID register */
id_bits = inb(dev->iobase + DAS800_ID) & 0x3; /* get id bits */
......@@ -352,8 +352,8 @@ static irqreturn_t das800_interrupt(int irq, void *d)
struct comedi_async *async;
int status;
unsigned long irq_flags;
static const int max_loops = 128; // half-fifo size for cio-das802/16
// flags
static const int max_loops = 128; /* half-fifo size for cio-das802/16 */
/* flags */
int fifo_empty = 0;
int fifo_overflow = 0;
......@@ -369,7 +369,7 @@ static irqreturn_t das800_interrupt(int irq, void *d)
*/
async = s->async;
// if hardware conversions are not enabled, then quit
/* if hardware conversions are not enabled, then quit */
comedi_spin_lock_irqsave(&dev->spinlock, irq_flags);
outb(CONTROL1, dev->iobase + DAS800_GAIN); /* select base address + 7 to be STATUS2 register */
status = inb(dev->iobase + DAS800_STATUS2) & STATUS2_HCEN;
......@@ -390,7 +390,7 @@ static irqreturn_t das800_interrupt(int irq, void *d)
if (fifo_overflow)
break;
} else {
fifo_empty = 0; // cio-das802/16 has no fifo empty status bit
fifo_empty = 0; /* cio-das802/16 has no fifo empty status bit */
}
if (fifo_empty) {
break;
......@@ -410,7 +410,7 @@ static irqreturn_t das800_interrupt(int irq, void *d)
/* check for fifo overflow */
if (thisboard->resolution == 12) {
fifo_overflow = dataPoint & FIFO_OVF;
// else cio-das802/16
/* else cio-das802/16 */
} else {
fifo_overflow = inb(dev->iobase + DAS800_GAIN) & CIO_FFOV;
}
......@@ -564,7 +564,7 @@ static void enable_das800(struct comedi_device * dev)
{
unsigned long irq_flags;
comedi_spin_lock_irqsave(&dev->spinlock, irq_flags);
// enable fifo-half full interrupts for cio-das802/16
/* enable fifo-half full interrupts for cio-das802/16 */
if (thisboard->resolution == 16)
outb(CIO_ENHF, dev->iobase + DAS800_GAIN);
outb(CONV_CONTROL, dev->iobase + DAS800_GAIN); /* select dev->iobase + 2 to be conversion control register */
......@@ -684,7 +684,7 @@ static int das800_ai_do_cmdtest(struct comedi_device * dev, struct comedi_subdev
if (err)
return 4;
// check channel/gain list against card's limitations
/* check channel/gain list against card's limitations */
if (cmd->chanlist) {
gain = CR_RANGE(cmd->chanlist[0]);
startChan = CR_CHAN(cmd->chanlist[0]);
......@@ -861,7 +861,7 @@ static int das800_do_wbits(struct comedi_device * dev, struct comedi_subdevice *
int wbits;
unsigned long irq_flags;
// only set bits that have been masked
/* only set bits that have been masked */
data[0] &= 0xf;
wbits = devpriv->do_bits >> 4;
wbits &= ~data[0];
......
This diff is collapsed.
This diff is collapsed.
......@@ -313,9 +313,10 @@ static irqreturn_t dt2811_interrupt(int irq, void *d)
static int dt2811_attach(struct comedi_device * dev, struct comedi_devconfig * it)
{
//int i, irq;
//unsigned long irqs;
//long flags;
/* int i, irq; */
/* unsigned long irqs; */
/* long flags; */
int ret;
struct comedi_subdevice *s;
unsigned long iobase;
......@@ -531,7 +532,7 @@ int dt2811_adtrig(kdev_t minor, comedi_adtrig * adtrig)
case COMEDI_MDEMAND:
dev->ntrig = adtrig->n - 1;
/*printk("dt2811: AD soft trigger\n"); */
/*outb(DT2811_CLRERROR|DT2811_INTENB,dev->iobase+DT2811_ADCSR); *//* not neccessary */
/*outb(DT2811_CLRERROR|DT2811_INTENB,dev->iobase+DT2811_ADCSR); */ /* not neccessary */
outb(dev->curadchan, dev->iobase + DT2811_ADGCR);
do_gettimeofday(&trigtime);
break;
......
......@@ -345,8 +345,8 @@ static void dt3k_writesingle(struct comedi_device * dev, unsigned int subsys,
static int debug_n_ints = 0;
// FIXME! Assumes shared interrupt is for this card.
// What's this debug_n_ints stuff? Obviously needs some work...
/* FIXME! Assumes shared interrupt is for this card. */
/* What's this debug_n_ints stuff? Obviously needs some work... */
static irqreturn_t dt3k_interrupt(int irq, void *d)
{
struct comedi_device *dev = d;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment