Lines Matching defs:cpkt
388 struct virtio_console_control cpkt;
395 cpkt.id = port_id;
396 cpkt.event = event;
397 cpkt.value = value;
401 sg_init_one(sg, &cpkt, sizeof(cpkt));
402 if (virtqueue_add_buf(vq, sg, 1, 0, &cpkt) >= 0) {
1162 struct virtio_console_control *cpkt;
1167 cpkt = (struct virtio_console_control *)(buf->buf + buf->offset);
1169 port = find_port_by_id(portdev, cpkt->id);
1170 if (!port && cpkt->event != VIRTIO_CONSOLE_PORT_ADD) {
1173 "Invalid index %u in control packet\n", cpkt->id);
1177 switch (cpkt->event) {
1185 if (cpkt->id >= portdev->config.max_nr_ports) {
1188 cpkt->id, portdev->config.max_nr_ports - 1);
1191 add_port(portdev, cpkt->id);
1197 if (!cpkt->value)
1217 memcpy(&size, buf->buf + buf->offset + sizeof(*cpkt),
1226 port->host_connected = cpkt->value;
1239 * Skip the size of the header and the cpkt to get the size
1242 name_size = buf->len - buf->offset - sizeof(*cpkt) + 1;
1250 strncpy(port->name, buf->buf + buf->offset + sizeof(*cpkt),