aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/virtio_console.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index df45e5e9a947..e52ee1151f5f 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -187,6 +187,7 @@ static int get_chars(u32 vtermno, char *buf, int count)
187 */ 187 */
188static void virtcons_apply_config(struct virtio_device *dev) 188static void virtcons_apply_config(struct virtio_device *dev)
189{ 189{
190 struct port *port = dev->priv;
190 struct winsize ws; 191 struct winsize ws;
191 192
192 if (virtio_has_feature(dev, VIRTIO_CONSOLE_F_SIZE)) { 193 if (virtio_has_feature(dev, VIRTIO_CONSOLE_F_SIZE)) {
@@ -196,7 +197,7 @@ static void virtcons_apply_config(struct virtio_device *dev)
196 dev->config->get(dev, 197 dev->config->get(dev,
197 offsetof(struct virtio_console_config, rows), 198 offsetof(struct virtio_console_config, rows),
198 &ws.ws_row, sizeof(u16)); 199 &ws.ws_row, sizeof(u16));
199 hvc_resize(console.hvc, ws); 200 hvc_resize(port->hvc, ws);
200 } 201 }
201} 202}
202 203
@@ -219,7 +220,9 @@ static void notifier_del_vio(struct hvc_struct *hp, int data)
219 220
220static void hvc_handle_input(struct virtqueue *vq) 221static void hvc_handle_input(struct virtqueue *vq)
221{ 222{
222 if (hvc_poll(console.hvc)) 223 struct port *port = vq->vdev->priv;
224
225 if (hvc_poll(port->hvc))
223 hvc_kick(); 226 hvc_kick();
224} 227}
225 228
@@ -272,7 +275,10 @@ static int __devinit virtcons_probe(struct virtio_device *vdev)
272 "Multiple virtio-console devices not supported yet\n"); 275 "Multiple virtio-console devices not supported yet\n");
273 return -EEXIST; 276 return -EEXIST;
274 } 277 }
278
279 /* Attach this port to this virtio_device, and vice-versa. */
275 port->vdev = vdev; 280 port->vdev = vdev;
281 vdev->priv = port;
276 282
277 /* This is the scratch page we use to receive console input */ 283 /* This is the scratch page we use to receive console input */
278 port->inbuf = alloc_buf(PAGE_SIZE); 284 port->inbuf = alloc_buf(PAGE_SIZE);