diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-30 20:37:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-12-30 20:37:25 -0500 |
commit | ab70537c32a3245325b48774664da588904e47f2 (patch) | |
tree | fdb4447e520bd34dd8696fdd3b976075414d8555 /drivers/char | |
parent | 14a3c4ab0e58d143c7928c9eb2f2610205e13bf2 (diff) | |
parent | bda53cd510b6777ced652ba279020bb7b414b744 (diff) |
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.c | 1 | ||||
-rw-r--r-- | drivers/char/virtio_console.c | 30 |
2 files changed, 30 insertions, 1 deletions
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index fb57f67bb42..0587b66d6fc 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) | |||
695 | hp->ws = ws; | 695 | hp->ws = ws; |
696 | schedule_work(&hp->tty_resize); | 696 | schedule_work(&hp->tty_resize); |
697 | } | 697 | } |
698 | EXPORT_SYMBOL_GPL(hvc_resize); | ||
698 | 699 | ||
699 | /* | 700 | /* |
700 | * This kthread is either polling or interrupt driven. This is determined by | 701 | * 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 3fb0d2c88ba..ff6f5a4b58f 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)) | |||
138 | } | 138 | } |
139 | 139 | ||
140 | /* | 140 | /* |
141 | * virtio console configuration. This supports: | ||
142 | * - console resize | ||
143 | */ | ||
144 | static void virtcons_apply_config(struct virtio_device *dev) | ||
145 | { | ||
146 | struct winsize ws; | ||
147 | |||
148 | if (virtio_has_feature(dev, VIRTIO_CONSOLE_F_SIZE)) { | ||
149 | dev->config->get(dev, | ||
150 | offsetof(struct virtio_console_config, cols), | ||
151 | &ws.ws_col, sizeof(u16)); | ||
152 | dev->config->get(dev, | ||
153 | offsetof(struct virtio_console_config, rows), | ||
154 | &ws.ws_row, sizeof(u16)); | ||
155 | hvc_resize(hvc, ws); | ||
156 | } | ||
157 | } | ||
158 | |||
159 | /* | ||
141 | * we support only one console, the hvc struct is a global var | 160 | * we support only one console, the hvc struct is a global var |
142 | * There is no need to do anything | 161 | * We set the configuration at this point, since we now have a tty |
143 | */ | 162 | */ |
144 | static int notifier_add_vio(struct hvc_struct *hp, int data) | 163 | static int notifier_add_vio(struct hvc_struct *hp, int data) |
145 | { | 164 | { |
146 | hp->irq_requested = 1; | 165 | hp->irq_requested = 1; |
166 | virtcons_apply_config(vdev); | ||
167 | |||
147 | return 0; | 168 | return 0; |
148 | } | 169 | } |
149 | 170 | ||
@@ -234,11 +255,18 @@ static struct virtio_device_id id_table[] = { | |||
234 | { 0 }, | 255 | { 0 }, |
235 | }; | 256 | }; |
236 | 257 | ||
258 | static unsigned int features[] = { | ||
259 | VIRTIO_CONSOLE_F_SIZE, | ||
260 | }; | ||
261 | |||
237 | static struct virtio_driver virtio_console = { | 262 | static struct virtio_driver virtio_console = { |
263 | .feature_table = features, | ||
264 | .feature_table_size = ARRAY_SIZE(features), | ||
238 | .driver.name = KBUILD_MODNAME, | 265 | .driver.name = KBUILD_MODNAME, |
239 | .driver.owner = THIS_MODULE, | 266 | .driver.owner = THIS_MODULE, |
240 | .id_table = id_table, | 267 | .id_table = id_table, |
241 | .probe = virtcons_probe, | 268 | .probe = virtcons_probe, |
269 | .config_changed = virtcons_apply_config, | ||
242 | }; | 270 | }; |
243 | 271 | ||
244 | static int __init init(void) | 272 | static int __init init(void) |