vq 88 arch/arm64/include/asm/fpsimd.h static inline unsigned int __vq_to_bit(unsigned int vq) vq 90 arch/arm64/include/asm/fpsimd.h return SVE_VQ_MAX - vq; vq 99 arch/arm64/include/asm/fpsimd.h static inline bool sve_vq_available(unsigned int vq) vq 101 arch/arm64/include/asm/fpsimd.h return test_bit(__vq_to_bit(vq), sve_vq_map); vq 156 arch/arm64/include/uapi/asm/ptrace.h #define SVE_PT_FPSIMD_SIZE(vq, flags) (sizeof(struct user_fpsimd_state)) vq 187 arch/arm64/include/uapi/asm/ptrace.h #define SVE_PT_SVE_ZREG_SIZE(vq) __SVE_ZREG_SIZE(vq) vq 188 arch/arm64/include/uapi/asm/ptrace.h #define SVE_PT_SVE_PREG_SIZE(vq) __SVE_PREG_SIZE(vq) vq 189 arch/arm64/include/uapi/asm/ptrace.h #define SVE_PT_SVE_FFR_SIZE(vq) __SVE_FFR_SIZE(vq) vq 197 arch/arm64/include/uapi/asm/ptrace.h #define SVE_PT_SVE_ZREG_OFFSET(vq, n) \ vq 198 arch/arm64/include/uapi/asm/ptrace.h (SVE_PT_REGS_OFFSET + __SVE_ZREG_OFFSET(vq, n)) vq 199 arch/arm64/include/uapi/asm/ptrace.h #define SVE_PT_SVE_ZREGS_SIZE(vq) \ vq 200 arch/arm64/include/uapi/asm/ptrace.h (SVE_PT_SVE_ZREG_OFFSET(vq, __SVE_NUM_ZREGS) - SVE_PT_SVE_ZREGS_OFFSET) vq 202 arch/arm64/include/uapi/asm/ptrace.h #define SVE_PT_SVE_PREGS_OFFSET(vq) \ vq 203 arch/arm64/include/uapi/asm/ptrace.h (SVE_PT_REGS_OFFSET + __SVE_PREGS_OFFSET(vq)) vq 204 arch/arm64/include/uapi/asm/ptrace.h #define SVE_PT_SVE_PREG_OFFSET(vq, n) \ vq 205 arch/arm64/include/uapi/asm/ptrace.h (SVE_PT_REGS_OFFSET + __SVE_PREG_OFFSET(vq, n)) vq 206 arch/arm64/include/uapi/asm/ptrace.h #define SVE_PT_SVE_PREGS_SIZE(vq) \ vq 207 arch/arm64/include/uapi/asm/ptrace.h (SVE_PT_SVE_PREG_OFFSET(vq, __SVE_NUM_PREGS) - \ vq 208 arch/arm64/include/uapi/asm/ptrace.h SVE_PT_SVE_PREGS_OFFSET(vq)) vq 210 arch/arm64/include/uapi/asm/ptrace.h #define SVE_PT_SVE_FFR_OFFSET(vq) \ vq 211 arch/arm64/include/uapi/asm/ptrace.h (SVE_PT_REGS_OFFSET + __SVE_FFR_OFFSET(vq)) vq 213 arch/arm64/include/uapi/asm/ptrace.h #define SVE_PT_SVE_FPSR_OFFSET(vq) \ vq 214 arch/arm64/include/uapi/asm/ptrace.h ((SVE_PT_SVE_FFR_OFFSET(vq) + SVE_PT_SVE_FFR_SIZE(vq) + \ vq 217 arch/arm64/include/uapi/asm/ptrace.h #define SVE_PT_SVE_FPCR_OFFSET(vq) \ vq 218 arch/arm64/include/uapi/asm/ptrace.h (SVE_PT_SVE_FPSR_OFFSET(vq) + SVE_PT_SVE_FPSR_SIZE) vq 225 arch/arm64/include/uapi/asm/ptrace.h #define SVE_PT_SVE_SIZE(vq, flags) \ vq 226 arch/arm64/include/uapi/asm/ptrace.h ((SVE_PT_SVE_FPCR_OFFSET(vq) + SVE_PT_SVE_FPCR_SIZE \ vq 230 arch/arm64/include/uapi/asm/ptrace.h #define SVE_PT_SIZE(vq, flags) \ vq 232 arch/arm64/include/uapi/asm/ptrace.h SVE_PT_SVE_OFFSET + SVE_PT_SVE_SIZE(vq, flags) \ vq 233 arch/arm64/include/uapi/asm/ptrace.h : SVE_PT_FPSIMD_OFFSET + SVE_PT_FPSIMD_SIZE(vq, flags)) vq 165 arch/arm64/include/uapi/asm/sigcontext.h #define sve_vl_from_vq(vq) __sve_vl_from_vq(vq) vq 223 arch/arm64/include/uapi/asm/sigcontext.h #define SVE_SIG_ZREG_SIZE(vq) __SVE_ZREG_SIZE(vq) vq 224 arch/arm64/include/uapi/asm/sigcontext.h #define SVE_SIG_PREG_SIZE(vq) __SVE_PREG_SIZE(vq) vq 225 arch/arm64/include/uapi/asm/sigcontext.h #define SVE_SIG_FFR_SIZE(vq) __SVE_FFR_SIZE(vq) vq 233 arch/arm64/include/uapi/asm/sigcontext.h #define SVE_SIG_ZREG_OFFSET(vq, n) \ vq 234 arch/arm64/include/uapi/asm/sigcontext.h (SVE_SIG_REGS_OFFSET + __SVE_ZREG_OFFSET(vq, n)) vq 235 arch/arm64/include/uapi/asm/sigcontext.h #define SVE_SIG_ZREGS_SIZE(vq) __SVE_ZREGS_SIZE(vq) vq 237 arch/arm64/include/uapi/asm/sigcontext.h #define SVE_SIG_PREGS_OFFSET(vq) \ vq 238 arch/arm64/include/uapi/asm/sigcontext.h (SVE_SIG_REGS_OFFSET + __SVE_PREGS_OFFSET(vq)) vq 239 arch/arm64/include/uapi/asm/sigcontext.h #define SVE_SIG_PREG_OFFSET(vq, n) \ vq 240 arch/arm64/include/uapi/asm/sigcontext.h (SVE_SIG_REGS_OFFSET + __SVE_PREG_OFFSET(vq, n)) vq 241 arch/arm64/include/uapi/asm/sigcontext.h #define SVE_SIG_PREGS_SIZE(vq) __SVE_PREGS_SIZE(vq) vq 243 arch/arm64/include/uapi/asm/sigcontext.h #define SVE_SIG_FFR_OFFSET(vq) \ vq 244 arch/arm64/include/uapi/asm/sigcontext.h (SVE_SIG_REGS_OFFSET + __SVE_FFR_OFFSET(vq)) vq 246 arch/arm64/include/uapi/asm/sigcontext.h #define SVE_SIG_REGS_SIZE(vq) \ vq 247 arch/arm64/include/uapi/asm/sigcontext.h (__SVE_FFR_OFFSET(vq) + __SVE_FFR_SIZE(vq)) vq 249 arch/arm64/include/uapi/asm/sigcontext.h #define SVE_SIG_CONTEXT_SIZE(vq) \ vq 250 arch/arm64/include/uapi/asm/sigcontext.h (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq)) vq 31 arch/arm64/include/uapi/asm/sve_context.h #define __sve_vl_from_vq(vq) ((vq) * __SVE_VQ_BYTES) vq 33 arch/arm64/include/uapi/asm/sve_context.h #define __SVE_ZREG_SIZE(vq) ((__u32)(vq) * __SVE_VQ_BYTES) vq 34 arch/arm64/include/uapi/asm/sve_context.h #define __SVE_PREG_SIZE(vq) ((__u32)(vq) * (__SVE_VQ_BYTES / 8)) vq 35 arch/arm64/include/uapi/asm/sve_context.h #define __SVE_FFR_SIZE(vq) __SVE_PREG_SIZE(vq) vq 38 arch/arm64/include/uapi/asm/sve_context.h #define __SVE_ZREG_OFFSET(vq, n) \ vq 39 arch/arm64/include/uapi/asm/sve_context.h (__SVE_ZREGS_OFFSET + __SVE_ZREG_SIZE(vq) * (n)) vq 40 arch/arm64/include/uapi/asm/sve_context.h #define __SVE_ZREGS_SIZE(vq) \ vq 41 arch/arm64/include/uapi/asm/sve_context.h (__SVE_ZREG_OFFSET(vq, __SVE_NUM_ZREGS) - __SVE_ZREGS_OFFSET) vq 43 arch/arm64/include/uapi/asm/sve_context.h #define __SVE_PREGS_OFFSET(vq) \ vq 44 arch/arm64/include/uapi/asm/sve_context.h (__SVE_ZREGS_OFFSET + __SVE_ZREGS_SIZE(vq)) vq 45 arch/arm64/include/uapi/asm/sve_context.h #define __SVE_PREG_OFFSET(vq, n) \ vq 46 arch/arm64/include/uapi/asm/sve_context.h (__SVE_PREGS_OFFSET(vq) + __SVE_PREG_SIZE(vq) * (n)) vq 47 arch/arm64/include/uapi/asm/sve_context.h #define __SVE_PREGS_SIZE(vq) \ vq 48 arch/arm64/include/uapi/asm/sve_context.h (__SVE_PREG_OFFSET(vq, __SVE_NUM_PREGS) - __SVE_PREGS_OFFSET(vq)) vq 50 arch/arm64/include/uapi/asm/sve_context.h #define __SVE_FFR_OFFSET(vq) \ vq 51 arch/arm64/include/uapi/asm/sve_context.h (__SVE_PREGS_OFFSET(vq) + __SVE_PREGS_SIZE(vq)) vq 391 arch/arm64/kernel/fpsimd.c #define ZREG(sve_state, vq, n) ((char *)(sve_state) + \ vq 392 arch/arm64/kernel/fpsimd.c (SVE_SIG_ZREG_OFFSET(vq, n) - SVE_SIG_REGS_OFFSET)) vq 412 arch/arm64/kernel/fpsimd.c unsigned int vq) vq 418 arch/arm64/kernel/fpsimd.c p = (__uint128_t *)ZREG(sst, vq, i); vq 437 arch/arm64/kernel/fpsimd.c unsigned int vq; vq 444 arch/arm64/kernel/fpsimd.c vq = sve_vq_from_vl(task->thread.sve_vl); vq 445 arch/arm64/kernel/fpsimd.c __fpsimd_to_sve(sst, fst, vq); vq 461 arch/arm64/kernel/fpsimd.c unsigned int vq; vq 470 arch/arm64/kernel/fpsimd.c vq = sve_vq_from_vl(task->thread.sve_vl); vq 472 arch/arm64/kernel/fpsimd.c p = (__uint128_t const *)ZREG(sst, vq, i); vq 559 arch/arm64/kernel/fpsimd.c unsigned int vq; vq 566 arch/arm64/kernel/fpsimd.c vq = sve_vq_from_vl(task->thread.sve_vl); vq 568 arch/arm64/kernel/fpsimd.c memset(sst, 0, SVE_SIG_REGS_SIZE(vq)); vq 569 arch/arm64/kernel/fpsimd.c __fpsimd_to_sve(sst, fst, vq); vq 690 arch/arm64/kernel/fpsimd.c unsigned int vq, vl; vq 698 arch/arm64/kernel/fpsimd.c for (vq = SVE_VQ_MAX; vq >= SVE_VQ_MIN; --vq) { vq 699 arch/arm64/kernel/fpsimd.c write_sysreg_s(zcr | (vq - 1), SYS_ZCR_EL1); /* self-syncing */ vq 701 arch/arm64/kernel/fpsimd.c vq = sve_vq_from_vl(vl); /* skip intervening lengths */ vq 702 arch/arm64/kernel/fpsimd.c set_bit(__vq_to_bit(vq), map); vq 761 arch/arm64/kernel/ptrace.c unsigned int vq; vq 771 arch/arm64/kernel/ptrace.c vq = sve_vq_from_vl(header->vl); vq 774 arch/arm64/kernel/ptrace.c header->size = SVE_PT_SIZE(vq, header->flags); vq 803 arch/arm64/kernel/ptrace.c unsigned int vq; vq 811 arch/arm64/kernel/ptrace.c vq = sve_vq_from_vl(header.vl); vq 832 arch/arm64/kernel/ptrace.c end = SVE_PT_SVE_FFR_OFFSET(vq) + SVE_PT_SVE_FFR_SIZE(vq); vq 840 arch/arm64/kernel/ptrace.c end = SVE_PT_SVE_FPSR_OFFSET(vq); vq 851 arch/arm64/kernel/ptrace.c end = SVE_PT_SVE_FPCR_OFFSET(vq) + SVE_PT_SVE_FPCR_SIZE; vq 871 arch/arm64/kernel/ptrace.c unsigned int vq; vq 895 arch/arm64/kernel/ptrace.c vq = sve_vq_from_vl(target->thread.sve_vl); vq 914 arch/arm64/kernel/ptrace.c if (count && vq != sve_vq_from_vl(header.vl)) { vq 931 arch/arm64/kernel/ptrace.c end = SVE_PT_SVE_FFR_OFFSET(vq) + SVE_PT_SVE_FFR_SIZE(vq); vq 939 arch/arm64/kernel/ptrace.c end = SVE_PT_SVE_FPSR_OFFSET(vq); vq 950 arch/arm64/kernel/ptrace.c end = SVE_PT_SVE_FPCR_OFFSET(vq) + SVE_PT_SVE_FPCR_SIZE; vq 230 arch/arm64/kernel/signal.c unsigned int vq = 0; vq 233 arch/arm64/kernel/signal.c vq = sve_vq_from_vl(vl); vq 238 arch/arm64/kernel/signal.c __put_user_error(round_up(SVE_SIG_CONTEXT_SIZE(vq), 16), vq 244 arch/arm64/kernel/signal.c if (vq) { vq 251 arch/arm64/kernel/signal.c SVE_SIG_REGS_SIZE(vq)); vq 260 arch/arm64/kernel/signal.c unsigned int vq; vq 275 arch/arm64/kernel/signal.c vq = sve_vq_from_vl(sve.vl); vq 277 arch/arm64/kernel/signal.c if (sve.head.size < SVE_SIG_CONTEXT_SIZE(vq)) vq 294 arch/arm64/kernel/signal.c SVE_SIG_REGS_SIZE(vq)); vq 585 arch/arm64/kernel/signal.c unsigned int vq = 0; vq 593 arch/arm64/kernel/signal.c vq = sve_vq_from_vl(vl); vq 597 arch/arm64/kernel/signal.c SVE_SIG_CONTEXT_SIZE(vq)); vq 216 arch/arm64/kvm/guest.c #define vq_word(vq) (((vq) - SVE_VQ_MIN) / 64) vq 217 arch/arm64/kvm/guest.c #define vq_mask(vq) ((u64)1 << ((vq) - SVE_VQ_MIN) % 64) vq 218 arch/arm64/kvm/guest.c #define vq_present(vqs, vq) (!!((vqs)[vq_word(vq)] & vq_mask(vq))) vq 222 arch/arm64/kvm/guest.c unsigned int max_vq, vq; vq 234 arch/arm64/kvm/guest.c for (vq = SVE_VQ_MIN; vq <= max_vq; ++vq) vq 235 arch/arm64/kvm/guest.c if (sve_vq_available(vq)) vq 236 arch/arm64/kvm/guest.c vqs[vq_word(vq)] |= vq_mask(vq); vq 246 arch/arm64/kvm/guest.c unsigned int max_vq, vq; vq 262 arch/arm64/kvm/guest.c for (vq = SVE_VQ_MIN; vq <= SVE_VQ_MAX; ++vq) vq 263 arch/arm64/kvm/guest.c if (vq_present(vqs, vq)) vq 264 arch/arm64/kvm/guest.c max_vq = vq; vq 276 arch/arm64/kvm/guest.c for (vq = SVE_VQ_MIN; vq <= max_vq; ++vq) vq 277 arch/arm64/kvm/guest.c if (vq_present(vqs, vq) != sve_vq_available(vq)) vq 338 arch/arm64/kvm/guest.c unsigned int vq; vq 361 arch/arm64/kvm/guest.c vq = sve_vq_from_vl(vcpu->arch.sve_max_vl); vq 363 arch/arm64/kvm/guest.c reqoffset = SVE_SIG_ZREG_OFFSET(vq, reg_num) - vq 366 arch/arm64/kvm/guest.c maxlen = SVE_SIG_ZREG_SIZE(vq); vq 371 arch/arm64/kvm/guest.c vq = sve_vq_from_vl(vcpu->arch.sve_max_vl); vq 373 arch/arm64/kvm/guest.c reqoffset = SVE_SIG_PREG_OFFSET(vq, reg_num) - vq 376 arch/arm64/kvm/guest.c maxlen = SVE_SIG_PREG_SIZE(vq); vq 664 arch/um/drivers/virtio_uml.c static bool vu_notify(struct virtqueue *vq) vq 666 arch/um/drivers/virtio_uml.c struct virtio_uml_vq_info *info = vq->priv; vq 678 arch/um/drivers/virtio_uml.c struct virtqueue *vq = opaque; vq 679 arch/um/drivers/virtio_uml.c struct virtio_uml_vq_info *info = vq->priv; vq 687 arch/um/drivers/virtio_uml.c ret |= vring_interrupt(irq, vq); vq 731 arch/um/drivers/virtio_uml.c static void vu_del_vq(struct virtqueue *vq) vq 733 arch/um/drivers/virtio_uml.c struct virtio_uml_vq_info *info = vq->priv; vq 735 arch/um/drivers/virtio_uml.c um_free_irq(VIRTIO_IRQ, vq); vq 740 arch/um/drivers/virtio_uml.c vring_del_virtqueue(vq); vq 747 arch/um/drivers/virtio_uml.c struct virtqueue *vq, *n; vq 751 arch/um/drivers/virtio_uml.c list_for_each_entry_reverse(vq, &vdev->vqs, list) vq 752 arch/um/drivers/virtio_uml.c WARN_ON(vhost_user_set_vring_enable(vu_dev, vq->index, false)); vq 757 arch/um/drivers/virtio_uml.c list_for_each_entry_safe(vq, n, &vdev->vqs, list) vq 758 arch/um/drivers/virtio_uml.c vu_del_vq(vq); vq 762 arch/um/drivers/virtio_uml.c struct virtqueue *vq) vq 764 arch/um/drivers/virtio_uml.c struct virtio_uml_vq_info *info = vq->priv; vq 775 arch/um/drivers/virtio_uml.c vu_interrupt, IRQF_SHARED, info->name, vq); vq 779 arch/um/drivers/virtio_uml.c rc = vhost_user_set_vring_call(vu_dev, vq->index, call_fds[1]); vq 786 arch/um/drivers/virtio_uml.c um_free_irq(VIRTIO_IRQ, vq); vq 803 arch/um/drivers/virtio_uml.c struct virtqueue *vq; vq 815 arch/um/drivers/virtio_uml.c vq = vring_create_virtqueue(index, num, PAGE_SIZE, vdev, true, true, vq 817 arch/um/drivers/virtio_uml.c if (!vq) { vq 821 arch/um/drivers/virtio_uml.c vq->priv = info; vq 822 arch/um/drivers/virtio_uml.c num = virtqueue_get_vring_size(vq); vq 829 arch/um/drivers/virtio_uml.c rc = vu_setup_vq_call_fd(vu_dev, vq); vq 842 arch/um/drivers/virtio_uml.c virtqueue_get_desc_addr(vq), vq 843 arch/um/drivers/virtio_uml.c virtqueue_get_used_addr(vq), vq 844 arch/um/drivers/virtio_uml.c virtqueue_get_avail_addr(vq), vq 849 arch/um/drivers/virtio_uml.c return vq; vq 852 arch/um/drivers/virtio_uml.c um_free_irq(VIRTIO_IRQ, vq); vq 857 arch/um/drivers/virtio_uml.c vring_del_virtqueue(vq); vq 871 arch/um/drivers/virtio_uml.c struct virtqueue *vq; vq 891 arch/um/drivers/virtio_uml.c list_for_each_entry(vq, &vdev->vqs, list) { vq 892 arch/um/drivers/virtio_uml.c struct virtio_uml_vq_info *info = vq->priv; vq 894 arch/um/drivers/virtio_uml.c rc = vhost_user_set_vring_kick(vu_dev, vq->index, vq 899 arch/um/drivers/virtio_uml.c rc = vhost_user_set_vring_enable(vu_dev, vq->index, true); vq 30 drivers/block/virtio_blk.c struct virtqueue *vq; vq 104 drivers/block/virtio_blk.c static int virtblk_add_req_scsi(struct virtqueue *vq, struct virtblk_req *vbr, vq 116 drivers/block/virtio_blk.c if (vbr->out_hdr.type & cpu_to_virtio32(vq->vdev, VIRTIO_BLK_T_OUT)) vq 129 drivers/block/virtio_blk.c return virtqueue_add_sgs(vq, sgs, num_out, num_in, vbr, GFP_ATOMIC); vq 159 drivers/block/virtio_blk.c static inline int virtblk_add_req_scsi(struct virtqueue *vq, vq 171 drivers/block/virtio_blk.c static int virtblk_add_req(struct virtqueue *vq, struct virtblk_req *vbr, vq 181 drivers/block/virtio_blk.c if (vbr->out_hdr.type & cpu_to_virtio32(vq->vdev, VIRTIO_BLK_T_OUT)) vq 190 drivers/block/virtio_blk.c return virtqueue_add_sgs(vq, sgs, num_out, num_in, vbr, GFP_ATOMIC); vq 245 drivers/block/virtio_blk.c static void virtblk_done(struct virtqueue *vq) vq 247 drivers/block/virtio_blk.c struct virtio_blk *vblk = vq->vdev->priv; vq 249 drivers/block/virtio_blk.c int qid = vq->index; vq 256 drivers/block/virtio_blk.c virtqueue_disable_cb(vq); vq 257 drivers/block/virtio_blk.c while ((vbr = virtqueue_get_buf(vblk->vqs[qid].vq, &len)) != NULL) { vq 263 drivers/block/virtio_blk.c if (unlikely(virtqueue_is_broken(vq))) vq 265 drivers/block/virtio_blk.c } while (!virtqueue_enable_cb(vq)); vq 276 drivers/block/virtio_blk.c struct virtio_blk_vq *vq = &vblk->vqs[hctx->queue_num]; vq 279 drivers/block/virtio_blk.c spin_lock_irq(&vq->lock); vq 280 drivers/block/virtio_blk.c kick = virtqueue_kick_prepare(vq->vq); vq 281 drivers/block/virtio_blk.c spin_unlock_irq(&vq->lock); vq 284 drivers/block/virtio_blk.c virtqueue_notify(vq->vq); vq 353 drivers/block/virtio_blk.c err = virtblk_add_req_scsi(vblk->vqs[qid].vq, vbr, vbr->sg, num); vq 355 drivers/block/virtio_blk.c err = virtblk_add_req(vblk->vqs[qid].vq, vbr, vbr->sg, num); vq 357 drivers/block/virtio_blk.c virtqueue_kick(vblk->vqs[qid].vq); vq 374 drivers/block/virtio_blk.c if (bd->last && virtqueue_kick_prepare(vblk->vqs[qid].vq)) vq 379 drivers/block/virtio_blk.c virtqueue_notify(vblk->vqs[qid].vq); vq 616 drivers/block/virtio_blk.c vblk->vqs[i].vq = vqs[i]; vq 857 drivers/block/virtio_blk.c virtblk_queue_depth = vblk->vqs[0].vq->num_free; vq 19 drivers/char/hw_random/virtio-rng.c struct virtqueue *vq; vq 29 drivers/char/hw_random/virtio-rng.c static void random_recv_done(struct virtqueue *vq) vq 31 drivers/char/hw_random/virtio-rng.c struct virtrng_info *vi = vq->vdev->priv; vq 34 drivers/char/hw_random/virtio-rng.c if (!virtqueue_get_buf(vi->vq, &vi->data_avail)) vq 48 drivers/char/hw_random/virtio-rng.c virtqueue_add_inbuf(vi->vq, &sg, 1, buf, GFP_KERNEL); vq 50 drivers/char/hw_random/virtio-rng.c virtqueue_kick(vi->vq); vq 114 drivers/char/hw_random/virtio-rng.c vi->vq = virtio_find_single_vq(vdev, random_recv_done, "input"); vq 115 drivers/char/hw_random/virtio-rng.c if (IS_ERR(vi->vq)) { vq 116 drivers/char/hw_random/virtio-rng.c err = PTR_ERR(vi->vq); vq 316 drivers/char/virtio_console.c struct virtqueue *vq) vq 323 drivers/char/virtio_console.c if (port->in_vq == vq || port->out_vq == vq) vq 491 drivers/char/virtio_console.c static int add_inbuf(struct virtqueue *vq, struct port_buffer *buf) vq 498 drivers/char/virtio_console.c ret = virtqueue_add_inbuf(vq, sg, 1, buf, GFP_ATOMIC); vq 499 drivers/char/virtio_console.c virtqueue_kick(vq); vq 501 drivers/char/virtio_console.c ret = vq->num_free; vq 551 drivers/char/virtio_console.c struct virtqueue *vq; vq 557 drivers/char/virtio_console.c vq = portdev->c_ovq; vq 567 drivers/char/virtio_console.c if (virtqueue_add_outbuf(vq, sg, 1, &portdev->cpkt, GFP_ATOMIC) == 0) { vq 568 drivers/char/virtio_console.c virtqueue_kick(vq); vq 569 drivers/char/virtio_console.c while (!virtqueue_get_buf(vq, &len) vq 570 drivers/char/virtio_console.c && !virtqueue_is_broken(vq)) vq 1328 drivers/char/virtio_console.c static int fill_queue(struct virtqueue *vq, spinlock_t *lock) vq 1336 drivers/char/virtio_console.c buf = alloc_buf(vq->vdev, PAGE_SIZE, 0); vq 1341 drivers/char/virtio_console.c ret = add_inbuf(vq, buf); vq 1706 drivers/char/virtio_console.c struct virtqueue *vq; vq 1711 drivers/char/virtio_console.c vq = portdev->c_ivq; vq 1714 drivers/char/virtio_console.c while ((buf = virtqueue_get_buf(vq, &len))) { vq 1720 drivers/char/virtio_console.c handle_control_message(vq->vdev, portdev, buf); vq 1732 drivers/char/virtio_console.c static void flush_bufs(struct virtqueue *vq, bool can_sleep) vq 1737 drivers/char/virtio_console.c while ((buf = virtqueue_get_buf(vq, &len))) vq 1741 drivers/char/virtio_console.c static void out_intr(struct virtqueue *vq) vq 1745 drivers/char/virtio_console.c port = find_port_by_vq(vq->vdev->priv, vq); vq 1747 drivers/char/virtio_console.c flush_bufs(vq, false); vq 1754 drivers/char/virtio_console.c static void in_intr(struct virtqueue *vq) vq 1759 drivers/char/virtio_console.c port = find_port_by_vq(vq->vdev->priv, vq); vq 1761 drivers/char/virtio_console.c flush_bufs(vq, false); vq 1799 drivers/char/virtio_console.c static void control_intr(struct virtqueue *vq) vq 1803 drivers/char/virtio_console.c portdev = vq->vdev->priv; vq 1939 drivers/char/virtio_console.c struct virtqueue *vq; vq 1941 drivers/char/virtio_console.c virtio_device_for_each_vq(portdev->vdev, vq) { vq 1944 drivers/char/virtio_console.c flush_bufs(vq, true); vq 1945 drivers/char/virtio_console.c while ((buf = virtqueue_detach_unused_buf(vq))) vq 197 drivers/crypto/cavium/cpt/cpt_hw_types.h u64 vq:8; vq 199 drivers/crypto/cavium/cpt/cpt_hw_types.h u64 vq:8; vq 468 drivers/crypto/virtio/virtio_crypto_algs.c err = virtqueue_add_sgs(data_vq->vq, sgs, num_out, vq 470 drivers/crypto/virtio/virtio_crypto_algs.c virtqueue_kick(data_vq->vq); vq 575 drivers/crypto/virtio/virtio_crypto_algs.c virtqueue_kick(data_vq->vq); vq 21 drivers/crypto/virtio/virtio_crypto_common.h struct virtqueue *vq; vq 25 drivers/crypto/virtio/virtio_crypto_core.c static void virtcrypto_dataq_callback(struct virtqueue *vq) vq 27 drivers/crypto/virtio/virtio_crypto_core.c struct virtio_crypto *vcrypto = vq->vdev->priv; vq 31 drivers/crypto/virtio/virtio_crypto_core.c unsigned int qid = vq->index; vq 35 drivers/crypto/virtio/virtio_crypto_core.c virtqueue_disable_cb(vq); vq 36 drivers/crypto/virtio/virtio_crypto_core.c while ((vc_req = virtqueue_get_buf(vq, &len)) != NULL) { vq 44 drivers/crypto/virtio/virtio_crypto_core.c } while (!virtqueue_enable_cb(vq)); vq 95 drivers/crypto/virtio/virtio_crypto_core.c vi->data_vq[i].vq = vqs[i]; vq 137 drivers/crypto/virtio/virtio_crypto_core.c virtqueue_set_affinity(vi->data_vq[i].vq, NULL); vq 164 drivers/crypto/virtio/virtio_crypto_core.c virtqueue_set_affinity(vcrypto->data_vq[i].vq, cpumask_of(cpu)); vq 420 drivers/crypto/virtio/virtio_crypto_core.c struct virtqueue *vq; vq 423 drivers/crypto/virtio/virtio_crypto_core.c vq = vcrypto->data_vq[i].vq; vq 424 drivers/crypto/virtio/virtio_crypto_core.c while ((vc_req = virtqueue_detach_unused_buf(vq)) != NULL) { vq 155 drivers/gpu/drm/virtio/virtgpu_drv.h struct virtqueue *vq; vq 321 drivers/gpu/drm/virtio/virtgpu_drv.h void virtio_gpu_ctrl_ack(struct virtqueue *vq); vq 322 drivers/gpu/drm/virtio/virtgpu_drv.h void virtio_gpu_cursor_ack(struct virtqueue *vq); vq 323 drivers/gpu/drm/virtio/virtgpu_drv.h void virtio_gpu_fence_ack(struct virtqueue *vq); vq 168 drivers/gpu/drm/virtio/virtgpu_kms.c vgdev->ctrlq.vq = vqs[0]; vq 169 drivers/gpu/drm/virtio/virtgpu_kms.c vgdev->cursorq.vq = vqs[1]; vq 12 drivers/gpu/drm/virtio/virtgpu_trace.h TP_PROTO(struct virtqueue *vq, struct virtio_gpu_ctrl_hdr *hdr), vq 13 drivers/gpu/drm/virtio/virtgpu_trace.h TP_ARGS(vq, hdr), vq 16 drivers/gpu/drm/virtio/virtgpu_trace.h __field(unsigned int, vq) vq 24 drivers/gpu/drm/virtio/virtgpu_trace.h __entry->dev = vq->vdev->index; vq 25 drivers/gpu/drm/virtio/virtgpu_trace.h __entry->vq = vq->index; vq 26 drivers/gpu/drm/virtio/virtgpu_trace.h __entry->name = vq->name; vq 33 drivers/gpu/drm/virtio/virtgpu_trace.h __entry->dev, __entry->vq, __entry->name, vq 39 drivers/gpu/drm/virtio/virtgpu_trace.h TP_PROTO(struct virtqueue *vq, struct virtio_gpu_ctrl_hdr *hdr), vq 40 drivers/gpu/drm/virtio/virtgpu_trace.h TP_ARGS(vq, hdr) vq 44 drivers/gpu/drm/virtio/virtgpu_trace.h TP_PROTO(struct virtqueue *vq, struct virtio_gpu_ctrl_hdr *hdr), vq 45 drivers/gpu/drm/virtio/virtgpu_trace.h TP_ARGS(vq, hdr) vq 43 drivers/gpu/drm/virtio/virtgpu_vq.c void virtio_gpu_ctrl_ack(struct virtqueue *vq) vq 45 drivers/gpu/drm/virtio/virtgpu_vq.c struct drm_device *dev = vq->vdev->priv; vq 51 drivers/gpu/drm/virtio/virtgpu_vq.c void virtio_gpu_cursor_ack(struct virtqueue *vq) vq 53 drivers/gpu/drm/virtio/virtgpu_vq.c struct drm_device *dev = vq->vdev->priv; vq 162 drivers/gpu/drm/virtio/virtgpu_vq.c static void reclaim_vbufs(struct virtqueue *vq, struct list_head *reclaim_list) vq 168 drivers/gpu/drm/virtio/virtgpu_vq.c while ((vbuf = virtqueue_get_buf(vq, &len))) { vq 189 drivers/gpu/drm/virtio/virtgpu_vq.c virtqueue_disable_cb(vgdev->ctrlq.vq); vq 190 drivers/gpu/drm/virtio/virtgpu_vq.c reclaim_vbufs(vgdev->ctrlq.vq, &reclaim_list); vq 192 drivers/gpu/drm/virtio/virtgpu_vq.c } while (!virtqueue_enable_cb(vgdev->ctrlq.vq)); vq 198 drivers/gpu/drm/virtio/virtgpu_vq.c trace_virtio_gpu_cmd_response(vgdev->ctrlq.vq, resp); vq 243 drivers/gpu/drm/virtio/virtgpu_vq.c virtqueue_disable_cb(vgdev->cursorq.vq); vq 244 drivers/gpu/drm/virtio/virtgpu_vq.c reclaim_vbufs(vgdev->cursorq.vq, &reclaim_list); vq 245 drivers/gpu/drm/virtio/virtgpu_vq.c } while (!virtqueue_enable_cb(vgdev->cursorq.vq)); vq 260 drivers/gpu/drm/virtio/virtgpu_vq.c struct virtqueue *vq = vgdev->ctrlq.vq; vq 285 drivers/gpu/drm/virtio/virtgpu_vq.c ret = virtqueue_add_sgs(vq, sgs, outcnt, incnt, vbuf, GFP_ATOMIC); vq 288 drivers/gpu/drm/virtio/virtgpu_vq.c wait_event(vgdev->ctrlq.ack_queue, vq->num_free >= outcnt + incnt); vq 292 drivers/gpu/drm/virtio/virtgpu_vq.c trace_virtio_gpu_cmd_queue(vq, vq 295 drivers/gpu/drm/virtio/virtgpu_vq.c virtqueue_kick(vq); vq 299 drivers/gpu/drm/virtio/virtgpu_vq.c ret = vq->num_free; vq 319 drivers/gpu/drm/virtio/virtgpu_vq.c struct virtqueue *vq = vgdev->ctrlq.vq; vq 333 drivers/gpu/drm/virtio/virtgpu_vq.c if (vq->num_free < 3) { vq 335 drivers/gpu/drm/virtio/virtgpu_vq.c wait_event(vgdev->ctrlq.ack_queue, vq->num_free >= 3); vq 349 drivers/gpu/drm/virtio/virtgpu_vq.c struct virtqueue *vq = vgdev->cursorq.vq; vq 363 drivers/gpu/drm/virtio/virtgpu_vq.c ret = virtqueue_add_sgs(vq, sgs, outcnt, 0, vbuf, GFP_ATOMIC); vq 366 drivers/gpu/drm/virtio/virtgpu_vq.c wait_event(vgdev->cursorq.ack_queue, vq->num_free >= outcnt); vq 370 drivers/gpu/drm/virtio/virtgpu_vq.c trace_virtio_gpu_cmd_queue(vq, vq 373 drivers/gpu/drm/virtio/virtgpu_vq.c virtqueue_kick(vq); vq 379 drivers/gpu/drm/virtio/virtgpu_vq.c ret = vq->num_free; vq 901 drivers/input/touchscreen/sur40.c static int sur40_start_streaming(struct vb2_queue *vq, unsigned int count) vq 903 drivers/input/touchscreen/sur40.c struct sur40_state *sur40 = vb2_get_drv_priv(vq); vq 913 drivers/input/touchscreen/sur40.c static void sur40_stop_streaming(struct vb2_queue *vq) vq 915 drivers/input/touchscreen/sur40.c struct sur40_state *sur40 = vb2_get_drv_priv(vq); vq 916 drivers/input/touchscreen/sur40.c vb2_wait_for_all_buffers(vq); vq 160 drivers/iommu/virtio-iommu.c struct virtqueue *vq = viommu->vqs[VIOMMU_REQUEST_VQ]; vq 164 drivers/iommu/virtio-iommu.c virtqueue_kick(vq); vq 168 drivers/iommu/virtio-iommu.c req = virtqueue_get_buf(vq, &len); vq 226 drivers/iommu/virtio-iommu.c struct virtqueue *vq = viommu->vqs[VIOMMU_REQUEST_VQ]; vq 248 drivers/iommu/virtio-iommu.c ret = virtqueue_add_sgs(vq, sg, 1, 1, req, GFP_ATOMIC); vq 252 drivers/iommu/virtio-iommu.c ret = virtqueue_add_sgs(vq, sg, 1, 1, req, GFP_ATOMIC); vq 559 drivers/iommu/virtio-iommu.c static void viommu_event_handler(struct virtqueue *vq) vq 565 drivers/iommu/virtio-iommu.c struct viommu_dev *viommu = vq->vdev->priv; vq 567 drivers/iommu/virtio-iommu.c while ((evt = virtqueue_get_buf(vq, &len)) != NULL) { vq 577 drivers/iommu/virtio-iommu.c ret = virtqueue_add_inbuf(vq, sg, 1, evt, GFP_ATOMIC); vq 582 drivers/iommu/virtio-iommu.c virtqueue_kick(vq); vq 989 drivers/iommu/virtio-iommu.c struct virtqueue *vq = viommu->vqs[VIOMMU_EVENT_VQ]; vq 990 drivers/iommu/virtio-iommu.c size_t nr_evts = vq->num_free; vq 999 drivers/iommu/virtio-iommu.c ret = virtqueue_add_inbuf(vq, sg, 1, &evts[i], GFP_KERNEL); vq 1150 drivers/media/common/videobuf2/videobuf2-v4l2.c void vb2_ops_wait_prepare(struct vb2_queue *vq) vq 1152 drivers/media/common/videobuf2/videobuf2-v4l2.c mutex_unlock(vq->lock); vq 1156 drivers/media/common/videobuf2/videobuf2-v4l2.c void vb2_ops_wait_finish(struct vb2_queue *vq) vq 1158 drivers/media/common/videobuf2/videobuf2-v4l2.c mutex_lock(vq->lock); vq 33 drivers/media/dvb-core/dvb_vb2.c static int _queue_setup(struct vb2_queue *vq, vq 37 drivers/media/dvb-core/dvb_vb2.c struct dvb_vb2_ctx *ctx = vb2_get_drv_priv(vq); vq 84 drivers/media/dvb-core/dvb_vb2.c static int _start_streaming(struct vb2_queue *vq, unsigned int count) vq 86 drivers/media/dvb-core/dvb_vb2.c struct dvb_vb2_ctx *ctx = vb2_get_drv_priv(vq); vq 92 drivers/media/dvb-core/dvb_vb2.c static void _stop_streaming(struct vb2_queue *vq) vq 94 drivers/media/dvb-core/dvb_vb2.c struct dvb_vb2_ctx *ctx = vb2_get_drv_priv(vq); vq 110 drivers/media/dvb-core/dvb_vb2.c static void _dmxdev_lock(struct vb2_queue *vq) vq 112 drivers/media/dvb-core/dvb_vb2.c struct dvb_vb2_ctx *ctx = vb2_get_drv_priv(vq); vq 118 drivers/media/dvb-core/dvb_vb2.c static void _dmxdev_unlock(struct vb2_queue *vq) vq 120 drivers/media/dvb-core/dvb_vb2.c struct dvb_vb2_ctx *ctx = vb2_get_drv_priv(vq); vq 433 drivers/media/dvb-frontends/rtl2832_sdr.c static int rtl2832_sdr_queue_setup(struct vb2_queue *vq, vq 437 drivers/media/dvb-frontends/rtl2832_sdr.c struct rtl2832_sdr_dev *dev = vb2_get_drv_priv(vq); vq 443 drivers/media/dvb-frontends/rtl2832_sdr.c if (vq->num_buffers + *nbuffers < 8) vq 444 drivers/media/dvb-frontends/rtl2832_sdr.c *nbuffers = 8 - vq->num_buffers; vq 844 drivers/media/dvb-frontends/rtl2832_sdr.c static int rtl2832_sdr_start_streaming(struct vb2_queue *vq, unsigned int count) vq 846 drivers/media/dvb-frontends/rtl2832_sdr.c struct rtl2832_sdr_dev *dev = vb2_get_drv_priv(vq); vq 905 drivers/media/dvb-frontends/rtl2832_sdr.c static void rtl2832_sdr_stop_streaming(struct vb2_queue *vq) vq 907 drivers/media/dvb-frontends/rtl2832_sdr.c struct rtl2832_sdr_dev *dev = vb2_get_drv_priv(vq); vq 397 drivers/media/i2c/video-i2c.c static int queue_setup(struct vb2_queue *vq, vq 401 drivers/media/i2c/video-i2c.c struct video_i2c_data *data = vb2_get_drv_priv(vq); vq 404 drivers/media/i2c/video-i2c.c if (vq->num_buffers + *nbuffers < 2) vq 491 drivers/media/i2c/video-i2c.c static void video_i2c_del_list(struct vb2_queue *vq, enum vb2_buffer_state state) vq 493 drivers/media/i2c/video-i2c.c struct video_i2c_data *data = vb2_get_drv_priv(vq); vq 506 drivers/media/i2c/video-i2c.c static int start_streaming(struct vb2_queue *vq, unsigned int count) vq 508 drivers/media/i2c/video-i2c.c struct video_i2c_data *data = vb2_get_drv_priv(vq); vq 536 drivers/media/i2c/video-i2c.c video_i2c_del_list(vq, VB2_BUF_STATE_QUEUED); vq 541 drivers/media/i2c/video-i2c.c static void stop_streaming(struct vb2_queue *vq) vq 543 drivers/media/i2c/video-i2c.c struct video_i2c_data *data = vb2_get_drv_priv(vq); vq 553 drivers/media/i2c/video-i2c.c video_i2c_del_list(vq, VB2_BUF_STATE_ERROR); vq 123 drivers/media/pci/dt3155/dt3155.c dt3155_queue_setup(struct vb2_queue *vq, vq 128 drivers/media/pci/dt3155/dt3155.c struct dt3155_priv *pd = vb2_get_drv_priv(vq); vq 131 drivers/media/pci/dt3155/dt3155.c if (vq->num_buffers + *nbuffers < 2) vq 132 drivers/media/pci/dt3155/dt3155.c *nbuffers = 2 - vq->num_buffers; vq 806 drivers/media/pci/intel/ipu3/ipu3-cio2.c static int cio2_vb2_queue_setup(struct vb2_queue *vq, vq 812 drivers/media/pci/intel/ipu3/ipu3-cio2.c struct cio2_device *cio2 = vb2_get_drv_priv(vq); vq 813 drivers/media/pci/intel/ipu3/ipu3-cio2.c struct cio2_queue *q = vb2q_to_cio2_queue(vq); vq 987 drivers/media/pci/intel/ipu3/ipu3-cio2.c static int cio2_vb2_start_streaming(struct vb2_queue *vq, unsigned int count) vq 989 drivers/media/pci/intel/ipu3/ipu3-cio2.c struct cio2_queue *q = vb2q_to_cio2_queue(vq); vq 990 drivers/media/pci/intel/ipu3/ipu3-cio2.c struct cio2_device *cio2 = vb2_get_drv_priv(vq); vq 1032 drivers/media/pci/intel/ipu3/ipu3-cio2.c static void cio2_vb2_stop_streaming(struct vb2_queue *vq) vq 1034 drivers/media/pci/intel/ipu3/ipu3-cio2.c struct cio2_queue *q = vb2q_to_cio2_queue(vq); vq 1035 drivers/media/pci/intel/ipu3/ipu3-cio2.c struct cio2_device *cio2 = vb2_get_drv_priv(vq); vq 432 drivers/media/pci/intel/ipu3/ipu3-cio2.h static inline struct cio2_queue *vb2q_to_cio2_queue(struct vb2_queue *vq) vq 434 drivers/media/pci/intel/ipu3/ipu3-cio2.h return container_of(vq, struct cio2_queue, vbq); vq 284 drivers/media/pci/netup_unidvb/netup_unidvb_core.c static int netup_unidvb_queue_setup(struct vb2_queue *vq, vq 290 drivers/media/pci/netup_unidvb/netup_unidvb_core.c struct netup_dma *dma = vb2_get_drv_priv(vq); vq 295 drivers/media/pci/netup_unidvb/netup_unidvb_core.c if (vq->num_buffers + *nbuffers < VIDEO_MAX_FRAME) vq 296 drivers/media/pci/netup_unidvb/netup_unidvb_core.c *nbuffers = VIDEO_MAX_FRAME - vq->num_buffers; vq 31 drivers/media/pci/saa7134/saa7134-empress.c static int start_streaming(struct vb2_queue *vq, unsigned int count) vq 33 drivers/media/pci/saa7134/saa7134-empress.c struct saa7134_dmaqueue *dmaq = vq->drv_priv; vq 38 drivers/media/pci/saa7134/saa7134-empress.c err = saa7134_ts_start_streaming(vq, count); vq 59 drivers/media/pci/saa7134/saa7134-empress.c static void stop_streaming(struct vb2_queue *vq) vq 61 drivers/media/pci/saa7134/saa7134-empress.c struct saa7134_dmaqueue *dmaq = vq->drv_priv; vq 64 drivers/media/pci/saa7134/saa7134-empress.c saa7134_ts_stop_streaming(vq); vq 125 drivers/media/pci/saa7134/saa7134-ts.c int saa7134_ts_start_streaming(struct vb2_queue *vq, unsigned int count) vq 127 drivers/media/pci/saa7134/saa7134-ts.c struct saa7134_dmaqueue *dmaq = vq->drv_priv; vq 154 drivers/media/pci/saa7134/saa7134-ts.c void saa7134_ts_stop_streaming(struct vb2_queue *vq) vq 156 drivers/media/pci/saa7134/saa7134-ts.c struct saa7134_dmaqueue *dmaq = vq->drv_priv; vq 976 drivers/media/pci/saa7134/saa7134-video.c int saa7134_vb2_start_streaming(struct vb2_queue *vq, unsigned int count) vq 978 drivers/media/pci/saa7134/saa7134-video.c struct saa7134_dmaqueue *dmaq = vq->drv_priv; vq 1018 drivers/media/pci/saa7134/saa7134-video.c void saa7134_vb2_stop_streaming(struct vb2_queue *vq) vq 1020 drivers/media/pci/saa7134/saa7134-video.c struct saa7134_dmaqueue *dmaq = vq->drv_priv; vq 807 drivers/media/pci/saa7134/saa7134.h int saa7134_vb2_start_streaming(struct vb2_queue *vq, unsigned int count); vq 808 drivers/media/pci/saa7134/saa7134.h void saa7134_vb2_stop_streaming(struct vb2_queue *vq); vq 847 drivers/media/pci/saa7134/saa7134.h int saa7134_ts_start_streaming(struct vb2_queue *vq, unsigned int count); vq 848 drivers/media/pci/saa7134/saa7134.h void saa7134_ts_stop_streaming(struct vb2_queue *vq); vq 672 drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c struct vb2_queue *vq = vb->vb2_queue; vq 673 drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c struct solo_enc_dev *solo_enc = vb2_get_drv_priv(vq); vq 352 drivers/media/pci/solo6x10/solo6x10-v4l2.c struct vb2_queue *vq = vb->vb2_queue; vq 353 drivers/media/pci/solo6x10/solo6x10-v4l2.c struct solo_dev *solo_dev = vb2_get_drv_priv(vq); vq 252 drivers/media/pci/sta2x11/sta2x11_vip.c static int queue_setup(struct vb2_queue *vq, vq 256 drivers/media/pci/sta2x11/sta2x11_vip.c struct sta2x11_vip *vip = vb2_get_drv_priv(vq); vq 331 drivers/media/pci/sta2x11/sta2x11_vip.c static int start_streaming(struct vb2_queue *vq, unsigned int count) vq 333 drivers/media/pci/sta2x11/sta2x11_vip.c struct sta2x11_vip *vip = vb2_get_drv_priv(vq); vq 347 drivers/media/pci/sta2x11/sta2x11_vip.c static void stop_streaming(struct vb2_queue *vq) vq 349 drivers/media/pci/sta2x11/sta2x11_vip.c struct sta2x11_vip *vip = vb2_get_drv_priv(vq); vq 198 drivers/media/pci/tw5864/tw5864-video.c struct vb2_queue *vq = vb->vb2_queue; vq 199 drivers/media/pci/tw5864/tw5864-video.c struct tw5864_input *dev = vb2_get_drv_priv(vq); vq 406 drivers/media/pci/tw68/tw68-video.c struct vb2_queue *vq = vb->vb2_queue; vq 407 drivers/media/pci/tw68/tw68-video.c struct tw68_dev *dev = vb2_get_drv_priv(vq); vq 441 drivers/media/pci/tw68/tw68-video.c struct vb2_queue *vq = vb->vb2_queue; vq 442 drivers/media/pci/tw68/tw68-video.c struct tw68_dev *dev = vb2_get_drv_priv(vq); vq 484 drivers/media/pci/tw68/tw68-video.c struct vb2_queue *vq = vb->vb2_queue; vq 485 drivers/media/pci/tw68/tw68-video.c struct tw68_dev *dev = vb2_get_drv_priv(vq); vq 422 drivers/media/pci/tw686x/tw686x-video.c static int tw686x_queue_setup(struct vb2_queue *vq, vq 426 drivers/media/pci/tw686x/tw686x-video.c struct tw686x_video_channel *vc = vb2_get_drv_priv(vq); vq 434 drivers/media/pci/tw686x/tw686x-video.c if (vq->num_buffers + *nbuffers < 3) vq 435 drivers/media/pci/tw686x/tw686x-video.c *nbuffers = 3 - vq->num_buffers; vq 493 drivers/media/pci/tw686x/tw686x-video.c static int tw686x_start_streaming(struct vb2_queue *vq, unsigned int count) vq 495 drivers/media/pci/tw686x/tw686x-video.c struct tw686x_video_channel *vc = vb2_get_drv_priv(vq); vq 545 drivers/media/pci/tw686x/tw686x-video.c static void tw686x_stop_streaming(struct vb2_queue *vq) vq 547 drivers/media/pci/tw686x/tw686x-video.c struct tw686x_video_channel *vc = vb2_get_drv_priv(vq); vq 1896 drivers/media/platform/am437x/am437x-vpfe.c static int vpfe_queue_setup(struct vb2_queue *vq, vq 1900 drivers/media/platform/am437x/am437x-vpfe.c struct vpfe_device *vpfe = vb2_get_drv_priv(vq); vq 1903 drivers/media/platform/am437x/am437x-vpfe.c if (vq->num_buffers + *nbuffers < 3) vq 1904 drivers/media/platform/am437x/am437x-vpfe.c *nbuffers = 3 - vq->num_buffers; vq 1969 drivers/media/platform/am437x/am437x-vpfe.c static int vpfe_start_streaming(struct vb2_queue *vq, unsigned int count) vq 1971 drivers/media/platform/am437x/am437x-vpfe.c struct vpfe_device *vpfe = vb2_get_drv_priv(vq); vq 2030 drivers/media/platform/am437x/am437x-vpfe.c static void vpfe_stop_streaming(struct vb2_queue *vq) vq 2032 drivers/media/platform/am437x/am437x-vpfe.c struct vpfe_device *vpfe = vb2_get_drv_priv(vq); vq 533 drivers/media/platform/atmel/atmel-isc-base.c static int isc_queue_setup(struct vb2_queue *vq, vq 537 drivers/media/platform/atmel/atmel-isc-base.c struct isc_device *isc = vb2_get_drv_priv(vq); vq 768 drivers/media/platform/atmel/atmel-isc-base.c static int isc_start_streaming(struct vb2_queue *vq, unsigned int count) vq 770 drivers/media/platform/atmel/atmel-isc-base.c struct isc_device *isc = vb2_get_drv_priv(vq); vq 828 drivers/media/platform/atmel/atmel-isc-base.c static void isc_stop_streaming(struct vb2_queue *vq) vq 830 drivers/media/platform/atmel/atmel-isc-base.c struct isc_device *isc = vb2_get_drv_priv(vq); vq 271 drivers/media/platform/atmel/atmel-isi.c static int queue_setup(struct vb2_queue *vq, vq 275 drivers/media/platform/atmel/atmel-isi.c struct atmel_isi *isi = vb2_get_drv_priv(vq); vq 419 drivers/media/platform/atmel/atmel-isi.c static int start_streaming(struct vb2_queue *vq, unsigned int count) vq 421 drivers/media/platform/atmel/atmel-isi.c struct atmel_isi *isi = vb2_get_drv_priv(vq); vq 474 drivers/media/platform/atmel/atmel-isi.c static void stop_streaming(struct vb2_queue *vq) vq 476 drivers/media/platform/atmel/atmel-isi.c struct atmel_isi *isi = vb2_get_drv_priv(vq); vq 689 drivers/media/platform/coda/coda-common.c struct vb2_queue *vq; vq 691 drivers/media/platform/coda/coda-common.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 692 drivers/media/platform/coda/coda-common.c if (!vq) vq 699 drivers/media/platform/coda/coda-common.c if (vb2_is_busy(vq)) { vq 701 drivers/media/platform/coda/coda-common.c __func__, v4l2_type_names[f->type], vq->num_buffers); vq 1575 drivers/media/platform/coda/coda-common.c static int coda_queue_setup(struct vb2_queue *vq, vq 1579 drivers/media/platform/coda/coda-common.c struct coda_ctx *ctx = vb2_get_drv_priv(vq); vq 1583 drivers/media/platform/coda/coda-common.c q_data = get_q_data(ctx, vq->type); vq 1733 drivers/media/platform/coda/coda-common.c struct vb2_queue *vq = vb->vb2_queue; vq 1742 drivers/media/platform/coda/coda-common.c if (ctx->bitstream.size && vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) { vq 1789 drivers/media/platform/coda/coda-common.c vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) vq 2330 drivers/media/platform/coda/coda-common.c static int coda_queue_init(struct coda_ctx *ctx, struct vb2_queue *vq) vq 2332 drivers/media/platform/coda/coda-common.c vq->drv_priv = ctx; vq 2333 drivers/media/platform/coda/coda-common.c vq->ops = &coda_qops; vq 2334 drivers/media/platform/coda/coda-common.c vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer); vq 2335 drivers/media/platform/coda/coda-common.c vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; vq 2336 drivers/media/platform/coda/coda-common.c vq->lock = &ctx->dev->dev_mutex; vq 2343 drivers/media/platform/coda/coda-common.c vq->allow_zero_bytesused = 1; vq 2349 drivers/media/platform/coda/coda-common.c vq->min_buffers_needed = 1; vq 2350 drivers/media/platform/coda/coda-common.c vq->dev = ctx->dev->dev; vq 2352 drivers/media/platform/coda/coda-common.c return vb2_queue_init(vq); vq 222 drivers/media/platform/davinci/vpbe_display.c vpbe_buffer_queue_setup(struct vb2_queue *vq, vq 228 drivers/media/platform/davinci/vpbe_display.c struct vpbe_layer *layer = vb2_get_drv_priv(vq); vq 234 drivers/media/platform/davinci/vpbe_display.c if (vq->num_buffers + *nbuffers < VPBE_DEFAULT_NUM_BUFS) vq 235 drivers/media/platform/davinci/vpbe_display.c *nbuffers = VPBE_DEFAULT_NUM_BUFS - vq->num_buffers; vq 270 drivers/media/platform/davinci/vpbe_display.c static int vpbe_start_streaming(struct vb2_queue *vq, unsigned int count) vq 272 drivers/media/platform/davinci/vpbe_display.c struct vpbe_layer *layer = vb2_get_drv_priv(vq); vq 313 drivers/media/platform/davinci/vpbe_display.c static void vpbe_stop_streaming(struct vb2_queue *vq) vq 315 drivers/media/platform/davinci/vpbe_display.c struct vpbe_layer *layer = vb2_get_drv_priv(vq); vq 320 drivers/media/platform/davinci/vpbe_display.c if (!vb2_is_streaming(vq)) vq 1155 drivers/media/platform/davinci/vpfe_capture.c static int vpfe_videobuf_setup(struct videobuf_queue *vq, vq 1159 drivers/media/platform/davinci/vpfe_capture.c struct vpfe_fh *fh = vq->priv_data; vq 1175 drivers/media/platform/davinci/vpfe_capture.c static int vpfe_videobuf_prepare(struct videobuf_queue *vq, vq 1179 drivers/media/platform/davinci/vpfe_capture.c struct vpfe_fh *fh = vq->priv_data; vq 1193 drivers/media/platform/davinci/vpfe_capture.c ret = videobuf_iolock(vq, vb, NULL); vq 1207 drivers/media/platform/davinci/vpfe_capture.c static void vpfe_videobuf_queue(struct videobuf_queue *vq, vq 1211 drivers/media/platform/davinci/vpfe_capture.c struct vpfe_fh *fh = vq->priv_data; vq 1226 drivers/media/platform/davinci/vpfe_capture.c static void vpfe_videobuf_release(struct videobuf_queue *vq, vq 1229 drivers/media/platform/davinci/vpfe_capture.c struct vpfe_fh *fh = vq->priv_data; vq 1242 drivers/media/platform/davinci/vpfe_capture.c videobuf_dma_contig_free(vq, vb); vq 109 drivers/media/platform/davinci/vpif_capture.c static int vpif_buffer_queue_setup(struct vb2_queue *vq, vq 113 drivers/media/platform/davinci/vpif_capture.c struct channel_obj *ch = vb2_get_drv_priv(vq); vq 125 drivers/media/platform/davinci/vpif_capture.c if (vq->num_buffers + *nbuffers < 3) vq 126 drivers/media/platform/davinci/vpif_capture.c *nbuffers = 3 - vq->num_buffers; vq 164 drivers/media/platform/davinci/vpif_capture.c static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) vq 168 drivers/media/platform/davinci/vpif_capture.c struct channel_obj *ch = vb2_get_drv_priv(vq); vq 256 drivers/media/platform/davinci/vpif_capture.c static void vpif_stop_streaming(struct vb2_queue *vq) vq 258 drivers/media/platform/davinci/vpif_capture.c struct channel_obj *ch = vb2_get_drv_priv(vq); vq 111 drivers/media/platform/davinci/vpif_display.c static int vpif_buffer_queue_setup(struct vb2_queue *vq, vq 115 drivers/media/platform/davinci/vpif_display.c struct channel_obj *ch = vb2_get_drv_priv(vq); vq 125 drivers/media/platform/davinci/vpif_display.c if (vq->num_buffers + *nbuffers < 3) vq 126 drivers/media/platform/davinci/vpif_display.c *nbuffers = 3 - vq->num_buffers; vq 164 drivers/media/platform/davinci/vpif_display.c static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count) vq 168 drivers/media/platform/davinci/vpif_display.c struct channel_obj *ch = vb2_get_drv_priv(vq); vq 251 drivers/media/platform/davinci/vpif_display.c static void vpif_stop_streaming(struct vb2_queue *vq) vq 253 drivers/media/platform/davinci/vpif_display.c struct channel_obj *ch = vb2_get_drv_priv(vq); vq 227 drivers/media/platform/exynos-gsc/gsc-m2m.c static int gsc_m2m_queue_setup(struct vb2_queue *vq, vq 231 drivers/media/platform/exynos-gsc/gsc-m2m.c struct gsc_ctx *ctx = vb2_get_drv_priv(vq); vq 235 drivers/media/platform/exynos-gsc/gsc-m2m.c frame = ctx_get_frame(ctx, vq->type); vq 326 drivers/media/platform/exynos-gsc/gsc-m2m.c struct vb2_queue *vq; vq 335 drivers/media/platform/exynos-gsc/gsc-m2m.c vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type); vq 337 drivers/media/platform/exynos-gsc/gsc-m2m.c if (vb2_is_streaming(vq)) { vq 339 drivers/media/platform/exynos4-is/fimc-capture.c static int queue_setup(struct vb2_queue *vq, vq 343 drivers/media/platform/exynos4-is/fimc-capture.c struct fimc_ctx *ctx = vq->drv_priv; vq 377 drivers/media/platform/exynos4-is/fimc-capture.c struct vb2_queue *vq = vb->vb2_queue; vq 378 drivers/media/platform/exynos4-is/fimc-capture.c struct fimc_ctx *ctx = vq->drv_priv; vq 38 drivers/media/platform/exynos4-is/fimc-isp-video.c static int isp_video_capture_queue_setup(struct vb2_queue *vq, vq 42 drivers/media/platform/exynos4-is/fimc-isp-video.c struct fimc_isp *isp = vb2_get_drv_priv(vq); vq 348 drivers/media/platform/exynos4-is/fimc-lite.c static int queue_setup(struct vb2_queue *vq, vq 352 drivers/media/platform/exynos4-is/fimc-lite.c struct fimc_lite *fimc = vq->drv_priv; vq 380 drivers/media/platform/exynos4-is/fimc-lite.c struct vb2_queue *vq = vb->vb2_queue; vq 381 drivers/media/platform/exynos4-is/fimc-lite.c struct fimc_lite *fimc = vq->drv_priv; vq 171 drivers/media/platform/exynos4-is/fimc-m2m.c static int fimc_queue_setup(struct vb2_queue *vq, vq 175 drivers/media/platform/exynos4-is/fimc-m2m.c struct fimc_ctx *ctx = vb2_get_drv_priv(vq); vq 179 drivers/media/platform/exynos4-is/fimc-m2m.c f = ctx_get_frame(ctx, vq->type); vq 347 drivers/media/platform/exynos4-is/fimc-m2m.c struct vb2_queue *vq; vq 355 drivers/media/platform/exynos4-is/fimc-m2m.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 357 drivers/media/platform/exynos4-is/fimc-m2m.c if (vb2_is_busy(vq)) { vq 363 drivers/media/platform/fsl-viu.c static int buffer_setup(struct videobuf_queue *vq, unsigned int *count, vq 366 drivers/media/platform/fsl-viu.c struct viu_fh *fh = vq->priv_data; vq 379 drivers/media/platform/fsl-viu.c static void free_buffer(struct videobuf_queue *vq, struct viu_buf *buf) vq 386 drivers/media/platform/fsl-viu.c videobuf_waiton(vq, &buf->vb, 0, 0); vq 388 drivers/media/platform/fsl-viu.c if (vq->int_ops && vq->int_ops->vaddr) vq 389 drivers/media/platform/fsl-viu.c vaddr = vq->int_ops->vaddr(vb); vq 392 drivers/media/platform/fsl-viu.c videobuf_dma_contig_free(vq, &buf->vb); vq 446 drivers/media/platform/fsl-viu.c static int buffer_prepare(struct videobuf_queue *vq, vq 450 drivers/media/platform/fsl-viu.c struct viu_fh *fh = vq->priv_data; vq 474 drivers/media/platform/fsl-viu.c rc = videobuf_iolock(vq, &buf->vb, NULL); vq 488 drivers/media/platform/fsl-viu.c free_buffer(vq, buf); vq 492 drivers/media/platform/fsl-viu.c static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) vq 495 drivers/media/platform/fsl-viu.c struct viu_fh *fh = vq->priv_data; vq 539 drivers/media/platform/fsl-viu.c static void buffer_release(struct videobuf_queue *vq, vq 543 drivers/media/platform/fsl-viu.c struct viu_fh *fh = vq->priv_data; vq 547 drivers/media/platform/fsl-viu.c free_buffer(vq, buf); vq 1080 drivers/media/platform/imx-pxp.c struct vb2_queue *vq; vq 1083 drivers/media/platform/imx-pxp.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 1084 drivers/media/platform/imx-pxp.c if (!vq) vq 1226 drivers/media/platform/imx-pxp.c struct vb2_queue *vq; vq 1228 drivers/media/platform/imx-pxp.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 1229 drivers/media/platform/imx-pxp.c if (!vq) vq 1236 drivers/media/platform/imx-pxp.c if (vb2_is_busy(vq)) { vq 1367 drivers/media/platform/imx-pxp.c static int pxp_queue_setup(struct vb2_queue *vq, vq 1371 drivers/media/platform/imx-pxp.c struct pxp_ctx *ctx = vb2_get_drv_priv(vq); vq 1375 drivers/media/platform/imx-pxp.c q_data = get_q_data(ctx, vq->type); vq 483 drivers/media/platform/m2m-deinterlace.c struct vb2_queue *vq; vq 486 drivers/media/platform/m2m-deinterlace.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 487 drivers/media/platform/m2m-deinterlace.c if (!vq) vq 581 drivers/media/platform/m2m-deinterlace.c struct vb2_queue *vq; vq 583 drivers/media/platform/m2m-deinterlace.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 584 drivers/media/platform/m2m-deinterlace.c if (!vq) vq 591 drivers/media/platform/m2m-deinterlace.c if (vb2_is_busy(vq)) { vq 731 drivers/media/platform/m2m-deinterlace.c static int deinterlace_queue_setup(struct vb2_queue *vq, vq 735 drivers/media/platform/m2m-deinterlace.c struct deinterlace_ctx *ctx = vb2_get_drv_priv(vq); vq 739 drivers/media/platform/m2m-deinterlace.c q_data = get_q_data(vq->type); vq 1092 drivers/media/platform/marvell-ccic/mcam-core.c static int mcam_vb_queue_setup(struct vb2_queue *vq, vq 1097 drivers/media/platform/marvell-ccic/mcam-core.c struct mcam_camera *cam = vb2_get_drv_priv(vq); vq 1130 drivers/media/platform/marvell-ccic/mcam-core.c static void mcam_vb_requeue_bufs(struct vb2_queue *vq, vq 1133 drivers/media/platform/marvell-ccic/mcam-core.c struct mcam_camera *cam = vb2_get_drv_priv(vq); vq 1157 drivers/media/platform/marvell-ccic/mcam-core.c static int mcam_vb_start_streaming(struct vb2_queue *vq, unsigned int count) vq 1159 drivers/media/platform/marvell-ccic/mcam-core.c struct mcam_camera *cam = vb2_get_drv_priv(vq); vq 1164 drivers/media/platform/marvell-ccic/mcam-core.c mcam_vb_requeue_bufs(vq, VB2_BUF_STATE_QUEUED); vq 1192 drivers/media/platform/marvell-ccic/mcam-core.c mcam_vb_requeue_bufs(vq, VB2_BUF_STATE_QUEUED); vq 1196 drivers/media/platform/marvell-ccic/mcam-core.c static void mcam_vb_stop_streaming(struct vb2_queue *vq) vq 1198 drivers/media/platform/marvell-ccic/mcam-core.c struct mcam_camera *cam = vb2_get_drv_priv(vq); vq 1215 drivers/media/platform/marvell-ccic/mcam-core.c mcam_vb_requeue_bufs(vq, VB2_BUF_STATE_ERROR); vq 1296 drivers/media/platform/marvell-ccic/mcam-core.c struct vb2_queue *vq = &cam->vb_queue; vq 1298 drivers/media/platform/marvell-ccic/mcam-core.c memset(vq, 0, sizeof(*vq)); vq 1299 drivers/media/platform/marvell-ccic/mcam-core.c vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; vq 1300 drivers/media/platform/marvell-ccic/mcam-core.c vq->drv_priv = cam; vq 1301 drivers/media/platform/marvell-ccic/mcam-core.c vq->lock = &cam->s_mutex; vq 1302 drivers/media/platform/marvell-ccic/mcam-core.c vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; vq 1303 drivers/media/platform/marvell-ccic/mcam-core.c vq->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ; vq 1304 drivers/media/platform/marvell-ccic/mcam-core.c vq->buf_struct_size = sizeof(struct mcam_vb_buffer); vq 1305 drivers/media/platform/marvell-ccic/mcam-core.c vq->dev = cam->dev; vq 1310 drivers/media/platform/marvell-ccic/mcam-core.c vq->ops = &mcam_vb2_ops; vq 1311 drivers/media/platform/marvell-ccic/mcam-core.c vq->mem_ops = &vb2_dma_contig_memops; vq 1318 drivers/media/platform/marvell-ccic/mcam-core.c vq->ops = &mcam_vb2_sg_ops; vq 1319 drivers/media/platform/marvell-ccic/mcam-core.c vq->mem_ops = &vb2_dma_sg_memops; vq 1328 drivers/media/platform/marvell-ccic/mcam-core.c vq->ops = &mcam_vb2_ops; vq 1329 drivers/media/platform/marvell-ccic/mcam-core.c vq->mem_ops = &vb2_vmalloc_memops; vq 1335 drivers/media/platform/marvell-ccic/mcam-core.c return vb2_queue_init(vq); vq 266 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c struct vb2_queue *vq; vq 273 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 274 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c if (!vq) vq 359 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c struct vb2_queue *vq; vq 366 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 367 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c if (!vq) vq 372 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c if (vb2_is_busy(vq)) { vq 508 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c struct vb2_queue *vq; vq 515 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c vq = v4l2_m2m_get_vq(fh->m2m_ctx, buf->type); vq 516 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c if (buf->index >= vq->num_buffers) { vq 521 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c vb = vb2_get_buffer(vq, buf->index); vq 551 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c static int mtk_mdp_m2m_queue_setup(struct vb2_queue *vq, vq 555 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c struct mtk_mdp_ctx *ctx = vb2_get_drv_priv(vq); vq 559 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c frame = mtk_mdp_ctx_get_frame(ctx, vq->type); vq 564 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c ctx->id, vq->type, *num_planes, *num_buffers, vq 693 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c struct vb2_queue *vq; vq 709 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type); vq 710 drivers/media/platform/mtk-mdp/mtk_mdp_m2m.c if (vb2_is_streaming(vq)) { vq 976 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c struct vb2_queue *vq; vq 979 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type); vq 980 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c if (!vq) { vq 1059 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c static int vb2ops_vdec_queue_setup(struct vb2_queue *vq, vq 1065 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c struct mtk_vcodec_ctx *ctx = vb2_get_drv_priv(vq); vq 1069 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c q_data = mtk_vdec_get_q_data(ctx, vq->type); vq 1072 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c mtk_v4l2_err("vq->type=%d err\n", vq->type); vq 1082 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) vq 1093 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c ctx->id, vq->type, *nplanes, *nbuffers, vq 420 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c struct vb2_queue *vq; vq 425 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type); vq 426 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c if (!vq) { vq 431 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c if (vb2_is_busy(vq)) { vq 482 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c struct vb2_queue *vq; vq 488 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type); vq 489 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c if (!vq) { vq 494 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c if (vb2_is_busy(vq)) { vq 550 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c struct vb2_queue *vq; vq 554 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type); vq 555 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c if (!vq) vq 746 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c static int vb2ops_venc_queue_setup(struct vb2_queue *vq, vq 752 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c struct mtk_vcodec_ctx *ctx = vb2_get_drv_priv(vq); vq 756 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c q_data = mtk_venc_get_q_data(ctx, vq->type); vq 429 drivers/media/platform/mx2_emmaprp.c struct vb2_queue *vq; vq 432 drivers/media/platform/mx2_emmaprp.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 433 drivers/media/platform/mx2_emmaprp.c if (!vq) vq 534 drivers/media/platform/mx2_emmaprp.c struct vb2_queue *vq; vq 537 drivers/media/platform/mx2_emmaprp.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 538 drivers/media/platform/mx2_emmaprp.c if (!vq) vq 545 drivers/media/platform/mx2_emmaprp.c if (vb2_is_busy(vq)) { vq 620 drivers/media/platform/mx2_emmaprp.c static int emmaprp_queue_setup(struct vb2_queue *vq, vq 624 drivers/media/platform/mx2_emmaprp.c struct emmaprp_ctx *ctx = vb2_get_drv_priv(vq); vq 628 drivers/media/platform/mx2_emmaprp.c q_data = get_q_data(ctx, vq->type); vq 642 drivers/media/platform/omap/omap_vout.c if (vb2_is_busy(&vout->vq)) vq 830 drivers/media/platform/omap/omap_vout.c if (vb2_is_busy(&vout->vq)) vq 940 drivers/media/platform/omap/omap_vout.c static int omap_vout_vb2_queue_setup(struct vb2_queue *vq, vq 945 drivers/media/platform/omap/omap_vout.c struct omap_vout_device *vout = vb2_get_drv_priv(vq); vq 948 drivers/media/platform/omap/omap_vout.c if (is_rotation_enabled(vout) && vq->num_buffers + *nbufs > VRFB_NUM_BUFS) { vq 949 drivers/media/platform/omap/omap_vout.c *nbufs = VRFB_NUM_BUFS - vq->num_buffers; vq 993 drivers/media/platform/omap/omap_vout.c static int omap_vout_vb2_start_streaming(struct vb2_queue *vq, unsigned int count) vq 995 drivers/media/platform/omap/omap_vout.c struct omap_vout_device *vout = vb2_get_drv_priv(vq); vq 1081 drivers/media/platform/omap/omap_vout.c static void omap_vout_vb2_stop_streaming(struct vb2_queue *vq) vq 1083 drivers/media/platform/omap/omap_vout.c struct omap_vout_device *vout = vb2_get_drv_priv(vq); vq 1313 drivers/media/platform/omap/omap_vout.c struct vb2_queue *vq; vq 1393 drivers/media/platform/omap/omap_vout.c vq = &vout->vq; vq 1394 drivers/media/platform/omap/omap_vout.c vq->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; vq 1395 drivers/media/platform/omap/omap_vout.c vq->io_modes = VB2_MMAP | VB2_DMABUF; vq 1396 drivers/media/platform/omap/omap_vout.c vq->drv_priv = vout; vq 1397 drivers/media/platform/omap/omap_vout.c vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; vq 1398 drivers/media/platform/omap/omap_vout.c vq->buf_struct_size = sizeof(struct omap_vout_buffer); vq 1399 drivers/media/platform/omap/omap_vout.c vq->dev = vfd->v4l2_dev->dev; vq 1401 drivers/media/platform/omap/omap_vout.c vq->ops = &omap_vout_vb2_ops; vq 1402 drivers/media/platform/omap/omap_vout.c vq->mem_ops = &vb2_dma_contig_memops; vq 1403 drivers/media/platform/omap/omap_vout.c vq->lock = &vout->lock; vq 1404 drivers/media/platform/omap/omap_vout.c vq->min_buffers_needed = 1; vq 1405 drivers/media/platform/omap/omap_vout.c vfd->queue = vq; vq 1407 drivers/media/platform/omap/omap_vout.c ret = vb2_queue_init(vq); vq 42 drivers/media/platform/omap/omap_vout_vrfb.c if (vout->vq.memory == V4L2_MEMORY_MMAP && i >= startindex) vq 177 drivers/media/platform/omap/omap_voutdef.h struct vb2_queue vq; vq 1498 drivers/media/platform/pxa_camera.c static int pxac_vb2_queue_setup(struct vb2_queue *vq, vq 1503 drivers/media/platform/pxa_camera.c struct pxa_camera_dev *pcdev = vb2_get_drv_priv(vq); vq 1508 drivers/media/platform/pxa_camera.c __func__, vq, *nbufs, *num_planes, size); vq 1533 drivers/media/platform/pxa_camera.c static int pxac_vb2_start_streaming(struct vb2_queue *vq, unsigned int count) vq 1535 drivers/media/platform/pxa_camera.c struct pxa_camera_dev *pcdev = vb2_get_drv_priv(vq); vq 1547 drivers/media/platform/pxa_camera.c static void pxac_vb2_stop_streaming(struct vb2_queue *vq) vq 1549 drivers/media/platform/pxa_camera.c struct pxa_camera_dev *pcdev = vb2_get_drv_priv(vq); vq 1575 drivers/media/platform/pxa_camera.c struct vb2_queue *vq = &pcdev->vb2_vq; vq 1577 drivers/media/platform/pxa_camera.c memset(vq, 0, sizeof(*vq)); vq 1578 drivers/media/platform/pxa_camera.c vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; vq 1579 drivers/media/platform/pxa_camera.c vq->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF; vq 1580 drivers/media/platform/pxa_camera.c vq->drv_priv = pcdev; vq 1581 drivers/media/platform/pxa_camera.c vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; vq 1582 drivers/media/platform/pxa_camera.c vq->buf_struct_size = sizeof(struct pxa_buffer); vq 1583 drivers/media/platform/pxa_camera.c vq->dev = pcdev->v4l2_dev.dev; vq 1585 drivers/media/platform/pxa_camera.c vq->ops = &pxac_vb2_ops; vq 1586 drivers/media/platform/pxa_camera.c vq->mem_ops = &vb2_dma_sg_memops; vq 1587 drivers/media/platform/pxa_camera.c vq->lock = &pcdev->mlock; vq 1589 drivers/media/platform/pxa_camera.c ret = vb2_queue_init(vq); vq 1591 drivers/media/platform/pxa_camera.c "vb2_queue_init(vq=%p): %d\n", vq, ret); vq 993 drivers/media/platform/rcar-vin/rcar-dma.c static int rvin_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, vq 998 drivers/media/platform/rcar-vin/rcar-dma.c struct rvin_dev *vin = vb2_get_drv_priv(vq); vq 1157 drivers/media/platform/rcar-vin/rcar-dma.c static int rvin_start_streaming(struct vb2_queue *vq, unsigned int count) vq 1159 drivers/media/platform/rcar-vin/rcar-dma.c struct rvin_dev *vin = vb2_get_drv_priv(vq); vq 1201 drivers/media/platform/rcar-vin/rcar-dma.c static void rvin_stop_streaming(struct vb2_queue *vq) vq 1203 drivers/media/platform/rcar-vin/rcar-dma.c struct rvin_dev *vin = vb2_get_drv_priv(vq); vq 423 drivers/media/platform/rcar_drif.c static int rcar_drif_queue_setup(struct vb2_queue *vq, vq 427 drivers/media/platform/rcar_drif.c struct rcar_drif_sdr *sdr = vb2_get_drv_priv(vq); vq 430 drivers/media/platform/rcar_drif.c if (vq->num_buffers + *num_buffers < 16) vq 431 drivers/media/platform/rcar_drif.c *num_buffers = 16 - vq->num_buffers; vq 769 drivers/media/platform/rcar_drif.c static int rcar_drif_start_streaming(struct vb2_queue *vq, unsigned int count) vq 771 drivers/media/platform/rcar_drif.c struct rcar_drif_sdr *sdr = vb2_get_drv_priv(vq); vq 833 drivers/media/platform/rcar_drif.c static void rcar_drif_stop_streaming(struct vb2_queue *vq) vq 835 drivers/media/platform/rcar_drif.c struct rcar_drif_sdr *sdr = vb2_get_drv_priv(vq); vq 1664 drivers/media/platform/rcar_fdp1.c struct vb2_queue *vq = v4l2_m2m_get_vq(m2m_ctx, f->type); vq 1666 drivers/media/platform/rcar_fdp1.c if (vb2_is_busy(vq)) { vq 1763 drivers/media/platform/rcar_fdp1.c static int fdp1_queue_setup(struct vb2_queue *vq, vq 1768 drivers/media/platform/rcar_fdp1.c struct fdp1_ctx *ctx = vb2_get_drv_priv(vq); vq 1772 drivers/media/platform/rcar_fdp1.c q_data = get_q_data(ctx, vq->type); vq 848 drivers/media/platform/rcar_jpu.c struct vb2_queue *vq; vq 855 drivers/media/platform/rcar_jpu.c vq = v4l2_m2m_get_vq(m2m_ctx, f->type); vq 856 drivers/media/platform/rcar_jpu.c if (!vq) vq 859 drivers/media/platform/rcar_jpu.c if (vb2_is_busy(vq)) { vq 1008 drivers/media/platform/rcar_jpu.c static int jpu_queue_setup(struct vb2_queue *vq, vq 1012 drivers/media/platform/rcar_jpu.c struct jpu_ctx *ctx = vb2_get_drv_priv(vq); vq 1016 drivers/media/platform/rcar_jpu.c q_data = jpu_get_q_data(ctx, vq->type); vq 1151 drivers/media/platform/rcar_jpu.c static int jpu_start_streaming(struct vb2_queue *vq, unsigned count) vq 1153 drivers/media/platform/rcar_jpu.c struct jpu_ctx *ctx = vb2_get_drv_priv(vq); vq 1154 drivers/media/platform/rcar_jpu.c struct jpu_q_data *q_data = jpu_get_q_data(ctx, vq->type); vq 1160 drivers/media/platform/rcar_jpu.c static void jpu_stop_streaming(struct vb2_queue *vq) vq 1162 drivers/media/platform/rcar_jpu.c struct jpu_ctx *ctx = vb2_get_drv_priv(vq); vq 1167 drivers/media/platform/rcar_jpu.c if (V4L2_TYPE_IS_OUTPUT(vq->type)) vq 621 drivers/media/platform/renesas-ceu.c static int ceu_vb2_setup(struct vb2_queue *vq, unsigned int *count, vq 625 drivers/media/platform/renesas-ceu.c struct ceu_device *ceudev = vb2_get_drv_priv(vq); vq 679 drivers/media/platform/renesas-ceu.c static int ceu_start_streaming(struct vb2_queue *vq, unsigned int count) vq 681 drivers/media/platform/renesas-ceu.c struct ceu_device *ceudev = vb2_get_drv_priv(vq); vq 739 drivers/media/platform/renesas-ceu.c static void ceu_stop_streaming(struct vb2_queue *vq) vq 741 drivers/media/platform/renesas-ceu.c struct ceu_device *ceudev = vb2_get_drv_priv(vq); vq 19 drivers/media/platform/rockchip/rga/rga-buf.c rga_queue_setup(struct vb2_queue *vq, vq 23 drivers/media/platform/rockchip/rga/rga-buf.c struct rga_ctx *ctx = vb2_get_drv_priv(vq); vq 24 drivers/media/platform/rockchip/rga/rga-buf.c struct rga_frame *f = rga_get_frame(ctx, vq->type); vq 465 drivers/media/platform/rockchip/rga/rga.c struct vb2_queue *vq; vq 468 drivers/media/platform/rockchip/rga/rga.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 469 drivers/media/platform/rockchip/rga/rga.c if (!vq) vq 523 drivers/media/platform/rockchip/rga/rga.c struct vb2_queue *vq; vq 534 drivers/media/platform/rockchip/rga/rga.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 535 drivers/media/platform/rockchip/rga/rga.c if (vb2_is_busy(vq)) { vq 374 drivers/media/platform/s3c-camif/camif-capture.c static int start_streaming(struct vb2_queue *vq, unsigned int count) vq 376 drivers/media/platform/s3c-camif/camif-capture.c struct camif_vp *vp = vb2_get_drv_priv(vq); vq 431 drivers/media/platform/s3c-camif/camif-capture.c static void stop_streaming(struct vb2_queue *vq) vq 433 drivers/media/platform/s3c-camif/camif-capture.c struct camif_vp *vp = vb2_get_drv_priv(vq); vq 437 drivers/media/platform/s3c-camif/camif-capture.c static int queue_setup(struct vb2_queue *vq, vq 441 drivers/media/platform/s3c-camif/camif-capture.c struct camif_vp *vp = vb2_get_drv_priv(vq); vq 95 drivers/media/platform/s5p-g2d/g2d.c static int g2d_queue_setup(struct vb2_queue *vq, vq 99 drivers/media/platform/s5p-g2d/g2d.c struct g2d_ctx *ctx = vb2_get_drv_priv(vq); vq 100 drivers/media/platform/s5p-g2d/g2d.c struct g2d_frame *f = get_frame(ctx, vq->type); vq 308 drivers/media/platform/s5p-g2d/g2d.c struct vb2_queue *vq; vq 311 drivers/media/platform/s5p-g2d/g2d.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 312 drivers/media/platform/s5p-g2d/g2d.c if (!vq) vq 361 drivers/media/platform/s5p-g2d/g2d.c struct vb2_queue *vq; vq 371 drivers/media/platform/s5p-g2d/g2d.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 372 drivers/media/platform/s5p-g2d/g2d.c if (vb2_is_busy(vq)) { vq 1333 drivers/media/platform/s5p-jpeg/jpeg-core.c struct vb2_queue *vq; vq 1338 drivers/media/platform/s5p-jpeg/jpeg-core.c vq = v4l2_m2m_get_vq(ct->fh.m2m_ctx, f->type); vq 1339 drivers/media/platform/s5p-jpeg/jpeg-core.c if (!vq) vq 1586 drivers/media/platform/s5p-jpeg/jpeg-core.c struct vb2_queue *vq; vq 1593 drivers/media/platform/s5p-jpeg/jpeg-core.c vq = v4l2_m2m_get_vq(ct->fh.m2m_ctx, f->type); vq 1594 drivers/media/platform/s5p-jpeg/jpeg-core.c if (!vq) vq 1600 drivers/media/platform/s5p-jpeg/jpeg-core.c if (vb2_is_busy(vq)) { vq 2462 drivers/media/platform/s5p-jpeg/jpeg-core.c static int s5p_jpeg_queue_setup(struct vb2_queue *vq, vq 2466 drivers/media/platform/s5p-jpeg/jpeg-core.c struct s5p_jpeg_ctx *ctx = vb2_get_drv_priv(vq); vq 2470 drivers/media/platform/s5p-jpeg/jpeg-core.c q_data = get_q_data(ctx, vq->type); vq 130 drivers/media/platform/s5p-mfc/s5p_mfc.c void s5p_mfc_cleanup_queue(struct list_head *lh, struct vb2_queue *vq) vq 759 drivers/media/platform/s5p-mfc/s5p_mfc_common.h void s5p_mfc_cleanup_queue(struct list_head *lh, struct vb2_queue *vq); vq 883 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c static int s5p_mfc_queue_setup(struct vb2_queue *vq, vq 888 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); vq 894 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { vq 904 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { vq 916 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c ctx->state, vq->type); vq 922 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { vq 931 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE && vq 945 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c struct vb2_queue *vq = vb->vb2_queue; vq 946 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); vq 949 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { vq 971 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { vq 1057 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c struct vb2_queue *vq = vb->vb2_queue; vq 1058 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); vq 1063 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { vq 1070 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c } else if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { vq 1080 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c mfc_err("Unsupported buffer type (%d)\n", vq->type); vq 2367 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c static int s5p_mfc_queue_setup(struct vb2_queue *vq, vq 2371 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); vq 2374 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { vq 2390 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { vq 2412 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c mfc_err("invalid queue type: %d\n", vq->type); vq 2421 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c struct vb2_queue *vq = vb->vb2_queue; vq 2422 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); vq 2426 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { vq 2435 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { vq 2447 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c mfc_err("invalid queue type: %d\n", vq->type); vq 2455 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c struct vb2_queue *vq = vb->vb2_queue; vq 2456 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); vq 2459 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { vq 2469 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { vq 2483 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c mfc_err("invalid queue type: %d\n", vq->type); vq 2550 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c struct vb2_queue *vq = vb->vb2_queue; vq 2551 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); vq 2561 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { vq 2569 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { vq 2577 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c mfc_err("unsupported buffer type (%d)\n", vq->type); vq 540 drivers/media/platform/sh_veu.c struct vb2_queue *vq; vq 545 drivers/media/platform/sh_veu.c vq = v4l2_m2m_get_vq(veu->m2m_ctx, f->type); vq 546 drivers/media/platform/sh_veu.c if (!vq) vq 549 drivers/media/platform/sh_veu.c if (vb2_is_busy(vq)) { vq 853 drivers/media/platform/sh_veu.c static int sh_veu_queue_setup(struct vb2_queue *vq, vq 857 drivers/media/platform/sh_veu.c struct sh_veu_dev *veu = vb2_get_drv_priv(vq); vq 858 drivers/media/platform/sh_veu.c struct sh_veu_vfmt *vfmt = sh_veu_get_vfmt(veu, vq->type); vq 237 drivers/media/platform/sh_vou.c static int sh_vou_queue_setup(struct vb2_queue *vq, vq 241 drivers/media/platform/sh_vou.c struct sh_vou_device *vou_dev = vb2_get_drv_priv(vq); vq 287 drivers/media/platform/sh_vou.c static int sh_vou_start_streaming(struct vb2_queue *vq, unsigned int count) vq 289 drivers/media/platform/sh_vou.c struct sh_vou_device *vou_dev = vb2_get_drv_priv(vq); vq 335 drivers/media/platform/sh_vou.c static void sh_vou_stop_streaming(struct vb2_queue *vq) vq 337 drivers/media/platform/sh_vou.c struct sh_vou_device *vou_dev = vb2_get_drv_priv(vq); vq 440 drivers/media/platform/sti/bdisp/bdisp-v4l2.c static int bdisp_queue_setup(struct vb2_queue *vq, vq 444 drivers/media/platform/sti/bdisp/bdisp-v4l2.c struct bdisp_ctx *ctx = vb2_get_drv_priv(vq); vq 445 drivers/media/platform/sti/bdisp/bdisp-v4l2.c struct bdisp_frame *frame = ctx_get_frame(ctx, vq->type); vq 794 drivers/media/platform/sti/bdisp/bdisp-v4l2.c struct vb2_queue *vq; vq 806 drivers/media/platform/sti/bdisp/bdisp-v4l2.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 807 drivers/media/platform/sti/bdisp/bdisp-v4l2.c if (vb2_is_streaming(vq)) { vq 610 drivers/media/platform/sti/delta/delta-v4l2.c struct vb2_queue *vq; vq 622 drivers/media/platform/sti/delta/delta-v4l2.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 623 drivers/media/platform/sti/delta/delta-v4l2.c if (vb2_is_streaming(vq)) { vq 650 drivers/media/platform/sti/delta/delta-v4l2.c struct vb2_queue *vq; vq 653 drivers/media/platform/sti/delta/delta-v4l2.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 654 drivers/media/platform/sti/delta/delta-v4l2.c if (vb2_is_streaming(vq)) { vq 1092 drivers/media/platform/sti/delta/delta-v4l2.c static int delta_vb2_au_queue_setup(struct vb2_queue *vq, vq 1098 drivers/media/platform/sti/delta/delta-v4l2.c struct delta_ctx *ctx = vb2_get_drv_priv(vq); vq 1414 drivers/media/platform/sti/delta/delta-v4l2.c static int delta_vb2_frame_queue_setup(struct vb2_queue *vq, vq 1420 drivers/media/platform/sti/delta/delta-v4l2.c struct delta_ctx *ctx = vb2_get_drv_priv(vq); vq 454 drivers/media/platform/sti/hva/hva-v4l2.c struct vb2_queue *vq; vq 464 drivers/media/platform/sti/hva/hva-v4l2.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 465 drivers/media/platform/sti/hva/hva-v4l2.c if (vb2_is_streaming(vq)) { vq 485 drivers/media/platform/sti/hva/hva-v4l2.c struct vb2_queue *vq; vq 495 drivers/media/platform/sti/hva/hva-v4l2.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 496 drivers/media/platform/sti/hva/hva-v4l2.c if (vb2_is_streaming(vq)) { vq 567 drivers/media/platform/sti/hva/hva-v4l2.c struct vb2_queue *vq; vq 571 drivers/media/platform/sti/hva/hva-v4l2.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, buf->type); vq 573 drivers/media/platform/sti/hva/hva-v4l2.c if (buf->index >= vq->num_buffers) { vq 575 drivers/media/platform/sti/hva/hva-v4l2.c ctx->name, buf->index, vq->num_buffers); vq 579 drivers/media/platform/sti/hva/hva-v4l2.c vb2_buf = vb2_get_buffer(vq, buf->index); vq 909 drivers/media/platform/sti/hva/hva-v4l2.c static int hva_queue_setup(struct vb2_queue *vq, vq 913 drivers/media/platform/sti/hva/hva-v4l2.c struct hva_ctx *ctx = vb2_get_drv_priv(vq); vq 918 drivers/media/platform/sti/hva/hva-v4l2.c to_type_str(vq->type), *num_buffers); vq 920 drivers/media/platform/sti/hva/hva-v4l2.c size = vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT ? vq 994 drivers/media/platform/sti/hva/hva-v4l2.c static int hva_start_streaming(struct vb2_queue *vq, unsigned int count) vq 996 drivers/media/platform/sti/hva/hva-v4l2.c struct hva_ctx *ctx = vb2_get_drv_priv(vq); vq 1005 drivers/media/platform/sti/hva/hva-v4l2.c to_type_str(vq->type)); vq 1008 drivers/media/platform/sti/hva/hva-v4l2.c if (V4L2_TYPE_IS_OUTPUT(vq->type)) { vq 1050 drivers/media/platform/sti/hva/hva-v4l2.c if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) { vq 1065 drivers/media/platform/sti/hva/hva-v4l2.c static void hva_stop_streaming(struct vb2_queue *vq) vq 1067 drivers/media/platform/sti/hva/hva-v4l2.c struct hva_ctx *ctx = vb2_get_drv_priv(vq); vq 1074 drivers/media/platform/sti/hva/hva-v4l2.c to_type_str(vq->type)); vq 1076 drivers/media/platform/sti/hva/hva-v4l2.c if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) { vq 1088 drivers/media/platform/sti/hva/hva-v4l2.c if ((V4L2_TYPE_IS_OUTPUT(vq->type) && vq 1090 drivers/media/platform/sti/hva/hva-v4l2.c (!V4L2_TYPE_IS_OUTPUT(vq->type) && vq 1093 drivers/media/platform/sti/hva/hva-v4l2.c ctx->name, to_type_str(vq->type), vq 1128 drivers/media/platform/sti/hva/hva-v4l2.c static int queue_init(struct hva_ctx *ctx, struct vb2_queue *vq) vq 1130 drivers/media/platform/sti/hva/hva-v4l2.c vq->io_modes = VB2_MMAP | VB2_DMABUF; vq 1131 drivers/media/platform/sti/hva/hva-v4l2.c vq->drv_priv = ctx; vq 1132 drivers/media/platform/sti/hva/hva-v4l2.c vq->ops = &hva_qops; vq 1133 drivers/media/platform/sti/hva/hva-v4l2.c vq->mem_ops = &vb2_dma_contig_memops; vq 1134 drivers/media/platform/sti/hva/hva-v4l2.c vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; vq 1135 drivers/media/platform/sti/hva/hva-v4l2.c vq->lock = &ctx->hva_dev->lock; vq 1137 drivers/media/platform/sti/hva/hva-v4l2.c return vb2_queue_init(vq); vq 492 drivers/media/platform/stm32/stm32-dcmi.c static int dcmi_queue_setup(struct vb2_queue *vq, vq 498 drivers/media/platform/stm32/stm32-dcmi.c struct stm32_dcmi *dcmi = vb2_get_drv_priv(vq); vq 725 drivers/media/platform/stm32/stm32-dcmi.c static int dcmi_start_streaming(struct vb2_queue *vq, unsigned int count) vq 727 drivers/media/platform/stm32/stm32-dcmi.c struct stm32_dcmi *dcmi = vb2_get_drv_priv(vq); vq 857 drivers/media/platform/stm32/stm32-dcmi.c static void dcmi_stop_streaming(struct vb2_queue *vq) vq 859 drivers/media/platform/stm32/stm32-dcmi.c struct stm32_dcmi *dcmi = vb2_get_drv_priv(vq); vq 46 drivers/media/platform/sunxi/sun4i-csi/sun4i_dma.c static int sun4i_csi_queue_setup(struct vb2_queue *vq, vq 52 drivers/media/platform/sunxi/sun4i-csi/sun4i_dma.c struct sun4i_csi *csi = vb2_get_drv_priv(vq); vq 226 drivers/media/platform/sunxi/sun4i-csi/sun4i_dma.c static int sun4i_csi_start_streaming(struct vb2_queue *vq, unsigned int count) vq 228 drivers/media/platform/sunxi/sun4i-csi/sun4i_dma.c struct sun4i_csi *csi = vb2_get_drv_priv(vq); vq 347 drivers/media/platform/sunxi/sun4i-csi/sun4i_dma.c static void sun4i_csi_stop_streaming(struct vb2_queue *vq) vq 349 drivers/media/platform/sunxi/sun4i-csi/sun4i_dma.c struct sun4i_csi *csi = vb2_get_drv_priv(vq); vq 91 drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c static int sun6i_video_queue_setup(struct vb2_queue *vq, vq 97 drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c struct sun6i_video *video = vb2_get_drv_priv(vq); vq 132 drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c static int sun6i_video_start_streaming(struct vb2_queue *vq, unsigned int count) vq 134 drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c struct sun6i_video *video = vb2_get_drv_priv(vq); vq 219 drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c static void sun6i_video_stop_streaming(struct vb2_queue *vq) vq 221 drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c struct sun6i_video *video = vb2_get_drv_priv(vq); vq 1211 drivers/media/platform/ti-vpe/cal.c static int cal_queue_setup(struct vb2_queue *vq, vq 1215 drivers/media/platform/ti-vpe/cal.c struct cal_ctx *ctx = vb2_get_drv_priv(vq); vq 1218 drivers/media/platform/ti-vpe/cal.c if (vq->num_buffers + *nbuffers < 3) vq 1219 drivers/media/platform/ti-vpe/cal.c *nbuffers = 3 - vq->num_buffers; vq 1271 drivers/media/platform/ti-vpe/cal.c static int cal_start_streaming(struct vb2_queue *vq, unsigned int count) vq 1273 drivers/media/platform/ti-vpe/cal.c struct cal_ctx *ctx = vb2_get_drv_priv(vq); vq 1333 drivers/media/platform/ti-vpe/cal.c static void cal_stop_streaming(struct vb2_queue *vq) vq 1335 drivers/media/platform/ti-vpe/cal.c struct cal_ctx *ctx = vb2_get_drv_priv(vq); vq 1537 drivers/media/platform/ti-vpe/vpe.c struct vb2_queue *vq; vq 1541 drivers/media/platform/ti-vpe/vpe.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 1542 drivers/media/platform/ti-vpe/vpe.c if (!vq) vq 1714 drivers/media/platform/ti-vpe/vpe.c struct vb2_queue *vq; vq 1717 drivers/media/platform/ti-vpe/vpe.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 1718 drivers/media/platform/ti-vpe/vpe.c if (!vq) vq 1721 drivers/media/platform/ti-vpe/vpe.c if (vb2_is_busy(vq)) { vq 2005 drivers/media/platform/ti-vpe/vpe.c static int vpe_queue_setup(struct vb2_queue *vq, vq 2010 drivers/media/platform/ti-vpe/vpe.c struct vpe_ctx *ctx = vb2_get_drv_priv(vq); vq 2013 drivers/media/platform/ti-vpe/vpe.c q_data = get_q_data(ctx, vq->type); vq 90 drivers/media/platform/via-camera.c struct vb2_queue vq; vq 605 drivers/media/platform/via-camera.c static int viacam_vb2_queue_setup(struct vb2_queue *vq, vq 610 drivers/media/platform/via-camera.c struct via_camera *cam = vb2_get_drv_priv(vq); vq 621 drivers/media/platform/via-camera.c static int viacam_vb2_start_streaming(struct vb2_queue *vq, unsigned int count) vq 623 drivers/media/platform/via-camera.c struct via_camera *cam = vb2_get_drv_priv(vq); vq 660 drivers/media/platform/via-camera.c static void viacam_vb2_stop_streaming(struct vb2_queue *vq) vq 662 drivers/media/platform/via-camera.c struct via_camera *cam = vb2_get_drv_priv(vq); vq 1139 drivers/media/platform/via-camera.c struct vb2_queue *vq; vq 1244 drivers/media/platform/via-camera.c vq = &cam->vq; vq 1245 drivers/media/platform/via-camera.c vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; vq 1246 drivers/media/platform/via-camera.c vq->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ; vq 1247 drivers/media/platform/via-camera.c vq->drv_priv = cam; vq 1248 drivers/media/platform/via-camera.c vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; vq 1249 drivers/media/platform/via-camera.c vq->buf_struct_size = sizeof(struct via_buffer); vq 1250 drivers/media/platform/via-camera.c vq->dev = cam->v4l2_dev.dev; vq 1252 drivers/media/platform/via-camera.c vq->ops = &viacam_vb2_ops; vq 1253 drivers/media/platform/via-camera.c vq->mem_ops = &vb2_dma_sg_memops; vq 1254 drivers/media/platform/via-camera.c vq->lock = &cam->lock; vq 1256 drivers/media/platform/via-camera.c ret = vb2_queue_init(vq); vq 1263 drivers/media/platform/via-camera.c cam->vdev.queue = vq; vq 770 drivers/media/platform/vicodec/vicodec-core.c struct vb2_queue *vq; vq 776 drivers/media/platform/vicodec/vicodec-core.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 777 drivers/media/platform/vicodec/vicodec-core.c if (!vq) vq 985 drivers/media/platform/vicodec/vicodec-core.c struct vb2_queue *vq; vq 990 drivers/media/platform/vicodec/vicodec-core.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 991 drivers/media/platform/vicodec/vicodec-core.c if (!vq) vq 1009 drivers/media/platform/vicodec/vicodec-core.c if (vb2_is_busy(vq) && fmt_changed) vq 1032 drivers/media/platform/vicodec/vicodec-core.c if (vb2_is_busy(vq) && fmt_changed) vq 1089 drivers/media/platform/vicodec/vicodec-core.c struct vb2_queue *vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 1102 drivers/media/platform/vicodec/vicodec-core.c if (vb2_is_busy(vq) && (coded_w != q_data->coded_width || vq 1411 drivers/media/platform/vicodec/vicodec-core.c static int vicodec_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, vq 1415 drivers/media/platform/vicodec/vicodec-core.c struct vicodec_ctx *ctx = vb2_get_drv_priv(vq); vq 1416 drivers/media/platform/vicodec/vicodec-core.c struct vicodec_q_data *q_data = get_q_data(ctx, vq->type); vq 735 drivers/media/platform/vim2m.c struct vb2_queue *vq; vq 738 drivers/media/platform/vim2m.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 739 drivers/media/platform/vim2m.c if (!vq) vq 850 drivers/media/platform/vim2m.c struct vb2_queue *vq; vq 852 drivers/media/platform/vim2m.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 853 drivers/media/platform/vim2m.c if (!vq) vq 860 drivers/media/platform/vim2m.c if (vb2_is_busy(vq)) { vq 990 drivers/media/platform/vim2m.c static int vim2m_queue_setup(struct vb2_queue *vq, vq 996 drivers/media/platform/vim2m.c struct vim2m_ctx *ctx = vb2_get_drv_priv(vq); vq 1000 drivers/media/platform/vim2m.c q_data = get_q_data(ctx, vq->type); vq 1017 drivers/media/platform/vim2m.c type_name(vq->type), count, size); vq 234 drivers/media/platform/vimc/vimc-capture.c static int vimc_cap_start_streaming(struct vb2_queue *vq, unsigned int count) vq 236 drivers/media/platform/vimc/vimc-capture.c struct vimc_cap_device *vcap = vb2_get_drv_priv(vq); vq 263 drivers/media/platform/vimc/vimc-capture.c static void vimc_cap_stop_streaming(struct vb2_queue *vq) vq 265 drivers/media/platform/vimc/vimc-capture.c struct vimc_cap_device *vcap = vb2_get_drv_priv(vq); vq 288 drivers/media/platform/vimc/vimc-capture.c static int vimc_cap_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, vq 292 drivers/media/platform/vimc/vimc-capture.c struct vimc_cap_device *vcap = vb2_get_drv_priv(vq); vq 210 drivers/media/platform/vivid/vivid-sdr-cap.c static int sdr_cap_queue_setup(struct vb2_queue *vq, vq 258 drivers/media/platform/vivid/vivid-sdr-cap.c static int sdr_cap_start_streaming(struct vb2_queue *vq, unsigned count) vq 260 drivers/media/platform/vivid/vivid-sdr-cap.c struct vivid_dev *dev = vb2_get_drv_priv(vq); vq 291 drivers/media/platform/vivid/vivid-sdr-cap.c static void sdr_cap_stop_streaming(struct vb2_queue *vq) vq 293 drivers/media/platform/vivid/vivid-sdr-cap.c struct vivid_dev *dev = vb2_get_drv_priv(vq); vq 122 drivers/media/platform/vivid/vivid-vbi-cap.c static int vbi_cap_queue_setup(struct vb2_queue *vq, vq 126 drivers/media/platform/vivid/vivid-vbi-cap.c struct vivid_dev *dev = vb2_get_drv_priv(vq); vq 128 drivers/media/platform/vivid/vivid-vbi-cap.c unsigned size = vq->type == V4L2_BUF_TYPE_SLICED_VBI_CAPTURE ? vq 137 drivers/media/platform/vivid/vivid-vbi-cap.c if (vq->num_buffers + *nbuffers < 2) vq 138 drivers/media/platform/vivid/vivid-vbi-cap.c *nbuffers = 2 - vq->num_buffers; vq 185 drivers/media/platform/vivid/vivid-vbi-cap.c static int vbi_cap_start_streaming(struct vb2_queue *vq, unsigned count) vq 187 drivers/media/platform/vivid/vivid-vbi-cap.c struct vivid_dev *dev = vb2_get_drv_priv(vq); vq 211 drivers/media/platform/vivid/vivid-vbi-cap.c static void vbi_cap_stop_streaming(struct vb2_queue *vq) vq 213 drivers/media/platform/vivid/vivid-vbi-cap.c struct vivid_dev *dev = vb2_get_drv_priv(vq); vq 18 drivers/media/platform/vivid/vivid-vbi-out.c static int vbi_out_queue_setup(struct vb2_queue *vq, vq 22 drivers/media/platform/vivid/vivid-vbi-out.c struct vivid_dev *dev = vb2_get_drv_priv(vq); vq 24 drivers/media/platform/vivid/vivid-vbi-out.c unsigned size = vq->type == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT ? vq 33 drivers/media/platform/vivid/vivid-vbi-out.c if (vq->num_buffers + *nbuffers < 2) vq 34 drivers/media/platform/vivid/vivid-vbi-out.c *nbuffers = 2 - vq->num_buffers; vq 81 drivers/media/platform/vivid/vivid-vbi-out.c static int vbi_out_start_streaming(struct vb2_queue *vq, unsigned count) vq 83 drivers/media/platform/vivid/vivid-vbi-out.c struct vivid_dev *dev = vb2_get_drv_priv(vq); vq 107 drivers/media/platform/vivid/vivid-vbi-out.c static void vbi_out_stop_streaming(struct vb2_queue *vq) vq 109 drivers/media/platform/vivid/vivid-vbi-out.c struct vivid_dev *dev = vb2_get_drv_priv(vq); vq 82 drivers/media/platform/vivid/vivid-vid-cap.c static int vid_cap_queue_setup(struct vb2_queue *vq, vq 86 drivers/media/platform/vivid/vivid-vid-cap.c struct vivid_dev *dev = vb2_get_drv_priv(vq); vq 96 drivers/media/platform/vivid/vivid-vid-cap.c if (vb2_fileio_is_active(vq)) vq 127 drivers/media/platform/vivid/vivid-vid-cap.c if (vq->num_buffers + *nbuffers < 2) vq 128 drivers/media/platform/vivid/vivid-vid-cap.c *nbuffers = 2 - vq->num_buffers; vq 217 drivers/media/platform/vivid/vivid-vid-cap.c static int vid_cap_start_streaming(struct vb2_queue *vq, unsigned count) vq 219 drivers/media/platform/vivid/vivid-vid-cap.c struct vivid_dev *dev = vb2_get_drv_priv(vq); vq 249 drivers/media/platform/vivid/vivid-vid-cap.c static void vid_cap_stop_streaming(struct vb2_queue *vq) vq 251 drivers/media/platform/vivid/vivid-vid-cap.c struct vivid_dev *dev = vb2_get_drv_priv(vq); vq 23 drivers/media/platform/vivid/vivid-vid-out.c static int vid_out_queue_setup(struct vb2_queue *vq, vq 27 drivers/media/platform/vivid/vivid-vid-out.c struct vivid_dev *dev = vb2_get_drv_priv(vq); vq 43 drivers/media/platform/vivid/vivid-vid-out.c if (vb2_fileio_is_active(vq)) vq 76 drivers/media/platform/vivid/vivid-vid-out.c if (vq->num_buffers + *nbuffers < 2) vq 77 drivers/media/platform/vivid/vivid-vid-out.c *nbuffers = 2 - vq->num_buffers; vq 156 drivers/media/platform/vivid/vivid-vid-out.c static int vid_out_start_streaming(struct vb2_queue *vq, unsigned count) vq 158 drivers/media/platform/vivid/vivid-vid-out.c struct vivid_dev *dev = vb2_get_drv_priv(vq); vq 185 drivers/media/platform/vivid/vivid-vid-out.c static void vid_out_stop_streaming(struct vb2_queue *vq) vq 187 drivers/media/platform/vivid/vivid-vid-out.c struct vivid_dev *dev = vb2_get_drv_priv(vq); vq 83 drivers/media/platform/vsp1/vsp1_histo.c static int histo_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, vq 87 drivers/media/platform/vsp1/vsp1_histo.c struct vsp1_histogram *histo = vb2_get_drv_priv(vq); vq 134 drivers/media/platform/vsp1/vsp1_histo.c static int histo_start_streaming(struct vb2_queue *vq, unsigned int count) vq 139 drivers/media/platform/vsp1/vsp1_histo.c static void histo_stop_streaming(struct vb2_queue *vq) vq 141 drivers/media/platform/vsp1/vsp1_histo.c struct vsp1_histogram *histo = vb2_get_drv_priv(vq); vq 707 drivers/media/platform/vsp1/vsp1_video.c vsp1_video_queue_setup(struct vb2_queue *vq, vq 711 drivers/media/platform/vsp1/vsp1_video.c struct vsp1_video *video = vb2_get_drv_priv(vq); vq 862 drivers/media/platform/vsp1/vsp1_video.c static int vsp1_video_start_streaming(struct vb2_queue *vq, unsigned int count) vq 864 drivers/media/platform/vsp1/vsp1_video.c struct vsp1_video *video = vb2_get_drv_priv(vq); vq 904 drivers/media/platform/vsp1/vsp1_video.c static void vsp1_video_stop_streaming(struct vb2_queue *vq) vq 906 drivers/media/platform/vsp1/vsp1_video.c struct vsp1_video *video = vb2_get_drv_priv(vq); vq 316 drivers/media/platform/xilinx/xilinx-dma.c xvip_dma_queue_setup(struct vb2_queue *vq, vq 320 drivers/media/platform/xilinx/xilinx-dma.c struct xvip_dma *dma = vb2_get_drv_priv(vq); vq 390 drivers/media/platform/xilinx/xilinx-dma.c static int xvip_dma_start_streaming(struct vb2_queue *vq, unsigned int count) vq 392 drivers/media/platform/xilinx/xilinx-dma.c struct xvip_dma *dma = vb2_get_drv_priv(vq); vq 449 drivers/media/platform/xilinx/xilinx-dma.c static void xvip_dma_stop_streaming(struct vb2_queue *vq) vq 451 drivers/media/platform/xilinx/xilinx-dma.c struct xvip_dma *dma = vb2_get_drv_priv(vq); vq 477 drivers/media/usb/airspy/airspy.c static int airspy_queue_setup(struct vb2_queue *vq, vq 481 drivers/media/usb/airspy/airspy.c struct airspy *s = vb2_get_drv_priv(vq); vq 486 drivers/media/usb/airspy/airspy.c if (vq->num_buffers + *nbuffers < 8) vq 487 drivers/media/usb/airspy/airspy.c *nbuffers = 8 - vq->num_buffers; vq 514 drivers/media/usb/airspy/airspy.c static int airspy_start_streaming(struct vb2_queue *vq, unsigned int count) vq 516 drivers/media/usb/airspy/airspy.c struct airspy *s = vb2_get_drv_priv(vq); vq 575 drivers/media/usb/airspy/airspy.c static void airspy_stop_streaming(struct vb2_queue *vq) vq 577 drivers/media/usb/airspy/airspy.c struct airspy *s = vb2_get_drv_priv(vq); vq 20 drivers/media/usb/au0828/au0828-vbi.c static int vbi_queue_setup(struct vb2_queue *vq, vq 24 drivers/media/usb/au0828/au0828-vbi.c struct au0828_dev *dev = vb2_get_drv_priv(vq); vq 683 drivers/media/usb/au0828/au0828-video.c static int queue_setup(struct vb2_queue *vq, vq 687 drivers/media/usb/au0828/au0828-video.c struct au0828_dev *dev = vb2_get_drv_priv(vq); vq 812 drivers/media/usb/au0828/au0828-video.c int au0828_start_analog_streaming(struct vb2_queue *vq, unsigned int count) vq 814 drivers/media/usb/au0828/au0828-video.c struct au0828_dev *dev = vb2_get_drv_priv(vq); vq 820 drivers/media/usb/au0828/au0828-video.c if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) vq 838 drivers/media/usb/au0828/au0828-video.c if (vq->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { vq 841 drivers/media/usb/au0828/au0828-video.c } else if (vq->type == V4L2_BUF_TYPE_VBI_CAPTURE) { vq 850 drivers/media/usb/au0828/au0828-video.c static void au0828_stop_streaming(struct vb2_queue *vq) vq 852 drivers/media/usb/au0828/au0828-video.c struct au0828_dev *dev = vb2_get_drv_priv(vq); vq 882 drivers/media/usb/au0828/au0828-video.c void au0828_stop_vbi_streaming(struct vb2_queue *vq) vq 884 drivers/media/usb/au0828/au0828-video.c struct au0828_dev *dev = vb2_get_drv_priv(vq); vq 320 drivers/media/usb/au0828/au0828.h extern int au0828_start_analog_streaming(struct vb2_queue *vq, vq 322 drivers/media/usb/au0828/au0828.h extern void au0828_stop_vbi_streaming(struct vb2_queue *vq); vq 1244 drivers/media/usb/cx231xx/cx231xx-417.c static void free_buffer(struct videobuf_queue *vq, struct cx231xx_buffer *buf) vq 1246 drivers/media/usb/cx231xx/cx231xx-417.c struct cx231xx_fh *fh = vq->priv_data; vq 1261 drivers/media/usb/cx231xx/cx231xx-417.c videobuf_waiton(vq, &buf->vb, 0, 0); vq 157 drivers/media/usb/cx231xx/cx231xx-vbi.c vbi_buffer_setup(struct videobuf_queue *vq, unsigned int *count, vq 160 drivers/media/usb/cx231xx/cx231xx-vbi.c struct cx231xx_fh *fh = vq->priv_data; vq 178 drivers/media/usb/cx231xx/cx231xx-vbi.c static void free_buffer(struct videobuf_queue *vq, struct cx231xx_buffer *buf) vq 180 drivers/media/usb/cx231xx/cx231xx-vbi.c struct cx231xx_fh *fh = vq->priv_data; vq 204 drivers/media/usb/cx231xx/cx231xx-vbi.c vbi_buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, vq 207 drivers/media/usb/cx231xx/cx231xx-vbi.c struct cx231xx_fh *fh = vq->priv_data; vq 227 drivers/media/usb/cx231xx/cx231xx-vbi.c rc = videobuf_iolock(vq, &buf->vb, NULL); vq 248 drivers/media/usb/cx231xx/cx231xx-vbi.c free_buffer(vq, buf); vq 253 drivers/media/usb/cx231xx/cx231xx-vbi.c vbi_buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) vq 257 drivers/media/usb/cx231xx/cx231xx-vbi.c struct cx231xx_fh *fh = vq->priv_data; vq 266 drivers/media/usb/cx231xx/cx231xx-vbi.c static void vbi_buffer_release(struct videobuf_queue *vq, vq 273 drivers/media/usb/cx231xx/cx231xx-vbi.c free_buffer(vq, buf); vq 712 drivers/media/usb/cx231xx/cx231xx-video.c buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size) vq 714 drivers/media/usb/cx231xx/cx231xx-video.c struct cx231xx_fh *fh = vq->priv_data; vq 731 drivers/media/usb/cx231xx/cx231xx-video.c static void free_buffer(struct videobuf_queue *vq, struct cx231xx_buffer *buf) vq 733 drivers/media/usb/cx231xx/cx231xx-video.c struct cx231xx_fh *fh = vq->priv_data; vq 763 drivers/media/usb/cx231xx/cx231xx-video.c buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, vq 766 drivers/media/usb/cx231xx/cx231xx-video.c struct cx231xx_fh *fh = vq->priv_data; vq 783 drivers/media/usb/cx231xx/cx231xx-video.c rc = videobuf_iolock(vq, &buf->vb, NULL); vq 819 drivers/media/usb/cx231xx/cx231xx-video.c free_buffer(vq, buf); vq 823 drivers/media/usb/cx231xx/cx231xx-video.c static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) vq 827 drivers/media/usb/cx231xx/cx231xx-video.c struct cx231xx_fh *fh = vq->priv_data; vq 836 drivers/media/usb/cx231xx/cx231xx-video.c static void buffer_release(struct videobuf_queue *vq, vq 841 drivers/media/usb/cx231xx/cx231xx-video.c struct cx231xx_fh *fh = vq->priv_data; vq 846 drivers/media/usb/cx231xx/cx231xx-video.c free_buffer(vq, buf); vq 18 drivers/media/usb/em28xx/em28xx-v4l.h int em28xx_start_analog_streaming(struct vb2_queue *vq, unsigned int count); vq 19 drivers/media/usb/em28xx/em28xx-v4l.h void em28xx_stop_vbi_streaming(struct vb2_queue *vq); vq 31 drivers/media/usb/em28xx/em28xx-vbi.c static int vbi_queue_setup(struct vb2_queue *vq, vq 35 drivers/media/usb/em28xx/em28xx-vbi.c struct em28xx *dev = vb2_get_drv_priv(vq); vq 1038 drivers/media/usb/em28xx/em28xx-video.c static int queue_setup(struct vb2_queue *vq, vq 1042 drivers/media/usb/em28xx/em28xx-video.c struct em28xx *dev = vb2_get_drv_priv(vq); vq 1079 drivers/media/usb/em28xx/em28xx-video.c int em28xx_start_analog_streaming(struct vb2_queue *vq, unsigned int count) vq 1081 drivers/media/usb/em28xx/em28xx-video.c struct em28xx *dev = vb2_get_drv_priv(vq); vq 1095 drivers/media/usb/em28xx/em28xx-video.c rc = res_get(dev, vq->type); vq 1130 drivers/media/usb/em28xx/em28xx-video.c owner = (struct v4l2_fh *)vq->owner; vq 1147 drivers/media/usb/em28xx/em28xx-video.c static void em28xx_stop_streaming(struct vb2_queue *vq) vq 1149 drivers/media/usb/em28xx/em28xx-video.c struct em28xx *dev = vb2_get_drv_priv(vq); vq 1156 drivers/media/usb/em28xx/em28xx-video.c res_free(dev, vq->type); vq 1182 drivers/media/usb/em28xx/em28xx-video.c void em28xx_stop_vbi_streaming(struct vb2_queue *vq) vq 1184 drivers/media/usb/em28xx/em28xx-video.c struct em28xx *dev = vb2_get_drv_priv(vq); vq 1191 drivers/media/usb/em28xx/em28xx-video.c res_free(dev, vq->type); vq 358 drivers/media/usb/go7007/go7007-v4l2.c struct vb2_queue *vq = vb->vb2_queue; vq 359 drivers/media/usb/go7007/go7007-v4l2.c struct go7007 *go = vb2_get_drv_priv(vq); vq 384 drivers/media/usb/go7007/go7007-v4l2.c struct vb2_queue *vq = vb->vb2_queue; vq 385 drivers/media/usb/go7007/go7007-v4l2.c struct go7007 *go = vb2_get_drv_priv(vq); vq 1287 drivers/media/usb/gspca/gspca.c static int gspca_queue_setup(struct vb2_queue *vq, vq 1291 drivers/media/usb/gspca/gspca.c struct gspca_dev *gspca_dev = vb2_get_drv_priv(vq); vq 1351 drivers/media/usb/gspca/gspca.c static int gspca_start_streaming(struct vb2_queue *vq, unsigned int count) vq 1353 drivers/media/usb/gspca/gspca.c struct gspca_dev *gspca_dev = vb2_get_drv_priv(vq); vq 1364 drivers/media/usb/gspca/gspca.c static void gspca_stop_streaming(struct vb2_queue *vq) vq 1366 drivers/media/usb/gspca/gspca.c struct gspca_dev *gspca_dev = vb2_get_drv_priv(vq); vq 726 drivers/media/usb/hackrf/hackrf.c static void hackrf_return_all_buffers(struct vb2_queue *vq, vq 729 drivers/media/usb/hackrf/hackrf.c struct hackrf_dev *dev = vb2_get_drv_priv(vq); vq 737 drivers/media/usb/hackrf/hackrf.c if (vq->type == V4L2_BUF_TYPE_SDR_CAPTURE) vq 751 drivers/media/usb/hackrf/hackrf.c static int hackrf_queue_setup(struct vb2_queue *vq, vq 755 drivers/media/usb/hackrf/hackrf.c struct hackrf_dev *dev = vb2_get_drv_priv(vq); vq 760 drivers/media/usb/hackrf/hackrf.c if (vq->num_buffers + *nbuffers < 8) vq 761 drivers/media/usb/hackrf/hackrf.c *nbuffers = 8 - vq->num_buffers; vq 772 drivers/media/usb/hackrf/hackrf.c struct vb2_queue *vq = vb->vb2_queue; vq 773 drivers/media/usb/hackrf/hackrf.c struct hackrf_dev *dev = vb2_get_drv_priv(vq); vq 780 drivers/media/usb/hackrf/hackrf.c if (vq->type == V4L2_BUF_TYPE_SDR_CAPTURE) vq 790 drivers/media/usb/hackrf/hackrf.c static int hackrf_start_streaming(struct vb2_queue *vq, unsigned int count) vq 792 drivers/media/usb/hackrf/hackrf.c struct hackrf_dev *dev = vb2_get_drv_priv(vq); vq 802 drivers/media/usb/hackrf/hackrf.c if (vq->type == V4L2_BUF_TYPE_SDR_CAPTURE) { vq 853 drivers/media/usb/hackrf/hackrf.c hackrf_return_all_buffers(vq, VB2_BUF_STATE_QUEUED); vq 859 drivers/media/usb/hackrf/hackrf.c static void hackrf_stop_streaming(struct vb2_queue *vq) vq 861 drivers/media/usb/hackrf/hackrf.c struct hackrf_dev *dev = vb2_get_drv_priv(vq); vq 875 drivers/media/usb/hackrf/hackrf.c hackrf_return_all_buffers(vq, VB2_BUF_STATE_ERROR); vq 877 drivers/media/usb/hackrf/hackrf.c if (vq->type == V4L2_BUF_TYPE_SDR_CAPTURE) vq 598 drivers/media/usb/msi2500/msi2500.c static int msi2500_queue_setup(struct vb2_queue *vq, vq 603 drivers/media/usb/msi2500/msi2500.c struct msi2500_dev *dev = vb2_get_drv_priv(vq); vq 826 drivers/media/usb/msi2500/msi2500.c static int msi2500_start_streaming(struct vb2_queue *vq, unsigned int count) vq 828 drivers/media/usb/msi2500/msi2500.c struct msi2500_dev *dev = vb2_get_drv_priv(vq); vq 855 drivers/media/usb/msi2500/msi2500.c static void msi2500_stop_streaming(struct vb2_queue *vq) vq 857 drivers/media/usb/msi2500/msi2500.c struct msi2500_dev *dev = vb2_get_drv_priv(vq); vq 605 drivers/media/usb/pwc/pwc-if.c static int queue_setup(struct vb2_queue *vq, vq 609 drivers/media/usb/pwc/pwc-if.c struct pwc_device *pdev = vb2_get_drv_priv(vq); vq 697 drivers/media/usb/pwc/pwc-if.c static int start_streaming(struct vb2_queue *vq, unsigned int count) vq 699 drivers/media/usb/pwc/pwc-if.c struct pwc_device *pdev = vb2_get_drv_priv(vq); vq 724 drivers/media/usb/pwc/pwc-if.c static void stop_streaming(struct vb2_queue *vq) vq 726 drivers/media/usb/pwc/pwc-if.c struct pwc_device *pdev = vb2_get_drv_priv(vq); vq 644 drivers/media/usb/s2255/s2255drv.c static int queue_setup(struct vb2_queue *vq, vq 648 drivers/media/usb/s2255/s2255drv.c struct s2255_vc *vc = vb2_get_drv_priv(vq); vq 698 drivers/media/usb/s2255/s2255drv.c static int start_streaming(struct vb2_queue *vq, unsigned int count); vq 699 drivers/media/usb/s2255/s2255drv.c static void stop_streaming(struct vb2_queue *vq); vq 1063 drivers/media/usb/s2255/s2255drv.c static int start_streaming(struct vb2_queue *vq, unsigned int count) vq 1065 drivers/media/usb/s2255/s2255drv.c struct s2255_vc *vc = vb2_get_drv_priv(vq); vq 1080 drivers/media/usb/s2255/s2255drv.c static void stop_streaming(struct vb2_queue *vq) vq 1082 drivers/media/usb/s2255/s2255drv.c struct s2255_vc *vc = vb2_get_drv_priv(vq); vq 650 drivers/media/usb/stk1160/stk1160-v4l.c static int queue_setup(struct vb2_queue *vq, vq 654 drivers/media/usb/stk1160/stk1160-v4l.c struct stk1160 *dev = vb2_get_drv_priv(vq); vq 715 drivers/media/usb/stk1160/stk1160-v4l.c static int start_streaming(struct vb2_queue *vq, unsigned int count) vq 717 drivers/media/usb/stk1160/stk1160-v4l.c struct stk1160 *dev = vb2_get_drv_priv(vq); vq 722 drivers/media/usb/stk1160/stk1160-v4l.c static void stop_streaming(struct vb2_queue *vq) vq 724 drivers/media/usb/stk1160/stk1160-v4l.c struct stk1160 *dev = vb2_get_drv_priv(vq); vq 672 drivers/media/usb/tm6000/tm6000-video.c buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size) vq 674 drivers/media/usb/tm6000/tm6000-video.c struct tm6000_fh *fh = vq->priv_data; vq 689 drivers/media/usb/tm6000/tm6000-video.c static void free_buffer(struct videobuf_queue *vq, struct tm6000_buffer *buf) vq 691 drivers/media/usb/tm6000/tm6000-video.c struct tm6000_fh *fh = vq->priv_data; vq 716 drivers/media/usb/tm6000/tm6000-video.c buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, vq 719 drivers/media/usb/tm6000/tm6000-video.c struct tm6000_fh *fh = vq->priv_data; vq 745 drivers/media/usb/tm6000/tm6000-video.c rc = videobuf_iolock(vq, &buf->vb, NULL); vq 765 drivers/media/usb/tm6000/tm6000-video.c free_buffer(vq, buf); vq 770 drivers/media/usb/tm6000/tm6000-video.c buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) vq 773 drivers/media/usb/tm6000/tm6000-video.c struct tm6000_fh *fh = vq->priv_data; vq 781 drivers/media/usb/tm6000/tm6000-video.c static void buffer_release(struct videobuf_queue *vq, struct videobuf_buffer *vb) vq 785 drivers/media/usb/tm6000/tm6000-video.c free_buffer(vq, buf); vq 720 drivers/media/usb/usbtv/usbtv-video.c static int usbtv_queue_setup(struct vb2_queue *vq, vq 724 drivers/media/usb/usbtv/usbtv-video.c struct usbtv *usbtv = vb2_get_drv_priv(vq); vq 727 drivers/media/usb/usbtv/usbtv-video.c if (vq->num_buffers + *nbuffers < 2) vq 728 drivers/media/usb/usbtv/usbtv-video.c *nbuffers = 2 - vq->num_buffers; vq 754 drivers/media/usb/usbtv/usbtv-video.c static int usbtv_start_streaming(struct vb2_queue *vq, unsigned int count) vq 756 drivers/media/usb/usbtv/usbtv-video.c struct usbtv *usbtv = vb2_get_drv_priv(vq); vq 766 drivers/media/usb/usbtv/usbtv-video.c static void usbtv_stop_streaming(struct vb2_queue *vq) vq 768 drivers/media/usb/usbtv/usbtv-video.c struct usbtv *usbtv = vb2_get_drv_priv(vq); vq 72 drivers/media/usb/uvc/uvc_queue.c static int uvc_queue_setup(struct vb2_queue *vq, vq 76 drivers/media/usb/uvc/uvc_queue.c struct uvc_video_queue *queue = vb2_get_drv_priv(vq); vq 80 drivers/media/usb/uvc/uvc_queue.c switch (vq->type) { vq 164 drivers/media/usb/uvc/uvc_queue.c static int uvc_start_streaming(struct vb2_queue *vq, unsigned int count) vq 166 drivers/media/usb/uvc/uvc_queue.c struct uvc_video_queue *queue = vb2_get_drv_priv(vq); vq 185 drivers/media/usb/uvc/uvc_queue.c static void uvc_stop_streaming(struct vb2_queue *vq) vq 187 drivers/media/usb/uvc/uvc_queue.c struct uvc_video_queue *queue = vb2_get_drv_priv(vq); vq 191 drivers/media/usb/uvc/uvc_queue.c if (vq->type != V4L2_BUF_TYPE_META_CAPTURE) vq 341 drivers/media/usb/zr364xx/zr364xx.c static int buffer_setup(struct videobuf_queue *vq, unsigned int *count, vq 344 drivers/media/usb/zr364xx/zr364xx.c struct zr364xx_camera *cam = vq->priv_data; vq 357 drivers/media/usb/zr364xx/zr364xx.c static void free_buffer(struct videobuf_queue *vq, struct zr364xx_buffer *buf) vq 367 drivers/media/usb/zr364xx/zr364xx.c static int buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, vq 370 drivers/media/usb/zr364xx/zr364xx.c struct zr364xx_camera *cam = vq->priv_data; vq 392 drivers/media/usb/zr364xx/zr364xx.c rc = videobuf_iolock(vq, &buf->vb, NULL); vq 400 drivers/media/usb/zr364xx/zr364xx.c free_buffer(vq, buf); vq 404 drivers/media/usb/zr364xx/zr364xx.c static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) vq 408 drivers/media/usb/zr364xx/zr364xx.c struct zr364xx_camera *cam = vq->priv_data; vq 416 drivers/media/usb/zr364xx/zr364xx.c static void buffer_release(struct videobuf_queue *vq, vq 423 drivers/media/usb/zr364xx/zr364xx.c free_buffer(vq, buf); vq 449 drivers/media/v4l2-core/v4l2-mem2mem.c struct vb2_queue *vq; vq 452 drivers/media/v4l2-core/v4l2-mem2mem.c vq = v4l2_m2m_get_vq(m2m_ctx, reqbufs->type); vq 453 drivers/media/v4l2-core/v4l2-mem2mem.c ret = vb2_reqbufs(vq, reqbufs); vq 457 drivers/media/v4l2-core/v4l2-mem2mem.c vq->owner = reqbufs->count ? file->private_data : NULL; vq 466 drivers/media/v4l2-core/v4l2-mem2mem.c struct vb2_queue *vq; vq 470 drivers/media/v4l2-core/v4l2-mem2mem.c vq = v4l2_m2m_get_vq(m2m_ctx, buf->type); vq 471 drivers/media/v4l2-core/v4l2-mem2mem.c ret = vb2_querybuf(vq, buf); vq 474 drivers/media/v4l2-core/v4l2-mem2mem.c if (buf->memory == V4L2_MEMORY_MMAP && !V4L2_TYPE_IS_OUTPUT(vq->type)) { vq 475 drivers/media/v4l2-core/v4l2-mem2mem.c if (V4L2_TYPE_IS_MULTIPLANAR(vq->type)) { vq 492 drivers/media/v4l2-core/v4l2-mem2mem.c struct vb2_queue *vq; vq 495 drivers/media/v4l2-core/v4l2-mem2mem.c vq = v4l2_m2m_get_vq(m2m_ctx, buf->type); vq 496 drivers/media/v4l2-core/v4l2-mem2mem.c if (!V4L2_TYPE_IS_OUTPUT(vq->type) && vq 502 drivers/media/v4l2-core/v4l2-mem2mem.c ret = vb2_qbuf(vq, vdev->v4l2_dev->mdev, buf); vq 513 drivers/media/v4l2-core/v4l2-mem2mem.c struct vb2_queue *vq; vq 515 drivers/media/v4l2-core/v4l2-mem2mem.c vq = v4l2_m2m_get_vq(m2m_ctx, buf->type); vq 516 drivers/media/v4l2-core/v4l2-mem2mem.c return vb2_dqbuf(vq, buf, file->f_flags & O_NONBLOCK); vq 524 drivers/media/v4l2-core/v4l2-mem2mem.c struct vb2_queue *vq; vq 526 drivers/media/v4l2-core/v4l2-mem2mem.c vq = v4l2_m2m_get_vq(m2m_ctx, buf->type); vq 527 drivers/media/v4l2-core/v4l2-mem2mem.c return vb2_prepare_buf(vq, vdev->v4l2_dev->mdev, buf); vq 534 drivers/media/v4l2-core/v4l2-mem2mem.c struct vb2_queue *vq; vq 536 drivers/media/v4l2-core/v4l2-mem2mem.c vq = v4l2_m2m_get_vq(m2m_ctx, create->format.type); vq 537 drivers/media/v4l2-core/v4l2-mem2mem.c return vb2_create_bufs(vq, create); vq 544 drivers/media/v4l2-core/v4l2-mem2mem.c struct vb2_queue *vq; vq 546 drivers/media/v4l2-core/v4l2-mem2mem.c vq = v4l2_m2m_get_vq(m2m_ctx, eb->type); vq 547 drivers/media/v4l2-core/v4l2-mem2mem.c return vb2_expbuf(vq, eb); vq 554 drivers/media/v4l2-core/v4l2-mem2mem.c struct vb2_queue *vq; vq 557 drivers/media/v4l2-core/v4l2-mem2mem.c vq = v4l2_m2m_get_vq(m2m_ctx, type); vq 558 drivers/media/v4l2-core/v4l2-mem2mem.c ret = vb2_streamon(vq, type); vq 692 drivers/media/v4l2-core/v4l2-mem2mem.c struct vb2_queue *vq; vq 695 drivers/media/v4l2-core/v4l2-mem2mem.c vq = v4l2_m2m_get_src_vq(m2m_ctx); vq 697 drivers/media/v4l2-core/v4l2-mem2mem.c vq = v4l2_m2m_get_dst_vq(m2m_ctx); vq 701 drivers/media/v4l2-core/v4l2-mem2mem.c return vb2_mmap(vq, vma); vq 238 drivers/misc/mic/vop/vop_main.c static bool vop_notify(struct virtqueue *vq) vq 240 drivers/misc/mic/vop/vop_main.c struct _vop_vdev *vdev = vq->priv; vq 247 drivers/misc/mic/vop/vop_main.c static void vop_del_vq(struct virtqueue *vq, int n) vq 249 drivers/misc/mic/vop/vop_main.c struct _vop_vdev *vdev = to_vopvdev(vq->vdev); vq 256 drivers/misc/mic/vop/vop_main.c vring_del_virtqueue(vq); vq 264 drivers/misc/mic/vop/vop_main.c struct virtqueue *vq, *n; vq 269 drivers/misc/mic/vop/vop_main.c list_for_each_entry_safe(vq, n, &dev->vqs, list) vq 270 drivers/misc/mic/vop/vop_main.c vop_del_vq(vq, idx++); vq 278 drivers/misc/mic/vop/vop_main.c bool (*notify)(struct virtqueue *vq), vq 279 drivers/misc/mic/vop/vop_main.c void (*callback)(struct virtqueue *vq), vq 300 drivers/misc/mic/vop/vop_main.c void (*callback)(struct virtqueue *vq), vq 307 drivers/misc/mic/vop/vop_main.c struct virtqueue *vq; vq 352 drivers/misc/mic/vop/vop_main.c vq = vop_new_virtqueue(index, le16_to_cpu(config.num), dev, ctx, vq 355 drivers/misc/mic/vop/vop_main.c if (!vq) { vq 371 drivers/misc/mic/vop/vop_main.c vq->priv = vdev; vq 372 drivers/misc/mic/vop/vop_main.c return vq; vq 374 drivers/misc/mic/vop/vop_main.c vring_del_virtqueue(vq); vq 457 drivers/misc/mic/vop/vop_main.c struct virtqueue *vq; vq 460 drivers/misc/mic/vop/vop_main.c list_for_each_entry(vq, &vdev->vdev.vqs, list) vq 461 drivers/misc/mic/vop/vop_main.c vring_interrupt(0, vq); vq 120 drivers/net/virtio_net.c struct virtqueue *vq; vq 136 drivers/net/virtio_net.c struct virtqueue *vq; vq 262 drivers/net/virtio_net.c static int vq2txq(struct virtqueue *vq) vq 264 drivers/net/virtio_net.c return (vq->index - 1) / 2; vq 272 drivers/net/virtio_net.c static int vq2rxq(struct virtqueue *vq) vq 274 drivers/net/virtio_net.c return vq->index / 2; vq 315 drivers/net/virtio_net.c struct virtqueue *vq) vq 318 drivers/net/virtio_net.c virtqueue_disable_cb(vq); vq 324 drivers/net/virtio_net.c struct virtqueue *vq, int processed) vq 328 drivers/net/virtio_net.c opaque = virtqueue_enable_cb_prepare(vq); vq 330 drivers/net/virtio_net.c if (unlikely(virtqueue_poll(vq, opaque))) vq 331 drivers/net/virtio_net.c virtqueue_napi_schedule(napi, vq); vq 333 drivers/net/virtio_net.c virtqueue_disable_cb(vq); vq 337 drivers/net/virtio_net.c static void skb_xmit_done(struct virtqueue *vq) vq 339 drivers/net/virtio_net.c struct virtnet_info *vi = vq->vdev->priv; vq 340 drivers/net/virtio_net.c struct napi_struct *napi = &vi->sq[vq2txq(vq)].napi; vq 343 drivers/net/virtio_net.c virtqueue_disable_cb(vq); vq 346 drivers/net/virtio_net.c virtqueue_napi_schedule(napi, vq); vq 349 drivers/net/virtio_net.c netif_wake_subqueue(vi->dev, vq2txq(vq)); vq 469 drivers/net/virtio_net.c err = virtqueue_add_outbuf(sq->vq, sq->sg, 1, xdp_to_ptr(xdpf), vq 517 drivers/net/virtio_net.c while ((ptr = virtqueue_get_buf(sq->vq, &len)) != NULL) { vq 544 drivers/net/virtio_net.c if (virtqueue_kick_prepare(sq->vq) && virtqueue_notify(sq->vq)) vq 599 drivers/net/virtio_net.c buf = virtqueue_get_buf(rq->vq, &buflen); vq 932 drivers/net/virtio_net.c buf = virtqueue_get_buf_ctx(rq->vq, &len, &ctx); vq 992 drivers/net/virtio_net.c buf = virtqueue_get_buf(rq->vq, &len); vq 1056 drivers/net/virtio_net.c skb_record_rx_queue(skb, vq2rxq(rq->vq)); vq 1094 drivers/net/virtio_net.c err = virtqueue_add_inbuf_ctx(rq->vq, rq->sg, 1, buf, ctx, gfp); vq 1141 drivers/net/virtio_net.c err = virtqueue_add_inbuf(rq->vq, rq->sg, MAX_SKB_FRAGS + 2, vq 1201 drivers/net/virtio_net.c err = virtqueue_add_inbuf_ctx(rq->vq, rq->sg, 1, buf, ctx, gfp); vq 1232 drivers/net/virtio_net.c } while (rq->vq->num_free); vq 1233 drivers/net/virtio_net.c if (virtqueue_kick_prepare(rq->vq) && virtqueue_notify(rq->vq)) { vq 1252 drivers/net/virtio_net.c static void virtnet_napi_enable(struct virtqueue *vq, struct napi_struct *napi) vq 1261 drivers/net/virtio_net.c virtqueue_napi_schedule(napi, vq); vq 1266 drivers/net/virtio_net.c struct virtqueue *vq, vq 1280 drivers/net/virtio_net.c return virtnet_napi_enable(vq, napi); vq 1301 drivers/net/virtio_net.c virtnet_napi_enable(rq->vq, &rq->napi); vq 1314 drivers/net/virtio_net.c struct virtnet_info *vi = rq->vq->vdev->priv; vq 1324 drivers/net/virtio_net.c (buf = virtqueue_get_buf_ctx(rq->vq, &len, &ctx))) { vq 1330 drivers/net/virtio_net.c (buf = virtqueue_get_buf(rq->vq, &len)) != NULL) { vq 1336 drivers/net/virtio_net.c if (rq->vq->num_free > min((unsigned int)budget, virtqueue_get_vring_size(rq->vq)) / 2) { vq 1361 drivers/net/virtio_net.c while ((ptr = virtqueue_get_buf(sq->vq, &len)) != NULL) { vq 1402 drivers/net/virtio_net.c struct virtnet_info *vi = rq->vq->vdev->priv; vq 1403 drivers/net/virtio_net.c unsigned int index = vq2rxq(rq->vq); vq 1415 drivers/net/virtio_net.c if (sq->vq->num_free >= 2 + MAX_SKB_FRAGS) vq 1423 drivers/net/virtio_net.c struct virtnet_info *vi = rq->vq->vdev->priv; vq 1434 drivers/net/virtio_net.c virtqueue_napi_complete(napi, rq->vq, received); vq 1441 drivers/net/virtio_net.c if (virtqueue_kick_prepare(sq->vq) && virtqueue_notify(sq->vq)) { vq 1473 drivers/net/virtio_net.c virtnet_napi_enable(vi->rq[i].vq, &vi->rq[i].napi); vq 1474 drivers/net/virtio_net.c virtnet_napi_tx_enable(vi, vi->sq[i].vq, &vi->sq[i].napi); vq 1483 drivers/net/virtio_net.c struct virtnet_info *vi = sq->vq->vdev->priv; vq 1484 drivers/net/virtio_net.c unsigned int index = vq2txq(sq->vq); vq 1498 drivers/net/virtio_net.c virtqueue_napi_complete(napi, sq->vq, 0); vq 1500 drivers/net/virtio_net.c if (sq->vq->num_free >= 2 + MAX_SKB_FRAGS) vq 1510 drivers/net/virtio_net.c struct virtnet_info *vi = sq->vq->vdev->priv; vq 1550 drivers/net/virtio_net.c return virtqueue_add_outbuf(sq->vq, sq->sg, num_sg, skb, GFP_ATOMIC); vq 1567 drivers/net/virtio_net.c virtqueue_enable_cb_delayed(sq->vq); vq 1603 drivers/net/virtio_net.c if (sq->vq->num_free < 2+MAX_SKB_FRAGS) { vq 1606 drivers/net/virtio_net.c unlikely(!virtqueue_enable_cb_delayed(sq->vq))) { vq 1609 drivers/net/virtio_net.c if (sq->vq->num_free >= 2+MAX_SKB_FRAGS) { vq 1611 drivers/net/virtio_net.c virtqueue_disable_cb(sq->vq); vq 1617 drivers/net/virtio_net.c if (virtqueue_kick_prepare(sq->vq) && virtqueue_notify(sq->vq)) { vq 1924 drivers/net/virtio_net.c virtqueue_set_affinity(vi->rq[i].vq, NULL); vq 1925 drivers/net/virtio_net.c virtqueue_set_affinity(vi->sq[i].vq, NULL); vq 1961 drivers/net/virtio_net.c virtqueue_set_affinity(vi->rq[i].vq, mask); vq 1962 drivers/net/virtio_net.c virtqueue_set_affinity(vi->sq[i].vq, mask); vq 2025 drivers/net/virtio_net.c ring->rx_max_pending = virtqueue_get_vring_size(vi->rq[0].vq); vq 2026 drivers/net/virtio_net.c ring->tx_max_pending = virtqueue_get_vring_size(vi->sq[0].vq); vq 2356 drivers/net/virtio_net.c virtnet_napi_enable(vi->rq[i].vq, &vi->rq[i].napi); vq 2357 drivers/net/virtio_net.c virtnet_napi_tx_enable(vi, vi->sq[i].vq, vq 2491 drivers/net/virtio_net.c virtnet_napi_enable(vi->rq[i].vq, &vi->rq[i].napi); vq 2492 drivers/net/virtio_net.c virtnet_napi_tx_enable(vi, vi->sq[i].vq, vq 2508 drivers/net/virtio_net.c virtnet_napi_enable(vi->rq[i].vq, &vi->rq[i].napi); vq 2509 drivers/net/virtio_net.c virtnet_napi_tx_enable(vi, vi->sq[i].vq, vq 2700 drivers/net/virtio_net.c struct virtqueue *vq = vi->sq[i].vq; vq 2701 drivers/net/virtio_net.c while ((buf = virtqueue_detach_unused_buf(vq)) != NULL) { vq 2710 drivers/net/virtio_net.c struct virtqueue *vq = vi->rq[i].vq; vq 2712 drivers/net/virtio_net.c while ((buf = virtqueue_detach_unused_buf(vq)) != NULL) { vq 2739 drivers/net/virtio_net.c static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqueue *vq) vq 2742 drivers/net/virtio_net.c unsigned int rq_size = virtqueue_get_vring_size(vq); vq 2815 drivers/net/virtio_net.c vi->rq[i].vq = vqs[rxq2vq(i)]; vq 2816 drivers/net/virtio_net.c vi->rq[i].min_buf_len = mergeable_min_buf_len(vi, vi->rq[i].vq); vq 2817 drivers/net/virtio_net.c vi->sq[i].vq = vqs[txq2vq(i)]; vq 13 drivers/nvdimm/nd_virtio.c void virtio_pmem_host_ack(struct virtqueue *vq) vq 15 drivers/nvdimm/nd_virtio.c struct virtio_pmem *vpmem = vq->vdev->priv; vq 21 drivers/nvdimm/nd_virtio.c while ((req_data = virtqueue_get_buf(vq, &len)) != NULL) { vq 53 drivers/nvdimm/virtio_pmem.h void virtio_pmem_host_ack(struct virtqueue *vq); vq 72 drivers/platform/mellanox/mlxbf-tmfifo.c struct virtqueue *vq; vq 221 drivers/platform/mellanox/mlxbf-tmfifo.c if (vring->vq) { vq 222 drivers/platform/mellanox/mlxbf-tmfifo.c vring_del_virtqueue(vring->vq); vq 223 drivers/platform/mellanox/mlxbf-tmfifo.c vring->vq = NULL; vq 290 drivers/platform/mellanox/mlxbf-tmfifo.c const struct vring *vr = virtqueue_get_vring(vring->vq); vq 291 drivers/platform/mellanox/mlxbf-tmfifo.c struct virtio_device *vdev = vring->vq->vdev; vq 311 drivers/platform/mellanox/mlxbf-tmfifo.c const struct vring *vr = virtqueue_get_vring(vring->vq); vq 312 drivers/platform/mellanox/mlxbf-tmfifo.c struct virtio_device *vdev = vring->vq->vdev; vq 333 drivers/platform/mellanox/mlxbf-tmfifo.c const struct vring *vr = virtqueue_get_vring(vring->vq); vq 334 drivers/platform/mellanox/mlxbf-tmfifo.c struct virtio_device *vdev = vring->vq->vdev; vq 372 drivers/platform/mellanox/mlxbf-tmfifo.c struct virtio_device *vdev = vring->vq->vdev; vq 415 drivers/platform/mellanox/mlxbf-tmfifo.c const struct vring *vr = virtqueue_get_vring(vring->vq); vq 563 drivers/platform/mellanox/mlxbf-tmfifo.c struct virtio_device *vdev = vring->vq->vdev; vq 674 drivers/platform/mellanox/mlxbf-tmfifo.c const struct vring *vr = virtqueue_get_vring(vring->vq); vq 735 drivers/platform/mellanox/mlxbf-tmfifo.c vring_interrupt(0, vring->vq); vq 805 drivers/platform/mellanox/mlxbf-tmfifo.c if (vring->vq) vq 834 drivers/platform/mellanox/mlxbf-tmfifo.c static bool mlxbf_tmfifo_virtio_notify(struct virtqueue *vq) vq 836 drivers/platform/mellanox/mlxbf-tmfifo.c struct mlxbf_tmfifo_vring *vring = vq->priv; vq 896 drivers/platform/mellanox/mlxbf-tmfifo.c struct virtqueue *vq; vq 905 drivers/platform/mellanox/mlxbf-tmfifo.c vq = vring->vq; vq 906 drivers/platform/mellanox/mlxbf-tmfifo.c if (vq) { vq 907 drivers/platform/mellanox/mlxbf-tmfifo.c vring->vq = NULL; vq 908 drivers/platform/mellanox/mlxbf-tmfifo.c vring_del_virtqueue(vq); vq 924 drivers/platform/mellanox/mlxbf-tmfifo.c struct virtqueue *vq; vq 940 drivers/platform/mellanox/mlxbf-tmfifo.c vq = vring_new_virtqueue(i, vring->num, vring->align, vdev, vq 944 drivers/platform/mellanox/mlxbf-tmfifo.c if (!vq) { vq 950 drivers/platform/mellanox/mlxbf-tmfifo.c vqs[i] = vq; vq 951 drivers/platform/mellanox/mlxbf-tmfifo.c vring->vq = vq; vq 952 drivers/platform/mellanox/mlxbf-tmfifo.c vq->priv = vring; vq 27 drivers/remoteproc/remoteproc_virtio.c static bool rproc_virtio_notify(struct virtqueue *vq) vq 29 drivers/remoteproc/remoteproc_virtio.c struct rproc_vring *rvring = vq->priv; vq 58 drivers/remoteproc/remoteproc_virtio.c if (!rvring || !rvring->vq) vq 61 drivers/remoteproc/remoteproc_virtio.c return vring_interrupt(0, rvring->vq); vq 67 drivers/remoteproc/remoteproc_virtio.c void (*callback)(struct virtqueue *vq), vq 76 drivers/remoteproc/remoteproc_virtio.c struct virtqueue *vq; vq 108 drivers/remoteproc/remoteproc_virtio.c vq = vring_new_virtqueue(id, len, rvring->align, vdev, false, ctx, vq 110 drivers/remoteproc/remoteproc_virtio.c if (!vq) { vq 116 drivers/remoteproc/remoteproc_virtio.c rvring->vq = vq; vq 117 drivers/remoteproc/remoteproc_virtio.c vq->priv = rvring; vq 123 drivers/remoteproc/remoteproc_virtio.c return vq; vq 128 drivers/remoteproc/remoteproc_virtio.c struct virtqueue *vq, *n; vq 131 drivers/remoteproc/remoteproc_virtio.c list_for_each_entry_safe(vq, n, &vdev->vqs, list) { vq 132 drivers/remoteproc/remoteproc_virtio.c rvring = vq->priv; vq 133 drivers/remoteproc/remoteproc_virtio.c rvring->vq = NULL; vq 134 drivers/remoteproc/remoteproc_virtio.c vring_del_virtqueue(vq); vq 123 drivers/s390/virtio/virtio_ccw.c struct virtqueue *vq; vq 191 drivers/s390/virtio/virtio_ccw.c static void drop_airq_indicator(struct virtqueue *vq, struct airq_info *info) vq 197 drivers/s390/virtio/virtio_ccw.c if (vq == (void *)airq_iv_get_ptr(info->aiv, i)) { vq 303 drivers/s390/virtio/virtio_ccw.c drop_airq_indicator(info->vq, vcdev->airq_info); vq 416 drivers/s390/virtio/virtio_ccw.c static bool virtio_ccw_kvm_notify(struct virtqueue *vq) vq 418 drivers/s390/virtio/virtio_ccw.c struct virtio_ccw_vq_info *info = vq->priv; vq 422 drivers/s390/virtio/virtio_ccw.c vcdev = to_vc_device(info->vq->vdev); vq 424 drivers/s390/virtio/virtio_ccw.c info->cookie = do_kvm_notify(schid, vq->index, info->cookie); vq 446 drivers/s390/virtio/virtio_ccw.c static void virtio_ccw_del_vq(struct virtqueue *vq, struct ccw1 *ccw) vq 448 drivers/s390/virtio/virtio_ccw.c struct virtio_ccw_device *vcdev = to_vc_device(vq->vdev); vq 449 drivers/s390/virtio/virtio_ccw.c struct virtio_ccw_vq_info *info = vq->priv; vq 452 drivers/s390/virtio/virtio_ccw.c unsigned int index = vq->index; vq 484 drivers/s390/virtio/virtio_ccw.c dev_warn(&vq->vdev->dev, "Error %d while deleting queue %d\n", vq 487 drivers/s390/virtio/virtio_ccw.c vring_del_virtqueue(vq); vq 495 drivers/s390/virtio/virtio_ccw.c struct virtqueue *vq, *n; vq 505 drivers/s390/virtio/virtio_ccw.c list_for_each_entry_safe(vq, n, &vdev->vqs, list) vq 506 drivers/s390/virtio/virtio_ccw.c virtio_ccw_del_vq(vq, ccw); vq 518 drivers/s390/virtio/virtio_ccw.c struct virtqueue *vq = NULL; vq 544 drivers/s390/virtio/virtio_ccw.c vq = vring_create_virtqueue(i, info->num, KVM_VIRTIO_CCW_RING_ALIGN, vq 548 drivers/s390/virtio/virtio_ccw.c if (!vq) { vq 555 drivers/s390/virtio/virtio_ccw.c info->num = virtqueue_get_vring_size(vq); vq 558 drivers/s390/virtio/virtio_ccw.c queue = virtqueue_get_desc_addr(vq); vq 569 drivers/s390/virtio/virtio_ccw.c info->info_block->s.avail = (__u64)virtqueue_get_avail_addr(vq); vq 570 drivers/s390/virtio/virtio_ccw.c info->info_block->s.used = (__u64)virtqueue_get_used_addr(vq); vq 582 drivers/s390/virtio/virtio_ccw.c info->vq = vq; vq 583 drivers/s390/virtio/virtio_ccw.c vq->priv = info; vq 590 drivers/s390/virtio/virtio_ccw.c return vq; vq 593 drivers/s390/virtio/virtio_ccw.c if (vq) vq 594 drivers/s390/virtio/virtio_ccw.c vring_del_virtqueue(vq); vq 1053 drivers/s390/virtio/virtio_ccw.c struct virtqueue *vq; vq 1055 drivers/s390/virtio/virtio_ccw.c vq = NULL; vq 1058 drivers/s390/virtio/virtio_ccw.c if (info->vq->index == index) { vq 1059 drivers/s390/virtio/virtio_ccw.c vq = info->vq; vq 1064 drivers/s390/virtio/virtio_ccw.c return vq; vq 1105 drivers/s390/virtio/virtio_ccw.c struct virtqueue *vq; vq 1136 drivers/s390/virtio/virtio_ccw.c vq = virtio_ccw_vq_by_ind(vcdev, i); vq 1137 drivers/s390/virtio/virtio_ccw.c vring_interrupt(0, vq); vq 67 drivers/scsi/virtio_scsi.c struct virtqueue *vq; vq 178 drivers/scsi/virtio_scsi.c struct virtqueue *vq = virtscsi_vq->vq; vq 182 drivers/scsi/virtio_scsi.c virtqueue_disable_cb(vq); vq 183 drivers/scsi/virtio_scsi.c while ((buf = virtqueue_get_buf(vq, &len)) != NULL) vq 186 drivers/scsi/virtio_scsi.c if (unlikely(virtqueue_is_broken(vq))) vq 188 drivers/scsi/virtio_scsi.c } while (!virtqueue_enable_cb(vq)); vq 192 drivers/scsi/virtio_scsi.c static void virtscsi_req_done(struct virtqueue *vq) vq 194 drivers/scsi/virtio_scsi.c struct Scsi_Host *sh = virtio_scsi_host(vq->vdev); vq 196 drivers/scsi/virtio_scsi.c int index = vq->index - VIRTIO_SCSI_VQ_BASE; vq 220 drivers/scsi/virtio_scsi.c static void virtscsi_ctrl_done(struct virtqueue *vq) vq 222 drivers/scsi/virtio_scsi.c struct Scsi_Host *sh = virtio_scsi_host(vq->vdev); vq 242 drivers/scsi/virtio_scsi.c err = virtqueue_add_inbuf(vscsi->event_vq.vq, &sg, 1, event_node, vq 245 drivers/scsi/virtio_scsi.c virtqueue_kick(vscsi->event_vq.vq); vq 397 drivers/scsi/virtio_scsi.c static void virtscsi_event_done(struct virtqueue *vq) vq 399 drivers/scsi/virtio_scsi.c struct Scsi_Host *sh = virtio_scsi_host(vq->vdev); vq 405 drivers/scsi/virtio_scsi.c static int __virtscsi_add_cmd(struct virtqueue *vq, vq 447 drivers/scsi/virtio_scsi.c return virtqueue_add_sgs(vq, sgs, out_num, in_num, cmd, GFP_ATOMIC); vq 450 drivers/scsi/virtio_scsi.c static void virtscsi_kick_vq(struct virtio_scsi_vq *vq) vq 455 drivers/scsi/virtio_scsi.c spin_lock_irqsave(&vq->vq_lock, flags); vq 456 drivers/scsi/virtio_scsi.c needs_kick = virtqueue_kick_prepare(vq->vq); vq 457 drivers/scsi/virtio_scsi.c spin_unlock_irqrestore(&vq->vq_lock, flags); vq 460 drivers/scsi/virtio_scsi.c virtqueue_notify(vq->vq); vq 471 drivers/scsi/virtio_scsi.c static int virtscsi_add_cmd(struct virtio_scsi_vq *vq, vq 480 drivers/scsi/virtio_scsi.c spin_lock_irqsave(&vq->vq_lock, flags); vq 481 drivers/scsi/virtio_scsi.c err = __virtscsi_add_cmd(vq->vq, cmd, req_size, resp_size); vq 483 drivers/scsi/virtio_scsi.c needs_kick = virtqueue_kick_prepare(vq->vq); vq 485 drivers/scsi/virtio_scsi.c spin_unlock_irqrestore(&vq->vq_lock, flags); vq 488 drivers/scsi/virtio_scsi.c virtqueue_notify(vq->vq); vq 762 drivers/scsi/virtio_scsi.c struct virtqueue *vq) vq 765 drivers/scsi/virtio_scsi.c virtscsi_vq->vq = vq; vq 868 drivers/scsi/virtio_scsi.c shost->can_queue = virtqueue_get_vring_size(vscsi->req_vqs[0].vq); vq 2075 drivers/staging/media/allegro-dvt/allegro-core.c static int allegro_queue_setup(struct vb2_queue *vq, vq 2080 drivers/staging/media/allegro-dvt/allegro-core.c struct allegro_channel *channel = vb2_get_drv_priv(vq); vq 2085 drivers/staging/media/allegro-dvt/allegro-core.c V4L2_TYPE_IS_OUTPUT(vq->type) ? "output" : "capture", vq 2089 drivers/staging/media/allegro-dvt/allegro-core.c if (V4L2_TYPE_IS_OUTPUT(vq->type)) { vq 2098 drivers/staging/media/allegro-dvt/allegro-core.c if (V4L2_TYPE_IS_OUTPUT(vq->type)) vq 108 drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c struct vb2_queue *vq; vq 110 drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c vq = v4l2_m2m_get_dst_vq(ctx->fh.m2m_ctx); vq 114 drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c backward_addr = hantro_get_ref(vq, vq 118 drivers/staging/media/hantro/hantro_g1_mpeg2_dec.c forward_addr = hantro_get_ref(vq, vq 370 drivers/staging/media/hantro/hantro_v4l2.c struct vb2_queue *vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 387 drivers/staging/media/hantro/hantro_v4l2.c if (vb2_is_streaming(vq) || (vb2_is_busy(vq) && vq 404 drivers/staging/media/hantro/hantro_v4l2.c if (vb2_is_busy(vq)) vq 445 drivers/staging/media/hantro/hantro_v4l2.c struct vb2_queue *vq; vq 450 drivers/staging/media/hantro/hantro_v4l2.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 451 drivers/staging/media/hantro/hantro_v4l2.c if (vb2_is_busy(vq)) vq 536 drivers/staging/media/hantro/hantro_v4l2.c hantro_queue_setup(struct vb2_queue *vq, unsigned int *num_buffers, vq 540 drivers/staging/media/hantro/hantro_v4l2.c struct hantro_ctx *ctx = vb2_get_drv_priv(vq); vq 544 drivers/staging/media/hantro/hantro_v4l2.c switch (vq->type) { vq 552 drivers/staging/media/hantro/hantro_v4l2.c vpu_err("invalid queue type: %d\n", vq->type); vq 592 drivers/staging/media/hantro/hantro_v4l2.c struct vb2_queue *vq = vb->vb2_queue; vq 593 drivers/staging/media/hantro/hantro_v4l2.c struct hantro_ctx *ctx = vb2_get_drv_priv(vq); vq 595 drivers/staging/media/hantro/hantro_v4l2.c if (V4L2_TYPE_IS_OUTPUT(vq->type)) vq 110 drivers/staging/media/hantro/rk3399_vpu_hw_mpeg2_dec.c struct vb2_queue *vq; vq 112 drivers/staging/media/hantro/rk3399_vpu_hw_mpeg2_dec.c vq = v4l2_m2m_get_dst_vq(ctx->fh.m2m_ctx); vq 116 drivers/staging/media/hantro/rk3399_vpu_hw_mpeg2_dec.c backward_addr = hantro_get_ref(vq, vq 120 drivers/staging/media/hantro/rk3399_vpu_hw_mpeg2_dec.c forward_addr = hantro_get_ref(vq, vq 459 drivers/staging/media/imx/imx-media-capture.c static int capture_queue_setup(struct vb2_queue *vq, vq 465 drivers/staging/media/imx/imx-media-capture.c struct capture_priv *priv = vb2_get_drv_priv(vq); vq 469 drivers/staging/media/imx/imx-media-capture.c if (vq->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) vq 475 drivers/staging/media/imx/imx-media-capture.c count += vq->num_buffers; vq 481 drivers/staging/media/imx/imx-media-capture.c *nbuffers = (count < vq->num_buffers) ? 0 : vq 482 drivers/staging/media/imx/imx-media-capture.c count - vq->num_buffers; vq 503 drivers/staging/media/imx/imx-media-capture.c struct vb2_queue *vq = vb->vb2_queue; vq 504 drivers/staging/media/imx/imx-media-capture.c struct capture_priv *priv = vb2_get_drv_priv(vq); vq 559 drivers/staging/media/imx/imx-media-capture.c static int capture_start_streaming(struct vb2_queue *vq, unsigned int count) vq 561 drivers/staging/media/imx/imx-media-capture.c struct capture_priv *priv = vb2_get_drv_priv(vq); vq 593 drivers/staging/media/imx/imx-media-capture.c static void capture_stop_streaming(struct vb2_queue *vq) vq 595 drivers/staging/media/imx/imx-media-capture.c struct capture_priv *priv = vb2_get_drv_priv(vq); vq 658 drivers/staging/media/imx/imx-media-capture.c struct vb2_queue *vq = &priv->q; vq 662 drivers/staging/media/imx/imx-media-capture.c if (file->private_data == vq->owner) { vq 663 drivers/staging/media/imx/imx-media-capture.c vb2_queue_release(vq); vq 664 drivers/staging/media/imx/imx-media-capture.c vq->owner = NULL; vq 718 drivers/staging/media/imx/imx-media-capture.c struct vb2_queue *vq = &priv->q; vq 721 drivers/staging/media/imx/imx-media-capture.c if (!vb2_is_streaming(vq)) vq 725 drivers/staging/media/imx/imx-media-capture.c vb2_queue_error(vq); vq 736 drivers/staging/media/imx/imx-media-capture.c struct vb2_queue *vq = &priv->q; vq 751 drivers/staging/media/imx/imx-media-capture.c vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; vq 752 drivers/staging/media/imx/imx-media-capture.c vq->io_modes = VB2_MMAP | VB2_DMABUF; vq 753 drivers/staging/media/imx/imx-media-capture.c vq->drv_priv = priv; vq 754 drivers/staging/media/imx/imx-media-capture.c vq->buf_struct_size = sizeof(struct imx_media_buffer); vq 755 drivers/staging/media/imx/imx-media-capture.c vq->ops = &capture_qops; vq 756 drivers/staging/media/imx/imx-media-capture.c vq->mem_ops = &vb2_dma_contig_memops; vq 757 drivers/staging/media/imx/imx-media-capture.c vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; vq 758 drivers/staging/media/imx/imx-media-capture.c vq->lock = &priv->mutex; vq 759 drivers/staging/media/imx/imx-media-capture.c vq->min_buffers_needed = 2; vq 760 drivers/staging/media/imx/imx-media-capture.c vq->dev = priv->dev; vq 762 drivers/staging/media/imx/imx-media-capture.c ret = vb2_queue_init(vq); vq 242 drivers/staging/media/imx/imx-media-csc-scaler.c struct vb2_queue *vq; vq 245 drivers/staging/media/imx/imx-media-csc-scaler.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 246 drivers/staging/media/imx/imx-media-csc-scaler.c if (vb2_is_busy(vq)) { vq 415 drivers/staging/media/imx/imx-media-csc-scaler.c static int ipu_csc_scaler_queue_setup(struct vb2_queue *vq, vq 421 drivers/staging/media/imx/imx-media-csc-scaler.c struct ipu_csc_scaler_ctx *ctx = vb2_get_drv_priv(vq); vq 425 drivers/staging/media/imx/imx-media-csc-scaler.c q_data = get_q_data(ctx, vq->type); vq 445 drivers/staging/media/imx/imx-media-csc-scaler.c struct vb2_queue *vq = vb->vb2_queue; vq 447 drivers/staging/media/imx/imx-media-csc-scaler.c struct ipu_csc_scaler_ctx *ctx = vb2_get_drv_priv(vq); vq 451 drivers/staging/media/imx/imx-media-csc-scaler.c dev_dbg(ctx->priv->dev, "type: %d\n", vq->type); vq 453 drivers/staging/media/imx/imx-media-csc-scaler.c if (V4L2_TYPE_IS_OUTPUT(vq->type)) { vq 463 drivers/staging/media/imx/imx-media-csc-scaler.c q_data = get_q_data(ctx, vq->type); vq 377 drivers/staging/media/ipu3/ipu3-v4l2.c static int imgu_vb2_queue_setup(struct vb2_queue *vq, vq 383 drivers/staging/media/ipu3/ipu3-v4l2.c struct imgu_device *imgu = vb2_get_drv_priv(vq); vq 385 drivers/staging/media/ipu3/ipu3-v4l2.c container_of(vq, struct imgu_video_device, vbq); vq 392 drivers/staging/media/ipu3/ipu3-v4l2.c if (vq->type == V4L2_BUF_TYPE_META_CAPTURE || vq 393 drivers/staging/media/ipu3/ipu3-v4l2.c vq->type == V4L2_BUF_TYPE_META_OUTPUT) vq 458 drivers/staging/media/ipu3/ipu3-v4l2.c static int imgu_vb2_start_streaming(struct vb2_queue *vq, unsigned int count) vq 461 drivers/staging/media/ipu3/ipu3-v4l2.c struct imgu_device *imgu = vb2_get_drv_priv(vq); vq 464 drivers/staging/media/ipu3/ipu3-v4l2.c container_of(vq, struct imgu_video_device, vbq); vq 515 drivers/staging/media/ipu3/ipu3-v4l2.c static void imgu_vb2_stop_streaming(struct vb2_queue *vq) vq 518 drivers/staging/media/ipu3/ipu3-v4l2.c struct imgu_device *imgu = vb2_get_drv_priv(vq); vq 521 drivers/staging/media/ipu3/ipu3-v4l2.c container_of(vq, struct imgu_video_device, vbq); vq 299 drivers/staging/media/omap4iss/iss_video.c static int iss_video_queue_setup(struct vb2_queue *vq, vq 304 drivers/staging/media/omap4iss/iss_video.c struct iss_video_fh *vfh = vb2_get_drv_priv(vq); vq 183 drivers/staging/media/sunxi/cedrus/cedrus.h struct vb2_queue *vq; vq 188 drivers/staging/media/sunxi/cedrus/cedrus.h vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE); vq 189 drivers/staging/media/sunxi/cedrus/cedrus.h if (vq) vq 190 drivers/staging/media/sunxi/cedrus/cedrus.h buf = vb2_get_buffer(vq, index); vq 85 drivers/staging/media/sunxi/cedrus/cedrus_mpeg2.c struct vb2_queue *vq; vq 163 drivers/staging/media/sunxi/cedrus/cedrus_mpeg2.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE); vq 165 drivers/staging/media/sunxi/cedrus/cedrus_mpeg2.c forward_idx = vb2_find_timestamp(vq, slice_params->forward_ref_ts, 0); vq 172 drivers/staging/media/sunxi/cedrus/cedrus_mpeg2.c backward_idx = vb2_find_timestamp(vq, slice_params->backward_ref_ts, 0); vq 290 drivers/staging/media/sunxi/cedrus/cedrus_video.c struct vb2_queue *vq; vq 293 drivers/staging/media/sunxi/cedrus/cedrus_video.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 294 drivers/staging/media/sunxi/cedrus/cedrus_video.c if (vb2_is_busy(vq)) vq 312 drivers/staging/media/sunxi/cedrus/cedrus_video.c struct vb2_queue *vq; vq 315 drivers/staging/media/sunxi/cedrus/cedrus_video.c vq = v4l2_m2m_get_vq(ctx->fh.m2m_ctx, f->type); vq 316 drivers/staging/media/sunxi/cedrus/cedrus_video.c if (vb2_is_busy(vq)) vq 362 drivers/staging/media/sunxi/cedrus/cedrus_video.c static int cedrus_queue_setup(struct vb2_queue *vq, unsigned int *nbufs, vq 366 drivers/staging/media/sunxi/cedrus/cedrus_video.c struct cedrus_ctx *ctx = vb2_get_drv_priv(vq); vq 371 drivers/staging/media/sunxi/cedrus/cedrus_video.c if (V4L2_TYPE_IS_OUTPUT(vq->type)) { vq 394 drivers/staging/media/sunxi/cedrus/cedrus_video.c static void cedrus_queue_cleanup(struct vb2_queue *vq, u32 state) vq 396 drivers/staging/media/sunxi/cedrus/cedrus_video.c struct cedrus_ctx *ctx = vb2_get_drv_priv(vq); vq 400 drivers/staging/media/sunxi/cedrus/cedrus_video.c if (V4L2_TYPE_IS_OUTPUT(vq->type)) vq 424 drivers/staging/media/sunxi/cedrus/cedrus_video.c struct vb2_queue *vq = vb->vb2_queue; vq 425 drivers/staging/media/sunxi/cedrus/cedrus_video.c struct cedrus_ctx *ctx = vb2_get_drv_priv(vq); vq 428 drivers/staging/media/sunxi/cedrus/cedrus_video.c if (V4L2_TYPE_IS_OUTPUT(vq->type)) vq 441 drivers/staging/media/sunxi/cedrus/cedrus_video.c static int cedrus_start_streaming(struct vb2_queue *vq, unsigned int count) vq 443 drivers/staging/media/sunxi/cedrus/cedrus_video.c struct cedrus_ctx *ctx = vb2_get_drv_priv(vq); vq 460 drivers/staging/media/sunxi/cedrus/cedrus_video.c if (V4L2_TYPE_IS_OUTPUT(vq->type) && vq 465 drivers/staging/media/sunxi/cedrus/cedrus_video.c cedrus_queue_cleanup(vq, VB2_BUF_STATE_QUEUED); vq 470 drivers/staging/media/sunxi/cedrus/cedrus_video.c static void cedrus_stop_streaming(struct vb2_queue *vq) vq 472 drivers/staging/media/sunxi/cedrus/cedrus_video.c struct cedrus_ctx *ctx = vb2_get_drv_priv(vq); vq 475 drivers/staging/media/sunxi/cedrus/cedrus_video.c if (V4L2_TYPE_IS_OUTPUT(vq->type) && vq 479 drivers/staging/media/sunxi/cedrus/cedrus_video.c cedrus_queue_cleanup(vq, VB2_BUF_STATE_ERROR); vq 200 drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c static int queue_setup(struct vb2_queue *vq, vq 204 drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c struct bm2835_mmal_dev *dev = vb2_get_drv_priv(vq); vq 488 drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c static int start_streaming(struct vb2_queue *vq, unsigned int count) vq 490 drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c struct bm2835_mmal_dev *dev = vb2_get_drv_priv(vq); vq 581 drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c static void stop_streaming(struct vb2_queue *vq) vq 585 drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c struct bm2835_mmal_dev *dev = vb2_get_drv_priv(vq); vq 40 drivers/usb/gadget/function/uvc_queue.c static int uvc_queue_setup(struct vb2_queue *vq, vq 44 drivers/usb/gadget/function/uvc_queue.c struct uvc_video_queue *queue = vb2_get_drv_priv(vq); vq 97 drivers/vhost/net.c struct vhost_virtqueue *vq; vq 108 drivers/vhost/net.c struct vhost_virtqueue vq; vq 228 drivers/vhost/net.c static void vhost_net_enable_zcopy(int vq) vq 230 drivers/vhost/net.c vhost_net_zcopy_mask |= 0x1 << vq; vq 234 drivers/vhost/net.c vhost_net_ubuf_alloc(struct vhost_virtqueue *vq, bool zcopy) vq 245 drivers/vhost/net.c ubufs->vq = vq; vq 359 drivers/vhost/net.c struct vhost_virtqueue *vq) vq 362 drivers/vhost/net.c container_of(vq, struct vhost_net_virtqueue, vq); vq 367 drivers/vhost/net.c if (vq->heads[i].len == VHOST_DMA_FAILED_LEN) vq 369 drivers/vhost/net.c if (VHOST_DMA_IS_DONE(vq->heads[i].len)) { vq 370 drivers/vhost/net.c vq->heads[i].len = VHOST_DMA_CLEAR_LEN; vq 377 drivers/vhost/net.c vhost_add_used_and_signal_n(vq->dev, vq, vq 378 drivers/vhost/net.c &vq->heads[nvq->done_idx], add); vq 387 drivers/vhost/net.c struct vhost_virtqueue *vq = ubufs->vq; vq 393 drivers/vhost/net.c vq->heads[ubuf->desc].len = success ? vq 405 drivers/vhost/net.c vhost_poll_queue(&vq->poll); vq 422 drivers/vhost/net.c struct vhost_virtqueue *vq) vq 425 drivers/vhost/net.c container_of(vq, struct vhost_net_virtqueue, vq); vq 427 drivers/vhost/net.c if (!vq->private_data) vq 433 drivers/vhost/net.c struct vhost_virtqueue *vq) vq 436 drivers/vhost/net.c container_of(vq, struct vhost_net_virtqueue, vq); vq 440 drivers/vhost/net.c sock = vq->private_data; vq 449 drivers/vhost/net.c struct vhost_virtqueue *vq = &nvq->vq; vq 450 drivers/vhost/net.c struct vhost_dev *dev = vq->dev; vq 455 drivers/vhost/net.c vhost_add_used_and_signal_n(dev, vq, vq->heads, nvq->done_idx); vq 477 drivers/vhost/net.c vq_err(&nvq->vq, "Fail to batch sending packets\n"); vq 498 drivers/vhost/net.c struct vhost_virtqueue *vq) vq 500 drivers/vhost/net.c if (!vhost_vq_avail_empty(&net->dev, vq)) { vq 501 drivers/vhost/net.c vhost_poll_queue(&vq->poll); vq 502 drivers/vhost/net.c } else if (unlikely(vhost_enable_notify(&net->dev, vq))) { vq 503 drivers/vhost/net.c vhost_disable_notify(&net->dev, vq); vq 504 drivers/vhost/net.c vhost_poll_queue(&vq->poll); vq 517 drivers/vhost/net.c struct vhost_virtqueue *vq = poll_rx ? tvq : rvq; vq 523 drivers/vhost/net.c if (!mutex_trylock(&vq->mutex)) vq 526 drivers/vhost/net.c vhost_disable_notify(&net->dev, vq); vq 552 drivers/vhost/net.c vhost_net_busy_poll_try_queue(net, vq); vq 556 drivers/vhost/net.c mutex_unlock(&vq->mutex); vq 565 drivers/vhost/net.c struct vhost_virtqueue *rvq = &rnvq->vq; vq 566 drivers/vhost/net.c struct vhost_virtqueue *tvq = &tnvq->vq; vq 588 drivers/vhost/net.c struct vhost_virtqueue *vq = &nvq->vq; vq 591 drivers/vhost/net.c min_t(unsigned int, VHOST_MAX_PEND, vq->num >> 2); vq 594 drivers/vhost/net.c static size_t init_iov_iter(struct vhost_virtqueue *vq, struct iov_iter *iter, vq 598 drivers/vhost/net.c size_t len = iov_length(vq->iov, out); vq 600 drivers/vhost/net.c iov_iter_init(iter, WRITE, vq->iov, out, len); vq 612 drivers/vhost/net.c struct vhost_virtqueue *vq = &nvq->vq; vq 617 drivers/vhost/net.c if (ret < 0 || ret == vq->num) vq 621 drivers/vhost/net.c vq_err(vq, "Unexpected descriptor format for TX: out %d, int %d\n", vq 627 drivers/vhost/net.c *len = init_iov_iter(vq, &msg->msg_iter, nvq->vhost_hlen, *out); vq 629 drivers/vhost/net.c vq_err(vq, "Unexpected header len for TX: %zd expected %zd\n", vq 637 drivers/vhost/net.c static bool tx_can_batch(struct vhost_virtqueue *vq, size_t total_len) vq 640 drivers/vhost/net.c !vhost_vq_avail_empty(vq->dev, vq); vq 685 drivers/vhost/net.c struct vhost_virtqueue *vq = &nvq->vq; vq 686 drivers/vhost/net.c struct vhost_net *net = container_of(vq->dev, struct vhost_net, vq 688 drivers/vhost/net.c struct socket *sock = vq->private_data; vq 726 drivers/vhost/net.c vhost16_to_cpu(vq, gso->csum_start) + vq 727 drivers/vhost/net.c vhost16_to_cpu(vq, gso->csum_offset) + 2 > vq 728 drivers/vhost/net.c vhost16_to_cpu(vq, gso->hdr_len)) { vq 729 drivers/vhost/net.c gso->hdr_len = cpu_to_vhost16(vq, vq 730 drivers/vhost/net.c vhost16_to_cpu(vq, gso->csum_start) + vq 731 drivers/vhost/net.c vhost16_to_cpu(vq, gso->csum_offset) + 2); vq 733 drivers/vhost/net.c if (vhost16_to_cpu(vq, gso->hdr_len) > len) vq 760 drivers/vhost/net.c struct vhost_virtqueue *vq = &nvq->vq; vq 787 drivers/vhost/net.c if (head == vq->num) { vq 789 drivers/vhost/net.c vhost_poll_queue(&vq->poll); vq 791 drivers/vhost/net.c vq))) { vq 792 drivers/vhost/net.c vhost_disable_notify(&net->dev, vq); vq 809 drivers/vhost/net.c vhost_discard_vq_desc(vq, 1); vq 810 drivers/vhost/net.c vhost_net_enable_vq(net, vq); vq 821 drivers/vhost/net.c if (tx_can_batch(vq, total_len)) vq 830 drivers/vhost/net.c vhost_discard_vq_desc(vq, 1); vq 831 drivers/vhost/net.c vhost_net_enable_vq(net, vq); vq 838 drivers/vhost/net.c vq->heads[nvq->done_idx].id = cpu_to_vhost32(vq, head); vq 839 drivers/vhost/net.c vq->heads[nvq->done_idx].len = 0; vq 841 drivers/vhost/net.c } while (likely(!vhost_exceeds_weight(vq, ++sent_pkts, total_len))); vq 849 drivers/vhost/net.c struct vhost_virtqueue *vq = &nvq->vq; vq 870 drivers/vhost/net.c vhost_zerocopy_signal_used(net, vq); vq 879 drivers/vhost/net.c if (head == vq->num) { vq 881 drivers/vhost/net.c vhost_poll_queue(&vq->poll); vq 882 drivers/vhost/net.c } else if (unlikely(vhost_enable_notify(&net->dev, vq))) { vq 883 drivers/vhost/net.c vhost_disable_notify(&net->dev, vq); vq 898 drivers/vhost/net.c vq->heads[nvq->upend_idx].id = cpu_to_vhost32(vq, head); vq 899 drivers/vhost/net.c vq->heads[nvq->upend_idx].len = VHOST_DMA_IN_PROGRESS; vq 916 drivers/vhost/net.c if (tx_can_batch(vq, total_len) && vq 931 drivers/vhost/net.c vhost_discard_vq_desc(vq, 1); vq 932 drivers/vhost/net.c vhost_net_enable_vq(net, vq); vq 939 drivers/vhost/net.c vhost_add_used_and_signal(&net->dev, vq, head, 0); vq 941 drivers/vhost/net.c vhost_zerocopy_signal_used(net, vq); vq 943 drivers/vhost/net.c } while (likely(!vhost_exceeds_weight(vq, ++sent_pkts, total_len))); vq 951 drivers/vhost/net.c struct vhost_virtqueue *vq = &nvq->vq; vq 954 drivers/vhost/net.c mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_TX); vq 955 drivers/vhost/net.c sock = vq->private_data; vq 959 drivers/vhost/net.c if (!vq_meta_prefetch(vq)) vq 962 drivers/vhost/net.c vhost_disable_notify(&net->dev, vq); vq 963 drivers/vhost/net.c vhost_net_disable_vq(net, vq); vq 971 drivers/vhost/net.c mutex_unlock(&vq->mutex); vq 1000 drivers/vhost/net.c struct vhost_virtqueue *rvq = &rnvq->vq; vq 1001 drivers/vhost/net.c struct vhost_virtqueue *tvq = &tnvq->vq; vq 1026 drivers/vhost/net.c static int get_rx_bufs(struct vhost_virtqueue *vq, vq 1049 drivers/vhost/net.c r = vhost_get_vq_desc(vq, vq->iov + seg, vq 1050 drivers/vhost/net.c ARRAY_SIZE(vq->iov) - seg, &out, vq 1056 drivers/vhost/net.c if (d == vq->num) { vq 1061 drivers/vhost/net.c vq_err(vq, "unexpected descriptor format for RX: " vq 1070 drivers/vhost/net.c heads[headcount].id = cpu_to_vhost32(vq, d); vq 1071 drivers/vhost/net.c len = iov_length(vq->iov + seg, in); vq 1072 drivers/vhost/net.c heads[headcount].len = cpu_to_vhost32(vq, len); vq 1077 drivers/vhost/net.c heads[headcount - 1].len = cpu_to_vhost32(vq, len + datalen); vq 1089 drivers/vhost/net.c vhost_discard_vq_desc(vq, headcount); vq 1098 drivers/vhost/net.c struct vhost_virtqueue *vq = &nvq->vq; vq 1123 drivers/vhost/net.c mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_RX); vq 1124 drivers/vhost/net.c sock = vq->private_data; vq 1128 drivers/vhost/net.c if (!vq_meta_prefetch(vq)) vq 1131 drivers/vhost/net.c vhost_disable_notify(&net->dev, vq); vq 1132 drivers/vhost/net.c vhost_net_disable_vq(net, vq); vq 1137 drivers/vhost/net.c vq_log = unlikely(vhost_has_feature(vq, VHOST_F_LOG_ALL)) ? vq 1138 drivers/vhost/net.c vq->log : NULL; vq 1139 drivers/vhost/net.c mergeable = vhost_has_feature(vq, VIRTIO_NET_F_MRG_RXBUF); vq 1148 drivers/vhost/net.c headcount = get_rx_bufs(vq, vq->heads + nvq->done_idx, vq 1157 drivers/vhost/net.c vhost_poll_queue(&vq->poll); vq 1158 drivers/vhost/net.c } else if (unlikely(vhost_enable_notify(&net->dev, vq))) { vq 1161 drivers/vhost/net.c vhost_disable_notify(&net->dev, vq); vq 1173 drivers/vhost/net.c iov_iter_init(&msg.msg_iter, READ, vq->iov, 1, 1); vq 1180 drivers/vhost/net.c iov_iter_init(&msg.msg_iter, READ, vq->iov, in, vhost_len); vq 1196 drivers/vhost/net.c vhost_discard_vq_desc(vq, headcount); vq 1203 drivers/vhost/net.c vq_err(vq, "Unable to write vnet_hdr " vq 1204 drivers/vhost/net.c "at addr %p\n", vq->iov->iov_base); vq 1215 drivers/vhost/net.c num_buffers = cpu_to_vhost16(vq, headcount); vq 1219 drivers/vhost/net.c vq_err(vq, "Failed num_buffers write"); vq 1220 drivers/vhost/net.c vhost_discard_vq_desc(vq, headcount); vq 1227 drivers/vhost/net.c vhost_log_write(vq, vq_log, log, vhost_len, vq 1228 drivers/vhost/net.c vq->iov, in); vq 1230 drivers/vhost/net.c } while (likely(!vhost_exceeds_weight(vq, ++recv_pkts, total_len))); vq 1233 drivers/vhost/net.c vhost_poll_queue(&vq->poll); vq 1235 drivers/vhost/net.c vhost_net_enable_vq(net, vq); vq 1238 drivers/vhost/net.c mutex_unlock(&vq->mutex); vq 1243 drivers/vhost/net.c struct vhost_virtqueue *vq = container_of(work, struct vhost_virtqueue, vq 1245 drivers/vhost/net.c struct vhost_net *net = container_of(vq->dev, struct vhost_net, dev); vq 1252 drivers/vhost/net.c struct vhost_virtqueue *vq = container_of(work, struct vhost_virtqueue, vq 1254 drivers/vhost/net.c struct vhost_net *net = container_of(vq->dev, struct vhost_net, dev); vq 1310 drivers/vhost/net.c vqs[VHOST_NET_VQ_TX] = &n->vqs[VHOST_NET_VQ_TX].vq; vq 1311 drivers/vhost/net.c vqs[VHOST_NET_VQ_RX] = &n->vqs[VHOST_NET_VQ_RX].vq; vq 1312 drivers/vhost/net.c n->vqs[VHOST_NET_VQ_TX].vq.handle_kick = handle_tx_kick; vq 1313 drivers/vhost/net.c n->vqs[VHOST_NET_VQ_RX].vq.handle_kick = handle_rx_kick; vq 1340 drivers/vhost/net.c struct vhost_virtqueue *vq) vq 1344 drivers/vhost/net.c container_of(vq, struct vhost_net_virtqueue, vq); vq 1346 drivers/vhost/net.c mutex_lock(&vq->mutex); vq 1347 drivers/vhost/net.c sock = vq->private_data; vq 1348 drivers/vhost/net.c vhost_net_disable_vq(n, vq); vq 1349 drivers/vhost/net.c vq->private_data = NULL; vq 1352 drivers/vhost/net.c mutex_unlock(&vq->mutex); vq 1359 drivers/vhost/net.c *tx_sock = vhost_net_stop_vq(n, &n->vqs[VHOST_NET_VQ_TX].vq); vq 1360 drivers/vhost/net.c *rx_sock = vhost_net_stop_vq(n, &n->vqs[VHOST_NET_VQ_RX].vq); vq 1366 drivers/vhost/net.c vhost_poll_flush(&n->vqs[index].vq.poll); vq 1374 drivers/vhost/net.c mutex_lock(&n->vqs[VHOST_NET_VQ_TX].vq.mutex); vq 1376 drivers/vhost/net.c mutex_unlock(&n->vqs[VHOST_NET_VQ_TX].vq.mutex); vq 1379 drivers/vhost/net.c mutex_lock(&n->vqs[VHOST_NET_VQ_TX].vq.mutex); vq 1382 drivers/vhost/net.c mutex_unlock(&n->vqs[VHOST_NET_VQ_TX].vq.mutex); vq 1493 drivers/vhost/net.c struct vhost_virtqueue *vq; vq 1507 drivers/vhost/net.c vq = &n->vqs[index].vq; vq 1509 drivers/vhost/net.c mutex_lock(&vq->mutex); vq 1512 drivers/vhost/net.c if (!vhost_vq_access_ok(vq)) { vq 1523 drivers/vhost/net.c oldsock = vq->private_data; vq 1525 drivers/vhost/net.c ubufs = vhost_net_ubuf_alloc(vq, vq 1532 drivers/vhost/net.c vhost_net_disable_vq(n, vq); vq 1533 drivers/vhost/net.c vq->private_data = sock; vq 1535 drivers/vhost/net.c r = vhost_vq_init_access(vq); vq 1538 drivers/vhost/net.c r = vhost_net_enable_vq(n, vq); vq 1552 drivers/vhost/net.c mutex_unlock(&vq->mutex); vq 1556 drivers/vhost/net.c mutex_lock(&vq->mutex); vq 1557 drivers/vhost/net.c vhost_zerocopy_signal_used(n, vq); vq 1558 drivers/vhost/net.c mutex_unlock(&vq->mutex); vq 1570 drivers/vhost/net.c vq->private_data = oldsock; vq 1571 drivers/vhost/net.c vhost_net_enable_vq(n, vq); vq 1578 drivers/vhost/net.c mutex_unlock(&vq->mutex); vq 1620 drivers/vhost/net.c mutex_lock(&n->vqs[i].vq.mutex); vq 1621 drivers/vhost/net.c n->vqs[i].vq.acked_backend_features = features; vq 1622 drivers/vhost/net.c mutex_unlock(&n->vqs[i].vq.mutex); vq 1658 drivers/vhost/net.c mutex_lock(&n->vqs[i].vq.mutex); vq 1659 drivers/vhost/net.c n->vqs[i].vq.acked_features = features; vq 1662 drivers/vhost/net.c mutex_unlock(&n->vqs[i].vq.mutex); vq 180 drivers/vhost/scsi.c struct vhost_virtqueue vq; vq 243 drivers/vhost/scsi.c struct vhost_virtqueue *vq; vq 247 drivers/vhost/scsi.c vq = &vs->vqs[i].vq; vq 249 drivers/vhost/scsi.c mutex_lock(&vq->mutex); vq 262 drivers/vhost/scsi.c mutex_unlock(&vq->mutex); vq 267 drivers/vhost/scsi.c vhost_scsi_get_inflight(struct vhost_virtqueue *vq) vq 272 drivers/vhost/scsi.c svq = container_of(vq, struct vhost_scsi_virtqueue, vq); vq 410 drivers/vhost/scsi.c struct vhost_virtqueue *vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq; vq 420 drivers/vhost/scsi.c vq_err(vq, "Failed to allocate vhost_scsi_evt\n"); vq 425 drivers/vhost/scsi.c evt->event.event = cpu_to_vhost32(vq, event); vq 426 drivers/vhost/scsi.c evt->event.reason = cpu_to_vhost32(vq, reason); vq 449 drivers/vhost/scsi.c struct vhost_virtqueue *vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq; vq 455 drivers/vhost/scsi.c if (!vq->private_data) { vq 461 drivers/vhost/scsi.c vhost_disable_notify(&vs->dev, vq); vq 462 drivers/vhost/scsi.c head = vhost_get_vq_desc(vq, vq->iov, vq 463 drivers/vhost/scsi.c ARRAY_SIZE(vq->iov), &out, &in, vq 469 drivers/vhost/scsi.c if (head == vq->num) { vq 470 drivers/vhost/scsi.c if (vhost_enable_notify(&vs->dev, vq)) vq 476 drivers/vhost/scsi.c if ((vq->iov[out].iov_len != sizeof(struct virtio_scsi_event))) { vq 477 drivers/vhost/scsi.c vq_err(vq, "Expecting virtio_scsi_event, got %zu bytes\n", vq 478 drivers/vhost/scsi.c vq->iov[out].iov_len); vq 484 drivers/vhost/scsi.c event->event |= cpu_to_vhost32(vq, VIRTIO_SCSI_T_EVENTS_MISSED); vq 488 drivers/vhost/scsi.c eventp = vq->iov[out].iov_base; vq 491 drivers/vhost/scsi.c vhost_add_used_and_signal(&vs->dev, vq, head, 0); vq 493 drivers/vhost/scsi.c vq_err(vq, "Faulted on vhost_scsi_send_event\n"); vq 500 drivers/vhost/scsi.c struct vhost_virtqueue *vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq; vq 504 drivers/vhost/scsi.c mutex_lock(&vq->mutex); vq 510 drivers/vhost/scsi.c mutex_unlock(&vq->mutex); vq 528 drivers/vhost/scsi.c int ret, vq; vq 553 drivers/vhost/scsi.c q = container_of(cmd->tvc_vq, struct vhost_scsi_virtqueue, vq); vq 554 drivers/vhost/scsi.c vq = q - vs->vqs; vq 555 drivers/vhost/scsi.c __set_bit(vq, signal); vq 562 drivers/vhost/scsi.c vq = -1; vq 563 drivers/vhost/scsi.c while ((vq = find_next_bit(signal, VHOST_SCSI_MAX_VQ, vq + 1)) vq 565 drivers/vhost/scsi.c vhost_signal(&vs->dev, &vs->vqs[vq].vq); vq 569 drivers/vhost/scsi.c vhost_scsi_get_tag(struct vhost_virtqueue *vq, struct vhost_scsi_tpg *tpg, vq 609 drivers/vhost/scsi.c cmd->inflight = vhost_scsi_get_inflight(vq); vq 795 drivers/vhost/scsi.c struct vhost_virtqueue *vq, vq 804 drivers/vhost/scsi.c resp = vq->iov[out].iov_base; vq 807 drivers/vhost/scsi.c vhost_add_used_and_signal(&vs->dev, vq, head, 0); vq 813 drivers/vhost/scsi.c vhost_scsi_get_desc(struct vhost_scsi *vs, struct vhost_virtqueue *vq, vq 818 drivers/vhost/scsi.c vc->head = vhost_get_vq_desc(vq, vq->iov, vq 819 drivers/vhost/scsi.c ARRAY_SIZE(vq->iov), &vc->out, &vc->in, vq 830 drivers/vhost/scsi.c if (vc->head == vq->num) { vq 831 drivers/vhost/scsi.c if (unlikely(vhost_enable_notify(&vs->dev, vq))) { vq 832 drivers/vhost/scsi.c vhost_disable_notify(&vs->dev, vq); vq 842 drivers/vhost/scsi.c vc->out_size = iov_length(vq->iov, vc->out); vq 843 drivers/vhost/scsi.c vc->in_size = iov_length(&vq->iov[vc->out], vc->in); vq 855 drivers/vhost/scsi.c iov_iter_init(&vc->out_iter, WRITE, vq->iov, vc->out, vc->out_size); vq 863 drivers/vhost/scsi.c vhost_scsi_chk_size(struct vhost_virtqueue *vq, struct vhost_scsi_ctx *vc) vq 866 drivers/vhost/scsi.c vq_err(vq, vq 871 drivers/vhost/scsi.c vq_err(vq, vq 881 drivers/vhost/scsi.c vhost_scsi_get_req(struct vhost_virtqueue *vq, struct vhost_scsi_ctx *vc, vq 888 drivers/vhost/scsi.c vq_err(vq, "Faulted on copy_from_iter_full\n"); vq 891 drivers/vhost/scsi.c vq_err(vq, "Illegal virtio-scsi lun: %u\n", *vc->lunp); vq 895 drivers/vhost/scsi.c vs_tpg = vq->private_data; /* validated at handler entry */ vq 899 drivers/vhost/scsi.c vq_err(vq, "Target 0x%x does not exist\n", *vc->target); vq 911 drivers/vhost/scsi.c vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) vq 924 drivers/vhost/scsi.c bool t10_pi = vhost_has_feature(vq, VIRTIO_SCSI_F_T10_PI); vq 927 drivers/vhost/scsi.c mutex_lock(&vq->mutex); vq 932 drivers/vhost/scsi.c vs_tpg = vq->private_data; vq 939 drivers/vhost/scsi.c vhost_disable_notify(&vs->dev, vq); vq 942 drivers/vhost/scsi.c ret = vhost_scsi_get_desc(vs, vq, &vc); vq 967 drivers/vhost/scsi.c ret = vhost_scsi_chk_size(vq, &vc); vq 971 drivers/vhost/scsi.c ret = vhost_scsi_get_req(vq, &vc, &tpg); vq 1002 drivers/vhost/scsi.c iov_iter_init(&in_iter, READ, &vq->iov[vc.out], vc.in, vq 1018 drivers/vhost/scsi.c vq_err(vq, "Received non zero pi_bytesout," vq 1022 drivers/vhost/scsi.c prot_bytes = vhost32_to_cpu(vq, v_req_pi.pi_bytesout); vq 1025 drivers/vhost/scsi.c vq_err(vq, "Received non zero pi_bytesin," vq 1029 drivers/vhost/scsi.c prot_bytes = vhost32_to_cpu(vq, v_req_pi.pi_bytesin); vq 1045 drivers/vhost/scsi.c tag = vhost64_to_cpu(vq, v_req_pi.tag); vq 1050 drivers/vhost/scsi.c tag = vhost64_to_cpu(vq, v_req.tag); vq 1063 drivers/vhost/scsi.c vq_err(vq, "Received SCSI CDB with command_size: %d that" vq 1068 drivers/vhost/scsi.c cmd = vhost_scsi_get_tag(vq, tpg, cdb, tag, lun, task_attr, vq 1072 drivers/vhost/scsi.c vq_err(vq, "vhost_scsi_get_tag failed %ld\n", vq 1077 drivers/vhost/scsi.c cmd->tvc_vq = vq; vq 1078 drivers/vhost/scsi.c cmd->tvc_resp_iov = vq->iov[vc.out]; vq 1090 drivers/vhost/scsi.c vq_err(vq, "Failed to map iov to sgl\n"); vq 1120 drivers/vhost/scsi.c vhost_scsi_send_bad_target(vs, vq, vc.head, vc.out); vq 1121 drivers/vhost/scsi.c } while (likely(!vhost_exceeds_weight(vq, ++c, 0))); vq 1123 drivers/vhost/scsi.c mutex_unlock(&vq->mutex); vq 1128 drivers/vhost/scsi.c struct vhost_virtqueue *vq, vq 1139 drivers/vhost/scsi.c iov_iter_init(&iov_iter, READ, &vq->iov[vc->out], vc->in, sizeof(rsp)); vq 1143 drivers/vhost/scsi.c vhost_add_used_and_signal(&vs->dev, vq, vc->head, 0); vq 1150 drivers/vhost/scsi.c struct vhost_virtqueue *vq, vq 1161 drivers/vhost/scsi.c iov_iter_init(&iov_iter, READ, &vq->iov[vc->out], vc->in, sizeof(rsp)); vq 1165 drivers/vhost/scsi.c vhost_add_used_and_signal(&vs->dev, vq, vc->head, 0); vq 1171 drivers/vhost/scsi.c vhost_scsi_ctl_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) vq 1182 drivers/vhost/scsi.c mutex_lock(&vq->mutex); vq 1187 drivers/vhost/scsi.c if (!vq->private_data) vq 1192 drivers/vhost/scsi.c vhost_disable_notify(&vs->dev, vq); vq 1195 drivers/vhost/scsi.c ret = vhost_scsi_get_desc(vs, vq, &vc); vq 1208 drivers/vhost/scsi.c vq_err(vq, "Faulted on copy_from_iter tmf type\n"); vq 1235 drivers/vhost/scsi.c vq_err(vq, "Unknown control request %d", v_req.type); vq 1244 drivers/vhost/scsi.c ret = vhost_scsi_chk_size(vq, &vc); vq 1254 drivers/vhost/scsi.c ret = vhost_scsi_get_req(vq, &vc, NULL); vq 1259 drivers/vhost/scsi.c vhost_scsi_send_tmf_reject(vs, vq, &vc); vq 1261 drivers/vhost/scsi.c vhost_scsi_send_an_resp(vs, vq, &vc); vq 1272 drivers/vhost/scsi.c vhost_scsi_send_bad_target(vs, vq, vc.head, vc.out); vq 1273 drivers/vhost/scsi.c } while (likely(!vhost_exceeds_weight(vq, ++c, 0))); vq 1275 drivers/vhost/scsi.c mutex_unlock(&vq->mutex); vq 1280 drivers/vhost/scsi.c struct vhost_virtqueue *vq = container_of(work, struct vhost_virtqueue, vq 1282 drivers/vhost/scsi.c struct vhost_scsi *vs = container_of(vq->dev, struct vhost_scsi, dev); vq 1285 drivers/vhost/scsi.c vhost_scsi_ctl_handle_vq(vs, vq); vq 1320 drivers/vhost/scsi.c struct vhost_virtqueue *vq = container_of(work, struct vhost_virtqueue, vq 1322 drivers/vhost/scsi.c struct vhost_scsi *vs = container_of(vq->dev, struct vhost_scsi, dev); vq 1324 drivers/vhost/scsi.c mutex_lock(&vq->mutex); vq 1325 drivers/vhost/scsi.c if (!vq->private_data) vq 1331 drivers/vhost/scsi.c mutex_unlock(&vq->mutex); vq 1336 drivers/vhost/scsi.c struct vhost_virtqueue *vq = container_of(work, struct vhost_virtqueue, vq 1338 drivers/vhost/scsi.c struct vhost_scsi *vs = container_of(vq->dev, struct vhost_scsi, dev); vq 1340 drivers/vhost/scsi.c vhost_scsi_handle_vq(vs, vq); vq 1345 drivers/vhost/scsi.c vhost_poll_flush(&vs->vqs[index].vq.poll); vq 1391 drivers/vhost/scsi.c struct vhost_virtqueue *vq; vq 1401 drivers/vhost/scsi.c if (!vhost_vq_access_ok(&vs->vqs[index].vq)) { vq 1461 drivers/vhost/scsi.c vq = &vs->vqs[i].vq; vq 1462 drivers/vhost/scsi.c mutex_lock(&vq->mutex); vq 1463 drivers/vhost/scsi.c vq->private_data = vs_tpg; vq 1464 drivers/vhost/scsi.c vhost_vq_init_access(vq); vq 1465 drivers/vhost/scsi.c mutex_unlock(&vq->mutex); vq 1493 drivers/vhost/scsi.c struct vhost_virtqueue *vq; vq 1502 drivers/vhost/scsi.c if (!vhost_vq_access_ok(&vs->vqs[index].vq)) { vq 1548 drivers/vhost/scsi.c vq = &vs->vqs[i].vq; vq 1549 drivers/vhost/scsi.c mutex_lock(&vq->mutex); vq 1550 drivers/vhost/scsi.c vq->private_data = NULL; vq 1551 drivers/vhost/scsi.c mutex_unlock(&vq->mutex); vq 1576 drivers/vhost/scsi.c struct vhost_virtqueue *vq; vq 1590 drivers/vhost/scsi.c vq = &vs->vqs[i].vq; vq 1591 drivers/vhost/scsi.c mutex_lock(&vq->mutex); vq 1592 drivers/vhost/scsi.c vq->acked_features = features; vq 1593 drivers/vhost/scsi.c mutex_unlock(&vq->mutex); vq 1622 drivers/vhost/scsi.c vqs[VHOST_SCSI_VQ_CTL] = &vs->vqs[VHOST_SCSI_VQ_CTL].vq; vq 1623 drivers/vhost/scsi.c vqs[VHOST_SCSI_VQ_EVT] = &vs->vqs[VHOST_SCSI_VQ_EVT].vq; vq 1624 drivers/vhost/scsi.c vs->vqs[VHOST_SCSI_VQ_CTL].vq.handle_kick = vhost_scsi_ctl_handle_kick; vq 1625 drivers/vhost/scsi.c vs->vqs[VHOST_SCSI_VQ_EVT].vq.handle_kick = vhost_scsi_evt_handle_kick; vq 1627 drivers/vhost/scsi.c vqs[i] = &vs->vqs[i].vq; vq 1628 drivers/vhost/scsi.c vs->vqs[i].vq.handle_kick = vhost_scsi_handle_kick; vq 1675 drivers/vhost/scsi.c struct vhost_virtqueue *vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq; vq 1699 drivers/vhost/scsi.c mutex_lock(&vq->mutex); vq 1701 drivers/vhost/scsi.c mutex_unlock(&vq->mutex); vq 1704 drivers/vhost/scsi.c mutex_lock(&vq->mutex); vq 1706 drivers/vhost/scsi.c mutex_unlock(&vq->mutex); vq 1787 drivers/vhost/scsi.c struct vhost_virtqueue *vq; vq 1800 drivers/vhost/scsi.c vq = &vs->vqs[VHOST_SCSI_VQ_EVT].vq; vq 1801 drivers/vhost/scsi.c mutex_lock(&vq->mutex); vq 1802 drivers/vhost/scsi.c if (vhost_has_feature(vq, VIRTIO_SCSI_F_HOTPLUG)) vq 1805 drivers/vhost/scsi.c mutex_unlock(&vq->mutex); vq 45 drivers/vhost/test.c struct vhost_virtqueue *vq = &n->vqs[VHOST_TEST_VQ]; vq 51 drivers/vhost/test.c mutex_lock(&vq->mutex); vq 52 drivers/vhost/test.c private = vq->private_data; vq 54 drivers/vhost/test.c mutex_unlock(&vq->mutex); vq 58 drivers/vhost/test.c vhost_disable_notify(&n->dev, vq); vq 61 drivers/vhost/test.c head = vhost_get_vq_desc(vq, vq->iov, vq 62 drivers/vhost/test.c ARRAY_SIZE(vq->iov), vq 69 drivers/vhost/test.c if (head == vq->num) { vq 70 drivers/vhost/test.c if (unlikely(vhost_enable_notify(&n->dev, vq))) { vq 71 drivers/vhost/test.c vhost_disable_notify(&n->dev, vq); vq 77 drivers/vhost/test.c vq_err(vq, "Unexpected descriptor format for TX: " vq 81 drivers/vhost/test.c len = iov_length(vq->iov, out); vq 84 drivers/vhost/test.c vq_err(vq, "Unexpected 0 len for TX\n"); vq 87 drivers/vhost/test.c vhost_add_used_and_signal(&n->dev, vq, head, 0); vq 89 drivers/vhost/test.c if (unlikely(vhost_exceeds_weight(vq, 0, total_len))) vq 93 drivers/vhost/test.c mutex_unlock(&vq->mutex); vq 98 drivers/vhost/test.c struct vhost_virtqueue *vq = container_of(work, struct vhost_virtqueue, vq 100 drivers/vhost/test.c struct vhost_test *n = container_of(vq->dev, struct vhost_test, dev); vq 131 drivers/vhost/test.c struct vhost_virtqueue *vq) vq 135 drivers/vhost/test.c mutex_lock(&vq->mutex); vq 136 drivers/vhost/test.c private = vq->private_data; vq 137 drivers/vhost/test.c vq->private_data = NULL; vq 138 drivers/vhost/test.c mutex_unlock(&vq->mutex); vq 176 drivers/vhost/test.c struct vhost_virtqueue *vq; vq 196 drivers/vhost/test.c vq = n->vqs + index; vq 197 drivers/vhost/test.c mutex_lock(&vq->mutex); vq 201 drivers/vhost/test.c oldpriv = vq->private_data; vq 202 drivers/vhost/test.c vq->private_data = priv; vq 206 drivers/vhost/test.c mutex_unlock(&vq->mutex); vq 250 drivers/vhost/test.c struct vhost_virtqueue *vq; vq 258 drivers/vhost/test.c vq = &n->vqs[VHOST_TEST_VQ]; vq 259 drivers/vhost/test.c mutex_lock(&vq->mutex); vq 260 drivers/vhost/test.c vq->acked_features = features; vq 261 drivers/vhost/test.c mutex_unlock(&vq->mutex); vq 49 drivers/vhost/vhost.c #define vhost_used_event(vq) ((__virtio16 __user *)&vq->avail->ring[vq->num]) vq 50 drivers/vhost/vhost.c #define vhost_avail_event(vq) ((__virtio16 __user *)&vq->used->ring[vq->num]) vq 57 drivers/vhost/vhost.c static void vhost_disable_cross_endian(struct vhost_virtqueue *vq) vq 59 drivers/vhost/vhost.c vq->user_be = !virtio_legacy_is_little_endian(); vq 62 drivers/vhost/vhost.c static void vhost_enable_cross_endian_big(struct vhost_virtqueue *vq) vq 64 drivers/vhost/vhost.c vq->user_be = true; vq 67 drivers/vhost/vhost.c static void vhost_enable_cross_endian_little(struct vhost_virtqueue *vq) vq 69 drivers/vhost/vhost.c vq->user_be = false; vq 72 drivers/vhost/vhost.c static long vhost_set_vring_endian(struct vhost_virtqueue *vq, int __user *argp) vq 76 drivers/vhost/vhost.c if (vq->private_data) vq 87 drivers/vhost/vhost.c vhost_enable_cross_endian_big(vq); vq 89 drivers/vhost/vhost.c vhost_enable_cross_endian_little(vq); vq 94 drivers/vhost/vhost.c static long vhost_get_vring_endian(struct vhost_virtqueue *vq, u32 idx, vq 99 drivers/vhost/vhost.c .num = vq->user_be vq 108 drivers/vhost/vhost.c static void vhost_init_is_le(struct vhost_virtqueue *vq) vq 115 drivers/vhost/vhost.c vq->is_le = vhost_has_feature(vq, VIRTIO_F_VERSION_1) || !vq->user_be; vq 118 drivers/vhost/vhost.c static void vhost_disable_cross_endian(struct vhost_virtqueue *vq) vq 122 drivers/vhost/vhost.c static long vhost_set_vring_endian(struct vhost_virtqueue *vq, int __user *argp) vq 127 drivers/vhost/vhost.c static long vhost_get_vring_endian(struct vhost_virtqueue *vq, u32 idx, vq 133 drivers/vhost/vhost.c static void vhost_init_is_le(struct vhost_virtqueue *vq) vq 135 drivers/vhost/vhost.c vq->is_le = vhost_has_feature(vq, VIRTIO_F_VERSION_1) vq 140 drivers/vhost/vhost.c static void vhost_reset_is_le(struct vhost_virtqueue *vq) vq 142 drivers/vhost/vhost.c vhost_init_is_le(vq); vq 284 drivers/vhost/vhost.c static void __vhost_vq_meta_reset(struct vhost_virtqueue *vq) vq 289 drivers/vhost/vhost.c vq->meta_iotlb[j] = NULL; vq 301 drivers/vhost/vhost.c struct vhost_virtqueue *vq) vq 303 drivers/vhost/vhost.c vq->num = 1; vq 304 drivers/vhost/vhost.c vq->desc = NULL; vq 305 drivers/vhost/vhost.c vq->avail = NULL; vq 306 drivers/vhost/vhost.c vq->used = NULL; vq 307 drivers/vhost/vhost.c vq->last_avail_idx = 0; vq 308 drivers/vhost/vhost.c vq->avail_idx = 0; vq 309 drivers/vhost/vhost.c vq->last_used_idx = 0; vq 310 drivers/vhost/vhost.c vq->signalled_used = 0; vq 311 drivers/vhost/vhost.c vq->signalled_used_valid = false; vq 312 drivers/vhost/vhost.c vq->used_flags = 0; vq 313 drivers/vhost/vhost.c vq->log_used = false; vq 314 drivers/vhost/vhost.c vq->log_addr = -1ull; vq 315 drivers/vhost/vhost.c vq->private_data = NULL; vq 316 drivers/vhost/vhost.c vq->acked_features = 0; vq 317 drivers/vhost/vhost.c vq->acked_backend_features = 0; vq 318 drivers/vhost/vhost.c vq->log_base = NULL; vq 319 drivers/vhost/vhost.c vq->error_ctx = NULL; vq 320 drivers/vhost/vhost.c vq->kick = NULL; vq 321 drivers/vhost/vhost.c vq->call_ctx = NULL; vq 322 drivers/vhost/vhost.c vq->log_ctx = NULL; vq 323 drivers/vhost/vhost.c vhost_reset_is_le(vq); vq 324 drivers/vhost/vhost.c vhost_disable_cross_endian(vq); vq 325 drivers/vhost/vhost.c vq->busyloop_timeout = 0; vq 326 drivers/vhost/vhost.c vq->umem = NULL; vq 327 drivers/vhost/vhost.c vq->iotlb = NULL; vq 328 drivers/vhost/vhost.c __vhost_vq_meta_reset(vq); vq 370 drivers/vhost/vhost.c static void vhost_vq_free_iovecs(struct vhost_virtqueue *vq) vq 372 drivers/vhost/vhost.c kfree(vq->indirect); vq 373 drivers/vhost/vhost.c vq->indirect = NULL; vq 374 drivers/vhost/vhost.c kfree(vq->log); vq 375 drivers/vhost/vhost.c vq->log = NULL; vq 376 drivers/vhost/vhost.c kfree(vq->heads); vq 377 drivers/vhost/vhost.c vq->heads = NULL; vq 383 drivers/vhost/vhost.c struct vhost_virtqueue *vq; vq 387 drivers/vhost/vhost.c vq = dev->vqs[i]; vq 388 drivers/vhost/vhost.c vq->indirect = kmalloc_array(UIO_MAXIOV, vq 389 drivers/vhost/vhost.c sizeof(*vq->indirect), vq 391 drivers/vhost/vhost.c vq->log = kmalloc_array(dev->iov_limit, sizeof(*vq->log), vq 393 drivers/vhost/vhost.c vq->heads = kmalloc_array(dev->iov_limit, sizeof(*vq->heads), vq 395 drivers/vhost/vhost.c if (!vq->indirect || !vq->log || !vq->heads) vq 414 drivers/vhost/vhost.c bool vhost_exceeds_weight(struct vhost_virtqueue *vq, vq 417 drivers/vhost/vhost.c struct vhost_dev *dev = vq->dev; vq 421 drivers/vhost/vhost.c vhost_poll_queue(&vq->poll); vq 429 drivers/vhost/vhost.c static size_t vhost_get_avail_size(struct vhost_virtqueue *vq, vq 433 drivers/vhost/vhost.c vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; vq 435 drivers/vhost/vhost.c return sizeof(*vq->avail) + vq 436 drivers/vhost/vhost.c sizeof(*vq->avail->ring) * num + event; vq 439 drivers/vhost/vhost.c static size_t vhost_get_used_size(struct vhost_virtqueue *vq, vq 443 drivers/vhost/vhost.c vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; vq 445 drivers/vhost/vhost.c return sizeof(*vq->used) + vq 446 drivers/vhost/vhost.c sizeof(*vq->used->ring) * num + event; vq 449 drivers/vhost/vhost.c static size_t vhost_get_desc_size(struct vhost_virtqueue *vq, vq 452 drivers/vhost/vhost.c return sizeof(*vq->desc) * num; vq 459 drivers/vhost/vhost.c struct vhost_virtqueue *vq; vq 481 drivers/vhost/vhost.c vq = dev->vqs[i]; vq 482 drivers/vhost/vhost.c vq->log = NULL; vq 483 drivers/vhost/vhost.c vq->indirect = NULL; vq 484 drivers/vhost/vhost.c vq->heads = NULL; vq 485 drivers/vhost/vhost.c vq->dev = dev; vq 486 drivers/vhost/vhost.c mutex_init(&vq->mutex); vq 487 drivers/vhost/vhost.c vhost_vq_reset(dev, vq); vq 488 drivers/vhost/vhost.c if (vq->handle_kick) vq 489 drivers/vhost/vhost.c vhost_poll_init(&vq->poll, vq->handle_kick, vq 738 drivers/vhost/vhost.c static inline void __user *vhost_vq_meta_fetch(struct vhost_virtqueue *vq, vq 742 drivers/vhost/vhost.c const struct vhost_umem_node *node = vq->meta_iotlb[type]; vq 776 drivers/vhost/vhost.c static int translate_desc(struct vhost_virtqueue *vq, u64 addr, u32 len, vq 779 drivers/vhost/vhost.c static int vhost_copy_to_user(struct vhost_virtqueue *vq, void __user *to, vq 784 drivers/vhost/vhost.c if (!vq->iotlb) vq 793 drivers/vhost/vhost.c void __user *uaddr = vhost_vq_meta_fetch(vq, vq 800 drivers/vhost/vhost.c ret = translate_desc(vq, (u64)(uintptr_t)to, size, vq->iotlb_iov, vq 801 drivers/vhost/vhost.c ARRAY_SIZE(vq->iotlb_iov), vq 805 drivers/vhost/vhost.c iov_iter_init(&t, WRITE, vq->iotlb_iov, ret, size); vq 814 drivers/vhost/vhost.c static int vhost_copy_from_user(struct vhost_virtqueue *vq, void *to, vq 819 drivers/vhost/vhost.c if (!vq->iotlb) vq 827 drivers/vhost/vhost.c void __user *uaddr = vhost_vq_meta_fetch(vq, vq 835 drivers/vhost/vhost.c ret = translate_desc(vq, (u64)(uintptr_t)from, size, vq->iotlb_iov, vq 836 drivers/vhost/vhost.c ARRAY_SIZE(vq->iotlb_iov), vq 839 drivers/vhost/vhost.c vq_err(vq, "IOTLB translation failure: uaddr " vq 844 drivers/vhost/vhost.c iov_iter_init(&f, READ, vq->iotlb_iov, ret, size); vq 854 drivers/vhost/vhost.c static void __user *__vhost_get_user_slow(struct vhost_virtqueue *vq, vq 860 drivers/vhost/vhost.c ret = translate_desc(vq, (u64)(uintptr_t)addr, size, vq->iotlb_iov, vq 861 drivers/vhost/vhost.c ARRAY_SIZE(vq->iotlb_iov), vq 864 drivers/vhost/vhost.c vq_err(vq, "IOTLB translation failure: uaddr " vq 870 drivers/vhost/vhost.c if (ret != 1 || vq->iotlb_iov[0].iov_len != size) { vq 871 drivers/vhost/vhost.c vq_err(vq, "Non atomic userspace memory access: uaddr " vq 877 drivers/vhost/vhost.c return vq->iotlb_iov[0].iov_base; vq 885 drivers/vhost/vhost.c static inline void __user *__vhost_get_user(struct vhost_virtqueue *vq, vq 889 drivers/vhost/vhost.c void __user *uaddr = vhost_vq_meta_fetch(vq, vq 894 drivers/vhost/vhost.c return __vhost_get_user_slow(vq, addr, size, type); vq 897 drivers/vhost/vhost.c #define vhost_put_user(vq, x, ptr) \ vq 900 drivers/vhost/vhost.c if (!vq->iotlb) { \ vq 904 drivers/vhost/vhost.c (__typeof__(ptr)) __vhost_get_user(vq, ptr, \ vq 914 drivers/vhost/vhost.c static inline int vhost_put_avail_event(struct vhost_virtqueue *vq) vq 916 drivers/vhost/vhost.c return vhost_put_user(vq, cpu_to_vhost16(vq, vq->avail_idx), vq 917 drivers/vhost/vhost.c vhost_avail_event(vq)); vq 920 drivers/vhost/vhost.c static inline int vhost_put_used(struct vhost_virtqueue *vq, vq 924 drivers/vhost/vhost.c return vhost_copy_to_user(vq, vq->used->ring + idx, head, vq 928 drivers/vhost/vhost.c static inline int vhost_put_used_flags(struct vhost_virtqueue *vq) vq 931 drivers/vhost/vhost.c return vhost_put_user(vq, cpu_to_vhost16(vq, vq->used_flags), vq 932 drivers/vhost/vhost.c &vq->used->flags); vq 935 drivers/vhost/vhost.c static inline int vhost_put_used_idx(struct vhost_virtqueue *vq) vq 938 drivers/vhost/vhost.c return vhost_put_user(vq, cpu_to_vhost16(vq, vq->last_used_idx), vq 939 drivers/vhost/vhost.c &vq->used->idx); vq 942 drivers/vhost/vhost.c #define vhost_get_user(vq, x, ptr, type) \ vq 945 drivers/vhost/vhost.c if (!vq->iotlb) { \ vq 949 drivers/vhost/vhost.c (__typeof__(ptr)) __vhost_get_user(vq, ptr, \ vq 960 drivers/vhost/vhost.c #define vhost_get_avail(vq, x, ptr) \ vq 961 drivers/vhost/vhost.c vhost_get_user(vq, x, ptr, VHOST_ADDR_AVAIL) vq 963 drivers/vhost/vhost.c #define vhost_get_used(vq, x, ptr) \ vq 964 drivers/vhost/vhost.c vhost_get_user(vq, x, ptr, VHOST_ADDR_USED) vq 980 drivers/vhost/vhost.c static inline int vhost_get_avail_idx(struct vhost_virtqueue *vq, vq 983 drivers/vhost/vhost.c return vhost_get_avail(vq, *idx, &vq->avail->idx); vq 986 drivers/vhost/vhost.c static inline int vhost_get_avail_head(struct vhost_virtqueue *vq, vq 989 drivers/vhost/vhost.c return vhost_get_avail(vq, *head, vq 990 drivers/vhost/vhost.c &vq->avail->ring[idx & (vq->num - 1)]); vq 993 drivers/vhost/vhost.c static inline int vhost_get_avail_flags(struct vhost_virtqueue *vq, vq 996 drivers/vhost/vhost.c return vhost_get_avail(vq, *flags, &vq->avail->flags); vq 999 drivers/vhost/vhost.c static inline int vhost_get_used_event(struct vhost_virtqueue *vq, vq 1002 drivers/vhost/vhost.c return vhost_get_avail(vq, *event, vhost_used_event(vq)); vq 1005 drivers/vhost/vhost.c static inline int vhost_get_used_idx(struct vhost_virtqueue *vq, vq 1008 drivers/vhost/vhost.c return vhost_get_used(vq, *idx, &vq->used->idx); vq 1011 drivers/vhost/vhost.c static inline int vhost_get_desc(struct vhost_virtqueue *vq, vq 1014 drivers/vhost/vhost.c return vhost_copy_from_user(vq, desc, vq->desc + idx, sizeof(*desc)); vq 1070 drivers/vhost/vhost.c vhost_poll_queue(&node->vq->poll); vq 1269 drivers/vhost/vhost.c static int vhost_iotlb_miss(struct vhost_virtqueue *vq, u64 iova, int access) vq 1271 drivers/vhost/vhost.c struct vhost_dev *dev = vq->dev; vq 1274 drivers/vhost/vhost.c bool v2 = vhost_backend_has_feature(vq, VHOST_BACKEND_F_IOTLB_MSG_V2); vq 1276 drivers/vhost/vhost.c node = vhost_new_msg(vq, v2 ? VHOST_IOTLB_MSG_V2 : VHOST_IOTLB_MSG); vq 1296 drivers/vhost/vhost.c static bool vq_access_ok(struct vhost_virtqueue *vq, unsigned int num, vq 1302 drivers/vhost/vhost.c return access_ok(desc, vhost_get_desc_size(vq, num)) && vq 1303 drivers/vhost/vhost.c access_ok(avail, vhost_get_avail_size(vq, num)) && vq 1304 drivers/vhost/vhost.c access_ok(used, vhost_get_used_size(vq, num)); vq 1307 drivers/vhost/vhost.c static void vhost_vq_meta_update(struct vhost_virtqueue *vq, vq 1315 drivers/vhost/vhost.c vq->meta_iotlb[type] = node; vq 1318 drivers/vhost/vhost.c static bool iotlb_access_ok(struct vhost_virtqueue *vq, vq 1322 drivers/vhost/vhost.c struct vhost_umem *umem = vq->iotlb; vq 1325 drivers/vhost/vhost.c if (vhost_vq_meta_fetch(vq, addr, len, type)) vq 1333 drivers/vhost/vhost.c vhost_iotlb_miss(vq, addr, access); vq 1345 drivers/vhost/vhost.c vhost_vq_meta_update(vq, node, type); vq 1354 drivers/vhost/vhost.c int vq_meta_prefetch(struct vhost_virtqueue *vq) vq 1356 drivers/vhost/vhost.c unsigned int num = vq->num; vq 1358 drivers/vhost/vhost.c if (!vq->iotlb) vq 1361 drivers/vhost/vhost.c return iotlb_access_ok(vq, VHOST_ACCESS_RO, (u64)(uintptr_t)vq->desc, vq 1362 drivers/vhost/vhost.c vhost_get_desc_size(vq, num), VHOST_ADDR_DESC) && vq 1363 drivers/vhost/vhost.c iotlb_access_ok(vq, VHOST_ACCESS_RO, (u64)(uintptr_t)vq->avail, vq 1364 drivers/vhost/vhost.c vhost_get_avail_size(vq, num), vq 1366 drivers/vhost/vhost.c iotlb_access_ok(vq, VHOST_ACCESS_WO, (u64)(uintptr_t)vq->used, vq 1367 drivers/vhost/vhost.c vhost_get_used_size(vq, num), VHOST_ADDR_USED); vq 1381 drivers/vhost/vhost.c static bool vq_log_access_ok(struct vhost_virtqueue *vq, vq 1384 drivers/vhost/vhost.c return vq_memory_access_ok(log_base, vq->umem, vq 1385 drivers/vhost/vhost.c vhost_has_feature(vq, VHOST_F_LOG_ALL)) && vq 1386 drivers/vhost/vhost.c (!vq->log_used || log_access_ok(log_base, vq->log_addr, vq 1387 drivers/vhost/vhost.c vhost_get_used_size(vq, vq->num))); vq 1392 drivers/vhost/vhost.c bool vhost_vq_access_ok(struct vhost_virtqueue *vq) vq 1394 drivers/vhost/vhost.c if (!vq_log_access_ok(vq, vq->log_base)) vq 1398 drivers/vhost/vhost.c if (vq->iotlb) vq 1401 drivers/vhost/vhost.c return vq_access_ok(vq, vq->num, vq->desc, vq->avail, vq->used); vq 1488 drivers/vhost/vhost.c struct vhost_virtqueue *vq, vq 1495 drivers/vhost/vhost.c if (vq->private_data) vq 1503 drivers/vhost/vhost.c vq->num = s.num; vq 1509 drivers/vhost/vhost.c struct vhost_virtqueue *vq, vq 1527 drivers/vhost/vhost.c BUILD_BUG_ON(__alignof__ *vq->avail > VRING_AVAIL_ALIGN_SIZE); vq 1528 drivers/vhost/vhost.c BUILD_BUG_ON(__alignof__ *vq->used > VRING_USED_ALIGN_SIZE); vq 1537 drivers/vhost/vhost.c if (vq->private_data) { vq 1538 drivers/vhost/vhost.c if (!vq_access_ok(vq, vq->num, vq 1546 drivers/vhost/vhost.c !log_access_ok(vq->log_base, a.log_guest_addr, vq 1547 drivers/vhost/vhost.c sizeof *vq->used + vq 1548 drivers/vhost/vhost.c vq->num * sizeof *vq->used->ring)) vq 1552 drivers/vhost/vhost.c vq->log_used = !!(a.flags & (0x1 << VHOST_VRING_F_LOG)); vq 1553 drivers/vhost/vhost.c vq->desc = (void __user *)(unsigned long)a.desc_user_addr; vq 1554 drivers/vhost/vhost.c vq->avail = (void __user *)(unsigned long)a.avail_user_addr; vq 1555 drivers/vhost/vhost.c vq->log_addr = a.log_guest_addr; vq 1556 drivers/vhost/vhost.c vq->used = (void __user *)(unsigned long)a.used_user_addr; vq 1562 drivers/vhost/vhost.c struct vhost_virtqueue *vq, vq 1568 drivers/vhost/vhost.c mutex_lock(&vq->mutex); vq 1572 drivers/vhost/vhost.c r = vhost_vring_set_num(d, vq, argp); vq 1575 drivers/vhost/vhost.c r = vhost_vring_set_addr(d, vq, argp); vq 1581 drivers/vhost/vhost.c mutex_unlock(&vq->mutex); vq 1591 drivers/vhost/vhost.c struct vhost_virtqueue *vq; vq 1604 drivers/vhost/vhost.c vq = d->vqs[idx]; vq 1608 drivers/vhost/vhost.c return vhost_vring_set_num_addr(d, vq, ioctl, argp); vq 1611 drivers/vhost/vhost.c mutex_lock(&vq->mutex); vq 1617 drivers/vhost/vhost.c if (vq->private_data) { vq 1629 drivers/vhost/vhost.c vq->last_avail_idx = s.num; vq 1631 drivers/vhost/vhost.c vq->avail_idx = vq->last_avail_idx; vq 1635 drivers/vhost/vhost.c s.num = vq->last_avail_idx; vq 1649 drivers/vhost/vhost.c if (eventfp != vq->kick) { vq 1650 drivers/vhost/vhost.c pollstop = (filep = vq->kick) != NULL; vq 1651 drivers/vhost/vhost.c pollstart = (vq->kick = eventfp) != NULL; vq 1665 drivers/vhost/vhost.c swap(ctx, vq->call_ctx); vq 1677 drivers/vhost/vhost.c swap(ctx, vq->error_ctx); vq 1680 drivers/vhost/vhost.c r = vhost_set_vring_endian(vq, argp); vq 1683 drivers/vhost/vhost.c r = vhost_get_vring_endian(vq, idx, argp); vq 1690 drivers/vhost/vhost.c vq->busyloop_timeout = s.num; vq 1694 drivers/vhost/vhost.c s.num = vq->busyloop_timeout; vq 1702 drivers/vhost/vhost.c if (pollstop && vq->handle_kick) vq 1703 drivers/vhost/vhost.c vhost_poll_stop(&vq->poll); vq 1710 drivers/vhost/vhost.c if (pollstart && vq->handle_kick) vq 1711 drivers/vhost/vhost.c r = vhost_poll_start(&vq->poll, vq->kick); vq 1713 drivers/vhost/vhost.c mutex_unlock(&vq->mutex); vq 1715 drivers/vhost/vhost.c if (pollstop && vq->handle_kick) vq 1716 drivers/vhost/vhost.c vhost_poll_flush(&vq->poll); vq 1734 drivers/vhost/vhost.c struct vhost_virtqueue *vq = d->vqs[i]; vq 1736 drivers/vhost/vhost.c mutex_lock(&vq->mutex); vq 1737 drivers/vhost/vhost.c vq->iotlb = niotlb; vq 1738 drivers/vhost/vhost.c __vhost_vq_meta_reset(vq); vq 1739 drivers/vhost/vhost.c mutex_unlock(&vq->mutex); vq 1781 drivers/vhost/vhost.c struct vhost_virtqueue *vq; vq 1783 drivers/vhost/vhost.c vq = d->vqs[i]; vq 1784 drivers/vhost/vhost.c mutex_lock(&vq->mutex); vq 1786 drivers/vhost/vhost.c if (vq->private_data && !vq_log_access_ok(vq, base)) vq 1789 drivers/vhost/vhost.c vq->log_base = base; vq 1790 drivers/vhost/vhost.c mutex_unlock(&vq->mutex); vq 1870 drivers/vhost/vhost.c static int log_write_hva(struct vhost_virtqueue *vq, u64 hva, u64 len) vq 1872 drivers/vhost/vhost.c struct vhost_umem *umem = vq->umem; vq 1891 drivers/vhost/vhost.c r = log_write(vq->log_base, vq 1910 drivers/vhost/vhost.c static int log_used(struct vhost_virtqueue *vq, u64 used_offset, u64 len) vq 1915 drivers/vhost/vhost.c if (!vq->iotlb) vq 1916 drivers/vhost/vhost.c return log_write(vq->log_base, vq->log_addr + used_offset, len); vq 1918 drivers/vhost/vhost.c ret = translate_desc(vq, (uintptr_t)vq->used + used_offset, vq 1924 drivers/vhost/vhost.c ret = log_write_hva(vq, (uintptr_t)iov[i].iov_base, vq 1933 drivers/vhost/vhost.c int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log, vq 1941 drivers/vhost/vhost.c if (vq->iotlb) { vq 1943 drivers/vhost/vhost.c r = log_write_hva(vq, (uintptr_t)iov[i].iov_base, vq 1953 drivers/vhost/vhost.c r = log_write(vq->log_base, log[i].addr, l); vq 1958 drivers/vhost/vhost.c if (vq->log_ctx) vq 1959 drivers/vhost/vhost.c eventfd_signal(vq->log_ctx, 1); vq 1969 drivers/vhost/vhost.c static int vhost_update_used_flags(struct vhost_virtqueue *vq) vq 1972 drivers/vhost/vhost.c if (vhost_put_used_flags(vq)) vq 1974 drivers/vhost/vhost.c if (unlikely(vq->log_used)) { vq 1978 drivers/vhost/vhost.c used = &vq->used->flags; vq 1979 drivers/vhost/vhost.c log_used(vq, (used - (void __user *)vq->used), vq 1980 drivers/vhost/vhost.c sizeof vq->used->flags); vq 1981 drivers/vhost/vhost.c if (vq->log_ctx) vq 1982 drivers/vhost/vhost.c eventfd_signal(vq->log_ctx, 1); vq 1987 drivers/vhost/vhost.c static int vhost_update_avail_event(struct vhost_virtqueue *vq, u16 avail_event) vq 1989 drivers/vhost/vhost.c if (vhost_put_avail_event(vq)) vq 1991 drivers/vhost/vhost.c if (unlikely(vq->log_used)) { vq 1996 drivers/vhost/vhost.c used = vhost_avail_event(vq); vq 1997 drivers/vhost/vhost.c log_used(vq, (used - (void __user *)vq->used), vq 1998 drivers/vhost/vhost.c sizeof *vhost_avail_event(vq)); vq 1999 drivers/vhost/vhost.c if (vq->log_ctx) vq 2000 drivers/vhost/vhost.c eventfd_signal(vq->log_ctx, 1); vq 2005 drivers/vhost/vhost.c int vhost_vq_init_access(struct vhost_virtqueue *vq) vq 2009 drivers/vhost/vhost.c bool is_le = vq->is_le; vq 2011 drivers/vhost/vhost.c if (!vq->private_data) vq 2014 drivers/vhost/vhost.c vhost_init_is_le(vq); vq 2016 drivers/vhost/vhost.c r = vhost_update_used_flags(vq); vq 2019 drivers/vhost/vhost.c vq->signalled_used_valid = false; vq 2020 drivers/vhost/vhost.c if (!vq->iotlb && vq 2021 drivers/vhost/vhost.c !access_ok(&vq->used->idx, sizeof vq->used->idx)) { vq 2025 drivers/vhost/vhost.c r = vhost_get_used_idx(vq, &last_used_idx); vq 2027 drivers/vhost/vhost.c vq_err(vq, "Can't access used idx at %p\n", vq 2028 drivers/vhost/vhost.c &vq->used->idx); vq 2031 drivers/vhost/vhost.c vq->last_used_idx = vhost16_to_cpu(vq, last_used_idx); vq 2035 drivers/vhost/vhost.c vq->is_le = is_le; vq 2040 drivers/vhost/vhost.c static int translate_desc(struct vhost_virtqueue *vq, u64 addr, u32 len, vq 2044 drivers/vhost/vhost.c struct vhost_dev *dev = vq->dev; vq 2082 drivers/vhost/vhost.c vhost_iotlb_miss(vq, addr, access); vq 2089 drivers/vhost/vhost.c static unsigned next_desc(struct vhost_virtqueue *vq, struct vring_desc *desc) vq 2094 drivers/vhost/vhost.c if (!(desc->flags & cpu_to_vhost16(vq, VRING_DESC_F_NEXT))) vq 2098 drivers/vhost/vhost.c next = vhost16_to_cpu(vq, READ_ONCE(desc->next)); vq 2102 drivers/vhost/vhost.c static int get_indirect(struct vhost_virtqueue *vq, vq 2110 drivers/vhost/vhost.c u32 len = vhost32_to_cpu(vq, indirect->len); vq 2116 drivers/vhost/vhost.c vq_err(vq, "Invalid length in indirect descriptor: " vq 2123 drivers/vhost/vhost.c ret = translate_desc(vq, vhost64_to_cpu(vq, indirect->addr), len, vq->indirect, vq 2127 drivers/vhost/vhost.c vq_err(vq, "Translation failure %d in indirect.\n", ret); vq 2130 drivers/vhost/vhost.c iov_iter_init(&from, READ, vq->indirect, ret, len); vq 2140 drivers/vhost/vhost.c vq_err(vq, "Indirect buffer length too big: %d\n", vq 2148 drivers/vhost/vhost.c vq_err(vq, "Loop detected: last one at %u " vq 2154 drivers/vhost/vhost.c vq_err(vq, "Failed indirect descriptor: idx %d, %zx\n", vq 2155 drivers/vhost/vhost.c i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc); vq 2158 drivers/vhost/vhost.c if (unlikely(desc.flags & cpu_to_vhost16(vq, VRING_DESC_F_INDIRECT))) { vq 2159 drivers/vhost/vhost.c vq_err(vq, "Nested indirect descriptor: idx %d, %zx\n", vq 2160 drivers/vhost/vhost.c i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc); vq 2164 drivers/vhost/vhost.c if (desc.flags & cpu_to_vhost16(vq, VRING_DESC_F_WRITE)) vq 2169 drivers/vhost/vhost.c ret = translate_desc(vq, vhost64_to_cpu(vq, desc.addr), vq 2170 drivers/vhost/vhost.c vhost32_to_cpu(vq, desc.len), iov + iov_count, vq 2174 drivers/vhost/vhost.c vq_err(vq, "Translation failure %d indirect idx %d\n", vq 2182 drivers/vhost/vhost.c log[*log_num].addr = vhost64_to_cpu(vq, desc.addr); vq 2183 drivers/vhost/vhost.c log[*log_num].len = vhost32_to_cpu(vq, desc.len); vq 2190 drivers/vhost/vhost.c vq_err(vq, "Indirect descriptor " vq 2196 drivers/vhost/vhost.c } while ((i = next_desc(vq, &desc)) != -1); vq 2208 drivers/vhost/vhost.c int vhost_get_vq_desc(struct vhost_virtqueue *vq, vq 2221 drivers/vhost/vhost.c last_avail_idx = vq->last_avail_idx; vq 2223 drivers/vhost/vhost.c if (vq->avail_idx == vq->last_avail_idx) { vq 2224 drivers/vhost/vhost.c if (unlikely(vhost_get_avail_idx(vq, &avail_idx))) { vq 2225 drivers/vhost/vhost.c vq_err(vq, "Failed to access avail idx at %p\n", vq 2226 drivers/vhost/vhost.c &vq->avail->idx); vq 2229 drivers/vhost/vhost.c vq->avail_idx = vhost16_to_cpu(vq, avail_idx); vq 2231 drivers/vhost/vhost.c if (unlikely((u16)(vq->avail_idx - last_avail_idx) > vq->num)) { vq 2232 drivers/vhost/vhost.c vq_err(vq, "Guest moved used index from %u to %u", vq 2233 drivers/vhost/vhost.c last_avail_idx, vq->avail_idx); vq 2240 drivers/vhost/vhost.c if (vq->avail_idx == last_avail_idx) vq 2241 drivers/vhost/vhost.c return vq->num; vq 2251 drivers/vhost/vhost.c if (unlikely(vhost_get_avail_head(vq, &ring_head, last_avail_idx))) { vq 2252 drivers/vhost/vhost.c vq_err(vq, "Failed to read head: idx %d address %p\n", vq 2254 drivers/vhost/vhost.c &vq->avail->ring[last_avail_idx % vq->num]); vq 2258 drivers/vhost/vhost.c head = vhost16_to_cpu(vq, ring_head); vq 2261 drivers/vhost/vhost.c if (unlikely(head >= vq->num)) { vq 2262 drivers/vhost/vhost.c vq_err(vq, "Guest says index %u > %u is available", vq 2263 drivers/vhost/vhost.c head, vq->num); vq 2275 drivers/vhost/vhost.c if (unlikely(i >= vq->num)) { vq 2276 drivers/vhost/vhost.c vq_err(vq, "Desc index is %u > %u, head = %u", vq 2277 drivers/vhost/vhost.c i, vq->num, head); vq 2280 drivers/vhost/vhost.c if (unlikely(++found > vq->num)) { vq 2281 drivers/vhost/vhost.c vq_err(vq, "Loop detected: last one at %u " vq 2283 drivers/vhost/vhost.c i, vq->num, head); vq 2286 drivers/vhost/vhost.c ret = vhost_get_desc(vq, &desc, i); vq 2288 drivers/vhost/vhost.c vq_err(vq, "Failed to get descriptor: idx %d addr %p\n", vq 2289 drivers/vhost/vhost.c i, vq->desc + i); vq 2292 drivers/vhost/vhost.c if (desc.flags & cpu_to_vhost16(vq, VRING_DESC_F_INDIRECT)) { vq 2293 drivers/vhost/vhost.c ret = get_indirect(vq, iov, iov_size, vq 2298 drivers/vhost/vhost.c vq_err(vq, "Failure detected " vq 2305 drivers/vhost/vhost.c if (desc.flags & cpu_to_vhost16(vq, VRING_DESC_F_WRITE)) vq 2309 drivers/vhost/vhost.c ret = translate_desc(vq, vhost64_to_cpu(vq, desc.addr), vq 2310 drivers/vhost/vhost.c vhost32_to_cpu(vq, desc.len), iov + iov_count, vq 2314 drivers/vhost/vhost.c vq_err(vq, "Translation failure %d descriptor idx %d\n", vq 2323 drivers/vhost/vhost.c log[*log_num].addr = vhost64_to_cpu(vq, desc.addr); vq 2324 drivers/vhost/vhost.c log[*log_num].len = vhost32_to_cpu(vq, desc.len); vq 2331 drivers/vhost/vhost.c vq_err(vq, "Descriptor has out after in: " vq 2337 drivers/vhost/vhost.c } while ((i = next_desc(vq, &desc)) != -1); vq 2340 drivers/vhost/vhost.c vq->last_avail_idx++; vq 2344 drivers/vhost/vhost.c BUG_ON(!(vq->used_flags & VRING_USED_F_NO_NOTIFY)); vq 2350 drivers/vhost/vhost.c void vhost_discard_vq_desc(struct vhost_virtqueue *vq, int n) vq 2352 drivers/vhost/vhost.c vq->last_avail_idx -= n; vq 2358 drivers/vhost/vhost.c int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len) vq 2361 drivers/vhost/vhost.c cpu_to_vhost32(vq, head), vq 2362 drivers/vhost/vhost.c cpu_to_vhost32(vq, len) vq 2365 drivers/vhost/vhost.c return vhost_add_used_n(vq, &heads, 1); vq 2369 drivers/vhost/vhost.c static int __vhost_add_used_n(struct vhost_virtqueue *vq, vq 2377 drivers/vhost/vhost.c start = vq->last_used_idx & (vq->num - 1); vq 2378 drivers/vhost/vhost.c used = vq->used->ring + start; vq 2379 drivers/vhost/vhost.c if (vhost_put_used(vq, heads, start, count)) { vq 2380 drivers/vhost/vhost.c vq_err(vq, "Failed to write used"); vq 2383 drivers/vhost/vhost.c if (unlikely(vq->log_used)) { vq 2387 drivers/vhost/vhost.c log_used(vq, ((void __user *)used - (void __user *)vq->used), vq 2390 drivers/vhost/vhost.c old = vq->last_used_idx; vq 2391 drivers/vhost/vhost.c new = (vq->last_used_idx += count); vq 2396 drivers/vhost/vhost.c if (unlikely((u16)(new - vq->signalled_used) < (u16)(new - old))) vq 2397 drivers/vhost/vhost.c vq->signalled_used_valid = false; vq 2403 drivers/vhost/vhost.c int vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, vq 2408 drivers/vhost/vhost.c start = vq->last_used_idx & (vq->num - 1); vq 2409 drivers/vhost/vhost.c n = vq->num - start; vq 2411 drivers/vhost/vhost.c r = __vhost_add_used_n(vq, heads, n); vq 2417 drivers/vhost/vhost.c r = __vhost_add_used_n(vq, heads, count); vq 2421 drivers/vhost/vhost.c if (vhost_put_used_idx(vq)) { vq 2422 drivers/vhost/vhost.c vq_err(vq, "Failed to increment used idx"); vq 2425 drivers/vhost/vhost.c if (unlikely(vq->log_used)) { vq 2429 drivers/vhost/vhost.c log_used(vq, offsetof(struct vring_used, idx), vq 2430 drivers/vhost/vhost.c sizeof vq->used->idx); vq 2431 drivers/vhost/vhost.c if (vq->log_ctx) vq 2432 drivers/vhost/vhost.c eventfd_signal(vq->log_ctx, 1); vq 2438 drivers/vhost/vhost.c static bool vhost_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq) vq 2448 drivers/vhost/vhost.c if (vhost_has_feature(vq, VIRTIO_F_NOTIFY_ON_EMPTY) && vq 2449 drivers/vhost/vhost.c unlikely(vq->avail_idx == vq->last_avail_idx)) vq 2452 drivers/vhost/vhost.c if (!vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { vq 2454 drivers/vhost/vhost.c if (vhost_get_avail_flags(vq, &flags)) { vq 2455 drivers/vhost/vhost.c vq_err(vq, "Failed to get flags"); vq 2458 drivers/vhost/vhost.c return !(flags & cpu_to_vhost16(vq, VRING_AVAIL_F_NO_INTERRUPT)); vq 2460 drivers/vhost/vhost.c old = vq->signalled_used; vq 2461 drivers/vhost/vhost.c v = vq->signalled_used_valid; vq 2462 drivers/vhost/vhost.c new = vq->signalled_used = vq->last_used_idx; vq 2463 drivers/vhost/vhost.c vq->signalled_used_valid = true; vq 2468 drivers/vhost/vhost.c if (vhost_get_used_event(vq, &event)) { vq 2469 drivers/vhost/vhost.c vq_err(vq, "Failed to get used event idx"); vq 2472 drivers/vhost/vhost.c return vring_need_event(vhost16_to_cpu(vq, event), new, old); vq 2476 drivers/vhost/vhost.c void vhost_signal(struct vhost_dev *dev, struct vhost_virtqueue *vq) vq 2479 drivers/vhost/vhost.c if (vq->call_ctx && vhost_notify(dev, vq)) vq 2480 drivers/vhost/vhost.c eventfd_signal(vq->call_ctx, 1); vq 2486 drivers/vhost/vhost.c struct vhost_virtqueue *vq, vq 2489 drivers/vhost/vhost.c vhost_add_used(vq, head, len); vq 2490 drivers/vhost/vhost.c vhost_signal(dev, vq); vq 2496 drivers/vhost/vhost.c struct vhost_virtqueue *vq, vq 2499 drivers/vhost/vhost.c vhost_add_used_n(vq, heads, count); vq 2500 drivers/vhost/vhost.c vhost_signal(dev, vq); vq 2505 drivers/vhost/vhost.c bool vhost_vq_avail_empty(struct vhost_dev *dev, struct vhost_virtqueue *vq) vq 2510 drivers/vhost/vhost.c if (vq->avail_idx != vq->last_avail_idx) vq 2513 drivers/vhost/vhost.c r = vhost_get_avail_idx(vq, &avail_idx); vq 2516 drivers/vhost/vhost.c vq->avail_idx = vhost16_to_cpu(vq, avail_idx); vq 2518 drivers/vhost/vhost.c return vq->avail_idx == vq->last_avail_idx; vq 2523 drivers/vhost/vhost.c bool vhost_enable_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq) vq 2528 drivers/vhost/vhost.c if (!(vq->used_flags & VRING_USED_F_NO_NOTIFY)) vq 2530 drivers/vhost/vhost.c vq->used_flags &= ~VRING_USED_F_NO_NOTIFY; vq 2531 drivers/vhost/vhost.c if (!vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { vq 2532 drivers/vhost/vhost.c r = vhost_update_used_flags(vq); vq 2534 drivers/vhost/vhost.c vq_err(vq, "Failed to enable notification at %p: %d\n", vq 2535 drivers/vhost/vhost.c &vq->used->flags, r); vq 2539 drivers/vhost/vhost.c r = vhost_update_avail_event(vq, vq->avail_idx); vq 2541 drivers/vhost/vhost.c vq_err(vq, "Failed to update avail event index at %p: %d\n", vq 2542 drivers/vhost/vhost.c vhost_avail_event(vq), r); vq 2549 drivers/vhost/vhost.c r = vhost_get_avail_idx(vq, &avail_idx); vq 2551 drivers/vhost/vhost.c vq_err(vq, "Failed to check avail idx at %p: %d\n", vq 2552 drivers/vhost/vhost.c &vq->avail->idx, r); vq 2556 drivers/vhost/vhost.c return vhost16_to_cpu(vq, avail_idx) != vq->avail_idx; vq 2561 drivers/vhost/vhost.c void vhost_disable_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq) vq 2565 drivers/vhost/vhost.c if (vq->used_flags & VRING_USED_F_NO_NOTIFY) vq 2567 drivers/vhost/vhost.c vq->used_flags |= VRING_USED_F_NO_NOTIFY; vq 2568 drivers/vhost/vhost.c if (!vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { vq 2569 drivers/vhost/vhost.c r = vhost_update_used_flags(vq); vq 2571 drivers/vhost/vhost.c vq_err(vq, "Failed to enable notification at %p: %d\n", vq 2572 drivers/vhost/vhost.c &vq->used->flags, r); vq 2578 drivers/vhost/vhost.c struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type) vq 2586 drivers/vhost/vhost.c node->vq = vq; vq 155 drivers/vhost/vhost.h struct vhost_virtqueue *vq; vq 178 drivers/vhost/vhost.h bool vhost_exceeds_weight(struct vhost_virtqueue *vq, int pkts, int total_len); vq 190 drivers/vhost/vhost.h bool vhost_vq_access_ok(struct vhost_virtqueue *vq); vq 212 drivers/vhost/vhost.h int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log, vq 215 drivers/vhost/vhost.h int vq_meta_prefetch(struct vhost_virtqueue *vq); vq 217 drivers/vhost/vhost.h struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type); vq 231 drivers/vhost/vhost.h #define vq_err(vq, fmt, ...) do { \ vq 233 drivers/vhost/vhost.h if ((vq)->error_ctx) \ vq 234 drivers/vhost/vhost.h eventfd_signal((vq)->error_ctx, 1);\ vq 246 drivers/vhost/vhost.h static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit) vq 248 drivers/vhost/vhost.h return vq->acked_features & (1ULL << bit); vq 251 drivers/vhost/vhost.h static inline bool vhost_backend_has_feature(struct vhost_virtqueue *vq, int bit) vq 253 drivers/vhost/vhost.h return vq->acked_backend_features & (1ULL << bit); vq 257 drivers/vhost/vhost.h static inline bool vhost_is_little_endian(struct vhost_virtqueue *vq) vq 259 drivers/vhost/vhost.h return vq->is_le; vq 262 drivers/vhost/vhost.h static inline bool vhost_is_little_endian(struct vhost_virtqueue *vq) vq 264 drivers/vhost/vhost.h return virtio_legacy_is_little_endian() || vq->is_le; vq 269 drivers/vhost/vhost.h static inline u16 vhost16_to_cpu(struct vhost_virtqueue *vq, __virtio16 val) vq 271 drivers/vhost/vhost.h return __virtio16_to_cpu(vhost_is_little_endian(vq), val); vq 274 drivers/vhost/vhost.h static inline __virtio16 cpu_to_vhost16(struct vhost_virtqueue *vq, u16 val) vq 276 drivers/vhost/vhost.h return __cpu_to_virtio16(vhost_is_little_endian(vq), val); vq 279 drivers/vhost/vhost.h static inline u32 vhost32_to_cpu(struct vhost_virtqueue *vq, __virtio32 val) vq 281 drivers/vhost/vhost.h return __virtio32_to_cpu(vhost_is_little_endian(vq), val); vq 284 drivers/vhost/vhost.h static inline __virtio32 cpu_to_vhost32(struct vhost_virtqueue *vq, u32 val) vq 286 drivers/vhost/vhost.h return __cpu_to_virtio32(vhost_is_little_endian(vq), val); vq 289 drivers/vhost/vhost.h static inline u64 vhost64_to_cpu(struct vhost_virtqueue *vq, __virtio64 val) vq 291 drivers/vhost/vhost.h return __virtio64_to_cpu(vhost_is_little_endian(vq), val); vq 294 drivers/vhost/vhost.h static inline __virtio64 cpu_to_vhost64(struct vhost_virtqueue *vq, u64 val) vq 296 drivers/vhost/vhost.h return __cpu_to_virtio64(vhost_is_little_endian(vq), val); vq 85 drivers/vhost/vsock.c struct vhost_virtqueue *vq) vq 92 drivers/vhost/vsock.c mutex_lock(&vq->mutex); vq 94 drivers/vhost/vsock.c if (!vq->private_data) vq 98 drivers/vhost/vsock.c vhost_disable_notify(&vsock->dev, vq); vq 111 drivers/vhost/vsock.c vhost_enable_notify(&vsock->dev, vq); vq 120 drivers/vhost/vsock.c head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), vq 129 drivers/vhost/vsock.c if (head == vq->num) { vq 137 drivers/vhost/vsock.c if (unlikely(vhost_enable_notify(&vsock->dev, vq))) { vq 138 drivers/vhost/vsock.c vhost_disable_notify(&vsock->dev, vq); vq 146 drivers/vhost/vsock.c vq_err(vq, "Expected 0 output buffers, got %u\n", out); vq 150 drivers/vhost/vsock.c iov_len = iov_length(&vq->iov[out], in); vq 153 drivers/vhost/vsock.c vq_err(vq, "Buffer len [%zu] too small\n", iov_len); vq 157 drivers/vhost/vsock.c iov_iter_init(&iov_iter, READ, &vq->iov[out], in, iov_len); vq 172 drivers/vhost/vsock.c vq_err(vq, "Faulted on copying pkt hdr\n"); vq 180 drivers/vhost/vsock.c vq_err(vq, "Faulted on copying pkt buf\n"); vq 189 drivers/vhost/vsock.c vhost_add_used(vq, head, sizeof(pkt->hdr) + payload_len); vq 217 drivers/vhost/vsock.c } while(likely(!vhost_exceeds_weight(vq, ++pkts, total_len))); vq 219 drivers/vhost/vsock.c vhost_signal(&vsock->dev, vq); vq 222 drivers/vhost/vsock.c mutex_unlock(&vq->mutex); vq 230 drivers/vhost/vsock.c struct vhost_virtqueue *vq; vq 234 drivers/vhost/vsock.c vq = &vsock->vqs[VSOCK_VQ_RX]; vq 236 drivers/vhost/vsock.c vhost_transport_do_send_pkt(vsock, vq); vq 315 drivers/vhost/vsock.c vhost_vsock_alloc_pkt(struct vhost_virtqueue *vq, vq 324 drivers/vhost/vsock.c vq_err(vq, "Expected 0 input buffers, got %u\n", in); vq 332 drivers/vhost/vsock.c len = iov_length(vq->iov, out); vq 333 drivers/vhost/vsock.c iov_iter_init(&iov_iter, WRITE, vq->iov, out, len); vq 337 drivers/vhost/vsock.c vq_err(vq, "Expected %zu bytes for pkt->hdr, got %zu bytes\n", vq 366 drivers/vhost/vsock.c vq_err(vq, "Expected %u byte payload, got %zu bytes\n", vq 378 drivers/vhost/vsock.c struct vhost_virtqueue *vq = &vsock->vqs[VSOCK_VQ_TX]; vq 384 drivers/vhost/vsock.c return val < vq->num; vq 389 drivers/vhost/vsock.c struct vhost_virtqueue *vq = container_of(work, struct vhost_virtqueue, vq 391 drivers/vhost/vsock.c struct vhost_vsock *vsock = container_of(vq->dev, struct vhost_vsock, vq 398 drivers/vhost/vsock.c mutex_lock(&vq->mutex); vq 400 drivers/vhost/vsock.c if (!vq->private_data) vq 403 drivers/vhost/vsock.c vhost_disable_notify(&vsock->dev, vq); vq 415 drivers/vhost/vsock.c head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), vq 420 drivers/vhost/vsock.c if (head == vq->num) { vq 421 drivers/vhost/vsock.c if (unlikely(vhost_enable_notify(&vsock->dev, vq))) { vq 422 drivers/vhost/vsock.c vhost_disable_notify(&vsock->dev, vq); vq 428 drivers/vhost/vsock.c pkt = vhost_vsock_alloc_pkt(vq, out, in); vq 430 drivers/vhost/vsock.c vq_err(vq, "Faulted on pkt\n"); vq 448 drivers/vhost/vsock.c vhost_add_used(vq, head, len); vq 451 drivers/vhost/vsock.c } while(likely(!vhost_exceeds_weight(vq, ++pkts, total_len))); vq 455 drivers/vhost/vsock.c vhost_signal(&vsock->dev, vq); vq 458 drivers/vhost/vsock.c mutex_unlock(&vq->mutex); vq 463 drivers/vhost/vsock.c struct vhost_virtqueue *vq = container_of(work, struct vhost_virtqueue, vq 465 drivers/vhost/vsock.c struct vhost_vsock *vsock = container_of(vq->dev, struct vhost_vsock, vq 468 drivers/vhost/vsock.c vhost_transport_do_send_pkt(vsock, vq); vq 473 drivers/vhost/vsock.c struct vhost_virtqueue *vq; vq 484 drivers/vhost/vsock.c vq = &vsock->vqs[i]; vq 486 drivers/vhost/vsock.c mutex_lock(&vq->mutex); vq 488 drivers/vhost/vsock.c if (!vhost_vq_access_ok(vq)) { vq 493 drivers/vhost/vsock.c if (!vq->private_data) { vq 494 drivers/vhost/vsock.c vq->private_data = vsock; vq 495 drivers/vhost/vsock.c ret = vhost_vq_init_access(vq); vq 500 drivers/vhost/vsock.c mutex_unlock(&vq->mutex); vq 512 drivers/vhost/vsock.c vq->private_data = NULL; vq 513 drivers/vhost/vsock.c mutex_unlock(&vq->mutex); vq 516 drivers/vhost/vsock.c vq = &vsock->vqs[i]; vq 518 drivers/vhost/vsock.c mutex_lock(&vq->mutex); vq 519 drivers/vhost/vsock.c vq->private_data = NULL; vq 520 drivers/vhost/vsock.c mutex_unlock(&vq->mutex); vq 539 drivers/vhost/vsock.c struct vhost_virtqueue *vq = &vsock->vqs[i]; vq 541 drivers/vhost/vsock.c mutex_lock(&vq->mutex); vq 542 drivers/vhost/vsock.c vq->private_data = NULL; vq 543 drivers/vhost/vsock.c mutex_unlock(&vq->mutex); vq 705 drivers/vhost/vsock.c struct vhost_virtqueue *vq; vq 719 drivers/vhost/vsock.c vq = &vsock->vqs[i]; vq 720 drivers/vhost/vsock.c mutex_lock(&vq->mutex); vq 721 drivers/vhost/vsock.c vq->acked_features = features; vq 722 drivers/vhost/vsock.c mutex_unlock(&vq->mutex); vq 132 drivers/virtio/virtio_balloon.c static void balloon_ack(struct virtqueue *vq) vq 134 drivers/virtio/virtio_balloon.c struct virtio_balloon *vb = vq->vdev->priv; vq 139 drivers/virtio/virtio_balloon.c static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) vq 147 drivers/virtio/virtio_balloon.c virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL); vq 148 drivers/virtio/virtio_balloon.c virtqueue_kick(vq); vq 151 drivers/virtio/virtio_balloon.c wait_event(vb->acked, virtqueue_get_buf(vq, &len)); vq 330 drivers/virtio/virtio_balloon.c static void stats_request(struct virtqueue *vq) vq 332 drivers/virtio/virtio_balloon.c struct virtio_balloon *vb = vq->vdev->priv; vq 342 drivers/virtio/virtio_balloon.c struct virtqueue *vq; vq 348 drivers/virtio/virtio_balloon.c vq = vb->stats_vq; vq 349 drivers/virtio/virtio_balloon.c if (!virtqueue_get_buf(vq, &len)) vq 352 drivers/virtio/virtio_balloon.c virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL); vq 353 drivers/virtio/virtio_balloon.c virtqueue_kick(vq); vq 543 drivers/virtio/virtio_balloon.c struct virtqueue *vq = vb->free_page_vq; vq 547 drivers/virtio/virtio_balloon.c while (virtqueue_get_buf(vq, &unused)) vq 553 drivers/virtio/virtio_balloon.c err = virtqueue_add_outbuf(vq, &sg, 1, &vb->cmd_id_active, GFP_KERNEL); vq 555 drivers/virtio/virtio_balloon.c virtqueue_kick(vq); vq 562 drivers/virtio/virtio_balloon.c struct virtqueue *vq = vb->free_page_vq; vq 566 drivers/virtio/virtio_balloon.c while (virtqueue_get_buf(vq, &unused)) vq 570 drivers/virtio/virtio_balloon.c err = virtqueue_add_outbuf(vq, &sg, 1, &vb->cmd_id_stop, GFP_KERNEL); vq 572 drivers/virtio/virtio_balloon.c virtqueue_kick(vq); vq 578 drivers/virtio/virtio_balloon.c struct virtqueue *vq = vb->free_page_vq; vq 585 drivers/virtio/virtio_balloon.c while (virtqueue_get_buf(vq, &unused)) vq 600 drivers/virtio/virtio_balloon.c if (vq->num_free > 1) { vq 601 drivers/virtio/virtio_balloon.c err = virtqueue_add_inbuf(vq, &sg, 1, p, GFP_KERNEL); vq 607 drivers/virtio/virtio_balloon.c virtqueue_kick(vq); vq 31 drivers/virtio/virtio_input.c static void virtinput_recv_events(struct virtqueue *vq) vq 33 drivers/virtio/virtio_input.c struct virtio_input *vi = vq->vdev->priv; vq 49 drivers/virtio/virtio_input.c virtqueue_kick(vq); vq 89 drivers/virtio/virtio_input.c static void virtinput_recv_status(struct virtqueue *vq) vq 91 drivers/virtio/virtio_input.c struct virtio_input *vi = vq->vdev->priv; vq 97 drivers/virtio/virtio_mmio.c struct virtqueue *vq; vq 272 drivers/virtio/virtio_mmio.c static bool vm_notify(struct virtqueue *vq) vq 274 drivers/virtio/virtio_mmio.c struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vq->vdev); vq 278 drivers/virtio/virtio_mmio.c writel(vq->index, vm_dev->base + VIRTIO_MMIO_QUEUE_NOTIFY); vq 303 drivers/virtio/virtio_mmio.c ret |= vring_interrupt(irq, info->vq); vq 312 drivers/virtio/virtio_mmio.c static void vm_del_vq(struct virtqueue *vq) vq 314 drivers/virtio/virtio_mmio.c struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vq->vdev); vq 315 drivers/virtio/virtio_mmio.c struct virtio_mmio_vq_info *info = vq->priv; vq 317 drivers/virtio/virtio_mmio.c unsigned int index = vq->index; vq 332 drivers/virtio/virtio_mmio.c vring_del_virtqueue(vq); vq 340 drivers/virtio/virtio_mmio.c struct virtqueue *vq, *n; vq 342 drivers/virtio/virtio_mmio.c list_for_each_entry_safe(vq, n, &vdev->vqs, list) vq 343 drivers/virtio/virtio_mmio.c vm_del_vq(vq); vq 349 drivers/virtio/virtio_mmio.c void (*callback)(struct virtqueue *vq), vq 354 drivers/virtio/virtio_mmio.c struct virtqueue *vq; vq 386 drivers/virtio/virtio_mmio.c vq = vring_create_virtqueue(index, num, VIRTIO_MMIO_VRING_ALIGN, vdev, vq 388 drivers/virtio/virtio_mmio.c if (!vq) { vq 394 drivers/virtio/virtio_mmio.c writel(virtqueue_get_vring_size(vq), vm_dev->base + VIRTIO_MMIO_QUEUE_NUM); vq 396 drivers/virtio/virtio_mmio.c u64 q_pfn = virtqueue_get_desc_addr(vq) >> PAGE_SHIFT; vq 416 drivers/virtio/virtio_mmio.c addr = virtqueue_get_desc_addr(vq); vq 421 drivers/virtio/virtio_mmio.c addr = virtqueue_get_avail_addr(vq); vq 426 drivers/virtio/virtio_mmio.c addr = virtqueue_get_used_addr(vq); vq 434 drivers/virtio/virtio_mmio.c vq->priv = info; vq 435 drivers/virtio/virtio_mmio.c info->vq = vq; vq 441 drivers/virtio/virtio_mmio.c return vq; vq 444 drivers/virtio/virtio_mmio.c vring_del_virtqueue(vq); vq 41 drivers/virtio/virtio_pci_common.c bool vp_notify(struct virtqueue *vq) vq 45 drivers/virtio/virtio_pci_common.c iowrite16(vq->index, (void __iomem *)vq->priv); vq 68 drivers/virtio/virtio_pci_common.c if (vring_interrupt(irq, info->vq) == IRQ_HANDLED) vq 175 drivers/virtio/virtio_pci_common.c void (*callback)(struct virtqueue *vq), vq 182 drivers/virtio/virtio_pci_common.c struct virtqueue *vq; vq 189 drivers/virtio/virtio_pci_common.c vq = vp_dev->setup_vq(vp_dev, info, index, callback, name, ctx, vq 191 drivers/virtio/virtio_pci_common.c if (IS_ERR(vq)) vq 194 drivers/virtio/virtio_pci_common.c info->vq = vq; vq 204 drivers/virtio/virtio_pci_common.c return vq; vq 208 drivers/virtio/virtio_pci_common.c return vq; vq 211 drivers/virtio/virtio_pci_common.c static void vp_del_vq(struct virtqueue *vq) vq 213 drivers/virtio/virtio_pci_common.c struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev); vq 214 drivers/virtio/virtio_pci_common.c struct virtio_pci_vq_info *info = vp_dev->vqs[vq->index]; vq 229 drivers/virtio/virtio_pci_common.c struct virtqueue *vq, *n; vq 232 drivers/virtio/virtio_pci_common.c list_for_each_entry_safe(vq, n, &vdev->vqs, list) { vq 234 drivers/virtio/virtio_pci_common.c int v = vp_dev->vqs[vq->index]->msix_vector; vq 240 drivers/virtio/virtio_pci_common.c free_irq(irq, vq); vq 243 drivers/virtio/virtio_pci_common.c vp_del_vq(vq); vq 423 drivers/virtio/virtio_pci_common.c int vp_set_vq_affinity(struct virtqueue *vq, const struct cpumask *cpu_mask) vq 425 drivers/virtio/virtio_pci_common.c struct virtio_device *vdev = vq->vdev; vq 427 drivers/virtio/virtio_pci_common.c struct virtio_pci_vq_info *info = vp_dev->vqs[vq->index]; vq 431 drivers/virtio/virtio_pci_common.c if (!vq->callback) vq 33 drivers/virtio/virtio_pci_common.h struct virtqueue *vq; vq 100 drivers/virtio/virtio_pci_common.h void (*callback)(struct virtqueue *vq), vq 126 drivers/virtio/virtio_pci_common.h bool vp_notify(struct virtqueue *vq); vq 141 drivers/virtio/virtio_pci_common.h int vp_set_vq_affinity(struct virtqueue *vq, const struct cpumask *cpu_mask); vq 116 drivers/virtio/virtio_pci_legacy.c void (*callback)(struct virtqueue *vq), vq 121 drivers/virtio/virtio_pci_legacy.c struct virtqueue *vq; vq 137 drivers/virtio/virtio_pci_legacy.c vq = vring_create_virtqueue(index, num, vq 141 drivers/virtio/virtio_pci_legacy.c if (!vq) vq 144 drivers/virtio/virtio_pci_legacy.c q_pfn = virtqueue_get_desc_addr(vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT; vq 156 drivers/virtio/virtio_pci_legacy.c vq->priv = (void __force *)vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NOTIFY; vq 167 drivers/virtio/virtio_pci_legacy.c return vq; vq 172 drivers/virtio/virtio_pci_legacy.c vring_del_virtqueue(vq); vq 178 drivers/virtio/virtio_pci_legacy.c struct virtqueue *vq = info->vq; vq 179 drivers/virtio/virtio_pci_legacy.c struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev); vq 181 drivers/virtio/virtio_pci_legacy.c iowrite16(vq->index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL); vq 193 drivers/virtio/virtio_pci_legacy.c vring_del_virtqueue(vq); vq 309 drivers/virtio/virtio_pci_modern.c void (*callback)(struct virtqueue *vq), vq 315 drivers/virtio/virtio_pci_modern.c struct virtqueue *vq; vq 341 drivers/virtio/virtio_pci_modern.c vq = vring_create_virtqueue(index, num, vq 345 drivers/virtio/virtio_pci_modern.c if (!vq) vq 349 drivers/virtio/virtio_pci_modern.c vp_iowrite16(virtqueue_get_vring_size(vq), &cfg->queue_size); vq 350 drivers/virtio/virtio_pci_modern.c vp_iowrite64_twopart(virtqueue_get_desc_addr(vq), vq 352 drivers/virtio/virtio_pci_modern.c vp_iowrite64_twopart(virtqueue_get_avail_addr(vq), vq 354 drivers/virtio/virtio_pci_modern.c vp_iowrite64_twopart(virtqueue_get_used_addr(vq), vq 369 drivers/virtio/virtio_pci_modern.c vq->priv = (void __force *)vp_dev->notify_base + vq 372 drivers/virtio/virtio_pci_modern.c vq->priv = (void __force *)map_capability(vp_dev->pci_dev, vq 378 drivers/virtio/virtio_pci_modern.c if (!vq->priv) { vq 392 drivers/virtio/virtio_pci_modern.c return vq; vq 396 drivers/virtio/virtio_pci_modern.c pci_iounmap(vp_dev->pci_dev, (void __iomem __force *)vq->priv); vq 398 drivers/virtio/virtio_pci_modern.c vring_del_virtqueue(vq); vq 409 drivers/virtio/virtio_pci_modern.c struct virtqueue *vq; vq 418 drivers/virtio/virtio_pci_modern.c list_for_each_entry(vq, &vdev->vqs, list) { vq 419 drivers/virtio/virtio_pci_modern.c vp_iowrite16(vq->index, &vp_dev->common->queue_select); vq 428 drivers/virtio/virtio_pci_modern.c struct virtqueue *vq = info->vq; vq 429 drivers/virtio/virtio_pci_modern.c struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev); vq 431 drivers/virtio/virtio_pci_modern.c vp_iowrite16(vq->index, &vp_dev->common->queue_select); vq 441 drivers/virtio/virtio_pci_modern.c pci_iounmap(vp_dev->pci_dev, (void __force __iomem *)vq->priv); vq 443 drivers/virtio/virtio_pci_modern.c vring_del_virtqueue(vq); vq 20 drivers/virtio/virtio_ring.c dev_err(&(_vq)->vq.vdev->dev, \ vq 21 drivers/virtio/virtio_ring.c "%s:"fmt, (_vq)->vq.name, ##args); \ vq 29 drivers/virtio/virtio_ring.c (_vq)->vq.name, (_vq)->in_use); \ vq 57 drivers/virtio/virtio_ring.c dev_err(&_vq->vq.vdev->dev, \ vq 58 drivers/virtio/virtio_ring.c "%s:"fmt, (_vq)->vq.name, ##args); \ vq 61 drivers/virtio/virtio_ring.c #define START_USE(vq) vq 62 drivers/virtio/virtio_ring.c #define END_USE(vq) vq 63 drivers/virtio/virtio_ring.c #define LAST_ADD_TIME_UPDATE(vq) vq 64 drivers/virtio/virtio_ring.c #define LAST_ADD_TIME_CHECK(vq) vq 65 drivers/virtio/virtio_ring.c #define LAST_ADD_TIME_INVALID(vq) vq 88 drivers/virtio/virtio_ring.c struct virtqueue vq; vq 181 drivers/virtio/virtio_ring.c bool (*notify)(struct virtqueue *vq); vq 201 drivers/virtio/virtio_ring.c #define to_vvq(_vq) container_of(_vq, struct vring_virtqueue, vq) vq 206 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 212 drivers/virtio/virtio_ring.c return (vq->indirect && total_sg > 1 && vq->vq.num_free); vq 319 drivers/virtio/virtio_ring.c static inline struct device *vring_dma_dev(const struct vring_virtqueue *vq) vq 321 drivers/virtio/virtio_ring.c return vq->vq.vdev->dev.parent; vq 325 drivers/virtio/virtio_ring.c static dma_addr_t vring_map_one_sg(const struct vring_virtqueue *vq, vq 329 drivers/virtio/virtio_ring.c if (!vq->use_dma_api) vq 337 drivers/virtio/virtio_ring.c return dma_map_page(vring_dma_dev(vq), vq 342 drivers/virtio/virtio_ring.c static dma_addr_t vring_map_single(const struct vring_virtqueue *vq, vq 346 drivers/virtio/virtio_ring.c if (!vq->use_dma_api) vq 349 drivers/virtio/virtio_ring.c return dma_map_single(vring_dma_dev(vq), vq 353 drivers/virtio/virtio_ring.c static int vring_mapping_error(const struct vring_virtqueue *vq, vq 356 drivers/virtio/virtio_ring.c if (!vq->use_dma_api) vq 359 drivers/virtio/virtio_ring.c return dma_mapping_error(vring_dma_dev(vq), addr); vq 367 drivers/virtio/virtio_ring.c static void vring_unmap_one_split(const struct vring_virtqueue *vq, vq 372 drivers/virtio/virtio_ring.c if (!vq->use_dma_api) vq 375 drivers/virtio/virtio_ring.c flags = virtio16_to_cpu(vq->vq.vdev, desc->flags); vq 378 drivers/virtio/virtio_ring.c dma_unmap_single(vring_dma_dev(vq), vq 379 drivers/virtio/virtio_ring.c virtio64_to_cpu(vq->vq.vdev, desc->addr), vq 380 drivers/virtio/virtio_ring.c virtio32_to_cpu(vq->vq.vdev, desc->len), vq 384 drivers/virtio/virtio_ring.c dma_unmap_page(vring_dma_dev(vq), vq 385 drivers/virtio/virtio_ring.c virtio64_to_cpu(vq->vq.vdev, desc->addr), vq 386 drivers/virtio/virtio_ring.c virtio32_to_cpu(vq->vq.vdev, desc->len), vq 424 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 431 drivers/virtio/virtio_ring.c START_USE(vq); vq 434 drivers/virtio/virtio_ring.c BUG_ON(ctx && vq->indirect); vq 436 drivers/virtio/virtio_ring.c if (unlikely(vq->broken)) { vq 437 drivers/virtio/virtio_ring.c END_USE(vq); vq 441 drivers/virtio/virtio_ring.c LAST_ADD_TIME_UPDATE(vq); vq 445 drivers/virtio/virtio_ring.c head = vq->free_head; vq 451 drivers/virtio/virtio_ring.c WARN_ON_ONCE(total_sg > vq->split.vring.num && !vq->indirect); vq 462 drivers/virtio/virtio_ring.c desc = vq->split.vring.desc; vq 467 drivers/virtio/virtio_ring.c if (vq->vq.num_free < descs_used) { vq 469 drivers/virtio/virtio_ring.c descs_used, vq->vq.num_free); vq 474 drivers/virtio/virtio_ring.c vq->notify(&vq->vq); vq 477 drivers/virtio/virtio_ring.c END_USE(vq); vq 483 drivers/virtio/virtio_ring.c dma_addr_t addr = vring_map_one_sg(vq, sg, DMA_TO_DEVICE); vq 484 drivers/virtio/virtio_ring.c if (vring_mapping_error(vq, addr)) vq 496 drivers/virtio/virtio_ring.c dma_addr_t addr = vring_map_one_sg(vq, sg, DMA_FROM_DEVICE); vq 497 drivers/virtio/virtio_ring.c if (vring_mapping_error(vq, addr)) vq 513 drivers/virtio/virtio_ring.c vq, desc, total_sg * sizeof(struct vring_desc), vq 515 drivers/virtio/virtio_ring.c if (vring_mapping_error(vq, addr)) vq 518 drivers/virtio/virtio_ring.c vq->split.vring.desc[head].flags = cpu_to_virtio16(_vq->vdev, vq 520 drivers/virtio/virtio_ring.c vq->split.vring.desc[head].addr = cpu_to_virtio64(_vq->vdev, vq 523 drivers/virtio/virtio_ring.c vq->split.vring.desc[head].len = cpu_to_virtio32(_vq->vdev, vq 528 drivers/virtio/virtio_ring.c vq->vq.num_free -= descs_used; vq 532 drivers/virtio/virtio_ring.c vq->free_head = virtio16_to_cpu(_vq->vdev, vq 533 drivers/virtio/virtio_ring.c vq->split.vring.desc[head].next); vq 535 drivers/virtio/virtio_ring.c vq->free_head = i; vq 538 drivers/virtio/virtio_ring.c vq->split.desc_state[head].data = data; vq 540 drivers/virtio/virtio_ring.c vq->split.desc_state[head].indir_desc = desc; vq 542 drivers/virtio/virtio_ring.c vq->split.desc_state[head].indir_desc = ctx; vq 546 drivers/virtio/virtio_ring.c avail = vq->split.avail_idx_shadow & (vq->split.vring.num - 1); vq 547 drivers/virtio/virtio_ring.c vq->split.vring.avail->ring[avail] = cpu_to_virtio16(_vq->vdev, head); vq 551 drivers/virtio/virtio_ring.c virtio_wmb(vq->weak_barriers); vq 552 drivers/virtio/virtio_ring.c vq->split.avail_idx_shadow++; vq 553 drivers/virtio/virtio_ring.c vq->split.vring.avail->idx = cpu_to_virtio16(_vq->vdev, vq 554 drivers/virtio/virtio_ring.c vq->split.avail_idx_shadow); vq 555 drivers/virtio/virtio_ring.c vq->num_added++; vq 557 drivers/virtio/virtio_ring.c pr_debug("Added buffer head %i to %p\n", head, vq); vq 558 drivers/virtio/virtio_ring.c END_USE(vq); vq 562 drivers/virtio/virtio_ring.c if (unlikely(vq->num_added == (1 << 16) - 1)) vq 578 drivers/virtio/virtio_ring.c vring_unmap_one_split(vq, &desc[i]); vq 585 drivers/virtio/virtio_ring.c END_USE(vq); vq 591 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 595 drivers/virtio/virtio_ring.c START_USE(vq); vq 598 drivers/virtio/virtio_ring.c virtio_mb(vq->weak_barriers); vq 600 drivers/virtio/virtio_ring.c old = vq->split.avail_idx_shadow - vq->num_added; vq 601 drivers/virtio/virtio_ring.c new = vq->split.avail_idx_shadow; vq 602 drivers/virtio/virtio_ring.c vq->num_added = 0; vq 604 drivers/virtio/virtio_ring.c LAST_ADD_TIME_CHECK(vq); vq 605 drivers/virtio/virtio_ring.c LAST_ADD_TIME_INVALID(vq); vq 607 drivers/virtio/virtio_ring.c if (vq->event) { vq 609 drivers/virtio/virtio_ring.c vring_avail_event(&vq->split.vring)), vq 612 drivers/virtio/virtio_ring.c needs_kick = !(vq->split.vring.used->flags & vq 616 drivers/virtio/virtio_ring.c END_USE(vq); vq 620 drivers/virtio/virtio_ring.c static void detach_buf_split(struct vring_virtqueue *vq, unsigned int head, vq 624 drivers/virtio/virtio_ring.c __virtio16 nextflag = cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT); vq 627 drivers/virtio/virtio_ring.c vq->split.desc_state[head].data = NULL; vq 632 drivers/virtio/virtio_ring.c while (vq->split.vring.desc[i].flags & nextflag) { vq 633 drivers/virtio/virtio_ring.c vring_unmap_one_split(vq, &vq->split.vring.desc[i]); vq 634 drivers/virtio/virtio_ring.c i = virtio16_to_cpu(vq->vq.vdev, vq->split.vring.desc[i].next); vq 635 drivers/virtio/virtio_ring.c vq->vq.num_free++; vq 638 drivers/virtio/virtio_ring.c vring_unmap_one_split(vq, &vq->split.vring.desc[i]); vq 639 drivers/virtio/virtio_ring.c vq->split.vring.desc[i].next = cpu_to_virtio16(vq->vq.vdev, vq 640 drivers/virtio/virtio_ring.c vq->free_head); vq 641 drivers/virtio/virtio_ring.c vq->free_head = head; vq 644 drivers/virtio/virtio_ring.c vq->vq.num_free++; vq 646 drivers/virtio/virtio_ring.c if (vq->indirect) { vq 648 drivers/virtio/virtio_ring.c vq->split.desc_state[head].indir_desc; vq 655 drivers/virtio/virtio_ring.c len = virtio32_to_cpu(vq->vq.vdev, vq 656 drivers/virtio/virtio_ring.c vq->split.vring.desc[head].len); vq 658 drivers/virtio/virtio_ring.c BUG_ON(!(vq->split.vring.desc[head].flags & vq 659 drivers/virtio/virtio_ring.c cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_INDIRECT))); vq 663 drivers/virtio/virtio_ring.c vring_unmap_one_split(vq, &indir_desc[j]); vq 666 drivers/virtio/virtio_ring.c vq->split.desc_state[head].indir_desc = NULL; vq 668 drivers/virtio/virtio_ring.c *ctx = vq->split.desc_state[head].indir_desc; vq 672 drivers/virtio/virtio_ring.c static inline bool more_used_split(const struct vring_virtqueue *vq) vq 674 drivers/virtio/virtio_ring.c return vq->last_used_idx != virtio16_to_cpu(vq->vq.vdev, vq 675 drivers/virtio/virtio_ring.c vq->split.vring.used->idx); vq 682 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 687 drivers/virtio/virtio_ring.c START_USE(vq); vq 689 drivers/virtio/virtio_ring.c if (unlikely(vq->broken)) { vq 690 drivers/virtio/virtio_ring.c END_USE(vq); vq 694 drivers/virtio/virtio_ring.c if (!more_used_split(vq)) { vq 696 drivers/virtio/virtio_ring.c END_USE(vq); vq 701 drivers/virtio/virtio_ring.c virtio_rmb(vq->weak_barriers); vq 703 drivers/virtio/virtio_ring.c last_used = (vq->last_used_idx & (vq->split.vring.num - 1)); vq 705 drivers/virtio/virtio_ring.c vq->split.vring.used->ring[last_used].id); vq 707 drivers/virtio/virtio_ring.c vq->split.vring.used->ring[last_used].len); vq 709 drivers/virtio/virtio_ring.c if (unlikely(i >= vq->split.vring.num)) { vq 710 drivers/virtio/virtio_ring.c BAD_RING(vq, "id %u out of range\n", i); vq 713 drivers/virtio/virtio_ring.c if (unlikely(!vq->split.desc_state[i].data)) { vq 714 drivers/virtio/virtio_ring.c BAD_RING(vq, "id %u is not a head!\n", i); vq 719 drivers/virtio/virtio_ring.c ret = vq->split.desc_state[i].data; vq 720 drivers/virtio/virtio_ring.c detach_buf_split(vq, i, ctx); vq 721 drivers/virtio/virtio_ring.c vq->last_used_idx++; vq 725 drivers/virtio/virtio_ring.c if (!(vq->split.avail_flags_shadow & VRING_AVAIL_F_NO_INTERRUPT)) vq 726 drivers/virtio/virtio_ring.c virtio_store_mb(vq->weak_barriers, vq 727 drivers/virtio/virtio_ring.c &vring_used_event(&vq->split.vring), vq 728 drivers/virtio/virtio_ring.c cpu_to_virtio16(_vq->vdev, vq->last_used_idx)); vq 730 drivers/virtio/virtio_ring.c LAST_ADD_TIME_INVALID(vq); vq 732 drivers/virtio/virtio_ring.c END_USE(vq); vq 738 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 740 drivers/virtio/virtio_ring.c if (!(vq->split.avail_flags_shadow & VRING_AVAIL_F_NO_INTERRUPT)) { vq 741 drivers/virtio/virtio_ring.c vq->split.avail_flags_shadow |= VRING_AVAIL_F_NO_INTERRUPT; vq 742 drivers/virtio/virtio_ring.c if (!vq->event) vq 743 drivers/virtio/virtio_ring.c vq->split.vring.avail->flags = vq 745 drivers/virtio/virtio_ring.c vq->split.avail_flags_shadow); vq 751 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 754 drivers/virtio/virtio_ring.c START_USE(vq); vq 761 drivers/virtio/virtio_ring.c if (vq->split.avail_flags_shadow & VRING_AVAIL_F_NO_INTERRUPT) { vq 762 drivers/virtio/virtio_ring.c vq->split.avail_flags_shadow &= ~VRING_AVAIL_F_NO_INTERRUPT; vq 763 drivers/virtio/virtio_ring.c if (!vq->event) vq 764 drivers/virtio/virtio_ring.c vq->split.vring.avail->flags = vq 766 drivers/virtio/virtio_ring.c vq->split.avail_flags_shadow); vq 768 drivers/virtio/virtio_ring.c vring_used_event(&vq->split.vring) = cpu_to_virtio16(_vq->vdev, vq 769 drivers/virtio/virtio_ring.c last_used_idx = vq->last_used_idx); vq 770 drivers/virtio/virtio_ring.c END_USE(vq); vq 776 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 779 drivers/virtio/virtio_ring.c vq->split.vring.used->idx); vq 784 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 787 drivers/virtio/virtio_ring.c START_USE(vq); vq 794 drivers/virtio/virtio_ring.c if (vq->split.avail_flags_shadow & VRING_AVAIL_F_NO_INTERRUPT) { vq 795 drivers/virtio/virtio_ring.c vq->split.avail_flags_shadow &= ~VRING_AVAIL_F_NO_INTERRUPT; vq 796 drivers/virtio/virtio_ring.c if (!vq->event) vq 797 drivers/virtio/virtio_ring.c vq->split.vring.avail->flags = vq 799 drivers/virtio/virtio_ring.c vq->split.avail_flags_shadow); vq 802 drivers/virtio/virtio_ring.c bufs = (u16)(vq->split.avail_idx_shadow - vq->last_used_idx) * 3 / 4; vq 804 drivers/virtio/virtio_ring.c virtio_store_mb(vq->weak_barriers, vq 805 drivers/virtio/virtio_ring.c &vring_used_event(&vq->split.vring), vq 806 drivers/virtio/virtio_ring.c cpu_to_virtio16(_vq->vdev, vq->last_used_idx + bufs)); vq 808 drivers/virtio/virtio_ring.c if (unlikely((u16)(virtio16_to_cpu(_vq->vdev, vq->split.vring.used->idx) vq 809 drivers/virtio/virtio_ring.c - vq->last_used_idx) > bufs)) { vq 810 drivers/virtio/virtio_ring.c END_USE(vq); vq 814 drivers/virtio/virtio_ring.c END_USE(vq); vq 820 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 824 drivers/virtio/virtio_ring.c START_USE(vq); vq 826 drivers/virtio/virtio_ring.c for (i = 0; i < vq->split.vring.num; i++) { vq 827 drivers/virtio/virtio_ring.c if (!vq->split.desc_state[i].data) vq 830 drivers/virtio/virtio_ring.c buf = vq->split.desc_state[i].data; vq 831 drivers/virtio/virtio_ring.c detach_buf_split(vq, i, NULL); vq 832 drivers/virtio/virtio_ring.c vq->split.avail_idx_shadow--; vq 833 drivers/virtio/virtio_ring.c vq->split.vring.avail->idx = cpu_to_virtio16(_vq->vdev, vq 834 drivers/virtio/virtio_ring.c vq->split.avail_idx_shadow); vq 835 drivers/virtio/virtio_ring.c END_USE(vq); vq 839 drivers/virtio/virtio_ring.c BUG_ON(vq->vq.num_free != vq->split.vring.num); vq 841 drivers/virtio/virtio_ring.c END_USE(vq); vq 857 drivers/virtio/virtio_ring.c struct virtqueue *vq; vq 894 drivers/virtio/virtio_ring.c vq = __vring_new_virtqueue(index, vring, vdev, weak_barriers, context, vq 896 drivers/virtio/virtio_ring.c if (!vq) { vq 902 drivers/virtio/virtio_ring.c to_vvq(vq)->split.queue_dma_addr = dma_addr; vq 903 drivers/virtio/virtio_ring.c to_vvq(vq)->split.queue_size_in_bytes = queue_size_in_bytes; vq 904 drivers/virtio/virtio_ring.c to_vvq(vq)->we_own_ring = true; vq 906 drivers/virtio/virtio_ring.c return vq; vq 914 drivers/virtio/virtio_ring.c static void vring_unmap_state_packed(const struct vring_virtqueue *vq, vq 919 drivers/virtio/virtio_ring.c if (!vq->use_dma_api) vq 925 drivers/virtio/virtio_ring.c dma_unmap_single(vring_dma_dev(vq), vq 930 drivers/virtio/virtio_ring.c dma_unmap_page(vring_dma_dev(vq), vq 937 drivers/virtio/virtio_ring.c static void vring_unmap_desc_packed(const struct vring_virtqueue *vq, vq 942 drivers/virtio/virtio_ring.c if (!vq->use_dma_api) vq 948 drivers/virtio/virtio_ring.c dma_unmap_single(vring_dma_dev(vq), vq 954 drivers/virtio/virtio_ring.c dma_unmap_page(vring_dma_dev(vq), vq 979 drivers/virtio/virtio_ring.c static int virtqueue_add_indirect_packed(struct vring_virtqueue *vq, vq 993 drivers/virtio/virtio_ring.c head = vq->packed.next_avail_idx; vq 996 drivers/virtio/virtio_ring.c if (unlikely(vq->vq.num_free < 1)) { vq 999 drivers/virtio/virtio_ring.c END_USE(vq); vq 1004 drivers/virtio/virtio_ring.c id = vq->free_head; vq 1005 drivers/virtio/virtio_ring.c BUG_ON(id == vq->packed.vring.num); vq 1009 drivers/virtio/virtio_ring.c addr = vring_map_one_sg(vq, sg, n < out_sgs ? vq 1011 drivers/virtio/virtio_ring.c if (vring_mapping_error(vq, addr)) vq 1023 drivers/virtio/virtio_ring.c addr = vring_map_single(vq, desc, vq 1026 drivers/virtio/virtio_ring.c if (vring_mapping_error(vq, addr)) vq 1029 drivers/virtio/virtio_ring.c vq->packed.vring.desc[head].addr = cpu_to_le64(addr); vq 1030 drivers/virtio/virtio_ring.c vq->packed.vring.desc[head].len = cpu_to_le32(total_sg * vq 1032 drivers/virtio/virtio_ring.c vq->packed.vring.desc[head].id = cpu_to_le16(id); vq 1034 drivers/virtio/virtio_ring.c if (vq->use_dma_api) { vq 1035 drivers/virtio/virtio_ring.c vq->packed.desc_extra[id].addr = addr; vq 1036 drivers/virtio/virtio_ring.c vq->packed.desc_extra[id].len = total_sg * vq 1038 drivers/virtio/virtio_ring.c vq->packed.desc_extra[id].flags = VRING_DESC_F_INDIRECT | vq 1039 drivers/virtio/virtio_ring.c vq->packed.avail_used_flags; vq 1047 drivers/virtio/virtio_ring.c virtio_wmb(vq->weak_barriers); vq 1048 drivers/virtio/virtio_ring.c vq->packed.vring.desc[head].flags = cpu_to_le16(VRING_DESC_F_INDIRECT | vq 1049 drivers/virtio/virtio_ring.c vq->packed.avail_used_flags); vq 1052 drivers/virtio/virtio_ring.c vq->vq.num_free -= 1; vq 1056 drivers/virtio/virtio_ring.c if (n >= vq->packed.vring.num) { vq 1058 drivers/virtio/virtio_ring.c vq->packed.avail_wrap_counter ^= 1; vq 1059 drivers/virtio/virtio_ring.c vq->packed.avail_used_flags ^= vq 1063 drivers/virtio/virtio_ring.c vq->packed.next_avail_idx = n; vq 1064 drivers/virtio/virtio_ring.c vq->free_head = vq->packed.desc_state[id].next; vq 1067 drivers/virtio/virtio_ring.c vq->packed.desc_state[id].num = 1; vq 1068 drivers/virtio/virtio_ring.c vq->packed.desc_state[id].data = data; vq 1069 drivers/virtio/virtio_ring.c vq->packed.desc_state[id].indir_desc = desc; vq 1070 drivers/virtio/virtio_ring.c vq->packed.desc_state[id].last = id; vq 1072 drivers/virtio/virtio_ring.c vq->num_added += 1; vq 1074 drivers/virtio/virtio_ring.c pr_debug("Added buffer head %i to %p\n", head, vq); vq 1075 drivers/virtio/virtio_ring.c END_USE(vq); vq 1083 drivers/virtio/virtio_ring.c vring_unmap_desc_packed(vq, &desc[i]); vq 1087 drivers/virtio/virtio_ring.c END_USE(vq); vq 1100 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 1107 drivers/virtio/virtio_ring.c START_USE(vq); vq 1110 drivers/virtio/virtio_ring.c BUG_ON(ctx && vq->indirect); vq 1112 drivers/virtio/virtio_ring.c if (unlikely(vq->broken)) { vq 1113 drivers/virtio/virtio_ring.c END_USE(vq); vq 1117 drivers/virtio/virtio_ring.c LAST_ADD_TIME_UPDATE(vq); vq 1122 drivers/virtio/virtio_ring.c return virtqueue_add_indirect_packed(vq, sgs, total_sg, vq 1125 drivers/virtio/virtio_ring.c head = vq->packed.next_avail_idx; vq 1126 drivers/virtio/virtio_ring.c avail_used_flags = vq->packed.avail_used_flags; vq 1128 drivers/virtio/virtio_ring.c WARN_ON_ONCE(total_sg > vq->packed.vring.num && !vq->indirect); vq 1130 drivers/virtio/virtio_ring.c desc = vq->packed.vring.desc; vq 1134 drivers/virtio/virtio_ring.c if (unlikely(vq->vq.num_free < descs_used)) { vq 1136 drivers/virtio/virtio_ring.c descs_used, vq->vq.num_free); vq 1137 drivers/virtio/virtio_ring.c END_USE(vq); vq 1141 drivers/virtio/virtio_ring.c id = vq->free_head; vq 1142 drivers/virtio/virtio_ring.c BUG_ON(id == vq->packed.vring.num); vq 1148 drivers/virtio/virtio_ring.c dma_addr_t addr = vring_map_one_sg(vq, sg, n < out_sgs ? vq 1150 drivers/virtio/virtio_ring.c if (vring_mapping_error(vq, addr)) vq 1153 drivers/virtio/virtio_ring.c flags = cpu_to_le16(vq->packed.avail_used_flags | vq 1165 drivers/virtio/virtio_ring.c if (unlikely(vq->use_dma_api)) { vq 1166 drivers/virtio/virtio_ring.c vq->packed.desc_extra[curr].addr = addr; vq 1167 drivers/virtio/virtio_ring.c vq->packed.desc_extra[curr].len = sg->length; vq 1168 drivers/virtio/virtio_ring.c vq->packed.desc_extra[curr].flags = vq 1172 drivers/virtio/virtio_ring.c curr = vq->packed.desc_state[curr].next; vq 1174 drivers/virtio/virtio_ring.c if ((unlikely(++i >= vq->packed.vring.num))) { vq 1176 drivers/virtio/virtio_ring.c vq->packed.avail_used_flags ^= vq 1184 drivers/virtio/virtio_ring.c vq->packed.avail_wrap_counter ^= 1; vq 1187 drivers/virtio/virtio_ring.c vq->vq.num_free -= descs_used; vq 1190 drivers/virtio/virtio_ring.c vq->packed.next_avail_idx = i; vq 1191 drivers/virtio/virtio_ring.c vq->free_head = curr; vq 1194 drivers/virtio/virtio_ring.c vq->packed.desc_state[id].num = descs_used; vq 1195 drivers/virtio/virtio_ring.c vq->packed.desc_state[id].data = data; vq 1196 drivers/virtio/virtio_ring.c vq->packed.desc_state[id].indir_desc = ctx; vq 1197 drivers/virtio/virtio_ring.c vq->packed.desc_state[id].last = prev; vq 1204 drivers/virtio/virtio_ring.c virtio_wmb(vq->weak_barriers); vq 1205 drivers/virtio/virtio_ring.c vq->packed.vring.desc[head].flags = head_flags; vq 1206 drivers/virtio/virtio_ring.c vq->num_added += descs_used; vq 1208 drivers/virtio/virtio_ring.c pr_debug("Added buffer head %i to %p\n", head, vq); vq 1209 drivers/virtio/virtio_ring.c END_USE(vq); vq 1217 drivers/virtio/virtio_ring.c vq->packed.avail_used_flags = avail_used_flags; vq 1222 drivers/virtio/virtio_ring.c vring_unmap_desc_packed(vq, &desc[i]); vq 1224 drivers/virtio/virtio_ring.c if (i >= vq->packed.vring.num) vq 1228 drivers/virtio/virtio_ring.c END_USE(vq); vq 1234 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 1245 drivers/virtio/virtio_ring.c START_USE(vq); vq 1251 drivers/virtio/virtio_ring.c virtio_mb(vq->weak_barriers); vq 1253 drivers/virtio/virtio_ring.c old = vq->packed.next_avail_idx - vq->num_added; vq 1254 drivers/virtio/virtio_ring.c new = vq->packed.next_avail_idx; vq 1255 drivers/virtio/virtio_ring.c vq->num_added = 0; vq 1257 drivers/virtio/virtio_ring.c snapshot.u32 = *(u32 *)vq->packed.vring.device; vq 1260 drivers/virtio/virtio_ring.c LAST_ADD_TIME_CHECK(vq); vq 1261 drivers/virtio/virtio_ring.c LAST_ADD_TIME_INVALID(vq); vq 1272 drivers/virtio/virtio_ring.c if (wrap_counter != vq->packed.avail_wrap_counter) vq 1273 drivers/virtio/virtio_ring.c event_idx -= vq->packed.vring.num; vq 1277 drivers/virtio/virtio_ring.c END_USE(vq); vq 1281 drivers/virtio/virtio_ring.c static void detach_buf_packed(struct vring_virtqueue *vq, vq 1288 drivers/virtio/virtio_ring.c state = &vq->packed.desc_state[id]; vq 1293 drivers/virtio/virtio_ring.c vq->packed.desc_state[state->last].next = vq->free_head; vq 1294 drivers/virtio/virtio_ring.c vq->free_head = id; vq 1295 drivers/virtio/virtio_ring.c vq->vq.num_free += state->num; vq 1297 drivers/virtio/virtio_ring.c if (unlikely(vq->use_dma_api)) { vq 1300 drivers/virtio/virtio_ring.c vring_unmap_state_packed(vq, vq 1301 drivers/virtio/virtio_ring.c &vq->packed.desc_extra[curr]); vq 1302 drivers/virtio/virtio_ring.c curr = vq->packed.desc_state[curr].next; vq 1306 drivers/virtio/virtio_ring.c if (vq->indirect) { vq 1314 drivers/virtio/virtio_ring.c if (vq->use_dma_api) { vq 1315 drivers/virtio/virtio_ring.c len = vq->packed.desc_extra[id].len; vq 1318 drivers/virtio/virtio_ring.c vring_unmap_desc_packed(vq, &desc[i]); vq 1327 drivers/virtio/virtio_ring.c static inline bool is_used_desc_packed(const struct vring_virtqueue *vq, vq 1333 drivers/virtio/virtio_ring.c flags = le16_to_cpu(vq->packed.vring.desc[idx].flags); vq 1340 drivers/virtio/virtio_ring.c static inline bool more_used_packed(const struct vring_virtqueue *vq) vq 1342 drivers/virtio/virtio_ring.c return is_used_desc_packed(vq, vq->last_used_idx, vq 1343 drivers/virtio/virtio_ring.c vq->packed.used_wrap_counter); vq 1350 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 1354 drivers/virtio/virtio_ring.c START_USE(vq); vq 1356 drivers/virtio/virtio_ring.c if (unlikely(vq->broken)) { vq 1357 drivers/virtio/virtio_ring.c END_USE(vq); vq 1361 drivers/virtio/virtio_ring.c if (!more_used_packed(vq)) { vq 1363 drivers/virtio/virtio_ring.c END_USE(vq); vq 1368 drivers/virtio/virtio_ring.c virtio_rmb(vq->weak_barriers); vq 1370 drivers/virtio/virtio_ring.c last_used = vq->last_used_idx; vq 1371 drivers/virtio/virtio_ring.c id = le16_to_cpu(vq->packed.vring.desc[last_used].id); vq 1372 drivers/virtio/virtio_ring.c *len = le32_to_cpu(vq->packed.vring.desc[last_used].len); vq 1374 drivers/virtio/virtio_ring.c if (unlikely(id >= vq->packed.vring.num)) { vq 1375 drivers/virtio/virtio_ring.c BAD_RING(vq, "id %u out of range\n", id); vq 1378 drivers/virtio/virtio_ring.c if (unlikely(!vq->packed.desc_state[id].data)) { vq 1379 drivers/virtio/virtio_ring.c BAD_RING(vq, "id %u is not a head!\n", id); vq 1384 drivers/virtio/virtio_ring.c ret = vq->packed.desc_state[id].data; vq 1385 drivers/virtio/virtio_ring.c detach_buf_packed(vq, id, ctx); vq 1387 drivers/virtio/virtio_ring.c vq->last_used_idx += vq->packed.desc_state[id].num; vq 1388 drivers/virtio/virtio_ring.c if (unlikely(vq->last_used_idx >= vq->packed.vring.num)) { vq 1389 drivers/virtio/virtio_ring.c vq->last_used_idx -= vq->packed.vring.num; vq 1390 drivers/virtio/virtio_ring.c vq->packed.used_wrap_counter ^= 1; vq 1398 drivers/virtio/virtio_ring.c if (vq->packed.event_flags_shadow == VRING_PACKED_EVENT_FLAG_DESC) vq 1399 drivers/virtio/virtio_ring.c virtio_store_mb(vq->weak_barriers, vq 1400 drivers/virtio/virtio_ring.c &vq->packed.vring.driver->off_wrap, vq 1401 drivers/virtio/virtio_ring.c cpu_to_le16(vq->last_used_idx | vq 1402 drivers/virtio/virtio_ring.c (vq->packed.used_wrap_counter << vq 1405 drivers/virtio/virtio_ring.c LAST_ADD_TIME_INVALID(vq); vq 1407 drivers/virtio/virtio_ring.c END_USE(vq); vq 1413 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 1415 drivers/virtio/virtio_ring.c if (vq->packed.event_flags_shadow != VRING_PACKED_EVENT_FLAG_DISABLE) { vq 1416 drivers/virtio/virtio_ring.c vq->packed.event_flags_shadow = VRING_PACKED_EVENT_FLAG_DISABLE; vq 1417 drivers/virtio/virtio_ring.c vq->packed.vring.driver->flags = vq 1418 drivers/virtio/virtio_ring.c cpu_to_le16(vq->packed.event_flags_shadow); vq 1424 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 1426 drivers/virtio/virtio_ring.c START_USE(vq); vq 1433 drivers/virtio/virtio_ring.c if (vq->event) { vq 1434 drivers/virtio/virtio_ring.c vq->packed.vring.driver->off_wrap = vq 1435 drivers/virtio/virtio_ring.c cpu_to_le16(vq->last_used_idx | vq 1436 drivers/virtio/virtio_ring.c (vq->packed.used_wrap_counter << vq 1442 drivers/virtio/virtio_ring.c virtio_wmb(vq->weak_barriers); vq 1445 drivers/virtio/virtio_ring.c if (vq->packed.event_flags_shadow == VRING_PACKED_EVENT_FLAG_DISABLE) { vq 1446 drivers/virtio/virtio_ring.c vq->packed.event_flags_shadow = vq->event ? vq 1449 drivers/virtio/virtio_ring.c vq->packed.vring.driver->flags = vq 1450 drivers/virtio/virtio_ring.c cpu_to_le16(vq->packed.event_flags_shadow); vq 1453 drivers/virtio/virtio_ring.c END_USE(vq); vq 1454 drivers/virtio/virtio_ring.c return vq->last_used_idx | ((u16)vq->packed.used_wrap_counter << vq 1460 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 1467 drivers/virtio/virtio_ring.c return is_used_desc_packed(vq, used_idx, wrap_counter); vq 1472 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 1476 drivers/virtio/virtio_ring.c START_USE(vq); vq 1483 drivers/virtio/virtio_ring.c if (vq->event) { vq 1485 drivers/virtio/virtio_ring.c bufs = (vq->packed.vring.num - vq->vq.num_free) * 3 / 4; vq 1486 drivers/virtio/virtio_ring.c wrap_counter = vq->packed.used_wrap_counter; vq 1488 drivers/virtio/virtio_ring.c used_idx = vq->last_used_idx + bufs; vq 1489 drivers/virtio/virtio_ring.c if (used_idx >= vq->packed.vring.num) { vq 1490 drivers/virtio/virtio_ring.c used_idx -= vq->packed.vring.num; vq 1494 drivers/virtio/virtio_ring.c vq->packed.vring.driver->off_wrap = cpu_to_le16(used_idx | vq 1501 drivers/virtio/virtio_ring.c virtio_wmb(vq->weak_barriers); vq 1504 drivers/virtio/virtio_ring.c if (vq->packed.event_flags_shadow == VRING_PACKED_EVENT_FLAG_DISABLE) { vq 1505 drivers/virtio/virtio_ring.c vq->packed.event_flags_shadow = vq->event ? vq 1508 drivers/virtio/virtio_ring.c vq->packed.vring.driver->flags = vq 1509 drivers/virtio/virtio_ring.c cpu_to_le16(vq->packed.event_flags_shadow); vq 1516 drivers/virtio/virtio_ring.c virtio_mb(vq->weak_barriers); vq 1518 drivers/virtio/virtio_ring.c if (is_used_desc_packed(vq, vq 1519 drivers/virtio/virtio_ring.c vq->last_used_idx, vq 1520 drivers/virtio/virtio_ring.c vq->packed.used_wrap_counter)) { vq 1521 drivers/virtio/virtio_ring.c END_USE(vq); vq 1525 drivers/virtio/virtio_ring.c END_USE(vq); vq 1531 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 1535 drivers/virtio/virtio_ring.c START_USE(vq); vq 1537 drivers/virtio/virtio_ring.c for (i = 0; i < vq->packed.vring.num; i++) { vq 1538 drivers/virtio/virtio_ring.c if (!vq->packed.desc_state[i].data) vq 1541 drivers/virtio/virtio_ring.c buf = vq->packed.desc_state[i].data; vq 1542 drivers/virtio/virtio_ring.c detach_buf_packed(vq, i, NULL); vq 1543 drivers/virtio/virtio_ring.c END_USE(vq); vq 1547 drivers/virtio/virtio_ring.c BUG_ON(vq->vq.num_free != vq->packed.vring.num); vq 1549 drivers/virtio/virtio_ring.c END_USE(vq); vq 1565 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq; vq 1594 drivers/virtio/virtio_ring.c vq = kmalloc(sizeof(*vq), GFP_KERNEL); vq 1595 drivers/virtio/virtio_ring.c if (!vq) vq 1598 drivers/virtio/virtio_ring.c vq->vq.callback = callback; vq 1599 drivers/virtio/virtio_ring.c vq->vq.vdev = vdev; vq 1600 drivers/virtio/virtio_ring.c vq->vq.name = name; vq 1601 drivers/virtio/virtio_ring.c vq->vq.num_free = num; vq 1602 drivers/virtio/virtio_ring.c vq->vq.index = index; vq 1603 drivers/virtio/virtio_ring.c vq->we_own_ring = true; vq 1604 drivers/virtio/virtio_ring.c vq->notify = notify; vq 1605 drivers/virtio/virtio_ring.c vq->weak_barriers = weak_barriers; vq 1606 drivers/virtio/virtio_ring.c vq->broken = false; vq 1607 drivers/virtio/virtio_ring.c vq->last_used_idx = 0; vq 1608 drivers/virtio/virtio_ring.c vq->num_added = 0; vq 1609 drivers/virtio/virtio_ring.c vq->packed_ring = true; vq 1610 drivers/virtio/virtio_ring.c vq->use_dma_api = vring_use_dma_api(vdev); vq 1611 drivers/virtio/virtio_ring.c list_add_tail(&vq->vq.list, &vdev->vqs); vq 1613 drivers/virtio/virtio_ring.c vq->in_use = false; vq 1614 drivers/virtio/virtio_ring.c vq->last_add_time_valid = false; vq 1617 drivers/virtio/virtio_ring.c vq->indirect = virtio_has_feature(vdev, VIRTIO_RING_F_INDIRECT_DESC) && vq 1619 drivers/virtio/virtio_ring.c vq->event = virtio_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX); vq 1622 drivers/virtio/virtio_ring.c vq->weak_barriers = false; vq 1624 drivers/virtio/virtio_ring.c vq->packed.ring_dma_addr = ring_dma_addr; vq 1625 drivers/virtio/virtio_ring.c vq->packed.driver_event_dma_addr = driver_event_dma_addr; vq 1626 drivers/virtio/virtio_ring.c vq->packed.device_event_dma_addr = device_event_dma_addr; vq 1628 drivers/virtio/virtio_ring.c vq->packed.ring_size_in_bytes = ring_size_in_bytes; vq 1629 drivers/virtio/virtio_ring.c vq->packed.event_size_in_bytes = event_size_in_bytes; vq 1631 drivers/virtio/virtio_ring.c vq->packed.vring.num = num; vq 1632 drivers/virtio/virtio_ring.c vq->packed.vring.desc = ring; vq 1633 drivers/virtio/virtio_ring.c vq->packed.vring.driver = driver; vq 1634 drivers/virtio/virtio_ring.c vq->packed.vring.device = device; vq 1636 drivers/virtio/virtio_ring.c vq->packed.next_avail_idx = 0; vq 1637 drivers/virtio/virtio_ring.c vq->packed.avail_wrap_counter = 1; vq 1638 drivers/virtio/virtio_ring.c vq->packed.used_wrap_counter = 1; vq 1639 drivers/virtio/virtio_ring.c vq->packed.event_flags_shadow = 0; vq 1640 drivers/virtio/virtio_ring.c vq->packed.avail_used_flags = 1 << VRING_PACKED_DESC_F_AVAIL; vq 1642 drivers/virtio/virtio_ring.c vq->packed.desc_state = kmalloc_array(num, vq 1645 drivers/virtio/virtio_ring.c if (!vq->packed.desc_state) vq 1648 drivers/virtio/virtio_ring.c memset(vq->packed.desc_state, 0, vq 1652 drivers/virtio/virtio_ring.c vq->free_head = 0; vq 1654 drivers/virtio/virtio_ring.c vq->packed.desc_state[i].next = i + 1; vq 1656 drivers/virtio/virtio_ring.c vq->packed.desc_extra = kmalloc_array(num, vq 1659 drivers/virtio/virtio_ring.c if (!vq->packed.desc_extra) vq 1662 drivers/virtio/virtio_ring.c memset(vq->packed.desc_extra, 0, vq 1667 drivers/virtio/virtio_ring.c vq->packed.event_flags_shadow = VRING_PACKED_EVENT_FLAG_DISABLE; vq 1668 drivers/virtio/virtio_ring.c vq->packed.vring.driver->flags = vq 1669 drivers/virtio/virtio_ring.c cpu_to_le16(vq->packed.event_flags_shadow); vq 1672 drivers/virtio/virtio_ring.c return &vq->vq; vq 1675 drivers/virtio/virtio_ring.c kfree(vq->packed.desc_state); vq 1677 drivers/virtio/virtio_ring.c kfree(vq); vq 1702 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 1704 drivers/virtio/virtio_ring.c return vq->packed_ring ? virtqueue_add_packed(_vq, sgs, total_sg, vq 1758 drivers/virtio/virtio_ring.c int virtqueue_add_outbuf(struct virtqueue *vq, vq 1763 drivers/virtio/virtio_ring.c return virtqueue_add(vq, &sg, num, 1, 0, data, NULL, gfp); vq 1780 drivers/virtio/virtio_ring.c int virtqueue_add_inbuf(struct virtqueue *vq, vq 1785 drivers/virtio/virtio_ring.c return virtqueue_add(vq, &sg, num, 0, 1, data, NULL, gfp); vq 1803 drivers/virtio/virtio_ring.c int virtqueue_add_inbuf_ctx(struct virtqueue *vq, vq 1809 drivers/virtio/virtio_ring.c return virtqueue_add(vq, &sg, num, 0, 1, data, ctx, gfp); vq 1826 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 1828 drivers/virtio/virtio_ring.c return vq->packed_ring ? virtqueue_kick_prepare_packed(_vq) : vq 1843 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 1845 drivers/virtio/virtio_ring.c if (unlikely(vq->broken)) vq 1849 drivers/virtio/virtio_ring.c if (!vq->notify(_vq)) { vq 1850 drivers/virtio/virtio_ring.c vq->broken = true; vq 1869 drivers/virtio/virtio_ring.c bool virtqueue_kick(struct virtqueue *vq) vq 1871 drivers/virtio/virtio_ring.c if (virtqueue_kick_prepare(vq)) vq 1872 drivers/virtio/virtio_ring.c return virtqueue_notify(vq); vq 1897 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 1899 drivers/virtio/virtio_ring.c return vq->packed_ring ? virtqueue_get_buf_ctx_packed(_vq, len, ctx) : vq 1920 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 1922 drivers/virtio/virtio_ring.c if (vq->packed_ring) vq 1943 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 1945 drivers/virtio/virtio_ring.c return vq->packed_ring ? virtqueue_enable_cb_prepare_packed(_vq) : vq 1961 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 1963 drivers/virtio/virtio_ring.c virtio_mb(vq->weak_barriers); vq 1964 drivers/virtio/virtio_ring.c return vq->packed_ring ? virtqueue_poll_packed(_vq, last_used_idx) : vq 2003 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 2005 drivers/virtio/virtio_ring.c return vq->packed_ring ? virtqueue_enable_cb_delayed_packed(_vq) : vq 2020 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 2022 drivers/virtio/virtio_ring.c return vq->packed_ring ? virtqueue_detach_unused_buf_packed(_vq) : vq 2027 drivers/virtio/virtio_ring.c static inline bool more_used(const struct vring_virtqueue *vq) vq 2029 drivers/virtio/virtio_ring.c return vq->packed_ring ? more_used_packed(vq) : more_used_split(vq); vq 2034 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 2036 drivers/virtio/virtio_ring.c if (!more_used(vq)) { vq 2037 drivers/virtio/virtio_ring.c pr_debug("virtqueue interrupt with no work for %p\n", vq); vq 2041 drivers/virtio/virtio_ring.c if (unlikely(vq->broken)) vq 2044 drivers/virtio/virtio_ring.c pr_debug("virtqueue callback for %p (%p)\n", vq, vq->vq.callback); vq 2045 drivers/virtio/virtio_ring.c if (vq->vq.callback) vq 2046 drivers/virtio/virtio_ring.c vq->vq.callback(&vq->vq); vq 2063 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq; vq 2068 drivers/virtio/virtio_ring.c vq = kmalloc(sizeof(*vq), GFP_KERNEL); vq 2069 drivers/virtio/virtio_ring.c if (!vq) vq 2072 drivers/virtio/virtio_ring.c vq->packed_ring = false; vq 2073 drivers/virtio/virtio_ring.c vq->vq.callback = callback; vq 2074 drivers/virtio/virtio_ring.c vq->vq.vdev = vdev; vq 2075 drivers/virtio/virtio_ring.c vq->vq.name = name; vq 2076 drivers/virtio/virtio_ring.c vq->vq.num_free = vring.num; vq 2077 drivers/virtio/virtio_ring.c vq->vq.index = index; vq 2078 drivers/virtio/virtio_ring.c vq->we_own_ring = false; vq 2079 drivers/virtio/virtio_ring.c vq->notify = notify; vq 2080 drivers/virtio/virtio_ring.c vq->weak_barriers = weak_barriers; vq 2081 drivers/virtio/virtio_ring.c vq->broken = false; vq 2082 drivers/virtio/virtio_ring.c vq->last_used_idx = 0; vq 2083 drivers/virtio/virtio_ring.c vq->num_added = 0; vq 2084 drivers/virtio/virtio_ring.c vq->use_dma_api = vring_use_dma_api(vdev); vq 2085 drivers/virtio/virtio_ring.c list_add_tail(&vq->vq.list, &vdev->vqs); vq 2087 drivers/virtio/virtio_ring.c vq->in_use = false; vq 2088 drivers/virtio/virtio_ring.c vq->last_add_time_valid = false; vq 2091 drivers/virtio/virtio_ring.c vq->indirect = virtio_has_feature(vdev, VIRTIO_RING_F_INDIRECT_DESC) && vq 2093 drivers/virtio/virtio_ring.c vq->event = virtio_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX); vq 2096 drivers/virtio/virtio_ring.c vq->weak_barriers = false; vq 2098 drivers/virtio/virtio_ring.c vq->split.queue_dma_addr = 0; vq 2099 drivers/virtio/virtio_ring.c vq->split.queue_size_in_bytes = 0; vq 2101 drivers/virtio/virtio_ring.c vq->split.vring = vring; vq 2102 drivers/virtio/virtio_ring.c vq->split.avail_flags_shadow = 0; vq 2103 drivers/virtio/virtio_ring.c vq->split.avail_idx_shadow = 0; vq 2107 drivers/virtio/virtio_ring.c vq->split.avail_flags_shadow |= VRING_AVAIL_F_NO_INTERRUPT; vq 2108 drivers/virtio/virtio_ring.c if (!vq->event) vq 2109 drivers/virtio/virtio_ring.c vq->split.vring.avail->flags = cpu_to_virtio16(vdev, vq 2110 drivers/virtio/virtio_ring.c vq->split.avail_flags_shadow); vq 2113 drivers/virtio/virtio_ring.c vq->split.desc_state = kmalloc_array(vring.num, vq 2115 drivers/virtio/virtio_ring.c if (!vq->split.desc_state) { vq 2116 drivers/virtio/virtio_ring.c kfree(vq); vq 2121 drivers/virtio/virtio_ring.c vq->free_head = 0; vq 2123 drivers/virtio/virtio_ring.c vq->split.vring.desc[i].next = cpu_to_virtio16(vdev, i + 1); vq 2124 drivers/virtio/virtio_ring.c memset(vq->split.desc_state, 0, vring.num * vq 2127 drivers/virtio/virtio_ring.c return &vq->vq; vq 2163 drivers/virtio/virtio_ring.c bool (*notify)(struct virtqueue *vq), vq 2164 drivers/virtio/virtio_ring.c void (*callback)(struct virtqueue *vq), vq 2180 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 2182 drivers/virtio/virtio_ring.c if (vq->we_own_ring) { vq 2183 drivers/virtio/virtio_ring.c if (vq->packed_ring) { vq 2184 drivers/virtio/virtio_ring.c vring_free_queue(vq->vq.vdev, vq 2185 drivers/virtio/virtio_ring.c vq->packed.ring_size_in_bytes, vq 2186 drivers/virtio/virtio_ring.c vq->packed.vring.desc, vq 2187 drivers/virtio/virtio_ring.c vq->packed.ring_dma_addr); vq 2189 drivers/virtio/virtio_ring.c vring_free_queue(vq->vq.vdev, vq 2190 drivers/virtio/virtio_ring.c vq->packed.event_size_in_bytes, vq 2191 drivers/virtio/virtio_ring.c vq->packed.vring.driver, vq 2192 drivers/virtio/virtio_ring.c vq->packed.driver_event_dma_addr); vq 2194 drivers/virtio/virtio_ring.c vring_free_queue(vq->vq.vdev, vq 2195 drivers/virtio/virtio_ring.c vq->packed.event_size_in_bytes, vq 2196 drivers/virtio/virtio_ring.c vq->packed.vring.device, vq 2197 drivers/virtio/virtio_ring.c vq->packed.device_event_dma_addr); vq 2199 drivers/virtio/virtio_ring.c kfree(vq->packed.desc_state); vq 2200 drivers/virtio/virtio_ring.c kfree(vq->packed.desc_extra); vq 2202 drivers/virtio/virtio_ring.c vring_free_queue(vq->vq.vdev, vq 2203 drivers/virtio/virtio_ring.c vq->split.queue_size_in_bytes, vq 2204 drivers/virtio/virtio_ring.c vq->split.vring.desc, vq 2205 drivers/virtio/virtio_ring.c vq->split.queue_dma_addr); vq 2208 drivers/virtio/virtio_ring.c if (!vq->packed_ring) vq 2209 drivers/virtio/virtio_ring.c kfree(vq->split.desc_state); vq 2211 drivers/virtio/virtio_ring.c kfree(vq); vq 2252 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 2254 drivers/virtio/virtio_ring.c return vq->packed_ring ? vq->packed.vring.num : vq->split.vring.num; vq 2260 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 2262 drivers/virtio/virtio_ring.c return vq->broken; vq 2275 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 2276 drivers/virtio/virtio_ring.c vq->broken = true; vq 2283 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 2285 drivers/virtio/virtio_ring.c BUG_ON(!vq->we_own_ring); vq 2287 drivers/virtio/virtio_ring.c if (vq->packed_ring) vq 2288 drivers/virtio/virtio_ring.c return vq->packed.ring_dma_addr; vq 2290 drivers/virtio/virtio_ring.c return vq->split.queue_dma_addr; vq 2296 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 2298 drivers/virtio/virtio_ring.c BUG_ON(!vq->we_own_ring); vq 2300 drivers/virtio/virtio_ring.c if (vq->packed_ring) vq 2301 drivers/virtio/virtio_ring.c return vq->packed.driver_event_dma_addr; vq 2303 drivers/virtio/virtio_ring.c return vq->split.queue_dma_addr + vq 2304 drivers/virtio/virtio_ring.c ((char *)vq->split.vring.avail - (char *)vq->split.vring.desc); vq 2310 drivers/virtio/virtio_ring.c struct vring_virtqueue *vq = to_vvq(_vq); vq 2312 drivers/virtio/virtio_ring.c BUG_ON(!vq->we_own_ring); vq 2314 drivers/virtio/virtio_ring.c if (vq->packed_ring) vq 2315 drivers/virtio/virtio_ring.c return vq->packed.device_event_dma_addr; vq 2317 drivers/virtio/virtio_ring.c return vq->split.queue_dma_addr + vq 2318 drivers/virtio/virtio_ring.c ((char *)vq->split.vring.used - (char *)vq->split.vring.desc); vq 2323 drivers/virtio/virtio_ring.c const struct vring *virtqueue_get_vring(struct virtqueue *vq) vq 2325 drivers/virtio/virtio_ring.c return &to_vvq(vq)->split.vring; vq 30 fs/fuse/virtio_fs.c struct virtqueue *vq; /* protected by ->lock */ vq 61 fs/fuse/virtio_fs.c static inline struct virtio_fs_vq *vq_to_fsvq(struct virtqueue *vq) vq 63 fs/fuse/virtio_fs.c struct virtio_fs *fs = vq->vdev->priv; vq 65 fs/fuse/virtio_fs.c return &fs->vqs[vq->index]; vq 68 fs/fuse/virtio_fs.c static inline struct fuse_pqueue *vq_to_fpq(struct virtqueue *vq) vq 70 fs/fuse/virtio_fs.c return &vq_to_fsvq(vq)->fud->pq; vq 242 fs/fuse/virtio_fs.c struct virtqueue *vq = fsvq->vq; vq 250 fs/fuse/virtio_fs.c virtqueue_disable_cb(vq); vq 252 fs/fuse/virtio_fs.c while ((req = virtqueue_get_buf(vq, &len)) != NULL) { vq 256 fs/fuse/virtio_fs.c } while (!virtqueue_enable_cb(vq) && likely(!virtqueue_is_broken(vq))); vq 321 fs/fuse/virtio_fs.c struct virtqueue *vq = fsvq->vq; vq 348 fs/fuse/virtio_fs.c dev_dbg(&vq->vdev->dev, "%s\n", __func__); vq 349 fs/fuse/virtio_fs.c ret = virtqueue_add_sgs(vq, sgs, 1, 0, forget, GFP_ATOMIC); vq 368 fs/fuse/virtio_fs.c notify = virtqueue_kick_prepare(vq); vq 372 fs/fuse/virtio_fs.c virtqueue_notify(vq); vq 452 fs/fuse/virtio_fs.c struct virtqueue *vq = fsvq->vq; vq 464 fs/fuse/virtio_fs.c virtqueue_disable_cb(vq); vq 466 fs/fuse/virtio_fs.c while ((req = virtqueue_get_buf(vq, &len)) != NULL) { vq 471 fs/fuse/virtio_fs.c } while (!virtqueue_enable_cb(vq) && likely(!virtqueue_is_broken(vq))); vq 512 fs/fuse/virtio_fs.c static void virtio_fs_vq_done(struct virtqueue *vq) vq 514 fs/fuse/virtio_fs.c struct virtio_fs_vq *fsvq = vq_to_fsvq(vq); vq 516 fs/fuse/virtio_fs.c dev_dbg(&vq->vdev->dev, "%s %s\n", __func__, fsvq->name); vq 580 fs/fuse/virtio_fs.c fs->vqs[i].vq = vqs[i]; vq 716 fs/fuse/virtio_fs.c struct virtqueue *vq; vq 753 fs/fuse/virtio_fs.c vq = fsvq->vq; vq 754 fs/fuse/virtio_fs.c dev_dbg(&vq->vdev->dev, "%s\n", __func__); vq 756 fs/fuse/virtio_fs.c ret = virtqueue_add_sgs(vq, sgs, 1, 0, forget, GFP_ATOMIC); vq 775 fs/fuse/virtio_fs.c notify = virtqueue_kick_prepare(vq); vq 780 fs/fuse/virtio_fs.c virtqueue_notify(vq); vq 883 fs/fuse/virtio_fs.c struct virtqueue *vq; vq 940 fs/fuse/virtio_fs.c vq = fsvq->vq; vq 941 fs/fuse/virtio_fs.c ret = virtqueue_add_sgs(vq, sgs, out_sgs, in_sgs, req, GFP_ATOMIC); vq 958 fs/fuse/virtio_fs.c notify = virtqueue_kick_prepare(vq); vq 963 fs/fuse/virtio_fs.c virtqueue_notify(vq); vq 558 include/linux/remoteproc.h struct virtqueue *vq; vq 30 include/linux/virtio.h void (*callback)(struct virtqueue *vq); vq 38 include/linux/virtio.h int virtqueue_add_outbuf(struct virtqueue *vq, vq 43 include/linux/virtio.h int virtqueue_add_inbuf(struct virtqueue *vq, vq 48 include/linux/virtio.h int virtqueue_add_inbuf_ctx(struct virtqueue *vq, vq 54 include/linux/virtio.h int virtqueue_add_sgs(struct virtqueue *vq, vq 61 include/linux/virtio.h bool virtqueue_kick(struct virtqueue *vq); vq 63 include/linux/virtio.h bool virtqueue_kick_prepare(struct virtqueue *vq); vq 65 include/linux/virtio.h bool virtqueue_notify(struct virtqueue *vq); vq 67 include/linux/virtio.h void *virtqueue_get_buf(struct virtqueue *vq, unsigned int *len); vq 69 include/linux/virtio.h void *virtqueue_get_buf_ctx(struct virtqueue *vq, unsigned int *len, vq 72 include/linux/virtio.h void virtqueue_disable_cb(struct virtqueue *vq); vq 74 include/linux/virtio.h bool virtqueue_enable_cb(struct virtqueue *vq); vq 76 include/linux/virtio.h unsigned virtqueue_enable_cb_prepare(struct virtqueue *vq); vq 78 include/linux/virtio.h bool virtqueue_poll(struct virtqueue *vq, unsigned); vq 80 include/linux/virtio.h bool virtqueue_enable_cb_delayed(struct virtqueue *vq); vq 82 include/linux/virtio.h void *virtqueue_detach_unused_buf(struct virtqueue *vq); vq 84 include/linux/virtio.h unsigned int virtqueue_get_vring_size(struct virtqueue *vq); vq 86 include/linux/virtio.h bool virtqueue_is_broken(struct virtqueue *vq); vq 88 include/linux/virtio.h const struct vring *virtqueue_get_vring(struct virtqueue *vq); vq 89 include/linux/virtio.h dma_addr_t virtqueue_get_desc_addr(struct virtqueue *vq); vq 90 include/linux/virtio.h dma_addr_t virtqueue_get_avail_addr(struct virtqueue *vq); vq 91 include/linux/virtio.h dma_addr_t virtqueue_get_used_addr(struct virtqueue *vq); vq 145 include/linux/virtio.h #define virtio_device_for_each_vq(vdev, vq) \ vq 146 include/linux/virtio.h list_for_each_entry(vq, &vdev->vqs, list) vq 87 include/linux/virtio_config.h int (*set_vq_affinity)(struct virtqueue *vq, vq 183 include/linux/virtio_config.h struct virtqueue *vq; vq 184 include/linux/virtio_config.h int err = vdev->config->find_vqs(vdev, 1, &vq, callbacks, names, NULL, vq 188 include/linux/virtio_config.h return vq; vq 245 include/linux/virtio_config.h int virtqueue_set_affinity(struct virtqueue *vq, const struct cpumask *cpu_mask) vq 247 include/linux/virtio_config.h struct virtio_device *vdev = vq->vdev; vq 249 include/linux/virtio_config.h return vdev->config->set_vq_affinity(vq, cpu_mask); vq 76 include/linux/virtio_ring.h bool (*notify)(struct virtqueue *vq), vq 77 include/linux/virtio_ring.h void (*callback)(struct virtqueue *vq), vq 101 include/linux/virtio_ring.h bool (*notify)(struct virtqueue *vq), vq 102 include/linux/virtio_ring.h void (*callback)(struct virtqueue *vq), vq 109 include/linux/virtio_ring.h void vring_del_virtqueue(struct virtqueue *vq); vq 384 include/media/soc_camera.h static inline struct soc_camera_device *soc_camera_from_vb2q(const struct vb2_queue *vq) vq 386 include/media/soc_camera.h return container_of(vq, struct soc_camera_device, vb2_vidq); vq 394 include/media/soc_camera.h void soc_camera_lock(struct vb2_queue *vq); vq 395 include/media/soc_camera.h void soc_camera_unlock(struct vb2_queue *vq); vq 311 include/media/videobuf2-v4l2.h void vb2_ops_wait_prepare(struct vb2_queue *vq); vq 320 include/media/videobuf2-v4l2.h void vb2_ops_wait_finish(struct vb2_queue *vq); vq 68 net/9p/trans_virtio.c struct virtqueue *vq; vq 125 net/9p/trans_virtio.c static void req_done(struct virtqueue *vq) vq 127 net/9p/trans_virtio.c struct virtio_chan *chan = vq->vdev->priv; vq 136 net/9p/trans_virtio.c while ((req = virtqueue_get_buf(chan->vq, &len)) != NULL) { vq 277 net/9p/trans_virtio.c err = virtqueue_add_sgs(chan->vq, sgs, out_sgs, in_sgs, req, vq 297 net/9p/trans_virtio.c virtqueue_kick(chan->vq); vq 475 net/9p/trans_virtio.c err = virtqueue_add_sgs(chan->vq, sgs, out_sgs, in_sgs, req, vq 496 net/9p/trans_virtio.c virtqueue_kick(chan->vq); vq 575 net/9p/trans_virtio.c chan->vq = virtio_find_single_vq(vdev, req_done, "requests"); vq 576 net/9p/trans_virtio.c if (IS_ERR(chan->vq)) { vq 577 net/9p/trans_virtio.c err = PTR_ERR(chan->vq); vq 580 net/9p/trans_virtio.c chan->vq->vdev->priv = chan; vq 848 net/sched/sch_gred.c struct nlattr *vq; vq 853 net/sched/sch_gred.c vq = nla_nest_start_noflag(skb, TCA_GRED_VQ_ENTRY); vq 854 net/sched/sch_gred.c if (!vq) vq 889 net/sched/sch_gred.c nla_nest_end(skb, vq); vq 135 net/vmw_vsock/virtio_transport.c struct virtqueue *vq; vq 144 net/vmw_vsock/virtio_transport.c vq = vsock->vqs[VSOCK_VQ_TX]; vq 174 net/vmw_vsock/virtio_transport.c ret = virtqueue_add_sgs(vq, sgs, out_sg, in_sg, pkt, GFP_KERNEL); vq 200 net/vmw_vsock/virtio_transport.c virtqueue_kick(vq); vq 294 net/vmw_vsock/virtio_transport.c struct virtqueue *vq; vq 297 net/vmw_vsock/virtio_transport.c vq = vsock->vqs[VSOCK_VQ_RX]; vq 318 net/vmw_vsock/virtio_transport.c ret = virtqueue_add_sgs(vq, sgs, 0, 2, pkt, GFP_KERNEL); vq 324 net/vmw_vsock/virtio_transport.c } while (vq->num_free); vq 327 net/vmw_vsock/virtio_transport.c virtqueue_kick(vq); vq 334 net/vmw_vsock/virtio_transport.c struct virtqueue *vq; vq 337 net/vmw_vsock/virtio_transport.c vq = vsock->vqs[VSOCK_VQ_TX]; vq 347 net/vmw_vsock/virtio_transport.c virtqueue_disable_cb(vq); vq 348 net/vmw_vsock/virtio_transport.c while ((pkt = virtqueue_get_buf(vq, &len)) != NULL) { vq 352 net/vmw_vsock/virtio_transport.c } while (!virtqueue_enable_cb(vq)); vq 364 net/vmw_vsock/virtio_transport.c struct virtqueue *vq = vsock->vqs[VSOCK_VQ_RX]; vq 370 net/vmw_vsock/virtio_transport.c return val < virtqueue_get_vring_size(vq); vq 377 net/vmw_vsock/virtio_transport.c struct virtqueue *vq; vq 379 net/vmw_vsock/virtio_transport.c vq = vsock->vqs[VSOCK_VQ_RX]; vq 387 net/vmw_vsock/virtio_transport.c virtqueue_disable_cb(vq); vq 400 net/vmw_vsock/virtio_transport.c pkt = virtqueue_get_buf(vq, &len); vq 418 net/vmw_vsock/virtio_transport.c } while (!virtqueue_enable_cb(vq)); vq 431 net/vmw_vsock/virtio_transport.c struct virtqueue *vq; vq 433 net/vmw_vsock/virtio_transport.c vq = vsock->vqs[VSOCK_VQ_EVENT]; vq 437 net/vmw_vsock/virtio_transport.c return virtqueue_add_inbuf(vq, &sg, 1, event, GFP_KERNEL); vq 489 net/vmw_vsock/virtio_transport.c struct virtqueue *vq; vq 491 net/vmw_vsock/virtio_transport.c vq = vsock->vqs[VSOCK_VQ_EVENT]; vq 502 net/vmw_vsock/virtio_transport.c virtqueue_disable_cb(vq); vq 503 net/vmw_vsock/virtio_transport.c while ((event = virtqueue_get_buf(vq, &len)) != NULL) { vq 509 net/vmw_vsock/virtio_transport.c } while (!virtqueue_enable_cb(vq)); vq 516 net/vmw_vsock/virtio_transport.c static void virtio_vsock_event_done(struct virtqueue *vq) vq 518 net/vmw_vsock/virtio_transport.c struct virtio_vsock *vsock = vq->vdev->priv; vq 525 net/vmw_vsock/virtio_transport.c static void virtio_vsock_tx_done(struct virtqueue *vq) vq 527 net/vmw_vsock/virtio_transport.c struct virtio_vsock *vsock = vq->vdev->priv; vq 534 net/vmw_vsock/virtio_transport.c static void virtio_vsock_rx_done(struct virtqueue *vq) vq 536 net/vmw_vsock/virtio_transport.c struct virtio_vsock *vsock = vq->vdev->priv; vq 165 samples/v4l/v4l2-pci-skeleton.c static int queue_setup(struct vb2_queue *vq, vq 169 samples/v4l/v4l2-pci-skeleton.c struct skeleton *skel = vb2_get_drv_priv(vq); vq 177 samples/v4l/v4l2-pci-skeleton.c if (vb2_fileio_is_active(vq)) vq 182 samples/v4l/v4l2-pci-skeleton.c if (vq->num_buffers + *nbuffers < 3) vq 183 samples/v4l/v4l2-pci-skeleton.c *nbuffers = 3 - vq->num_buffers; vq 249 samples/v4l/v4l2-pci-skeleton.c static int start_streaming(struct vb2_queue *vq, unsigned int count) vq 251 samples/v4l/v4l2-pci-skeleton.c struct skeleton *skel = vb2_get_drv_priv(vq); vq 272 samples/v4l/v4l2-pci-skeleton.c static void stop_streaming(struct vb2_queue *vq) vq 274 samples/v4l/v4l2-pci-skeleton.c struct skeleton *skel = vb2_get_drv_priv(vq); vq 20 tools/virtio/linux/virtio.h void (*callback)(struct virtqueue *vq); vq 29 tools/virtio/linux/virtio.h int virtqueue_add_sgs(struct virtqueue *vq, vq 36 tools/virtio/linux/virtio.h int virtqueue_add_outbuf(struct virtqueue *vq, vq 41 tools/virtio/linux/virtio.h int virtqueue_add_inbuf(struct virtqueue *vq, vq 46 tools/virtio/linux/virtio.h bool virtqueue_kick(struct virtqueue *vq); vq 48 tools/virtio/linux/virtio.h void *virtqueue_get_buf(struct virtqueue *vq, unsigned int *len); vq 50 tools/virtio/linux/virtio.h void virtqueue_disable_cb(struct virtqueue *vq); vq 52 tools/virtio/linux/virtio.h bool virtqueue_enable_cb(struct virtqueue *vq); vq 53 tools/virtio/linux/virtio.h bool virtqueue_enable_cb_delayed(struct virtqueue *vq); vq 55 tools/virtio/linux/virtio.h void *virtqueue_detach_unused_buf(struct virtqueue *vq); vq 63 tools/virtio/linux/virtio.h bool (*notify)(struct virtqueue *vq), vq 64 tools/virtio/linux/virtio.h void (*callback)(struct virtqueue *vq), vq 66 tools/virtio/linux/virtio.h void vring_del_virtqueue(struct virtqueue *vq); vq 32 tools/virtio/virtio_test.c struct virtqueue *vq; vq 46 tools/virtio/virtio_test.c bool vq_notify(struct virtqueue *vq) vq 48 tools/virtio/virtio_test.c struct vq_info *info = vq->priv; vq 56 tools/virtio/virtio_test.c void vq_callback(struct virtqueue *vq) vq 102 tools/virtio/virtio_test.c info->vq = vring_new_virtqueue(info->idx, vq 106 tools/virtio/virtio_test.c assert(info->vq); vq 107 tools/virtio/virtio_test.c info->vq->priv = info; vq 154 tools/virtio/virtio_test.c static void run_test(struct vdev_info *dev, struct vq_info *vq, vq 166 tools/virtio/virtio_test.c virtqueue_disable_cb(vq->vq); vq 171 tools/virtio/virtio_test.c r = virtqueue_add_outbuf(vq->vq, &sl, 1, vq 176 tools/virtio/virtio_test.c if (unlikely(!virtqueue_kick(vq->vq))) vq 183 tools/virtio/virtio_test.c if (virtqueue_get_buf(vq->vq, &len)) { vq 196 tools/virtio/virtio_test.c if (virtqueue_enable_cb_delayed(vq->vq)) vq 199 tools/virtio/virtio_test.c if (virtqueue_enable_cb(vq->vq)) vq 27 tools/virtio/vringh_test.c static bool never_notify_host(struct virtqueue *vq) vq 32 tools/virtio/vringh_test.c static void never_callback_guest(struct virtqueue *vq) vq 70 tools/virtio/vringh_test.c static bool parallel_notify_host(struct virtqueue *vq) vq 75 tools/virtio/vringh_test.c gvdev = container_of(vq->vdev, struct guest_virtio_device, vdev); vq 83 tools/virtio/vringh_test.c static bool no_notify_host(struct virtqueue *vq) vq 294 tools/virtio/vringh_test.c struct virtqueue *vq; vq 317 tools/virtio/vringh_test.c vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &gvdev.vdev, true, vq 334 tools/virtio/vringh_test.c while ((dbuf = virtqueue_get_buf(vq, &len)) != NULL) { vq 380 tools/virtio/vringh_test.c err = virtqueue_add_outbuf(vq, sg, num_sg, dbuf, vq 383 tools/virtio/vringh_test.c err = virtqueue_add_inbuf(vq, sg, num_sg, vq 387 tools/virtio/vringh_test.c if (!virtqueue_enable_cb_delayed(vq)) vq 394 tools/virtio/vringh_test.c virtqueue_disable_cb(vq); vq 402 tools/virtio/vringh_test.c virtqueue_kick(vq); vq 411 tools/virtio/vringh_test.c dbuf = virtqueue_get_buf(vq, &len); vq 421 tools/virtio/vringh_test.c if (!virtqueue_enable_cb_delayed(vq)) vq 427 tools/virtio/vringh_test.c virtqueue_disable_cb(vq); vq 432 tools/virtio/vringh_test.c vring_del_virtqueue(vq); vq 440 tools/virtio/vringh_test.c struct virtqueue *vq; vq 484 tools/virtio/vringh_test.c vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev, true, false, vq 510 tools/virtio/vringh_test.c err = virtqueue_add_sgs(vq, sgs, 1, 1, &err, GFP_KERNEL); vq 561 tools/virtio/vringh_test.c ret = virtqueue_get_buf(vq, &i); vq 579 tools/virtio/vringh_test.c err = virtqueue_add_outbuf(vq, guest_sg, RINGSIZE, &err, GFP_KERNEL); vq 623 tools/virtio/vringh_test.c ret = virtqueue_get_buf(vq, &i); vq 631 tools/virtio/vringh_test.c err = virtqueue_add_outbuf(vq, guest_sg, 1, &err, GFP_KERNEL); vq 656 tools/virtio/vringh_test.c assert(virtqueue_get_buf(vq, &len) != NULL); vq 667 tools/virtio/vringh_test.c vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev, true, vq 679 tools/virtio/vringh_test.c err = virtqueue_add_outbuf(vq, guest_sg, 4, &err, GFP_KERNEL); vq 747 tools/virtio/vringh_test.c vring_del_virtqueue(vq);