Lines Matching full:async

328 	struct comedi_async *async = s->async;  in resize_async_buffer()  local
333 if (new_size > async->max_bufsize) in resize_async_buffer()
361 s->index, async->prealloc_bufsz); in resize_async_buffer()
381 if (s && (s->subdev_flags & SDF_CMD_READ) && s->async) in max_read_buffer_kb_show()
382 size = s->async->max_bufsize / 1024; in max_read_buffer_kb_show()
412 if (s && (s->subdev_flags & SDF_CMD_READ) && s->async) in max_read_buffer_kb_store()
413 s->async->max_bufsize = size; in max_read_buffer_kb_store()
437 if (s && (s->subdev_flags & SDF_CMD_READ) && s->async) in read_buffer_kb_show()
438 size = s->async->prealloc_bufsz / 1024; in read_buffer_kb_show()
468 if (s && (s->subdev_flags & SDF_CMD_READ) && s->async) in read_buffer_kb_store()
494 if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async) in max_write_buffer_kb_show()
495 size = s->async->max_bufsize / 1024; in max_write_buffer_kb_show()
525 if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async) in max_write_buffer_kb_store()
526 s->async->max_bufsize = size; in max_write_buffer_kb_store()
550 if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async) in write_buffer_kb_show()
551 size = s->async->prealloc_bufsz / 1024; in write_buffer_kb_show()
581 if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async) in write_buffer_kb_store()
669 * comedi_is_subdevice_running() - Check if async command running on subdevice
738 struct comedi_async *async = s->async; in do_become_nonbusy() local
742 if (async) { in do_become_nonbusy()
744 async->inttrig = NULL; in do_become_nonbusy()
745 kfree(async->cmd.chanlist); in do_become_nonbusy()
746 async->cmd.chanlist = NULL; in do_become_nonbusy()
748 wake_up_interruptible_all(&async->wait_head); in do_become_nonbusy()
751 "BUG: (?) %s called with async=NULL\n", __func__); in do_become_nonbusy()
780 if (s->async) in comedi_device_cancel_all()
799 if (!s->async) in is_device_busy()
806 * from it since the subdevice has no active async command. in is_device_busy()
808 if (wq_has_sleeper(&s->async->wait_head)) in is_device_busy()
892 struct comedi_async *async; in do_bufconfig_ioctl() local
904 async = s->async; in do_bufconfig_ioctl()
906 if (!async) { in do_bufconfig_ioctl()
908 "subdevice does not have async capability\n"); in do_bufconfig_ioctl()
918 async->max_bufsize = bc.maximum_size; in do_bufconfig_ioctl()
927 bc.size = async->prealloc_bufsz; in do_bufconfig_ioctl()
928 bc.maximum_size = async->max_bufsize; in do_bufconfig_ioctl()
1130 struct comedi_async *async; in do_bufinfo_ioctl() local
1144 async = s->async; in do_bufinfo_ioctl()
1146 if (!async || s->busy != file) in do_bufinfo_ioctl()
1150 if (!(async->cmd.flags & CMDF_WRITE)) { in do_bufinfo_ioctl()
1185 bi.buf_write_count = async->buf_write_count; in do_bufinfo_ioctl()
1186 bi.buf_write_ptr = async->buf_write_ptr; in do_bufinfo_ioctl()
1187 bi.buf_read_count = async->buf_read_count; in do_bufinfo_ioctl()
1188 bi.buf_read_ptr = async->buf_read_ptr; in do_bufinfo_ioctl()
1376 if (!s->async) { in parse_insn()
1377 dev_dbg(dev->class_dev, "no async\n"); in parse_insn()
1381 if (!s->async->inttrig) { in parse_insn()
1386 ret = s->async->inttrig(dev, s, data[0]); in parse_insn()
1717 if (!s->do_cmd || !s->do_cmdtest || !s->async) { in __comedi_get_user_cmd()
1794 struct comedi_async *async; in do_cmd_ioctl() local
1809 async = s->async; in do_cmd_ioctl()
1830 async->cmd = *cmd; in do_cmd_ioctl()
1831 async->cmd.data = NULL; in do_cmd_ioctl()
1834 ret = __comedi_get_user_chanlist(dev, s, user_chanlist, &async->cmd); in do_cmd_ioctl()
1838 ret = s->do_cmdtest(dev, s, &async->cmd); in do_cmd_ioctl()
1840 if (async->cmd.flags & CMDF_BOGUS || ret) { in do_cmd_ioctl()
1842 *cmd = async->cmd; in do_cmd_ioctl()
1851 if (!async->prealloc_bufsz) { in do_cmd_ioctl()
1859 async->cb_mask = COMEDI_CB_BLOCK | COMEDI_CB_CANCEL_MASK; in do_cmd_ioctl()
1860 if (async->cmd.flags & CMDF_WAKE_EOS) in do_cmd_ioctl()
1861 async->cb_mask |= COMEDI_CB_EOS; in do_cmd_ioctl()
2025 if (!s->async) in do_cancel_ioctl()
2107 if (s_old && s_old->busy == file && s_old->async && in do_setrsubd_ioctl()
2108 !(s_old->async->cmd.flags & CMDF_WRITE)) in do_setrsubd_ioctl()
2150 if (s_old && s_old->busy == file && s_old->async && in do_setwsubd_ioctl()
2151 (s_old->async->cmd.flags & CMDF_WRITE)) in do_setwsubd_ioctl()
2371 struct comedi_async *async; in comedi_mmap() local
2404 async = s->async; in comedi_mmap()
2405 if (!async) { in comedi_mmap()
2417 if (size > async->prealloc_bufsz) { in comedi_mmap()
2511 if (s && s->async) { in comedi_poll()
2512 poll_wait(file, &s->async->wait_head, wait); in comedi_poll()
2514 (s->async->cmd.flags & CMDF_WRITE) || in comedi_poll()
2520 if (s && s->async) { in comedi_poll()
2524 poll_wait(file, &s->async->wait_head, wait); in comedi_poll()
2526 !(s->async->cmd.flags & CMDF_WRITE) || in comedi_poll()
2539 struct comedi_buf_map *bm = s->async->buf_map; in comedi_buf_copy_to_user()
2567 struct comedi_buf_map *bm = s->async->buf_map; in comedi_buf_copy_from_user()
2596 struct comedi_async *async; in comedi_write() local
2619 if (!s || !s->async) { in comedi_write()
2624 async = s->async; in comedi_write()
2625 if (s->busy != file || !(async->cmd.flags & CMDF_WRITE)) { in comedi_write()
2630 add_wait_queue(&async->wait_head, &wait); in comedi_write()
2648 comedi_buf_write_alloc(s, async->prealloc_bufsz); in comedi_write()
2663 !(async->cmd.flags & CMDF_WRITE)) { in comedi_write()
2671 m = comedi_buf_copy_from_user(s, async->buf_write_ptr, buf, n); in comedi_write()
2683 remove_wait_queue(&async->wait_head, &wait); in comedi_write()
2707 s == new_s && new_s->async == async && s->busy == file && in comedi_write()
2708 (async->cmd.flags & CMDF_WRITE) && in comedi_write()
2724 struct comedi_async *async; in comedi_read() local
2747 if (!s || !s->async) { in comedi_read()
2752 async = s->async; in comedi_read()
2753 if (s->busy != file || (async->cmd.flags & CMDF_WRITE)) { in comedi_read()
2758 add_wait_queue(&async->wait_head, &wait); in comedi_read()
2788 (async->cmd.flags & CMDF_WRITE)) { in comedi_read()
2796 m = comedi_buf_copy_to_user(s, buf, async->buf_read_ptr, n); in comedi_read()
2810 remove_wait_queue(&async->wait_head, &wait); in comedi_read()
2834 s == new_s && new_s->async == async && s->busy == file && in comedi_read()
2835 !(async->cmd.flags & CMDF_WRITE) && in comedi_read()
3315 struct comedi_async *async = s->async; in comedi_event() local
3322 events = async->events; in comedi_event()
3323 async->events = 0; in comedi_event()
3339 if (async->cb_mask & events) { in comedi_event()
3340 wake_up_interruptible(&async->wait_head); in comedi_event()
3341 si_code = async->cmd.flags & CMDF_WRITE ? POLL_OUT : POLL_IN; in comedi_event()