comedi_async *async = subd->async;
unsigned int retval;
+ if( num_bytes == 0 ) return 0;
+
retval = comedi_buf_write_alloc( async, num_bytes );
if( retval != num_bytes )
{
}
comedi_buf_memcpy_to( async, 0, data, num_bytes);
-
comedi_buf_write_free( async, num_bytes );
-
increment_scan_progress( subd, num_bytes );
-
- if( num_bytes ) async->events |= COMEDI_CB_BLOCK;
+ async->events |= COMEDI_CB_BLOCK;
return num_bytes;
}
comedi_async *async = subd->async;
unsigned int bytes_available;
+ if( num_bytes == 0 ) return 0;
+
bytes_available = comedi_buf_read_n_available( async );
if( bytes_available < num_bytes )
{
}
comedi_buf_memcpy_from( async, 0, data, num_bytes);
-
comedi_buf_read_free( async, num_bytes );
-
increment_scan_progress( subd, num_bytes );
-
- if( num_bytes ) async->events |= COMEDI_CB_BLOCK;
+ async->events |= COMEDI_CB_BLOCK;
return num_bytes;
}
{
unsigned int events = subd->async->events;
+ if( events == 0 ) return events;
+
if( events & ( COMEDI_CB_EOA | COMEDI_CB_ERROR | COMEDI_CB_OVERFLOW ) )
subd->cancel( dev, subd );