diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2006-07-13 04:53:32 -0400 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2006-07-13 04:53:32 -0400 |
commit | 4e9e95a3554e98e7383a3591283ffcd850c9ef48 (patch) | |
tree | 245703cc917a274b84f02cf68c43ba5efe370f59 /drivers/char | |
parent | 8bff05b052db7a4cfaaf0eee7f8145600548e9c9 (diff) |
[POWERPC] Make the hvc_console output buffer size settable
So the iSeries console will be faster since it can send up to 200 bytes at
a time to the Hypervisor. This only affects the tty part of the console,
the console writes are still in 16 byte lots.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/hvc_console.c | 14 | ||||
-rw-r--r-- | drivers/char/hvc_console.h | 2 | ||||
-rw-r--r-- | drivers/char/hvc_iseries.c | 3 | ||||
-rw-r--r-- | drivers/char/hvc_rtas.c | 2 | ||||
-rw-r--r-- | drivers/char/hvc_vio.c | 3 |
5 files changed, 15 insertions, 9 deletions
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index ca2f538e549e..dbee8bed0530 100644 --- a/drivers/char/hvc_console.c +++ b/drivers/char/hvc_console.c | |||
@@ -80,7 +80,8 @@ struct hvc_struct { | |||
80 | struct tty_struct *tty; | 80 | struct tty_struct *tty; |
81 | unsigned int count; | 81 | unsigned int count; |
82 | int do_wakeup; | 82 | int do_wakeup; |
83 | char outbuf[N_OUTBUF] __ALIGNED__; | 83 | char *outbuf; |
84 | int outbuf_size; | ||
84 | int n_outbuf; | 85 | int n_outbuf; |
85 | uint32_t vtermno; | 86 | uint32_t vtermno; |
86 | struct hv_ops *ops; | 87 | struct hv_ops *ops; |
@@ -505,7 +506,7 @@ static int hvc_write(struct tty_struct *tty, const unsigned char *buf, int count | |||
505 | if (hp->n_outbuf > 0) | 506 | if (hp->n_outbuf > 0) |
506 | hvc_push(hp); | 507 | hvc_push(hp); |
507 | 508 | ||
508 | while (count > 0 && (rsize = N_OUTBUF - hp->n_outbuf) > 0) { | 509 | while (count > 0 && (rsize = hp->outbuf_size - hp->n_outbuf) > 0) { |
509 | if (rsize > count) | 510 | if (rsize > count) |
510 | rsize = count; | 511 | rsize = count; |
511 | memcpy(hp->outbuf + hp->n_outbuf, buf, rsize); | 512 | memcpy(hp->outbuf + hp->n_outbuf, buf, rsize); |
@@ -538,7 +539,7 @@ static int hvc_write_room(struct tty_struct *tty) | |||
538 | if (!hp) | 539 | if (!hp) |
539 | return -1; | 540 | return -1; |
540 | 541 | ||
541 | return N_OUTBUF - hp->n_outbuf; | 542 | return hp->outbuf_size - hp->n_outbuf; |
542 | } | 543 | } |
543 | 544 | ||
544 | static int hvc_chars_in_buffer(struct tty_struct *tty) | 545 | static int hvc_chars_in_buffer(struct tty_struct *tty) |
@@ -728,12 +729,13 @@ static struct kobj_type hvc_kobj_type = { | |||
728 | }; | 729 | }; |
729 | 730 | ||
730 | struct hvc_struct __devinit *hvc_alloc(uint32_t vtermno, int irq, | 731 | struct hvc_struct __devinit *hvc_alloc(uint32_t vtermno, int irq, |
731 | struct hv_ops *ops) | 732 | struct hv_ops *ops, int outbuf_size) |
732 | { | 733 | { |
733 | struct hvc_struct *hp; | 734 | struct hvc_struct *hp; |
734 | int i; | 735 | int i; |
735 | 736 | ||
736 | hp = kmalloc(sizeof(*hp), GFP_KERNEL); | 737 | hp = kmalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size, |
738 | GFP_KERNEL); | ||
737 | if (!hp) | 739 | if (!hp) |
738 | return ERR_PTR(-ENOMEM); | 740 | return ERR_PTR(-ENOMEM); |
739 | 741 | ||
@@ -742,6 +744,8 @@ struct hvc_struct __devinit *hvc_alloc(uint32_t vtermno, int irq, | |||
742 | hp->vtermno = vtermno; | 744 | hp->vtermno = vtermno; |
743 | hp->irq = irq; | 745 | hp->irq = irq; |
744 | hp->ops = ops; | 746 | hp->ops = ops; |
747 | hp->outbuf_size = outbuf_size; | ||
748 | hp->outbuf = &((char *)hp)[ALIGN(sizeof(*hp), sizeof(long))]; | ||
745 | 749 | ||
746 | kobject_init(&hp->kobj); | 750 | kobject_init(&hp->kobj); |
747 | hp->kobj.ktype = &hvc_kobj_type; | 751 | hp->kobj.ktype = &hvc_kobj_type; |
diff --git a/drivers/char/hvc_console.h b/drivers/char/hvc_console.h index 96b7401319c1..8c59818050e6 100644 --- a/drivers/char/hvc_console.h +++ b/drivers/char/hvc_console.h | |||
@@ -56,7 +56,7 @@ extern int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops); | |||
56 | 56 | ||
57 | /* register a vterm for hvc tty operation (module_init or hotplug add) */ | 57 | /* register a vterm for hvc tty operation (module_init or hotplug add) */ |
58 | extern struct hvc_struct * __devinit hvc_alloc(uint32_t vtermno, int irq, | 58 | extern struct hvc_struct * __devinit hvc_alloc(uint32_t vtermno, int irq, |
59 | struct hv_ops *ops); | 59 | struct hv_ops *ops, int outbuf_size); |
60 | /* remove a vterm from hvc tty operation (modele_exit or hotplug remove) */ | 60 | /* remove a vterm from hvc tty operation (modele_exit or hotplug remove) */ |
61 | extern int __devexit hvc_remove(struct hvc_struct *hp); | 61 | extern int __devexit hvc_remove(struct hvc_struct *hp); |
62 | 62 | ||
diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c index 256afc8e5838..4747729459c7 100644 --- a/drivers/char/hvc_iseries.c +++ b/drivers/char/hvc_iseries.c | |||
@@ -221,7 +221,8 @@ static int __devinit hvc_vio_probe(struct vio_dev *vdev, | |||
221 | 221 | ||
222 | pi = &port_info[vdev->unit_address]; | 222 | pi = &port_info[vdev->unit_address]; |
223 | 223 | ||
224 | hp = hvc_alloc(vdev->unit_address, vdev->irq, &hvc_get_put_ops); | 224 | hp = hvc_alloc(vdev->unit_address, vdev->irq, &hvc_get_put_ops, |
225 | VIOCHAR_MAX_DATA); | ||
225 | if (IS_ERR(hp)) | 226 | if (IS_ERR(hp)) |
226 | return PTR_ERR(hp); | 227 | return PTR_ERR(hp); |
227 | pi->hp = hp; | 228 | pi->hp = hp; |
diff --git a/drivers/char/hvc_rtas.c b/drivers/char/hvc_rtas.c index 57106e02fd2e..4b97eaf18602 100644 --- a/drivers/char/hvc_rtas.c +++ b/drivers/char/hvc_rtas.c | |||
@@ -94,7 +94,7 @@ static int hvc_rtas_init(void) | |||
94 | 94 | ||
95 | /* Allocate an hvc_struct for the console device we instantiated | 95 | /* Allocate an hvc_struct for the console device we instantiated |
96 | * earlier. Save off hp so that we can return it on exit */ | 96 | * earlier. Save off hp so that we can return it on exit */ |
97 | hp = hvc_alloc(hvc_rtas_cookie, NO_IRQ, &hvc_rtas_get_put_ops); | 97 | hp = hvc_alloc(hvc_rtas_cookie, NO_IRQ, &hvc_rtas_get_put_ops, 16); |
98 | if (IS_ERR(hp)) | 98 | if (IS_ERR(hp)) |
99 | return PTR_ERR(hp); | 99 | return PTR_ERR(hp); |
100 | 100 | ||
diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c index 9add81ceb440..651e5d25f58b 100644 --- a/drivers/char/hvc_vio.c +++ b/drivers/char/hvc_vio.c | |||
@@ -90,7 +90,8 @@ static int __devinit hvc_vio_probe(struct vio_dev *vdev, | |||
90 | if (!vdev || !id) | 90 | if (!vdev || !id) |
91 | return -EPERM; | 91 | return -EPERM; |
92 | 92 | ||
93 | hp = hvc_alloc(vdev->unit_address, vdev->irq, &hvc_get_put_ops); | 93 | hp = hvc_alloc(vdev->unit_address, vdev->irq, &hvc_get_put_ops, |
94 | MAX_VIO_PUT_CHARS); | ||
94 | if (IS_ERR(hp)) | 95 | if (IS_ERR(hp)) |
95 | return PTR_ERR(hp); | 96 | return PTR_ERR(hp); |
96 | dev_set_drvdata(&vdev->dev, hp); | 97 | dev_set_drvdata(&vdev->dev, hp); |