diff options
Diffstat (limited to 'drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c')
-rw-r--r-- | drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c | 274 |
1 files changed, 136 insertions, 138 deletions
diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c index b7268e4da64e..338727879827 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c @@ -3,13 +3,13 @@ Copyright (C) 2004,2005 ADDI-DATA GmbH for the source code of this module. - ADDI-DATA GmbH - Dieselstrasse 3 - D-77833 Ottersweier - Tel: +19(0)7223/9493-0 - Fax: +49(0)7223/9493-92 - http://www.addi-data-com - info@addi-data.com + ADDI-DATA GmbH + Dieselstrasse 3 + D-77833 Ottersweier + Tel: +19(0)7223/9493-0 + Fax: +49(0)7223/9493-92 + http://www.addi-data-com + info@addi-data.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. @@ -54,7 +54,7 @@ You shoud also find the complete GPL in the COPYING file accompanying this sourc /* +----------------------------------------------------------------------------+ -| Function Name : INT i_APCI3XXX_TestConversionStarted | +| Function Name : int i_APCI3XXX_TestConversionStarted | | (struct comedi_device *dev) | +----------------------------------------------------------------------------+ | Task Test if any conversion started | @@ -68,18 +68,18 @@ You shoud also find the complete GPL in the COPYING file accompanying this sourc +----------------------------------------------------------------------------+ */ -int i_APCI3XXX_TestConversionStarted(struct comedi_device * dev) +int i_APCI3XXX_TestConversionStarted(struct comedi_device *dev) { - if ((readl((void *)(devpriv->dw_AiBase + 8)) & 0x80000UL) == 0x80000UL) { - return (1); - } else { - return (0); - } + if ((readl((void *)(devpriv->dw_AiBase + 8)) & 0x80000UL) == 0x80000UL) + return 1; + else + return 0; + } /* +----------------------------------------------------------------------------+ -| Function Name : INT i_APCI3XXX_AnalogInputConfigOperatingMode | +| Function Name : int i_APCI3XXX_AnalogInputConfigOperatingMode | | (struct comedi_device *dev, | | struct comedi_subdevice *s, | | struct comedi_insn *insn, | @@ -87,9 +87,9 @@ int i_APCI3XXX_TestConversionStarted(struct comedi_device * dev) +----------------------------------------------------------------------------+ | Task Converting mode and convert time selection | +----------------------------------------------------------------------------+ -| Input Parameters : b_SingleDiff = (BYTE) data[1]; | -| b_TimeBase = (BYTE) data[2]; (0: ns, 1:micros 2:ms)| -| dw_ReloadValue = (DWORD) data[3]; | +| Input Parameters : b_SingleDiff = (unsigned char) data[1]; | +| b_TimeBase = (unsigned char) data[2]; (0: ns, 1:micros 2:ms)| +| dw_ReloadValue = (unsigned int) data[3]; | | ........ | +----------------------------------------------------------------------------+ | Output Parameters : - | @@ -105,14 +105,14 @@ int i_APCI3XXX_TestConversionStarted(struct comedi_device * dev) +----------------------------------------------------------------------------+ */ -int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device * dev, - struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) +int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device *dev, + struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - INT i_ReturnValue = insn->n; - BYTE b_TimeBase = 0; - BYTE b_SingleDiff = 0; - DWORD dw_ReloadValue = 0; - DWORD dw_TestReloadValue = 0; + int i_ReturnValue = insn->n; + unsigned char b_TimeBase = 0; + unsigned char b_SingleDiff = 0; + unsigned int dw_ReloadValue = 0; + unsigned int dw_TestReloadValue = 0; /************************/ /* Test the buffer size */ @@ -123,19 +123,19 @@ int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device * dev, /* Get the Singel/Diff flag */ /****************************/ - b_SingleDiff = (BYTE) data[1]; + b_SingleDiff = (unsigned char) data[1]; /****************************/ /* Get the time base unitiy */ /****************************/ - b_TimeBase = (BYTE) data[2]; + b_TimeBase = (unsigned char) data[2]; /*************************************/ /* Get the convert time reload value */ /*************************************/ - dw_ReloadValue = (DWORD) data[3]; + dw_ReloadValue = (unsigned int) data[3]; /**********************/ /* Test the time base */ @@ -186,7 +186,7 @@ int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device * dev, devpriv-> ui_EocEosConversionTime = - (UINT) + (unsigned int) dw_ReloadValue; devpriv-> b_EocEosConversionTimeBase @@ -204,7 +204,7 @@ int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device * dev, /* Set the convert timing unit */ /*******************************/ - writel((DWORD) + writel((unsigned int) b_TimeBase, (void *) (devpriv-> @@ -268,12 +268,12 @@ int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device * dev, i_ReturnValue = -101; } - return (i_ReturnValue); + return i_ReturnValue; } /* +----------------------------------------------------------------------------+ -| Function Name : INT i_APCI3XXX_InsnConfigAnalogInput | +| Function Name : int i_APCI3XXX_InsnConfigAnalogInput | | (struct comedi_device *dev, | | struct comedi_subdevice *s, | | struct comedi_insn *insn, | @@ -281,9 +281,9 @@ int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device * dev, +----------------------------------------------------------------------------+ | Task Converting mode and convert time selection | +----------------------------------------------------------------------------+ -| Input Parameters : b_ConvertMode = (BYTE) data[0]; | -| b_TimeBase = (BYTE) data[1]; (0: ns, 1:micros 2:ms)| -| dw_ReloadValue = (DWORD) data[2]; | +| Input Parameters : b_ConvertMode = (unsigned char) data[0]; | +| b_TimeBase = (unsigned char) data[1]; (0: ns, 1:micros 2:ms)| +| dw_ReloadValue = (unsigned int) data[2]; | | ........ | +----------------------------------------------------------------------------+ | Output Parameters : - | @@ -295,17 +295,17 @@ int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device * dev, +----------------------------------------------------------------------------+ */ -int i_APCI3XXX_InsnConfigAnalogInput(struct comedi_device * dev, - struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) +int i_APCI3XXX_InsnConfigAnalogInput(struct comedi_device *dev, + struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - INT i_ReturnValue = insn->n; + int i_ReturnValue = insn->n; /************************/ /* Test the buffer size */ /************************/ if (insn->n >= 1) { - switch ((BYTE) data[0]) { + switch ((unsigned char) data[0]) { case APCI3XXX_CONFIGURATION: i_ReturnValue = i_APCI3XXX_AnalogInputConfigOperatingMode(dev, @@ -326,12 +326,12 @@ int i_APCI3XXX_InsnConfigAnalogInput(struct comedi_device * dev, i_ReturnValue = -101; } - return (i_ReturnValue); + return i_ReturnValue; } /* +----------------------------------------------------------------------------+ -| Function Name : INT i_APCI3XXX_InsnReadAnalogInput | +| Function Name : int i_APCI3XXX_InsnReadAnalogInput | | (struct comedi_device *dev, | | struct comedi_subdevice *s, | | struct comedi_insn *insn, | @@ -355,16 +355,16 @@ int i_APCI3XXX_InsnConfigAnalogInput(struct comedi_device * dev, +----------------------------------------------------------------------------+ */ -int i_APCI3XXX_InsnReadAnalogInput(struct comedi_device * dev, - struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) +int i_APCI3XXX_InsnReadAnalogInput(struct comedi_device *dev, + struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - INT i_ReturnValue = insn->n; - BYTE b_Configuration = (BYTE) CR_RANGE(insn->chanspec); - BYTE b_Channel = (BYTE) CR_CHAN(insn->chanspec); - DWORD dw_Temp = 0; - DWORD dw_Configuration = 0; - DWORD dw_AcquisitionCpt = 0; - BYTE b_Interrupt = 0; + int i_ReturnValue = insn->n; + unsigned char b_Configuration = (unsigned char) CR_RANGE(insn->chanspec); + unsigned char b_Channel = (unsigned char) CR_CHAN(insn->chanspec); + unsigned int dw_Temp = 0; + unsigned int dw_Configuration = 0; + unsigned int dw_AcquisitionCpt = 0; + unsigned char b_Interrupt = 0; /*************************************/ /* Test if operating mode configured */ @@ -449,8 +449,8 @@ int i_APCI3XXX_InsnReadAnalogInput(struct comedi_device * dev, dw_Configuration = (b_Configuration & 3) | - ((DWORD) (b_Configuration >> 2) - << 6) | ((DWORD) devpriv-> + ((unsigned int) (b_Configuration >> 2) + << 6) | ((unsigned int) devpriv-> b_SingelDiff << 7); /***************************/ @@ -468,7 +468,7 @@ int i_APCI3XXX_InsnReadAnalogInput(struct comedi_device * dev, writel(dw_Temp | 0x100UL, (void *)(devpriv->dw_AiBase + 4)); - writel((DWORD) b_Channel, + writel((unsigned int) b_Channel, (void *)(devpriv->dw_AiBase + 0)); @@ -535,8 +535,7 @@ int i_APCI3XXX_InsnReadAnalogInput(struct comedi_device * dev, dw_Temp = dw_Temp & 1; - } - while (dw_Temp != 1); + } while (dw_Temp != 1); /*************************/ /* Read the analog value */ @@ -585,7 +584,7 @@ int i_APCI3XXX_InsnReadAnalogInput(struct comedi_device * dev, printk("Operating mode not configured\n"); i_ReturnValue = -1; } - return (i_ReturnValue); + return i_ReturnValue; } /* @@ -607,15 +606,15 @@ int i_APCI3XXX_InsnReadAnalogInput(struct comedi_device * dev, void v_APCI3XXX_Interrupt(int irq, void *d) { struct comedi_device *dev = d; - BYTE b_CopyCpt = 0; - DWORD dw_Status = 0; + unsigned char b_CopyCpt = 0; + unsigned int dw_Status = 0; /***************************/ /* Test if interrupt occur */ /***************************/ - if (((dw_Status = readl((void *)(devpriv->dw_AiBase + 16))) & 0x2UL) == - 0x2UL) { + dw_Status = readl((void *)(devpriv->dw_AiBase + 16)); + if ( (dw_Status & 0x2UL) == 0x2UL) { /***********************/ /* Reset the interrupt */ /***********************/ @@ -635,7 +634,7 @@ void v_APCI3XXX_Interrupt(int irq, void *d) b_CopyCpt < devpriv->ui_AiNbrofChannels; b_CopyCpt++) { devpriv->ui_AiReadData[b_CopyCpt] = - (UINT) readl((void *)(devpriv-> + (unsigned int) readl((void *)(devpriv-> dw_AiBase + 28)); } @@ -662,7 +661,7 @@ void v_APCI3XXX_Interrupt(int irq, void *d) /* +----------------------------------------------------------------------------+ -| Function Name : INT i_APCI3XXX_InsnWriteAnalogOutput | +| Function Name : int i_APCI3XXX_InsnWriteAnalogOutput | | (struct comedi_device *dev, | | struct comedi_subdevice *s, | | struct comedi_insn *insn, | @@ -684,13 +683,13 @@ void v_APCI3XXX_Interrupt(int irq, void *d) +----------------------------------------------------------------------------+ */ -int i_APCI3XXX_InsnWriteAnalogOutput(struct comedi_device * dev, - struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) +int i_APCI3XXX_InsnWriteAnalogOutput(struct comedi_device *dev, + struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - BYTE b_Range = (BYTE) CR_RANGE(insn->chanspec); - BYTE b_Channel = (BYTE) CR_CHAN(insn->chanspec); - DWORD dw_Status = 0; - INT i_ReturnValue = insn->n; + unsigned char b_Range = (unsigned char) CR_RANGE(insn->chanspec); + unsigned char b_Channel = (unsigned char) CR_CHAN(insn->chanspec); + unsigned int dw_Status = 0; + int i_ReturnValue = insn->n; /************************/ /* Test the buffer size */ @@ -729,8 +728,7 @@ int i_APCI3XXX_InsnWriteAnalogOutput(struct comedi_device * dev, dw_Status = readl((void *)(devpriv-> dw_AiBase + 96)); - } - while ((dw_Status & 0x100) != 0x100); + } while ((dw_Status & 0x100) != 0x100); } else { /***************************/ /* Channel not initialised */ @@ -757,7 +755,7 @@ int i_APCI3XXX_InsnWriteAnalogOutput(struct comedi_device * dev, i_ReturnValue = -101; } - return (i_ReturnValue); + return i_ReturnValue; } /* @@ -768,7 +766,7 @@ int i_APCI3XXX_InsnWriteAnalogOutput(struct comedi_device * dev, /* +----------------------------------------------------------------------------+ -| Function Name : INT i_APCI3XXX_InsnConfigInitTTLIO | +| Function Name : int i_APCI3XXX_InsnConfigInitTTLIO | | (struct comedi_device *dev, | | struct comedi_subdevice *s, | | struct comedi_insn *insn, | @@ -778,8 +776,8 @@ int i_APCI3XXX_InsnWriteAnalogOutput(struct comedi_device * dev, | for you call any other function witch access of TTL. | | APCI3XXX_TTL_INIT_DIRECTION_PORT2(user inputs for direction)| +----------------------------------------------------------------------------+ -| Input Parameters : b_InitType = (BYTE) data[0]; | -| b_Port2Mode = (BYTE) data[1]; | +| Input Parameters : b_InitType = (unsigned char) data[0]; | +| b_Port2Mode = (unsigned char) data[1]; | +----------------------------------------------------------------------------+ | Output Parameters : - | +----------------------------------------------------------------------------+ @@ -791,11 +789,11 @@ int i_APCI3XXX_InsnWriteAnalogOutput(struct comedi_device * dev, +----------------------------------------------------------------------------+ */ -int i_APCI3XXX_InsnConfigInitTTLIO(struct comedi_device * dev, - struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) +int i_APCI3XXX_InsnConfigInitTTLIO(struct comedi_device *dev, + struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - INT i_ReturnValue = insn->n; - BYTE b_Command = 0; + int i_ReturnValue = insn->n; + unsigned char b_Command = 0; /************************/ /* Test the buffer size */ @@ -806,7 +804,7 @@ int i_APCI3XXX_InsnConfigInitTTLIO(struct comedi_device * dev, /* Get the command */ /* **************** */ - b_Command = (BYTE) data[0]; + b_Command = (unsigned char) data[0]; /********************/ /* Test the command */ @@ -888,7 +886,7 @@ int i_APCI3XXX_InsnConfigInitTTLIO(struct comedi_device * dev, } } - return (i_ReturnValue); + return i_ReturnValue; } /* @@ -899,7 +897,7 @@ int i_APCI3XXX_InsnConfigInitTTLIO(struct comedi_device * dev, /* +----------------------------------------------------------------------------+ -| Function Name : INT i_APCI3XXX_InsnBitsTTLIO | +| Function Name : int i_APCI3XXX_InsnBitsTTLIO | | (struct comedi_device *dev, | | struct comedi_subdevice *s, | | struct comedi_insn *insn, | @@ -919,14 +917,14 @@ int i_APCI3XXX_InsnConfigInitTTLIO(struct comedi_device * dev, +----------------------------------------------------------------------------+ */ -int i_APCI3XXX_InsnBitsTTLIO(struct comedi_device * dev, - struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) +int i_APCI3XXX_InsnBitsTTLIO(struct comedi_device *dev, + struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - INT i_ReturnValue = insn->n; - BYTE b_ChannelCpt = 0; - DWORD dw_ChannelMask = 0; - DWORD dw_BitMask = 0; - DWORD dw_Status = 0; + int i_ReturnValue = insn->n; + unsigned char b_ChannelCpt = 0; + unsigned int dw_ChannelMask = 0; + unsigned int dw_BitMask = 0; + unsigned int dw_Status = 0; /************************/ /* Test the buffer size */ @@ -1051,12 +1049,12 @@ int i_APCI3XXX_InsnBitsTTLIO(struct comedi_device * dev, i_ReturnValue = -101; } - return (i_ReturnValue); + return i_ReturnValue; } /* +----------------------------------------------------------------------------+ -| Function Name : INT i_APCI3XXX_InsnReadTTLIO | +| Function Name : int i_APCI3XXX_InsnReadTTLIO | | (struct comedi_device *dev, | | struct comedi_subdevice *s, | | struct comedi_insn *insn, | @@ -1074,11 +1072,11 @@ int i_APCI3XXX_InsnBitsTTLIO(struct comedi_device * dev, +----------------------------------------------------------------------------+ */ -int i_APCI3XXX_InsnReadTTLIO(struct comedi_device * dev, - struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) +int i_APCI3XXX_InsnReadTTLIO(struct comedi_device *dev, + struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - BYTE b_Channel = (BYTE) CR_CHAN(insn->chanspec); - INT i_ReturnValue = insn->n; + unsigned char b_Channel = (unsigned char) CR_CHAN(insn->chanspec); + int i_ReturnValue = insn->n; unsigned int *pls_ReadData = data; /************************/ @@ -1157,7 +1155,7 @@ int i_APCI3XXX_InsnReadTTLIO(struct comedi_device * dev, i_ReturnValue = -101; } - return (i_ReturnValue); + return i_ReturnValue; } /* @@ -1168,7 +1166,7 @@ int i_APCI3XXX_InsnReadTTLIO(struct comedi_device * dev, /* +----------------------------------------------------------------------------+ -| Function Name : INT i_APCI3XXX_InsnWriteTTLIO | +| Function Name : int i_APCI3XXX_InsnWriteTTLIO | | (struct comedi_device *dev, | | struct comedi_subdevice *s, | | struct comedi_insn *insn, | @@ -1187,20 +1185,20 @@ int i_APCI3XXX_InsnReadTTLIO(struct comedi_device * dev, +----------------------------------------------------------------------------+ */ -int i_APCI3XXX_InsnWriteTTLIO(struct comedi_device * dev, - struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) +int i_APCI3XXX_InsnWriteTTLIO(struct comedi_device *dev, + struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - INT i_ReturnValue = insn->n; - BYTE b_Channel = (BYTE) CR_CHAN(insn->chanspec); - BYTE b_State = 0; - DWORD dw_Status = 0; + int i_ReturnValue = insn->n; + unsigned char b_Channel = (unsigned char) CR_CHAN(insn->chanspec); + unsigned char b_State = 0; + unsigned int dw_Status = 0; /************************/ /* Test the buffer size */ /************************/ if (insn->n >= 1) { - b_State = (BYTE) data[0]; + b_State = (unsigned char) data[0]; /***********************/ /* Test if read port 0 */ @@ -1269,7 +1267,7 @@ int i_APCI3XXX_InsnWriteTTLIO(struct comedi_device * dev, i_ReturnValue = -101; } - return (i_ReturnValue); + return i_ReturnValue; } /* @@ -1298,12 +1296,12 @@ int i_APCI3XXX_InsnWriteTTLIO(struct comedi_device * dev, +----------------------------------------------------------------------------+ */ -int i_APCI3XXX_InsnReadDigitalInput(struct comedi_device * dev, - struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) +int i_APCI3XXX_InsnReadDigitalInput(struct comedi_device *dev, + struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - INT i_ReturnValue = insn->n; - BYTE b_Channel = (BYTE) CR_CHAN(insn->chanspec); - DWORD dw_Temp = 0; + int i_ReturnValue = insn->n; + unsigned char b_Channel = (unsigned char) CR_CHAN(insn->chanspec); + unsigned int dw_Temp = 0; /***************************/ /* Test the channel number */ @@ -1334,7 +1332,7 @@ int i_APCI3XXX_InsnReadDigitalInput(struct comedi_device * dev, i_ReturnValue = -3; } - return (i_ReturnValue); + return i_ReturnValue; } /* @@ -1356,11 +1354,11 @@ int i_APCI3XXX_InsnReadDigitalInput(struct comedi_device * dev, | -101 : Data size error | +----------------------------------------------------------------------------+ */ -int i_APCI3XXX_InsnBitsDigitalInput(struct comedi_device * dev, - struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) +int i_APCI3XXX_InsnBitsDigitalInput(struct comedi_device *dev, + struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - INT i_ReturnValue = insn->n; - DWORD dw_Temp = 0; + int i_ReturnValue = insn->n; + unsigned int dw_Temp = 0; /************************/ /* Test the buffer size */ @@ -1378,7 +1376,7 @@ int i_APCI3XXX_InsnBitsDigitalInput(struct comedi_device * dev, i_ReturnValue = -101; } - return (i_ReturnValue); + return i_ReturnValue; } /* @@ -1409,14 +1407,14 @@ int i_APCI3XXX_InsnBitsDigitalInput(struct comedi_device * dev, | -101 : Data size error | +----------------------------------------------------------------------------+ */ -int i_APCI3XXX_InsnBitsDigitalOutput(struct comedi_device * dev, - struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) +int i_APCI3XXX_InsnBitsDigitalOutput(struct comedi_device *dev, + struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - INT i_ReturnValue = insn->n; - BYTE b_ChannelCpt = 0; - DWORD dw_ChannelMask = 0; - DWORD dw_BitMask = 0; - DWORD dw_Status = 0; + int i_ReturnValue = insn->n; + unsigned char b_ChannelCpt = 0; + unsigned int dw_ChannelMask = 0; + unsigned int dw_BitMask = 0; + unsigned int dw_Status = 0; /************************/ /* Test the buffer size */ @@ -1481,7 +1479,7 @@ int i_APCI3XXX_InsnBitsDigitalOutput(struct comedi_device * dev, i_ReturnValue = -101; } - return (i_ReturnValue); + return i_ReturnValue; } /* @@ -1505,13 +1503,13 @@ int i_APCI3XXX_InsnBitsDigitalOutput(struct comedi_device * dev, +----------------------------------------------------------------------------+ */ -int i_APCI3XXX_InsnWriteDigitalOutput(struct comedi_device * dev, - struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) +int i_APCI3XXX_InsnWriteDigitalOutput(struct comedi_device *dev, + struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - INT i_ReturnValue = insn->n; - BYTE b_Channel = CR_CHAN(insn->chanspec); - BYTE b_State = 0; - DWORD dw_Status = 0; + int i_ReturnValue = insn->n; + unsigned char b_Channel = CR_CHAN(insn->chanspec); + unsigned char b_State = 0; + unsigned int dw_Status = 0; /************************/ /* Test the buffer size */ @@ -1527,7 +1525,7 @@ int i_APCI3XXX_InsnWriteDigitalOutput(struct comedi_device * dev, /* Get the command */ /*******************/ - b_State = (BYTE) data[0]; + b_State = (unsigned char) data[0]; /********************************/ /* Read the digital output port */ @@ -1557,7 +1555,7 @@ int i_APCI3XXX_InsnWriteDigitalOutput(struct comedi_device * dev, i_ReturnValue = -101; } - return (i_ReturnValue); + return i_ReturnValue; } /* @@ -1580,12 +1578,12 @@ int i_APCI3XXX_InsnWriteDigitalOutput(struct comedi_device * dev, +----------------------------------------------------------------------------+ */ -int i_APCI3XXX_InsnReadDigitalOutput(struct comedi_device * dev, - struct comedi_subdevice * s, struct comedi_insn * insn, unsigned int * data) +int i_APCI3XXX_InsnReadDigitalOutput(struct comedi_device *dev, + struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - INT i_ReturnValue = insn->n; - BYTE b_Channel = CR_CHAN(insn->chanspec); - DWORD dw_Status = 0; + int i_ReturnValue = insn->n; + unsigned char b_Channel = CR_CHAN(insn->chanspec); + unsigned int dw_Status = 0; /************************/ /* Test the buffer size */ @@ -1622,7 +1620,7 @@ int i_APCI3XXX_InsnReadDigitalOutput(struct comedi_device * dev, i_ReturnValue = -101; } - return (i_ReturnValue); + return i_ReturnValue; } /* @@ -1638,7 +1636,7 @@ int i_APCI3XXX_InsnReadDigitalOutput(struct comedi_device * dev, +----------------------------------------------------------------------------+ */ -int i_APCI3XXX_Reset(struct comedi_device * dev) +int i_APCI3XXX_Reset(struct comedi_device *dev) { unsigned char b_Cpt = 0; |