comedi.git
16 years agoCorrected number of channels for DO subdevice.
Ian Abbott [Wed, 16 Jan 2008 17:03:48 +0000 (17:03 +0000)]
Corrected number of channels for DO subdevice.

16 years agoIn comedi_do_insn:
Ian Abbott [Mon, 14 Jan 2008 18:05:35 +0000 (18:05 +0000)]
In comedi_do_insn:
For INSN_WAIT, make sure insn->n is exactly 1.
For subdevice instructions, if subdevice is unused, return -EIO.
For subdevice instructions, if chanspec is wrong, return -EINVAL.

16 years agoIn comedi_do_insn, #if'ed out the final check for return value of subdevice
Ian Abbott [Mon, 14 Jan 2008 17:59:31 +0000 (17:59 +0000)]
In comedi_do_insn, #if'ed out the final check for return value of subdevice
insn function matching insn.n.  Comedi documentation for userspace
comedi_do_insn allows a lower value to be returned and some drivers
blatently do so, particularly for configuration instructions.

Also added some XXX reminder comments for INSN_WAIT and INSN_CONFIG for
things that need to be fixed.

16 years agoCorrected test for INSN_WRITE data value exceeding maxdata. It failed on
Ian Abbott [Mon, 14 Jan 2008 12:26:16 +0000 (12:26 +0000)]
Corrected test for INSN_WRITE data value exceeding maxdata. It failed on
subdevices that used per-channel maxdata values (maxdata_list).

16 years agoApplied comedi_indent script.
Ian Abbott [Mon, 14 Jan 2008 12:13:26 +0000 (12:13 +0000)]
Applied comedi_indent script.

16 years agoAdded a proper PWM subdevice for comedi.
Bernd Porr [Sun, 13 Jan 2008 23:07:02 +0000 (23:07 +0000)]
Added a proper PWM subdevice for comedi.
PWM is started with INSN_CONFIG_ARM where the second argument
defines the time how long PWM will last. A zero indicates "forever".
PWM is stopped with INSN_CONFIG_DISARM. No further args.
The duty cycle is set via a comedi_data_write where maxdata defines
the 100% duty cycle.
The PWM period is set by INSN_CONFIG_PWM_SET_PERIOD where the second
argument is in nanoseconds, thus 1E9/frequency
INSN_CONFIG_PWM_GET_PERIOD retrieves the frequency which might have been
corrected by the driver
INSN_GET_PWM_STATUS queries if it's on or off
INSN_CONFIG_PWM_SET_H_BRIDGE allows the transmit the duty cycle with a polarity bit in the second argument.
See the usbdux driver and its PWM section.

16 years agoOnly set SRF_RT subdevice flag if comedi_switch_to_rt(dev) succeeds.
Ian Abbott [Mon, 7 Jan 2008 11:05:21 +0000 (11:05 +0000)]
Only set SRF_RT subdevice flag if comedi_switch_to_rt(dev) succeeds.

16 years agoFor COMEDI_DEVCONFIG ioctl, if argument is NULL, refuse to unconfigure the
Ian Abbott [Wed, 2 Jan 2008 17:41:47 +0000 (17:41 +0000)]
For COMEDI_DEVCONFIG ioctl, if argument is NULL, refuse to unconfigure the
device if any subdevices are busy or have mmap'ed buffers.  The errno is
EBUSY in this case.

16 years agoChanged read, write, poll, and mmap file operations to use the per-device
Ian Abbott [Wed, 2 Jan 2008 17:04:21 +0000 (17:04 +0000)]
Changed read, write, poll, and mmap file operations to use the per-device
mutex.  The mutex is released during read and write operations that block.

16 years agoAdded board entry for 6013.
Frank Mori Hess [Wed, 2 Jan 2008 02:17:43 +0000 (02:17 +0000)]
Added board entry for 6013.

17 years agoOnce the linux build directory has been determined ($LINUX_DIR), try and
Ian Abbott [Thu, 20 Dec 2007 15:12:22 +0000 (15:12 +0000)]
Once the linux build directory has been determined ($LINUX_DIR), try and
override the previous setting of the LINUX_KERNEL_RELEASE variable using
the release info from the Linux build directory.  Information comes from
the UTS_RELEASE C macro.  For kernel versions 2.6.18 and later this is
defined in include/linux/utsrelease.h.  For earlier kernel versions it is
defined in include/linux/version.h.

17 years agoSome changes for separate Linux source and build trees.
Ian Abbott [Mon, 17 Dec 2007 16:43:04 +0000 (16:43 +0000)]
Some changes for separate Linux source and build trees.
Add LINUX_SRC_DIR variable to point to Linux source tree (LINUX_DIR points
to the Linux build tree).  It can be set with a new --with-linuxsrcdir
option or determined automatically from the build tree.
Changed some configure tests to check the Linux source tree instead of the
build tree.  The affected tests are COMEDI_CHECK_PCMCIA_PROBE,
COMEDI_CHECK_LINUX_KBUILD and COMEDI_CHECK_HAVE_MUTEX_H.  The
COMEDI_CHECK_LINUX_KBUILD test has been simplified because it no longer
has to check for separate source and build trees.

17 years agoUse unlocked_ioctl file operation instead of ioctl if kernel supports it
Ian Abbott [Wed, 12 Dec 2007 14:55:14 +0000 (14:55 +0000)]
Use unlocked_ioctl file operation instead of ioctl if kernel supports it
and use a mutex in struct comedi_device.
Some parts of the driver still need to be changed to use the mutex.

17 years agoCheck for include/linux/mutex.h in kernel source.
Ian Abbott [Wed, 12 Dec 2007 14:51:57 +0000 (14:51 +0000)]
Check for include/linux/mutex.h in kernel source.

17 years agoAdded compatibility header for <linux/mutex.h>.
Ian Abbott [Wed, 12 Dec 2007 14:47:20 +0000 (14:47 +0000)]
Added compatibility header for <linux/mutex.h>.

17 years agoFor non-Kbuild make, don't build addi-data drivers that use floating point,
Ian Abbott [Wed, 12 Dec 2007 13:47:00 +0000 (13:47 +0000)]
For non-Kbuild make, don't build addi-data drivers that use floating point,
but include source in EXTRA_DIST.  (Kbuild make already skips these drivers.)

17 years agoCorrected type qualifiers for pc_DriverName in boardtype.
Ian Abbott [Wed, 12 Dec 2007 12:42:44 +0000 (12:42 +0000)]
Corrected type qualifiers for pc_DriverName in boardtype.

17 years agoRemoved #defines for types (now they're all in addi_common.h).
Ian Abbott [Wed, 12 Dec 2007 12:28:05 +0000 (12:28 +0000)]
Removed #defines for types (now they're all in addi_common.h).

17 years agoUse typedef instead of #define to define MS-Windows types. Add a few more
Ian Abbott [Wed, 12 Dec 2007 12:27:00 +0000 (12:27 +0000)]
Use typedef instead of #define to define MS-Windows types.  Add a few more
pointer types.

17 years agoInclude <linux/ioctl32.h> if using old-style register_ioctl32_conversion.
Ian Abbott [Wed, 12 Dec 2007 11:34:01 +0000 (11:34 +0000)]
Include <linux/ioctl32.h> if using old-style register_ioctl32_conversion.

17 years agoConverted initialization of board array to modern standard (indent does
Frank Mori Hess [Wed, 12 Dec 2007 03:12:55 +0000 (03:12 +0000)]
Converted initialization of board array to modern standard (indent does
a slightly less bad job of indenting it this way).

17 years agoFor read and write, check if command still running in non-blocking mode as well.
Ian Abbott [Wed, 5 Dec 2007 17:02:01 +0000 (17:02 +0000)]
For read and write, check if command still running in non-blocking mode as well.

17 years agoCheck for various errors such as subdevice in range and support for commands.
Ian Abbott [Wed, 5 Dec 2007 14:45:49 +0000 (14:45 +0000)]
Check for various errors such as subdevice in range and support for commands.
Use comedi_set_subdevice_runflags and comedi_get_subdevice_runflags when
checking/modifying SRF_RT runflag.

17 years agoIf comedi_switch_to_rt() is a macro it should stil have a return value.
Ian Abbott [Wed, 5 Dec 2007 14:41:47 +0000 (14:41 +0000)]
If comedi_switch_to_rt() is a macro it should stil have a return value.

17 years agoUse per-subdevice spin-lock instead of big_comedi_lock. Renamed existing
Ian Abbott [Wed, 5 Dec 2007 12:52:15 +0000 (12:52 +0000)]
Use per-subdevice spin-lock instead of big_comedi_lock.  Renamed existing
subdevice 'runflags_lock' to 'spin_lock' for more general use.  (Could have
used a separate spin-lock for locking/unlocking subdevices, but there
shouldn't be much contention for the existing spin-lock used for setting/
getting runflags.)

17 years agoDefine mmiowb() macro if necessary.
Ian Abbott [Tue, 4 Dec 2007 15:30:39 +0000 (15:30 +0000)]
Define mmiowb() macro if necessary.

17 years agoNo need to define kcalloc() compatibility function for kernel 2.6.9 onwards.
Ian Abbott [Tue, 4 Dec 2007 13:11:14 +0000 (13:11 +0000)]
No need to define kcalloc() compatibility function for kernel 2.6.9 onwards.
The kzalloc() compatibility function is still required for vanilla kernels
prior to 2.6.14, but some versions of RHEL4 2.6.9 kernel (e.g. 2.6.9-42)
already declare it, so use a macro to override it with our own version.

17 years agoExpanded documentation for the driver.
Ian Abbott [Mon, 3 Dec 2007 17:47:46 +0000 (17:47 +0000)]
Expanded documentation for the driver.

17 years agoReport error event when command stopped due to buffer overflow.
Ian Abbott [Mon, 3 Dec 2007 14:47:00 +0000 (14:47 +0000)]
Report error event when command stopped due to buffer overflow.

17 years agoAvoid setting s->async->inttrig to NULL in interrupt routine.
Ian Abbott [Mon, 3 Dec 2007 14:43:40 +0000 (14:43 +0000)]
Avoid setting s->async->inttrig to NULL in interrupt routine.

17 years agoAvoid setting s->async->inttrig to NULL in interrupt routine.
Ian Abbott [Mon, 3 Dec 2007 14:36:31 +0000 (14:36 +0000)]
Avoid setting s->async->inttrig to NULL in interrupt routine.

17 years agoFor AO command, if scan_begin_src is TRIG_INT and not using DAC FIFO, need
Ian Abbott [Mon, 3 Dec 2007 13:57:45 +0000 (13:57 +0000)]
For AO command, if scan_begin_src is TRIG_INT and not using DAC FIFO, need
to call comedi_event() in the inttrig function because it isn't being called
anywhere else.

17 years agoAvoid changing s->async->inttrig during an interrupt. In particular, do
Ian Abbott [Mon, 3 Dec 2007 13:31:49 +0000 (13:31 +0000)]
Avoid changing s->async->inttrig during an interrupt.  In particular, do
not set it to NULL when stopping command during interrupt.

17 years agoUse DAC FIFO if the card has one (PCI230+ hardware version 2).
Ian Abbott [Fri, 30 Nov 2007 18:37:59 +0000 (18:37 +0000)]
Use DAC FIFO if the card has one (PCI230+ hardware version 2).

17 years agoAdded enums for Amplicon DIO card clock and gate sources.
Ian Abbott [Fri, 30 Nov 2007 12:21:49 +0000 (12:21 +0000)]
Added enums for Amplicon DIO card clock and gate sources.

17 years agoFor AO command test step 3, return 3 if external trigger flags have been
Ian Abbott [Thu, 29 Nov 2007 15:49:31 +0000 (15:49 +0000)]
For AO command test step 3, return 3 if external trigger flags have been
corrected.

17 years agoWhen stopping AO command, only stop timer if using it
Ian Abbott [Wed, 28 Nov 2007 14:48:18 +0000 (14:48 +0000)]
When stopping AO command, only stop timer if using it
(scan_begin_src==TRIG_TIMER).

17 years agoRelease Z2-CT2 resource after AI command started if convert_src is neither
Ian Abbott [Wed, 28 Nov 2007 11:12:17 +0000 (11:12 +0000)]
Release Z2-CT2 resource after AI command started if convert_src is neither
TRIG_TIMER nor TRIG_INT.

17 years agoAvoid using software conversion trigger as it doesn't work very well for
Ian Abbott [Tue, 27 Nov 2007 16:43:51 +0000 (16:43 +0000)]
Avoid using software conversion trigger as it doesn't work very well for
differential mode on some versions of PCI230/260.  Use Z2 timer 2 output
instead and toggle the output in software to trigger a conversion.  Note
that the ADC busy bit only works for software triggers in non-FIFO mode,
so for AI INSN_READ, use the FIFO and the FIFO status bits to check when
the conversion is complete.

17 years agoRTAI support was broken in comedi-0.7.75 due to missing RTAI_VERSION_CODE
Ian Abbott [Tue, 27 Nov 2007 13:17:02 +0000 (13:17 +0000)]
RTAI support was broken in comedi-0.7.75 due to missing RTAI_VERSION_CODE
and RTAI_MANGLE_VERSION in comedi/drivers/comedi_rt_timer.c.
Added #include <rtai_version.h> to include/linux/comedi_rt.h to fix it.

17 years agoInsert delay after AI internal conversion trigger (convert_src==TRIG_INT)
Ian Abbott [Tue, 27 Nov 2007 12:52:33 +0000 (12:52 +0000)]
Insert delay after AI internal conversion trigger (convert_src==TRIG_INT)
so we don't trigger more often than the hardware is capable of.

17 years agoUse programmable ADC FIFO interrupt trigger level and ADC FIFO level
Ian Abbott [Mon, 26 Nov 2007 17:56:19 +0000 (17:56 +0000)]
Use programmable ADC FIFO interrupt trigger level and ADC FIFO level
registers on PCI230+/260+ to reduce number of interrupts required when
FIFO interrupt trigger level would otherwise be "trigger when not empty".

17 years agoAdded PWM to the USBDUX. Also moved any synchronous commands to
Bernd Porr [Sun, 25 Nov 2007 21:22:17 +0000 (21:22 +0000)]
Added PWM to the USBDUX. Also moved any synchronous commands to
EP1 which should reduce the latency dramatically because it is
single buffered which forces the host to wait (no race checks
needed anymore). The EP4 is now used for the PWM.
The bit patterns are generated in this driver
and the GPIF on the FX2 streams these automatically out through
the digital port.

17 years agoFor AI command, allow scan_begin_src == EXT_TRIG for PCI260+ (but not PCI260).
Ian Abbott [Fri, 23 Nov 2007 17:09:08 +0000 (17:09 +0000)]
For AI command, allow scan_begin_src == EXT_TRIG for PCI260+ (but not PCI260).
It will use the EXTTRIG/EXTCONVCLK input on pin 17 instead of the PPIC0 input
that is used for PCI230.

17 years agoFor AO command, support scan_begin_src == TRIG_INT. (Not terribly useful.)
Ian Abbott [Fri, 23 Nov 2007 16:47:44 +0000 (16:47 +0000)]
For AO command, support scan_begin_src == TRIG_INT.  (Not terribly useful.)
Also, if scan_begin_src == TRIG_TIMER, make sure the timer gate is set high
to enable counting.

17 years agoFor AI commands, support TRIG_INT for start_src, scan_begin_src and
Ian Abbott [Fri, 23 Nov 2007 16:08:15 +0000 (16:08 +0000)]
For AI commands, support TRIG_INT for start_src, scan_begin_src and
convert_src, but not all at the same time.

17 years agoIncreased maximum length of channel list for AI command to 256 to allow
Ian Abbott [Fri, 23 Nov 2007 15:05:16 +0000 (15:05 +0000)]
Increased maximum length of channel list for AI command to 256 to allow
a repeated subsequence of channels to be used with a reasonable number
of repeats.  Can't make the maximum length too long or the generation of
N pulses using a monostable as a gate would generate too many pulses in
some circumstances.

17 years agoSupport scan_begin_src == TRIG_TIMER for AI command, but not at same time
Ian Abbott [Fri, 23 Nov 2007 14:55:04 +0000 (14:55 +0000)]
Support scan_begin_src == TRIG_TIMER for AI command, but not at same time
as AO command as it uses one of the same 8254 counters.
Also, gone back to using timer mode 3 (square wave) instead of mode 2 (pulse)
as it seems to induce less noise.

17 years agoChanged some macros. No functional changes.
Ian Abbott [Fri, 23 Nov 2007 11:04:25 +0000 (11:04 +0000)]
Changed some macros.  No functional changes.

17 years agoOverhauled setting up and handling of commands, internal timers, and
Ian Abbott [Thu, 22 Nov 2007 18:20:20 +0000 (18:20 +0000)]
Overhauled setting up and handling of commands, internal timers, and
interrupts.

17 years agoFixed offset for isolated digital input register on 1762.
Frank Mori Hess [Wed, 21 Nov 2007 18:14:40 +0000 (18:14 +0000)]
Fixed offset for isolated digital input register on 1762.

17 years agoAdded Jeremy Theler
Frank Mori Hess [Mon, 19 Nov 2007 22:42:33 +0000 (22:42 +0000)]
Added Jeremy Theler

17 years agoChanged types of some members of struct pci230_private and renamed 'ai_stop'
Ian Abbott [Mon, 19 Nov 2007 12:26:41 +0000 (12:26 +0000)]
Changed types of some members of struct pci230_private and renamed 'ai_stop'
to 'ai_continuous' and 'ao_stop' to 'ao_continuous'.  No functional changes.

17 years agoReduced maximum speed (increased minimum period) for AO conversion
Ian Abbott [Fri, 16 Nov 2007 14:34:46 +0000 (14:34 +0000)]
Reduced maximum speed (increased minimum period) for AO conversion
to 125 kHz (8000 ns).

17 years agoFor ai_cmdtest, maximum AI convert rate depends on whether single-ended or
Ian Abbott [Fri, 16 Nov 2007 14:07:55 +0000 (14:07 +0000)]
For ai_cmdtest, maximum AI convert rate depends on whether single-ended or
differential, and whether the card is a PCI230/260 or PCI230+/260+.

17 years agoNeed to use 'do_div' macro for 64-bit division.
Ian Abbott [Fri, 16 Nov 2007 13:17:42 +0000 (13:17 +0000)]
Need to use 'do_div' macro for 64-bit division.

17 years agoFor ai_cmdtest, check channel list starts with channel 0 if there is more
Ian Abbott [Thu, 15 Nov 2007 18:02:02 +0000 (18:02 +0000)]
For ai_cmdtest, check channel list starts with channel 0 if there is more
than one channel and the card is an older PCI230+ or PCI260+ with buggy
channel sequencing.

17 years agoFix AI channel enables for AREF_DIFF if the hardware is PCI230+ or PCI260+
Ian Abbott [Thu, 15 Nov 2007 16:11:21 +0000 (16:11 +0000)]
Fix AI channel enables for AREF_DIFF if the hardware is PCI230+ or PCI260+
due to a difference in the way the register works between PCI230 and PCI230+
in differential mode.

17 years agoFor AI command, when convert_src == TRIG_EXT, make interpretation of
Ian Abbott [Tue, 13 Nov 2007 12:01:08 +0000 (12:01 +0000)]
For AI command, when convert_src == TRIG_EXT, make interpretation of
convert_arg backwards compatible with previous versions if no flag bits
are set.

17 years agoFixed sign error that prevented commands from aborting properly on
Frank Mori Hess [Mon, 12 Nov 2007 22:15:31 +0000 (22:15 +0000)]
Fixed sign error that prevented commands from aborting properly on
errors.

17 years agoOnly added a comment.
Ian Abbott [Mon, 12 Nov 2007 17:10:24 +0000 (17:10 +0000)]
Only added a comment.

17 years agoFor AI command, changed interpretation of scan_begin_arg when scan_begin_src
Ian Abbott [Mon, 12 Nov 2007 16:45:45 +0000 (16:45 +0000)]
For AI command, changed interpretation of scan_begin_arg when scan_begin_src
is TRIG_EXT.  Previously, 0 meant trigger on -ve edge, 1 meant +ve edge.
Now, the CR_INVERT flag is set to trigger on the -ve edge.

17 years agoThe ADC half full flag flag and interrupt occurs at 2049 samples, not 2048
Ian Abbott [Mon, 12 Nov 2007 15:04:46 +0000 (15:04 +0000)]
The ADC half full flag flag and interrupt occurs at 2049 samples, not 2048
(i.e. it's an "over half full" flag since the FIFO size is 4096).

17 years agoUse arrays to look up ai gain bits and polarity.
Ian Abbott [Mon, 12 Nov 2007 14:58:01 +0000 (14:58 +0000)]
Use arrays to look up ai gain bits and polarity.

17 years agoStripped ".o" from driver name on "Driver:" line for consistency.
Ian Abbott [Mon, 12 Nov 2007 14:16:05 +0000 (14:16 +0000)]
Stripped ".o" from driver name on "Driver:" line for consistency.

17 years agoFor AI INSN_READ, check for out-of-range differential channel - only the
Ian Abbott [Mon, 12 Nov 2007 12:16:26 +0000 (12:16 +0000)]
For AI INSN_READ, check for out-of-range differential channel - only the
first half of the channel numbers can be used if analog ref is AREF_DIFF.

17 years agoAdded new driver from jeremy theler <thelerg@ib.cnea.gov.ar> for
Frank Mori Hess [Sat, 10 Nov 2007 16:59:46 +0000 (16:59 +0000)]
Added new driver from jeremy theler <thelerg@ib.cnea.gov.ar> for
MicroAxial ADQ12-B.

17 years agoAdding trivial email address obfuscation, since some of the AUTHORS
Frank Mori Hess [Sat, 10 Nov 2007 16:53:17 +0000 (16:53 +0000)]
Adding trivial email address obfuscation, since some of the AUTHORS
files are linked to from the web page.

17 years agoIn pci230_choose_clk_src(), widen the type of the comparison constant
Ian Abbott [Fri, 9 Nov 2007 16:36:32 +0000 (16:36 +0000)]
In pci230_choose_clk_src(), widen the type of the comparison constant
6553600000 from ul to ull.

17 years agoCheck channel lists in AI and AO cmdtest handlers if chanlist != NULL and
Ian Abbott [Fri, 9 Nov 2007 16:02:38 +0000 (16:02 +0000)]
Check channel lists in AI and AO cmdtest handlers if chanlist != NULL and
chanlist_len > 0.

17 years agoMinor line-length fixes.
Ian Abbott [Fri, 9 Nov 2007 15:39:24 +0000 (15:39 +0000)]
Minor line-length fixes.

17 years agoIn cmdtest, use DPRINTK instead of comedi_error.
Ian Abbott [Fri, 9 Nov 2007 15:23:42 +0000 (15:23 +0000)]
In cmdtest, use DPRINTK instead of comedi_error.

17 years agoFor cmdtest, don't return 5 if chanlist_len == 0.
Ian Abbott [Fri, 9 Nov 2007 15:19:36 +0000 (15:19 +0000)]
For cmdtest, don't return 5 if chanlist_len == 0.

17 years agoFor cmdtest, don't return error 5 if chanlist is NULL.
Ian Abbott [Fri, 9 Nov 2007 14:06:44 +0000 (14:06 +0000)]
For cmdtest, don't return error 5 if chanlist is NULL.

17 years agoFor COMEDI_CMD ioctl, check chanlist_len > 0.
Ian Abbott [Fri, 9 Nov 2007 13:50:14 +0000 (13:50 +0000)]
For COMEDI_CMD ioctl, check chanlist_len > 0.

17 years agoI forgot to rename comedi_compat_ioctl_ function back to
Ian Abbott [Fri, 9 Nov 2007 12:17:14 +0000 (12:17 +0000)]
I forgot to rename comedi_compat_ioctl_ function back to
comedi_compat_ioctl in the previous commit.

17 years agoMake the 'comedi_compat_ioctl' symbole a function (again) instead of a
Ian Abbott [Fri, 9 Nov 2007 11:12:36 +0000 (11:12 +0000)]
Make the 'comedi_compat_ioctl' symbole a function (again) instead of a
macro (if HAVE_COMPAT_IOCTL is defined).

17 years agoGot rid of the timer subdevice as it was pretty useless and clashed with
Ian Abbott [Thu, 8 Nov 2007 17:09:07 +0000 (17:09 +0000)]
Got rid of the timer subdevice as it was pretty useless and clashed with
the AO and AI subdevices.  I may resurrect it as a counter subdevice at
some point.

17 years agoUse 64-bit ns value when determining clock source.
Ian Abbott [Thu, 8 Nov 2007 17:02:36 +0000 (17:02 +0000)]
Use 64-bit ns value when determining clock source.

17 years agoRenamed pci_iobase to iobase1.
Ian Abbott [Thu, 8 Nov 2007 16:45:45 +0000 (16:45 +0000)]
Renamed pci_iobase to iobase1.

17 years agoUsed specific constants for base addresses of 8254 and 8255 chips instead
Ian Abbott [Thu, 8 Nov 2007 16:33:30 +0000 (16:33 +0000)]
Used specific constants for base addresses of 8254 and 8255 chips instead
of using the constants for the first channel of each.

17 years agoEliminated clock source and divisor values from private data and combined
Ian Abbott [Thu, 8 Nov 2007 16:21:40 +0000 (16:21 +0000)]
Eliminated clock source and divisor values from private data and combined
a few functions.  Note: reading the period of the timer subdevice is now
even more broken than it was before, but I'm planning to remove it anyway
due to conflicts with the AI and AO subdevices.

17 years agoRenamed some macros. Now access the timebase values via a look-up table to
Ian Abbott [Thu, 8 Nov 2007 15:35:24 +0000 (15:35 +0000)]
Renamed some macros.  Now access the timebase values via a look-up table to
eliminate some switch statements.

17 years agoamplc_pci230.c whitespace changes / comment reformatting.
Ian Abbott [Thu, 8 Nov 2007 11:51:16 +0000 (11:51 +0000)]
amplc_pci230.c whitespace changes / comment reformatting.

17 years agoSpelling correction in Description: line.
Ian Abbott [Thu, 8 Nov 2007 10:52:04 +0000 (10:52 +0000)]
Spelling correction in Description: line.

17 years agoFix for 2.6.10 and earlier. Rename comedi_compat_ioctl function to
Ian Abbott [Wed, 7 Nov 2007 17:18:57 +0000 (17:18 +0000)]
Fix for 2.6.10 and earlier.  Rename comedi_compat_ioctl function to
comedi_compat_ioctl_ and define comedi_compat_ioctl macro to access it.
The comedi_compat_ioctl macro expands to 0 for 2.6.10 and earlier
(HAVE_COMPAT_IOCTL undefined) so it tried to define a function called '0'!

17 years agoRemoved a stray comment.
Ian Abbott [Wed, 7 Nov 2007 16:24:47 +0000 (16:24 +0000)]
Removed a stray comment.

17 years agoMake sure 32-bit ioctl handler for <= 2.6.10 kernel doesn't return
Ian Abbott [Wed, 7 Nov 2007 16:18:28 +0000 (16:18 +0000)]
Make sure 32-bit ioctl handler for <= 2.6.10 kernel doesn't return
-ENOIOCTLCMD.

17 years agoSupport 32-bit ioctl calls on 64-bit kernel (CONFIG_COMPAT).
Ian Abbott [Wed, 7 Nov 2007 16:03:15 +0000 (16:03 +0000)]
Support 32-bit ioctl calls on 64-bit kernel (CONFIG_COMPAT).

17 years agoReplaced INSN_CONFIG_8254_SET_MODE with INSN_CONFIG_SET_COUNTER_MODE.
Ian Abbott [Mon, 5 Nov 2007 14:07:00 +0000 (14:07 +0000)]
Replaced INSN_CONFIG_8254_SET_MODE with INSN_CONFIG_SET_COUNTER_MODE.

17 years agoInline fixes: define inline functions before calling them.
Ian Abbott [Mon, 5 Nov 2007 11:50:11 +0000 (11:50 +0000)]
Inline fixes: define inline functions before calling them.
Some versions of gcc treat it as an error.  Others will ignore the inline
in this case and compile in a function call.

17 years agoMade cfc_bytes_per_scan() 'static inline' instead of plain 'inline'.
Ian Abbott [Mon, 5 Nov 2007 11:47:53 +0000 (11:47 +0000)]
Made cfc_bytes_per_scan() 'static inline' instead of plain 'inline'.

17 years agoApplied comedi_indent script to all source files.
Frank Mori Hess [Sun, 4 Nov 2007 04:33:49 +0000 (04:33 +0000)]
Applied comedi_indent script to all source files.

17 years agoRemoved some dead code that was causing errors in indent program.
Frank Mori Hess [Sun, 4 Nov 2007 04:28:25 +0000 (04:28 +0000)]
Removed some dead code that was causing errors in indent program.

17 years agoRemoved some dead code that confused the indent program.
Frank Mori Hess [Sun, 4 Nov 2007 04:14:37 +0000 (04:14 +0000)]
Removed some dead code that confused the indent program.

17 years agoRemoved a bit of ifdef'd out code that confuses the indent program.
Frank Mori Hess [Sun, 4 Nov 2007 04:08:58 +0000 (04:08 +0000)]
Removed a bit of ifdef'd out code that confuses the indent program.

17 years agoAdded wrapper around indent utility with options I'm going to apply
Frank Mori Hess [Sun, 4 Nov 2007 03:45:53 +0000 (03:45 +0000)]
Added wrapper around indent utility with options I'm going to apply
to comedi source files.

17 years agoSecurity fix in comedi_buf_alloc() for non-DMA data buffers. Allocate each
Ian Abbott [Fri, 2 Nov 2007 11:11:17 +0000 (11:11 +0000)]
Security fix in comedi_buf_alloc() for non-DMA data buffers.  Allocate each
page using get_zeroed_page() instead of __get_free_page() to avoid exposing
random memory contents to user space if the buffer is mmap'ed.

17 years agoSanitize resource types. Use new comedi_pci_enable and comedi_pci_disable
Ian Abbott [Thu, 1 Nov 2007 17:47:00 +0000 (17:47 +0000)]
Sanitize resource types.  Use new comedi_pci_enable and comedi_pci_disable
functions instead of ad hoc calls to request_region and release_region.

17 years agoRemoved tests for whether PCI device supports bus-mastering as can't tell
Ian Abbott [Thu, 1 Nov 2007 16:14:53 +0000 (16:14 +0000)]
Removed tests for whether PCI device supports bus-mastering as can't tell
from PCI device structure.