comedi_subdevice *s = dev->subdevices + subdevice;
comedi_async *async;
- if( subdevice > dev->n_subdevices ) return -1;
+ if( subdevice >= dev->n_subdevices ) return -1;
async = s->async;
if(async == NULL) return 0;
comedi_subdevice *s = dev->subdevices + subdevice;
comedi_async *async;
- if( subdevice > dev->n_subdevices ) return -1;
+ if( subdevice >= dev->n_subdevices ) return -1;
async = s->async;
if( async == NULL ) return -1;
return async->prealloc_bufsz;
}
+int comedi_get_buffer_offset( comedi_t *d, unsigned int subdevice)
+{
+ comedi_device *dev = (comedi_device *)d;
+ comedi_subdevice *s = dev->subdevices + subdevice;
+ comedi_async *async;
+
+ if( subdevice >= dev->n_subdevices ) return -1;
+ async = s->async;
+ if(async == NULL) return 0;
+
+ return async->buf_read_ptr;
+}
//EXPORT_SYMBOL(comedi_get_max_buffer_size);
//EXPORT_SYMBOL(comedi_set_buffer_size);
EXPORT_SYMBOL(comedi_get_buffer_contents);
+EXPORT_SYMBOL(comedi_get_buffer_offset);
/* low-level stuff */
//EXPORT_SYMBOL(comedi_trigger);
int comedi_mark_buffer_read( comedi_t *dev, unsigned int subdevice,
unsigned int num_bytes );
int comedi_get_buffer_contents( comedi_t *dev, unsigned int subdevice );
-
+int comedi_get_buffer_offset( comedi_t *dev, unsigned int subdevice );
#else