Lines Matching refs: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()
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()
780 if (s->async) in comedi_device_cancel_all()
799 if (!s->async) 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()
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()
1381 if (!s->async->inttrig) { in parse_insn()
1386 ret = s->async->inttrig(dev, s, data[0]); in parse_insn()
1712 if (!s->do_cmd || !s->do_cmdtest || !s->async) { in __comedi_get_user_cmd()
1789 struct comedi_async *async; in do_cmd_ioctl() local
1804 async = s->async; in do_cmd_ioctl()
1825 async->cmd = *cmd; in do_cmd_ioctl()
1826 async->cmd.data = NULL; in do_cmd_ioctl()
1829 ret = __comedi_get_user_chanlist(dev, s, user_chanlist, &async->cmd); in do_cmd_ioctl()
1833 ret = s->do_cmdtest(dev, s, &async->cmd); in do_cmd_ioctl()
1835 if (async->cmd.flags & CMDF_BOGUS || ret) { in do_cmd_ioctl()
1837 *cmd = async->cmd; in do_cmd_ioctl()
1846 if (!async->prealloc_bufsz) { in do_cmd_ioctl()
1854 async->cb_mask = COMEDI_CB_BLOCK | COMEDI_CB_CANCEL_MASK; in do_cmd_ioctl()
1855 if (async->cmd.flags & CMDF_WAKE_EOS) in do_cmd_ioctl()
1856 async->cb_mask |= COMEDI_CB_EOS; in do_cmd_ioctl()
2020 if (!s->async) in do_cancel_ioctl()
2102 if (s_old && s_old->busy == file && s_old->async && in do_setrsubd_ioctl()
2103 !(s_old->async->cmd.flags & CMDF_WRITE)) in do_setrsubd_ioctl()
2145 if (s_old && s_old->busy == file && s_old->async && in do_setwsubd_ioctl()
2146 (s_old->async->cmd.flags & CMDF_WRITE)) in do_setwsubd_ioctl()
2366 struct comedi_async *async; in comedi_mmap() local
2399 async = s->async; in comedi_mmap()
2400 if (!async) { in comedi_mmap()
2412 if (size > async->prealloc_bufsz) { in comedi_mmap()
2506 if (s && s->async) { in comedi_poll()
2507 poll_wait(file, &s->async->wait_head, wait); in comedi_poll()
2509 (s->async->cmd.flags & CMDF_WRITE) || in comedi_poll()
2515 if (s && s->async) { in comedi_poll()
2519 poll_wait(file, &s->async->wait_head, wait); in comedi_poll()
2521 !(s->async->cmd.flags & CMDF_WRITE) || in comedi_poll()
2534 struct comedi_buf_map *bm = s->async->buf_map; in comedi_buf_copy_to_user()
2562 struct comedi_buf_map *bm = s->async->buf_map; in comedi_buf_copy_from_user()
2591 struct comedi_async *async; in comedi_write() local
2614 if (!s || !s->async) { in comedi_write()
2619 async = s->async; in comedi_write()
2620 if (s->busy != file || !(async->cmd.flags & CMDF_WRITE)) { in comedi_write()
2625 add_wait_queue(&async->wait_head, &wait); in comedi_write()
2643 comedi_buf_write_alloc(s, async->prealloc_bufsz); in comedi_write()
2658 !(async->cmd.flags & CMDF_WRITE)) { in comedi_write()
2666 m = comedi_buf_copy_from_user(s, async->buf_write_ptr, buf, n); in comedi_write()
2678 remove_wait_queue(&async->wait_head, &wait); in comedi_write()
2702 s == new_s && new_s->async == async && s->busy == file && in comedi_write()
2703 (async->cmd.flags & CMDF_WRITE) && in comedi_write()
2719 struct comedi_async *async; in comedi_read() local
2742 if (!s || !s->async) { in comedi_read()
2747 async = s->async; in comedi_read()
2748 if (s->busy != file || (async->cmd.flags & CMDF_WRITE)) { in comedi_read()
2753 add_wait_queue(&async->wait_head, &wait); in comedi_read()
2783 (async->cmd.flags & CMDF_WRITE)) { in comedi_read()
2791 m = comedi_buf_copy_to_user(s, buf, async->buf_read_ptr, n); in comedi_read()
2805 remove_wait_queue(&async->wait_head, &wait); in comedi_read()
2829 s == new_s && new_s->async == async && s->busy == file && in comedi_read()
2830 !(async->cmd.flags & CMDF_WRITE) && in comedi_read()
3310 struct comedi_async *async = s->async; in comedi_event() local
3317 events = async->events; in comedi_event()
3318 async->events = 0; in comedi_event()
3334 if (async->cb_mask & events) { in comedi_event()
3335 wake_up_interruptible(&async->wait_head); in comedi_event()
3336 si_code = async->cmd.flags & CMDF_WRITE ? POLL_OUT : POLL_IN; in comedi_event()