aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/virtio_console.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index e53c52b904fb..8c24b86aadc9 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -374,22 +374,22 @@ out:
374 return ret; 374 return ret;
375} 375}
376 376
377static ssize_t send_control_msg(struct port *port, unsigned int event, 377static ssize_t __send_control_msg(struct ports_device *portdev, u32 port_id,
378 unsigned int value) 378 unsigned int event, unsigned int value)
379{ 379{
380 struct scatterlist sg[1]; 380 struct scatterlist sg[1];
381 struct virtio_console_control cpkt; 381 struct virtio_console_control cpkt;
382 struct virtqueue *vq; 382 struct virtqueue *vq;
383 unsigned int len; 383 unsigned int len;
384 384
385 if (!use_multiport(port->portdev)) 385 if (!use_multiport(portdev))
386 return 0; 386 return 0;
387 387
388 cpkt.id = port->id; 388 cpkt.id = port_id;
389 cpkt.event = event; 389 cpkt.event = event;
390 cpkt.value = value; 390 cpkt.value = value;
391 391
392 vq = port->portdev->c_ovq; 392 vq = portdev->c_ovq;
393 393
394 sg_init_one(sg, &cpkt, sizeof(cpkt)); 394 sg_init_one(sg, &cpkt, sizeof(cpkt));
395 if (virtqueue_add_buf(vq, sg, 1, 0, &cpkt) >= 0) { 395 if (virtqueue_add_buf(vq, sg, 1, 0, &cpkt) >= 0) {
@@ -400,6 +400,12 @@ static ssize_t send_control_msg(struct port *port, unsigned int event,
400 return 0; 400 return 0;
401} 401}
402 402
403static ssize_t send_control_msg(struct port *port, unsigned int event,
404 unsigned int value)
405{
406 return __send_control_msg(port->portdev, port->id, event, value);
407}
408
403static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count) 409static ssize_t send_buf(struct port *port, void *in_buf, size_t in_count)
404{ 410{
405 struct scatterlist sg[1]; 411 struct scatterlist sg[1];