added comedi_error_done()
authorDavid Schleef <ds@schleef.org>
Wed, 24 May 2000 02:26:58 +0000 (02:26 +0000)
committerDavid Schleef <ds@schleef.org>
Wed, 24 May 2000 02:26:58 +0000 (02:26 +0000)
comedi/comedi_fops.c
comedi/comedi_ksyms.c
comedi/comedi_module.h
include/comedi.h

index 4f025d5371b2ccd75ab669010dc73f95876b5fe6..6cc194d6d5c24bf179a71d2bdbdca2c6f867c036 100644 (file)
@@ -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
 }
 
index 1aa583874815cd4d8d1dbed2df833e3f68225994..9cd16e581fef8728684308029869c82221a6765b 100644 (file)
@@ -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);
index 967fcdaa8d3627bce67e4772056dacd26feb8fba..ec608bf48e12818f449384d7795dc263206253ff 100644 (file)
@@ -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);
index a3bdc6aa1e21030289df03197423f90c59d54c22..7fe471f6b7d19b2f24e71358a046af9cbc418a59 100644 (file)
@@ -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 */