Lines Matching defs:async

169 			if (s->async) {
171 kfree(s->async);
453 struct comedi_cmd *cmd = &s->async->cmd;
462 struct comedi_async *async = s->async;
463 struct comedi_cmd *cmd = &async->cmd;
468 if (async->scans_done < cmd->stop_arg)
469 scans_left = cmd->stop_arg - async->scans_done;
483 * async buffer.
485 * If the async command has a stop_src of %TRIG_COUNT, the @nscans will be
514 struct comedi_async *async = s->async;
515 struct comedi_cmd *cmd = &async->cmd;
527 comedi_bytes_to_samples(s, async->scan_progress);
548 struct comedi_async *async = s->async;
549 struct comedi_cmd *cmd = &async->cmd;
554 async->cur_chan += comedi_bytes_to_samples(s, num_bytes);
555 async->cur_chan %= cmd->chanlist_len;
558 async->scan_progress += num_bytes;
559 if (async->scan_progress >= scan_length) {
560 unsigned int nscans = async->scan_progress / scan_length;
562 if (async->scans_done < (UINT_MAX - nscans))
563 async->scans_done += nscans;
565 async->scans_done = UINT_MAX;
567 async->scan_progress %= scan_length;
568 async->events |= COMEDI_CB_EOS;
592 unsigned int events = s->async->events;
644 struct comedi_async *async;
651 "async subdevices must support SDF_CMD_READ or SDF_CMD_WRITE\n");
656 "async subdevices must have a do_cmdtest() function\n");
661 "async subdevices should have a cancel() function\n");
663 async = kzalloc(sizeof(*async), GFP_KERNEL);
664 if (!async)
667 init_waitqueue_head(&async->wait_head);
668 s->async = async;
670 async->max_bufsize = comedi_default_buf_maxsize_kb * 1024;
672 if (buf_size > async->max_bufsize)
673 buf_size = async->max_bufsize;