Lines Matching refs:cpkt
171 struct virtio_console_control cpkt; member
574 portdev->cpkt.id = cpu_to_virtio32(portdev->vdev, port_id); in __send_control_msg()
575 portdev->cpkt.event = cpu_to_virtio16(portdev->vdev, event); in __send_control_msg()
576 portdev->cpkt.value = cpu_to_virtio16(portdev->vdev, value); in __send_control_msg()
578 sg_init_one(sg, &portdev->cpkt, sizeof(struct virtio_console_control)); in __send_control_msg()
580 if (virtqueue_add_outbuf(vq, sg, 1, &portdev->cpkt, GFP_ATOMIC) == 0) { in __send_control_msg()
1592 struct virtio_console_control *cpkt; in handle_control_message() local
1597 cpkt = (struct virtio_console_control *)(buf->buf + buf->offset); in handle_control_message()
1599 port = find_port_by_id(portdev, virtio32_to_cpu(vdev, cpkt->id)); in handle_control_message()
1601 cpkt->event != cpu_to_virtio16(vdev, VIRTIO_CONSOLE_PORT_ADD)) { in handle_control_message()
1604 "Invalid index %u in control packet\n", cpkt->id); in handle_control_message()
1608 switch (virtio16_to_cpu(vdev, cpkt->event)) { in handle_control_message()
1616 if (virtio32_to_cpu(vdev, cpkt->id) >= in handle_control_message()
1621 cpkt->id, portdev->max_nr_ports - 1); in handle_control_message()
1624 add_port(portdev, virtio32_to_cpu(vdev, cpkt->id)); in handle_control_message()
1630 if (!cpkt->value) in handle_control_message()
1651 memcpy(&size, buf->buf + buf->offset + sizeof(*cpkt), in handle_control_message()
1660 port->host_connected = virtio16_to_cpu(vdev, cpkt->value); in handle_control_message()
1691 name_size = buf->len - buf->offset - sizeof(*cpkt) + 1; in handle_control_message()
1699 strncpy(port->name, buf->buf + buf->offset + sizeof(*cpkt), in handle_control_message()