summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-12-30 17:37:25 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2008-12-30 17:37:25 -0800
commitab70537c32a3245325b48774664da588904e47f2 (patch)
treefdb4447e520bd34dd8696fdd3b976075414d8555 /drivers/char
parent14a3c4ab0e58d143c7928c9eb2f2610205e13bf2 (diff)
parentbda53cd510b6777ced652ba279020bb7b414b744 (diff)
downloadtalos-op-linux-ab70537c32a3245325b48774664da588904e47f2.tar.gz
talos-op-linux-ab70537c32a3245325b48774664da588904e47f2.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: lguest: struct device - replace bus_id with dev_name() lguest: move the initial guest page table creation code to the host kvm-s390: implement config_changed for virtio on s390 virtio_console: support console resizing virtio: add PCI device release() function virtio_blk: fix type warning virtio: block: dynamic maximum segments virtio: set max_segment_size and max_sectors to infinite. virtio: avoid implicit use of Linux page size in balloon interface virtio: hand virtio ring alignment as argument to vring_new_virtqueue virtio: use KVM_S390_VIRTIO_RING_ALIGN instead of relying on pagesize virtio: use LGUEST_VRING_ALIGN instead of relying on pagesize virtio: Don't use PAGE_SIZE for vring alignment in virtio_pci. virtio: rename 'pagesize' arg to vring_init/vring_size virtio: Don't use PAGE_SIZE in virtio_pci.c virtio: struct device - replace bus_id with dev_name(), dev_set_name() virtio-pci queue allocation not page-aligned
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/hvc_console.c1
-rw-r--r--drivers/char/virtio_console.c30
2 files changed, 30 insertions, 1 deletions
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index fb57f67bb427..0587b66d6fc7 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -695,6 +695,7 @@ void hvc_resize(struct hvc_struct *hp, struct winsize ws)
hp->ws = ws;
schedule_work(&hp->tty_resize);
}
+EXPORT_SYMBOL_GPL(hvc_resize);
/*
* This kthread is either polling or interrupt driven. This is determined by
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 3fb0d2c88ba5..ff6f5a4b58fb 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -138,12 +138,33 @@ int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int))
}
/*
+ * virtio console configuration. This supports:
+ * - console resize
+ */
+static void virtcons_apply_config(struct virtio_device *dev)
+{
+ struct winsize ws;
+
+ if (virtio_has_feature(dev, VIRTIO_CONSOLE_F_SIZE)) {
+ dev->config->get(dev,
+ offsetof(struct virtio_console_config, cols),
+ &ws.ws_col, sizeof(u16));
+ dev->config->get(dev,
+ offsetof(struct virtio_console_config, rows),
+ &ws.ws_row, sizeof(u16));
+ hvc_resize(hvc, ws);
+ }
+}
+
+/*
* we support only one console, the hvc struct is a global var
- * There is no need to do anything
+ * We set the configuration at this point, since we now have a tty
*/
static int notifier_add_vio(struct hvc_struct *hp, int data)
{
hp->irq_requested = 1;
+ virtcons_apply_config(vdev);
+
return 0;
}
@@ -234,11 +255,18 @@ static struct virtio_device_id id_table[] = {
{ 0 },
};
+static unsigned int features[] = {
+ VIRTIO_CONSOLE_F_SIZE,
+};
+
static struct virtio_driver virtio_console = {
+ .feature_table = features,
+ .feature_table_size = ARRAY_SIZE(features),
.driver.name = KBUILD_MODNAME,
.driver.owner = THIS_MODULE,
.id_table = id_table,
.probe = virtcons_probe,
+ .config_changed = virtcons_apply_config,
};
static int __init init(void)
OpenPOWER on IntegriCloud