The cmd->stop_src is used to determine how an async command is terminated.
Typically the following sources are used:

  TRIG_NONE:  command must be stopped with a (*cancel) operation
                cmd->stop_arg is always 0
  TRIG_COUNT: command terminates after cmd->stop_arg scans
  TRIG_EXT:   command terminates with an external signal (not common,
                cmd->stop_arg should define the signal, i.e. channel,
                that stops the command)

For TRIG_COUNT sources, some of the drivers currently allow a stop_arg == 0.
This causes the (*do_cmd) to immediately terminate the command with a
COMEDI_CB_EOA, indicating an "empty acquisition". This is not really useful
and some of the drivers actually enable the hardware enough that interrupts
are generated but no data is actually returned to the user.

Remove all the "empty acquisition" code and make sure the (*do_cmdtest) for
all drivers validates the cmd->stop_arg is >= 1 when the cmd->stop_src is
TRIG_COUNT.

Do a bit of additional cleanup regarding the cmd->stop_{src,arg} usage in the
drivers.

H Hartley Sweeten (34):
  staging: comedi: addi_apci_2032: remove "empty acquisition" async command
  staging: comedi: addi_apci_2032: absorb apci2032_int_start()
  staging: comedi: amplc_dio200_common: remove "empty acquisition" async command
  staging: comedi: amplc_dio200_common: 'stopcount' is always 'stop_arg'
  staging: comedi: amplc_dio200_common: return void from dio200_start_intr()
  staging: comedi: amplc_pci224: remove "empty acquisition" async command
  staging: comedi: amplc_pci224: simplify cmd->stop_arg validation
  staging: comedi: amplc_pci224: 'ao_stop_count' is always 'stop_arg'
  staging: comedi: amplc_pci230: remove analog output "empty acquisition" async 
command
  staging: comedi: amplc_pci230: 'ao_scan_count' is always 'stop_arg'
  staging: comedi: amplc_pci230: remove analog input "empty acquisition" async 
command
  staging: comedi: amplc_pci230: 'ai_scan_count' is always 'stop_arg'
  staging: comedi: cb_pcidas: prevent "empty acquisition" async commands
  staging: comedi: das16: prevent "empty acquisition" async command
  staging: comedi: das16m1: prevent "empty acquisition" async command
  staging: comedi: dt282x: prevent "empty acquisition" async commands
  staging: comedi: me4000: validate cmd->stop_arg in step 3 of (*do_cmdtest)
  staging: comedi: ni_atmio16d: prevent "empty acquisition" async command
  staging: comedi: ni_pcidio: prevent "empty acquisition" async command
  staging: comedi: pcl711: remove "empty acquisition" async command
  staging: comedi: pcmmio: remove "empty acquisition" async command
  staging: comedi: pcmmio: 'stop_count' is always 'stop_arg'
  staging: comedi: pcmmio: return void from pcmmio_start_intr()
  staging: comedi: pcmuio: remove "empty acquisition" async command
  staging: comedi: pcmuio: remove 'continuous' from private data
  staging: comedi: pcmuio: 'stop_count' is always 'stop_arg'
  staging: comedi: pcmuio: return void from pcmuio_start_intr()
  staging: comedi: rtd520: prevent "empty acquisition" async command
  staging: comedi: s626: remove 'ai_continuous' from private data
  staging: comedi: s626: clarify COMEDI_CB_EOA code
  staging: comedi: s626: 'ai_sample_count' is always 'stop_arg'
  staging: comedi: s626: fix cmd->stop_arg validation for stop_src == TRIG_COUNT
  staging: comedi: usbdux: prevent "empty acquisition" async commands
  staging: comedi: usbduxsigma: prevent "empty acquisition" async commands

 drivers/staging/comedi/drivers/addi_apci_2032.c    | 39 +++----------
 .../staging/comedi/drivers/amplc_dio200_common.c   | 66 +++++++---------------
 drivers/staging/comedi/drivers/amplc_pci224.c      | 54 +++++-------------
 drivers/staging/comedi/drivers/amplc_pci230.c      | 35 +++---------
 drivers/staging/comedi/drivers/cb_pcidas.c         |  8 ++-
 drivers/staging/comedi/drivers/das16.c             |  4 +-
 drivers/staging/comedi/drivers/das16m1.c           |  8 +--
 drivers/staging/comedi/drivers/dt282x.c            | 14 ++---
 drivers/staging/comedi/drivers/me4000.c            | 12 ++--
 drivers/staging/comedi/drivers/ni_atmio16d.c       |  7 +--
 drivers/staging/comedi/drivers/ni_pcidio.c         |  7 +--
 drivers/staging/comedi/drivers/pcl711.c            | 13 ++---
 drivers/staging/comedi/drivers/pcmmio.c            | 43 +++-----------
 drivers/staging/comedi/drivers/pcmuio.c            | 54 +++---------------
 drivers/staging/comedi/drivers/rtd520.c            |  8 +--
 drivers/staging/comedi/drivers/s626.c              | 35 ++++--------
 drivers/staging/comedi/drivers/usbdux.c            | 16 ++----
 drivers/staging/comedi/drivers/usbduxsigma.c       | 16 ++----
 18 files changed, 127 insertions(+), 312 deletions(-)

-- 
2.0.3

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to