Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211651
b: refs/heads/master
c: 6bdf2af
h: refs/heads/master
i:
  211649: cad39cc
  211647: 48b5452
v: v3
  • Loading branch information
Amit Shah authored and Rusty Russell committed Oct 21, 2010
1 parent 5fc1d00 commit 7897cb1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ad37e83c8dc413f92b10c3d9bdeabe9237f521d
refs/heads/master: 6bdf2afd02ae12bf8ac93e6d14c4b4dfef7c4c59
15 changes: 15 additions & 0 deletions trunk/drivers/char/virtio_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ struct ports_driver_data {
/* Used for exporting per-port information to debugfs */
struct dentry *debugfs_dir;

/* List of all the devices we're handling */
struct list_head portdevs;

/* Number of devices this driver is handling */
unsigned int index;

Expand Down Expand Up @@ -108,6 +111,9 @@ struct port_buffer {
* ports for that device (vdev->priv).
*/
struct ports_device {
/* Next portdev in the list, head is in the pdrvdata struct */
struct list_head list;

/*
* Workqueue handlers where we process deferred work after
* notification
Expand Down Expand Up @@ -1599,6 +1605,10 @@ static int __devinit virtcons_probe(struct virtio_device *vdev)
add_port(portdev, 0);
}

spin_lock_irq(&pdrvdata_lock);
list_add_tail(&portdev->list, &pdrvdata.portdevs);
spin_unlock_irq(&pdrvdata_lock);

__send_control_msg(portdev, VIRTIO_CONSOLE_BAD_ID,
VIRTIO_CONSOLE_DEVICE_READY, 1);
return 0;
Expand All @@ -1625,6 +1635,10 @@ static void virtcons_remove(struct virtio_device *vdev)

portdev = vdev->priv;

spin_lock_irq(&pdrvdata_lock);
list_del(&portdev->list);
spin_unlock_irq(&pdrvdata_lock);

/* Disable interrupts for vqs */
vdev->config->reset(vdev);
/* Finish up work that's lined up */
Expand Down Expand Up @@ -1691,6 +1705,7 @@ static int __init init(void)
PTR_ERR(pdrvdata.debugfs_dir));
}
INIT_LIST_HEAD(&pdrvdata.consoles);
INIT_LIST_HEAD(&pdrvdata.portdevs);

return register_virtio_driver(&virtio_console);
}
Expand Down

0 comments on commit 7897cb1

Please sign in to comment.