Lines Matching refs:async
169 if (s->async) {
171 kfree(s->async);
461 struct comedi_cmd *cmd = &s->async->cmd;
470 struct comedi_async *async = s->async;
471 struct comedi_cmd *cmd = &async->cmd;
476 if (async->scans_done < cmd->stop_arg)
477 scans_left = cmd->stop_arg - async->scans_done;
491 * async buffer.
493 * If the async command has a stop_src of %TRIG_COUNT, the @nscans will be
522 struct comedi_async *async = s->async;
523 struct comedi_cmd *cmd = &async->cmd;
535 comedi_bytes_to_samples(s, async->scan_progress);
556 struct comedi_async *async = s->async;
557 struct comedi_cmd *cmd = &async->cmd;
562 async->cur_chan += comedi_bytes_to_samples(s, num_bytes);
563 async->cur_chan %= cmd->chanlist_len;
566 async->scan_progress += num_bytes;
567 if (async->scan_progress >= scan_length) {
568 unsigned int nscans = async->scan_progress / scan_length;
570 if (async->scans_done < (UINT_MAX - nscans))
571 async->scans_done += nscans;
573 async->scans_done = UINT_MAX;
575 async->scan_progress %= scan_length;
576 async->events |= COMEDI_CB_EOS;
600 unsigned int events = s->async->events;
655 struct comedi_async *async;
662 "async subdevices must support SDF_CMD_READ or SDF_CMD_WRITE\n");
667 "async subdevices must have a do_cmdtest() function\n");
672 "async subdevices should have a cancel() function\n");
674 async = kzalloc(sizeof(*async), GFP_KERNEL);
675 if (!async)
678 init_waitqueue_head(&async->wait_head);
679 s->async = async;
681 async->max_bufsize = comedi_default_buf_maxsize_kb * 1024;
683 if (buf_size > async->max_bufsize)
684 buf_size = async->max_bufsize;