Lines Matching refs:cpkt
158 struct virtio_console_control cpkt; member
561 portdev->cpkt.id = cpu_to_virtio32(portdev->vdev, port_id); in __send_control_msg()
562 portdev->cpkt.event = cpu_to_virtio16(portdev->vdev, event); in __send_control_msg()
563 portdev->cpkt.value = cpu_to_virtio16(portdev->vdev, value); in __send_control_msg()
565 sg_init_one(sg, &portdev->cpkt, sizeof(struct virtio_console_control)); in __send_control_msg()
567 if (virtqueue_add_outbuf(vq, sg, 1, &portdev->cpkt, GFP_ATOMIC) == 0) { in __send_control_msg()
1570 struct virtio_console_control *cpkt; in handle_control_message() local
1575 cpkt = (struct virtio_console_control *)(buf->buf + buf->offset); in handle_control_message()
1577 port = find_port_by_id(portdev, virtio32_to_cpu(vdev, cpkt->id)); in handle_control_message()
1579 cpkt->event != cpu_to_virtio16(vdev, VIRTIO_CONSOLE_PORT_ADD)) { in handle_control_message()
1582 "Invalid index %u in control packet\n", cpkt->id); in handle_control_message()
1586 switch (virtio16_to_cpu(vdev, cpkt->event)) { in handle_control_message()
1594 if (virtio32_to_cpu(vdev, cpkt->id) >= in handle_control_message()
1599 cpkt->id, portdev->max_nr_ports - 1); in handle_control_message()
1602 add_port(portdev, virtio32_to_cpu(vdev, cpkt->id)); in handle_control_message()
1608 if (!cpkt->value) in handle_control_message()
1629 memcpy(&size, buf->buf + buf->offset + sizeof(*cpkt), in handle_control_message()
1638 port->host_connected = virtio16_to_cpu(vdev, cpkt->value); in handle_control_message()
1669 name_size = buf->len - buf->offset - sizeof(*cpkt) + 1; in handle_control_message()
1677 strncpy(port->name, buf->buf + buf->offset + sizeof(*cpkt), in handle_control_message()