Lines Matching refs:vdev

160 	struct virtio_device *vdev;  member
346 static bool is_rproc_serial(const struct virtio_device *vdev) in is_rproc_serial() argument
348 return is_rproc_enabled && vdev->id.device == VIRTIO_ID_RPROC_SERIAL; in is_rproc_serial()
357 if (!portdev->vdev) in use_multiport()
359 return __virtio_test_bit(portdev->vdev, VIRTIO_CONSOLE_F_MULTIPORT); in use_multiport()
443 if (is_rproc_serial(vq->vdev)) { in alloc_buf()
453 if (!vq->vdev->dev.parent || !vq->vdev->dev.parent->parent) in alloc_buf()
455 buf->dev = vq->vdev->dev.parent->parent; in alloc_buf()
570 cpkt.id = cpu_to_virtio32(portdev->vdev, port_id); in __send_control_msg()
571 cpkt.event = cpu_to_virtio16(portdev->vdev, event); in __send_control_msg()
572 cpkt.value = cpu_to_virtio16(portdev->vdev, value); in __send_control_msg()
940 if (is_rproc_serial(port->out_vq->vdev)) in port_fops_splice_write()
1172 struct virtio_device *vdev; in resize_console() local
1178 vdev = port->portdev->vdev; in resize_console()
1181 if (!is_rproc_serial(vdev) && in resize_console()
1182 virtio_has_feature(vdev, VIRTIO_CONSOLE_F_SIZE)) in resize_console()
1426 dev_err(&port->portdev->vdev->dev, "Error allocating cdev\n"); in add_port()
1435 dev_err(&port->portdev->vdev->dev, in add_port()
1439 port->dev = device_create(pdrvdata.class, &port->portdev->vdev->dev, in add_port()
1441 port->portdev->vdev->index, id); in add_port()
1444 dev_err(&port->portdev->vdev->dev, in add_port()
1462 if (is_rproc_serial(port->portdev->vdev)) in add_port()
1496 port->portdev->vdev->index, id); in add_port()
1607 static void handle_control_message(struct virtio_device *vdev, in handle_control_message() argument
1618 port = find_port_by_id(portdev, virtio32_to_cpu(vdev, cpkt->id)); in handle_control_message()
1620 cpkt->event != cpu_to_virtio16(vdev, VIRTIO_CONSOLE_PORT_ADD)) { in handle_control_message()
1622 dev_dbg(&portdev->vdev->dev, in handle_control_message()
1627 switch (virtio16_to_cpu(vdev, cpkt->event)) { in handle_control_message()
1630 dev_dbg(&portdev->vdev->dev, in handle_control_message()
1635 if (virtio32_to_cpu(vdev, cpkt->id) >= in handle_control_message()
1637 dev_warn(&portdev->vdev->dev, in handle_control_message()
1643 add_port(portdev, virtio32_to_cpu(vdev, cpkt->id)); in handle_control_message()
1679 port->host_connected = virtio16_to_cpu(vdev, cpkt->value); in handle_control_message()
1761 handle_control_message(vq->vdev, portdev, buf); in control_work_handler()
1765 dev_warn(&portdev->vdev->dev, in control_work_handler()
1777 port = find_port_by_vq(vq->vdev->priv, vq); in out_intr()
1789 port = find_port_by_vq(vq->vdev->priv, vq); in in_intr()
1813 if (!port->guest_connected && !is_rproc_serial(port->portdev->vdev)) in in_intr()
1831 portdev = vq->vdev->priv; in control_intr()
1835 static void config_intr(struct virtio_device *vdev) in config_intr() argument
1839 portdev = vdev->priv; in config_intr()
1851 struct virtio_device *vdev; in config_work_handler() local
1855 vdev = portdev->vdev; in config_work_handler()
1856 virtio_cread(vdev, struct virtio_console_config, cols, &cols); in config_work_handler()
1857 virtio_cread(vdev, struct virtio_console_config, rows, &rows); in config_work_handler()
1924 err = portdev->vdev->config->find_vqs(portdev->vdev, nr_queues, vqs, in init_vqs()
1966 portdev->vdev->config->del_vqs(portdev->vdev); in remove_vqs()
1994 static int virtcons_probe(struct virtio_device *vdev) in virtcons_probe() argument
2002 if (!vdev->config->get && in virtcons_probe()
2003 (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_SIZE) in virtcons_probe()
2004 || virtio_has_feature(vdev, VIRTIO_CONSOLE_F_MULTIPORT))) { in virtcons_probe()
2005 dev_err(&vdev->dev, "%s failure: config access disabled\n", in virtcons_probe()
2020 portdev->vdev = vdev; in virtcons_probe()
2021 vdev->priv = portdev; in virtcons_probe()
2026 dev_err(&vdev->dev, in virtcons_probe()
2028 portdev->chr_major, vdev->index); in virtcons_probe()
2037 if (!is_rproc_serial(vdev) && in virtcons_probe()
2038 virtio_cread_feature(vdev, VIRTIO_CONSOLE_F_MULTIPORT, in virtcons_probe()
2046 dev_err(&vdev->dev, "Error %d initializing vqs\n", err); in virtcons_probe()
2053 virtio_device_ready(portdev->vdev); in virtcons_probe()
2067 dev_err(&vdev->dev, in virtcons_probe()
2114 static void virtcons_remove(struct virtio_device *vdev) in virtcons_remove() argument
2119 portdev = vdev->priv; in virtcons_remove()
2126 vdev->config->reset(vdev); in virtcons_remove()
2172 static int virtcons_freeze(struct virtio_device *vdev) in virtcons_freeze() argument
2177 portdev = vdev->priv; in virtcons_freeze()
2179 vdev->config->reset(vdev); in virtcons_freeze()
2206 static int virtcons_restore(struct virtio_device *vdev) in virtcons_restore() argument
2212 portdev = vdev->priv; in virtcons_restore()
2218 virtio_device_ready(portdev->vdev); in virtcons_restore()