From 9a21cf3c6498722edbaa64cd21427b04ec88b01e Mon Sep 17 00:00:00 2001 From: David Schleef Date: Wed, 24 May 2000 02:26:58 +0000 Subject: [PATCH] added comedi_error_done() --- comedi/comedi_fops.c | 20 +++++++++++++++++++- comedi/comedi_ksyms.c | 1 + comedi/comedi_module.h | 1 + include/comedi.h | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index 4f025d53..6cc194d6 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -1482,6 +1482,20 @@ void comedi_done(comedi_device *dev,comedi_subdevice *s) s->subdev_flags &= ~SDF_RUNNING; } +void comedi_error_done(comedi_device *dev,comedi_subdevice *s) +{ +#if 0 + DPRINTK("comedi_error_done\n"); +#endif + + if(!(s->cur_trig.flags&TRIG_RT)) + wake_up_interruptible(&dev->wait); + else if(s->cb_mask&(COMEDI_CB_ERROR|COMEDI_CB_EOA)) + s->cb_func(COMEDI_CB_ERROR|COMEDI_CB_EOA,s->cb_arg); + + s->subdev_flags &= ~SDF_RUNNING; +} + void comedi_bufcheck(comedi_device *dev,comedi_subdevice *s) { #if 0 @@ -1493,8 +1507,12 @@ void comedi_bufcheck(comedi_device *dev,comedi_subdevice *s) (s->buf_int_count-s->buf_user_count >= 16)) wake_up_interruptible(&dev->wait); #else - if(!(s->cur_trig.flags&TRIG_RT)) + if(!(s->cur_trig.flags&TRIG_RT)) { wake_up_interruptible(&dev->wait); + }else{ + if(s->cb_mask&COMEDI_CB_BLOCK) + s->cb_func(COMEDI_CB_BLOCK,s->cb_arg); + } #endif } diff --git a/comedi/comedi_ksyms.c b/comedi/comedi_ksyms.c index 1aa58387..9cd16e58 100644 --- a/comedi/comedi_ksyms.c +++ b/comedi/comedi_ksyms.c @@ -52,6 +52,7 @@ EXPORT_SYMBOL(comedi_driver_register); EXPORT_SYMBOL(comedi_driver_unregister); EXPORT_SYMBOL(comedi_bufcheck); EXPORT_SYMBOL(comedi_done); +EXPORT_SYMBOL(comedi_error_done); EXPORT_SYMBOL(comedi_error); EXPORT_SYMBOL(do_pack); EXPORT_SYMBOL(di_unpack); diff --git a/comedi/comedi_module.h b/comedi/comedi_module.h index 967fcdaa..ec608bf4 100644 --- a/comedi/comedi_module.h +++ b/comedi/comedi_module.h @@ -197,6 +197,7 @@ extern comedi_device *comedi_devices; void comedi_error(comedi_device *dev,const char *s); void comedi_done(comedi_device *dev,comedi_subdevice *s); +void comedi_error_done(comedi_device *dev,comedi_subdevice *s); void comedi_eos(comedi_device *dev,comedi_subdevice *s); void comedi_eobuf(comedi_device *dev,comedi_subdevice *s); void comedi_bufcheck(comedi_device *dev,comedi_subdevice *s); diff --git a/include/comedi.h b/include/comedi.h index a3bdc6aa..7fe471f6 100644 --- a/include/comedi.h +++ b/include/comedi.h @@ -279,6 +279,7 @@ struct comedi_devconfig_struct{ #define COMEDI_CB_EOA 2 /* end of acquisition */ #define COMEDI_CB_BLOCK 4 /* convenient block size */ #define COMEDI_CB_EOBUF 8 /* end of buffer */ +#define COMEDI_CB_ERROR 16 /* card error during acquisition */ /* exported functions */ -- 2.26.2