Lines Matching defs:async
331 struct comedi_async *async = s->async;
336 if (new_size > async->max_bufsize)
364 s->index, async->prealloc_bufsz);
384 if (s && (s->subdev_flags & SDF_CMD_READ) && s->async)
385 size = s->async->max_bufsize / 1024;
415 if (s && (s->subdev_flags & SDF_CMD_READ) && s->async)
416 s->async->max_bufsize = size;
440 if (s && (s->subdev_flags & SDF_CMD_READ) && s->async)
441 size = s->async->prealloc_bufsz / 1024;
471 if (s && (s->subdev_flags & SDF_CMD_READ) && s->async)
497 if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async)
498 size = s->async->max_bufsize / 1024;
528 if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async)
529 s->async->max_bufsize = size;
553 if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async)
554 size = s->async->prealloc_bufsz / 1024;
584 if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async)
677 * comedi_is_subdevice_running() - Check if async command running on subdevice
699 * comedi_get_is_subdevice_running() - Get if async command running on subdevice
718 refcount_inc(&s->async->run_active);
725 * comedi_put_is_subdevice_running() - Put if async command running on subdevice
733 if (refcount_dec_and_test(&s->async->run_active))
734 complete_all(&s->async->run_complete);
786 struct comedi_async *async = s->async;
796 if (async) {
803 wait_for_completion(&async->run_complete);
806 async->inttrig = NULL;
807 kfree(async->cmd.chanlist);
808 async->cmd.chanlist = NULL;
810 wake_up_interruptible_all(&async->wait_head);
838 if (s->async)
857 if (!s->async)
864 * from it since the subdevice has no active async command.
866 if (wq_has_sleeper(&s->async->wait_head))
950 struct comedi_async *async;
962 async = s->async;
964 if (!async) {
966 "subdevice does not have async capability\n");
976 async->max_bufsize = bc.maximum_size;
985 bc.size = async->prealloc_bufsz;
986 bc.maximum_size = async->max_bufsize;
1190 struct comedi_async *async;
1219 async = s->async;
1221 if (!async || s->busy != file) {
1227 cmd_flags = async->cmd.flags;
1263 bi.buf_write_count = async->buf_write_count;
1264 bi.buf_write_ptr = async->buf_write_ptr;
1265 bi.buf_read_count = async->buf_read_count;
1266 bi.buf_read_ptr = async->buf_read_ptr;
1291 if (s == new_s && new_s->async == async && s->busy == file &&
1292 async->cmd.flags == cmd_flags &&
1487 if (!s->async) {
1488 dev_dbg(dev->class_dev, "no async\n");
1492 if (!s->async->inttrig) {
1497 ret = s->async->inttrig(dev, s, data[0]);
1828 if (!s->do_cmd || !s->do_cmdtest || !s->async) {
1905 struct comedi_async *async;
1920 async = s->async;
1941 async->cmd = *cmd;
1942 async->cmd.data = NULL;
1945 ret = __comedi_get_user_chanlist(dev, s, user_chanlist, &async->cmd);
1949 ret = s->do_cmdtest(dev, s, &async->cmd);
1951 if (async->cmd.flags & CMDF_BOGUS || ret) {
1953 *cmd = async->cmd;
1962 if (!async->prealloc_bufsz) {
1970 async->cb_mask = COMEDI_CB_BLOCK | COMEDI_CB_CANCEL_MASK;
1971 if (async->cmd.flags & CMDF_WAKE_EOS)
1972 async->cb_mask |= COMEDI_CB_EOS;
1978 refcount_set(&s->async->run_active, 1);
1979 reinit_completion(&s->async->run_complete);
2142 if (!s->async)
2224 if (s_old && s_old->busy == file && s_old->async &&
2225 !(s_old->async->cmd.flags & CMDF_WRITE))
2267 if (s_old && s_old->busy == file && s_old->async &&
2268 (s_old->async->cmd.flags & CMDF_WRITE))
2485 struct comedi_async *async;
2518 async = s->async;
2519 if (!async) {
2531 if (size > async->prealloc_bufsz) {
2625 if (s && s->async) {
2626 poll_wait(file, &s->async->wait_head, wait);
2628 (s->async->cmd.flags & CMDF_WRITE) ||
2634 if (s && s->async) {
2638 poll_wait(file, &s->async->wait_head, wait);
2640 !(s->async->cmd.flags & CMDF_WRITE) ||
2653 struct comedi_buf_map *bm = s->async->buf_map;
2681 struct comedi_buf_map *bm = s->async->buf_map;
2710 struct comedi_async *async;
2733 if (!s || !s->async) {
2738 async = s->async;
2739 if (s->busy != file || !(async->cmd.flags & CMDF_WRITE)) {
2744 add_wait_queue(&async->wait_head, &wait);
2762 _comedi_buf_write_alloc(s, async->prealloc_bufsz);
2777 !(async->cmd.flags & CMDF_WRITE)) {
2785 m = comedi_buf_copy_from_user(s, async->buf_write_ptr, buf, n);
2797 remove_wait_queue(&async->wait_head, &wait);
2821 s == new_s && new_s->async == async && s->busy == file &&
2822 (async->cmd.flags & CMDF_WRITE) &&
2838 struct comedi_async *async;
2861 if (!s || !s->async) {
2866 async = s->async;
2867 if (s->busy != file || (async->cmd.flags & CMDF_WRITE)) {
2872 add_wait_queue(&async->wait_head, &wait);
2902 (async->cmd.flags & CMDF_WRITE)) {
2910 m = comedi_buf_copy_to_user(s, buf, async->buf_read_ptr, n);
2924 remove_wait_queue(&async->wait_head, &wait);
2948 s == new_s && new_s->async == async && s->busy == file &&
2949 !(async->cmd.flags & CMDF_WRITE) &&
3448 struct comedi_async *async = s->async;
3455 events = async->events;
3456 async->events = 0;
3472 if (async->cb_mask & events) {
3473 wake_up_interruptible(&async->wait_head);
3474 si_code = async->cmd.flags & CMDF_WRITE ? POLL_OUT : POLL_IN;