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()
798 if (s->async && comedi_buf_is_mmapped(s)) in is_device_busy()
875 struct comedi_async *async; in do_bufconfig_ioctl() local
887 async = s->async; in do_bufconfig_ioctl()
889 if (!async) { in do_bufconfig_ioctl()
891 "subdevice does not have async capability\n"); in do_bufconfig_ioctl()
901 async->max_bufsize = bc.maximum_size; in do_bufconfig_ioctl()
910 bc.size = async->prealloc_bufsz; in do_bufconfig_ioctl()
911 bc.maximum_size = async->max_bufsize; in do_bufconfig_ioctl()
1113 struct comedi_async *async; in do_bufinfo_ioctl() local
1127 async = s->async; in do_bufinfo_ioctl()
1129 if (!async || s->busy != file) in do_bufinfo_ioctl()
1133 if (!(async->cmd.flags & CMDF_WRITE)) { in do_bufinfo_ioctl()
1168 bi.buf_write_count = async->buf_write_count; in do_bufinfo_ioctl()
1169 bi.buf_write_ptr = async->buf_write_ptr; in do_bufinfo_ioctl()
1170 bi.buf_read_count = async->buf_read_count; in do_bufinfo_ioctl()
1171 bi.buf_read_ptr = async->buf_read_ptr; in do_bufinfo_ioctl()
1359 if (!s->async) { in parse_insn()
1360 dev_dbg(dev->class_dev, "no async\n"); in parse_insn()
1364 if (!s->async->inttrig) { in parse_insn()
1369 ret = s->async->inttrig(dev, s, data[0]); in parse_insn()
1675 if (!s->do_cmd || !s->do_cmdtest || !s->async) { in __comedi_get_user_cmd()
1752 struct comedi_async *async; in do_cmd_ioctl() local
1767 async = s->async; in do_cmd_ioctl()
1788 async->cmd = *cmd; in do_cmd_ioctl()
1789 async->cmd.data = NULL; in do_cmd_ioctl()
1792 ret = __comedi_get_user_chanlist(dev, s, user_chanlist, &async->cmd); in do_cmd_ioctl()
1796 ret = s->do_cmdtest(dev, s, &async->cmd); in do_cmd_ioctl()
1798 if (async->cmd.flags & CMDF_BOGUS || ret) { in do_cmd_ioctl()
1800 *cmd = async->cmd; in do_cmd_ioctl()
1809 if (!async->prealloc_bufsz) { in do_cmd_ioctl()
1817 async->cb_mask = COMEDI_CB_BLOCK | COMEDI_CB_CANCEL_MASK; in do_cmd_ioctl()
1818 if (async->cmd.flags & CMDF_WAKE_EOS) in do_cmd_ioctl()
1819 async->cb_mask |= COMEDI_CB_EOS; in do_cmd_ioctl()
1983 if (!s->async) in do_cancel_ioctl()
2065 if (s_old && s_old->busy == file && s_old->async && in do_setrsubd_ioctl()
2066 !(s_old->async->cmd.flags & CMDF_WRITE)) in do_setrsubd_ioctl()
2108 if (s_old && s_old->busy == file && s_old->async && in do_setwsubd_ioctl()
2109 (s_old->async->cmd.flags & CMDF_WRITE)) in do_setwsubd_ioctl()
2326 struct comedi_async *async; in comedi_mmap() local
2359 async = s->async; in comedi_mmap()
2360 if (!async) { in comedi_mmap()
2372 if (size > async->prealloc_bufsz) { in comedi_mmap()
2453 if (s && s->async) { in comedi_poll()
2454 poll_wait(file, &s->async->wait_head, wait); in comedi_poll()
2456 (s->async->cmd.flags & CMDF_WRITE) || in comedi_poll()
2462 if (s && s->async) { in comedi_poll()
2466 poll_wait(file, &s->async->wait_head, wait); in comedi_poll()
2468 !(s->async->cmd.flags & CMDF_WRITE) || in comedi_poll()
2482 struct comedi_async *async; in comedi_write() local
2505 if (!s || !s->async) { in comedi_write()
2510 async = s->async; in comedi_write()
2511 if (s->busy != file || !(async->cmd.flags & CMDF_WRITE)) { in comedi_write()
2516 add_wait_queue(&async->wait_head, &wait); in comedi_write()
2535 comedi_buf_write_alloc(s, async->prealloc_bufsz); in comedi_write()
2550 !(async->cmd.flags & CMDF_WRITE)) { in comedi_write()
2558 wp = async->buf_write_ptr; in comedi_write()
2559 n1 = min(n, async->prealloc_bufsz - wp); in comedi_write()
2561 m = copy_from_user(async->prealloc_buf + wp, buf, n1); in comedi_write()
2565 m = copy_from_user(async->prealloc_buf, buf + n1, n2); in comedi_write()
2577 remove_wait_queue(&async->wait_head, &wait); in comedi_write()
2601 s == new_s && new_s->async == async && s->busy == file && in comedi_write()
2602 (async->cmd.flags & CMDF_WRITE) && in comedi_write()
2618 struct comedi_async *async; in comedi_read() local
2641 if (!s || !s->async) { in comedi_read()
2646 async = s->async; in comedi_read()
2647 if (s->busy != file || (async->cmd.flags & CMDF_WRITE)) { in comedi_read()
2652 add_wait_queue(&async->wait_head, &wait); in comedi_read()
2684 (async->cmd.flags & CMDF_WRITE)) { in comedi_read()
2692 rp = async->buf_read_ptr; in comedi_read()
2693 n1 = min(n, async->prealloc_bufsz - rp); in comedi_read()
2695 m = copy_to_user(buf, async->prealloc_buf + rp, n1); in comedi_read()
2699 m = copy_to_user(buf + n1, async->prealloc_buf, n2); in comedi_read()
2713 remove_wait_queue(&async->wait_head, &wait); in comedi_read()
2737 s == new_s && new_s->async == async && s->busy == file && in comedi_read()
2738 !(async->cmd.flags & CMDF_WRITE) && in comedi_read()
3215 struct comedi_async *async = s->async; in comedi_event() local
3222 events = async->events; in comedi_event()
3223 async->events = 0; in comedi_event()
3239 if (async->cb_mask & events) { in comedi_event()
3240 wake_up_interruptible(&async->wait_head); in comedi_event()
3241 si_code = async->cmd.flags & CMDF_WRITE ? POLL_OUT : POLL_IN; in comedi_event()