Lines Matching refs:async

169 			if (s->async) {  in comedi_device_detach_cleanup()
171 kfree(s->async); in comedi_device_detach_cleanup()
453 struct comedi_cmd *cmd = &s->async->cmd; in comedi_bytes_per_scan()
462 struct comedi_async *async = s->async; in __comedi_nscans_left() local
463 struct comedi_cmd *cmd = &async->cmd; in __comedi_nscans_left()
468 if (async->scans_done < cmd->stop_arg) in __comedi_nscans_left()
469 scans_left = cmd->stop_arg - async->scans_done; in __comedi_nscans_left()
514 struct comedi_async *async = s->async; in comedi_nsamples_left() local
515 struct comedi_cmd *cmd = &async->cmd; in comedi_nsamples_left()
527 comedi_bytes_to_samples(s, async->scan_progress); in comedi_nsamples_left()
548 struct comedi_async *async = s->async; in comedi_inc_scan_progress() local
549 struct comedi_cmd *cmd = &async->cmd; in comedi_inc_scan_progress()
554 async->cur_chan += comedi_bytes_to_samples(s, num_bytes); in comedi_inc_scan_progress()
555 async->cur_chan %= cmd->chanlist_len; in comedi_inc_scan_progress()
558 async->scan_progress += num_bytes; in comedi_inc_scan_progress()
559 if (async->scan_progress >= scan_length) { in comedi_inc_scan_progress()
560 unsigned int nscans = async->scan_progress / scan_length; in comedi_inc_scan_progress()
562 if (async->scans_done < (UINT_MAX - nscans)) in comedi_inc_scan_progress()
563 async->scans_done += nscans; in comedi_inc_scan_progress()
565 async->scans_done = UINT_MAX; in comedi_inc_scan_progress()
567 async->scan_progress %= scan_length; in comedi_inc_scan_progress()
568 async->events |= COMEDI_CB_EOS; in comedi_inc_scan_progress()
592 unsigned int events = s->async->events; in comedi_handle_events()
644 struct comedi_async *async; in __comedi_device_postconfig_async() local
663 async = kzalloc(sizeof(*async), GFP_KERNEL); in __comedi_device_postconfig_async()
664 if (!async) in __comedi_device_postconfig_async()
667 init_waitqueue_head(&async->wait_head); in __comedi_device_postconfig_async()
668 s->async = async; in __comedi_device_postconfig_async()
670 async->max_bufsize = comedi_default_buf_maxsize_kb * 1024; in __comedi_device_postconfig_async()
672 if (buf_size > async->max_bufsize) in __comedi_device_postconfig_async()
673 buf_size = async->max_bufsize; in __comedi_device_postconfig_async()