Lines Matching defs:cpkt
158 struct virtio_console_control cpkt;
561 portdev->cpkt.id = cpu_to_virtio32(portdev->vdev, port_id);
562 portdev->cpkt.event = cpu_to_virtio16(portdev->vdev, event);
563 portdev->cpkt.value = cpu_to_virtio16(portdev->vdev, value);
565 sg_init_one(sg, &portdev->cpkt, sizeof(struct virtio_console_control));
567 if (virtqueue_add_outbuf(vq, sg, 1, &portdev->cpkt, GFP_ATOMIC) == 0) {
1568 struct virtio_console_control *cpkt;
1573 cpkt = (struct virtio_console_control *)(buf->buf + buf->offset);
1575 port = find_port_by_id(portdev, virtio32_to_cpu(vdev, cpkt->id));
1577 cpkt->event != cpu_to_virtio16(vdev, VIRTIO_CONSOLE_PORT_ADD)) {
1580 "Invalid index %u in control packet\n", cpkt->id);
1584 switch (virtio16_to_cpu(vdev, cpkt->event)) {
1592 if (virtio32_to_cpu(vdev, cpkt->id) >=
1597 cpkt->id, portdev->max_nr_ports - 1);
1600 add_port(portdev, virtio32_to_cpu(vdev, cpkt->id));
1606 if (!cpkt->value)
1627 memcpy(&size, buf->buf + buf->offset + sizeof(*cpkt),
1636 port->host_connected = virtio16_to_cpu(vdev, cpkt->value);
1664 * Skip the size of the header and the cpkt to get the size
1667 name_size = buf->len - buf->offset - sizeof(*cpkt) + 1;
1675 strncpy(port->name, buf->buf + buf->offset + sizeof(*cpkt),