Lines Matching refs:async
341 struct comedi_async *async = s->async; in resize_async_buffer() local
346 if (new_size > async->max_bufsize) in resize_async_buffer()
374 s->index, async->prealloc_bufsz); in resize_async_buffer()
394 if (s && (s->subdev_flags & SDF_CMD_READ) && s->async) in max_read_buffer_kb_show()
395 size = s->async->max_bufsize / 1024; in max_read_buffer_kb_show()
425 if (s && (s->subdev_flags & SDF_CMD_READ) && s->async) in max_read_buffer_kb_store()
426 s->async->max_bufsize = size; in max_read_buffer_kb_store()
450 if (s && (s->subdev_flags & SDF_CMD_READ) && s->async) in read_buffer_kb_show()
451 size = s->async->prealloc_bufsz / 1024; in read_buffer_kb_show()
481 if (s && (s->subdev_flags & SDF_CMD_READ) && s->async) in read_buffer_kb_store()
507 if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async) in max_write_buffer_kb_show()
508 size = s->async->max_bufsize / 1024; in max_write_buffer_kb_show()
538 if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async) in max_write_buffer_kb_store()
539 s->async->max_bufsize = size; in max_write_buffer_kb_store()
563 if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async) in write_buffer_kb_show()
564 size = s->async->prealloc_bufsz / 1024; in write_buffer_kb_show()
594 if (s && (s->subdev_flags & SDF_CMD_WRITE) && s->async) in write_buffer_kb_store()
734 struct comedi_async *async = s->async; in do_become_nonbusy() local
738 if (async) { in do_become_nonbusy()
740 async->inttrig = NULL; in do_become_nonbusy()
741 kfree(async->cmd.chanlist); in do_become_nonbusy()
742 async->cmd.chanlist = NULL; in do_become_nonbusy()
744 wake_up_interruptible_all(&async->wait_head); in do_become_nonbusy()
776 if (s->async) in comedi_device_cancel_all()
794 if (s->async && comedi_buf_is_mmapped(s)) in is_device_busy()
871 struct comedi_async *async; in do_bufconfig_ioctl() local
883 async = s->async; in do_bufconfig_ioctl()
885 if (!async) { in do_bufconfig_ioctl()
897 async->max_bufsize = bc.maximum_size; in do_bufconfig_ioctl()
906 bc.size = async->prealloc_bufsz; in do_bufconfig_ioctl()
907 bc.maximum_size = async->max_bufsize; in do_bufconfig_ioctl()
1109 struct comedi_async *async; in do_bufinfo_ioctl() local
1123 async = s->async; in do_bufinfo_ioctl()
1125 if (!async || s->busy != file) in do_bufinfo_ioctl()
1129 if (!(async->cmd.flags & CMDF_WRITE)) { in do_bufinfo_ioctl()
1164 bi.buf_write_count = async->buf_write_count; in do_bufinfo_ioctl()
1165 bi.buf_write_ptr = async->buf_write_ptr; in do_bufinfo_ioctl()
1166 bi.buf_read_count = async->buf_read_count; in do_bufinfo_ioctl()
1167 bi.buf_read_ptr = async->buf_read_ptr; in do_bufinfo_ioctl()
1354 if (!s->async) { in parse_insn()
1359 if (!s->async->inttrig) { in parse_insn()
1364 ret = s->async->inttrig(dev, s, data[0]); in parse_insn()
1670 if (!s->do_cmd || !s->do_cmdtest || !s->async) { in __comedi_get_user_cmd()
1747 struct comedi_async *async; in do_cmd_ioctl() local
1762 async = s->async; in do_cmd_ioctl()
1783 async->cmd = *cmd; in do_cmd_ioctl()
1784 async->cmd.data = NULL; in do_cmd_ioctl()
1787 ret = __comedi_get_user_chanlist(dev, s, user_chanlist, &async->cmd); in do_cmd_ioctl()
1791 ret = s->do_cmdtest(dev, s, &async->cmd); in do_cmd_ioctl()
1793 if (async->cmd.flags & CMDF_BOGUS || ret) { in do_cmd_ioctl()
1795 *cmd = async->cmd; in do_cmd_ioctl()
1804 if (!async->prealloc_bufsz) { in do_cmd_ioctl()
1812 async->cb_mask = COMEDI_CB_BLOCK | COMEDI_CB_CANCEL_MASK; in do_cmd_ioctl()
1813 if (async->cmd.flags & CMDF_WAKE_EOS) in do_cmd_ioctl()
1814 async->cb_mask |= COMEDI_CB_EOS; in do_cmd_ioctl()
1978 if (!s->async) in do_cancel_ioctl()
2060 if (s_old && s_old->busy == file && s_old->async && in do_setrsubd_ioctl()
2061 !(s_old->async->cmd.flags & CMDF_WRITE)) in do_setrsubd_ioctl()
2103 if (s_old && s_old->busy == file && s_old->async && in do_setwsubd_ioctl()
2104 (s_old->async->cmd.flags & CMDF_WRITE)) in do_setwsubd_ioctl()
2321 struct comedi_async *async; in comedi_mmap() local
2354 async = s->async; in comedi_mmap()
2355 if (!async) { in comedi_mmap()
2367 if (size > async->prealloc_bufsz) { in comedi_mmap()
2436 if (s && s->async) { in comedi_poll()
2437 poll_wait(file, &s->async->wait_head, wait); in comedi_poll()
2439 (s->async->cmd.flags & CMDF_WRITE) || in comedi_poll()
2445 if (s && s->async) { in comedi_poll()
2449 poll_wait(file, &s->async->wait_head, wait); in comedi_poll()
2451 !(s->async->cmd.flags & CMDF_WRITE) || in comedi_poll()
2465 struct comedi_async *async; in comedi_write() local
2488 if (!s || !s->async) { in comedi_write()
2493 async = s->async; in comedi_write()
2494 if (s->busy != file || !(async->cmd.flags & CMDF_WRITE)) { in comedi_write()
2499 add_wait_queue(&async->wait_head, &wait); in comedi_write()
2518 comedi_buf_write_alloc(s, async->prealloc_bufsz); in comedi_write()
2533 !(async->cmd.flags & CMDF_WRITE)) { in comedi_write()
2541 wp = async->buf_write_ptr; in comedi_write()
2542 n1 = min(n, async->prealloc_bufsz - wp); in comedi_write()
2544 m = copy_from_user(async->prealloc_buf + wp, buf, n1); in comedi_write()
2548 m = copy_from_user(async->prealloc_buf, buf + n1, n2); in comedi_write()
2560 remove_wait_queue(&async->wait_head, &wait); in comedi_write()
2584 s == new_s && new_s->async == async && s->busy == file && in comedi_write()
2585 (async->cmd.flags & CMDF_WRITE) && in comedi_write()
2601 struct comedi_async *async; in comedi_read() local
2624 if (!s || !s->async) { in comedi_read()
2629 async = s->async; in comedi_read()
2630 if (s->busy != file || (async->cmd.flags & CMDF_WRITE)) { in comedi_read()
2635 add_wait_queue(&async->wait_head, &wait); in comedi_read()
2667 (async->cmd.flags & CMDF_WRITE)) { in comedi_read()
2675 rp = async->buf_read_ptr; in comedi_read()
2676 n1 = min(n, async->prealloc_bufsz - rp); in comedi_read()
2678 m = copy_to_user(buf, async->prealloc_buf + rp, n1); in comedi_read()
2682 m = copy_to_user(buf + n1, async->prealloc_buf, n2); in comedi_read()
2696 remove_wait_queue(&async->wait_head, &wait); in comedi_read()
2720 s == new_s && new_s->async == async && s->busy == file && in comedi_read()
2721 !(async->cmd.flags & CMDF_WRITE) && in comedi_read()
3198 struct comedi_async *async = s->async; in comedi_event() local
3205 events = async->events; in comedi_event()
3206 async->events = 0; in comedi_event()
3222 if (async->cb_mask & events) { in comedi_event()
3223 wake_up_interruptible(&async->wait_head); in comedi_event()
3224 si_code = async->cmd.flags & CMDF_WRITE ? POLL_OUT : POLL_IN; in comedi_event()