aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/tty3270.c
diff options
context:
space:
mode:
authorRichard Hitt <rbh00@utsglobal.com>2005-10-30 18:00:10 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 20:37:16 -0500
commited3cb6f039bb296457bfd2877cba6ad0287d8d54 (patch)
treec65ff2b245f17ab7e1da6f279b9d004b447d23bc /drivers/s390/char/tty3270.c
parentd89ea9b8bb4c4ad63122cd2d2ee5110a52da51b8 (diff)
[PATCH] s390: 3270 fullscreen view
Martin Schwidefsky <schwidefsky@de.ibm.com> Fix fullscreen view of the 3270 device driver. Signed-off-by: Richard Hitt <rbh00@utsglobal.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/char/tty3270.c')
-rw-r--r--drivers/s390/char/tty3270.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c
index 7db5ebce7f0f..4b9069370388 100644
--- a/drivers/s390/char/tty3270.c
+++ b/drivers/s390/char/tty3270.c
@@ -653,18 +653,12 @@ tty3270_activate(struct raw3270_view *view)
653 tp->update_flags = TTY_UPDATE_ALL; 653 tp->update_flags = TTY_UPDATE_ALL;
654 tty3270_set_timer(tp, 1); 654 tty3270_set_timer(tp, 1);
655 spin_unlock_irqrestore(&tp->view.lock, flags); 655 spin_unlock_irqrestore(&tp->view.lock, flags);
656 start_tty(tp->tty);
657 return 0; 656 return 0;
658} 657}
659 658
660static void 659static void
661tty3270_deactivate(struct raw3270_view *view) 660tty3270_deactivate(struct raw3270_view *view)
662{ 661{
663 struct tty3270 *tp;
664
665 tp = (struct tty3270 *) view;
666 if (tp && tp->tty)
667 stop_tty(tp->tty);
668} 662}
669 663
670static int 664static int
@@ -716,13 +710,13 @@ tty3270_alloc_view(void)
716 tp->freemem_pages[pages], PAGE_SIZE); 710 tp->freemem_pages[pages], PAGE_SIZE);
717 } 711 }
718 tp->write = raw3270_request_alloc(TTY3270_OUTPUT_BUFFER_SIZE); 712 tp->write = raw3270_request_alloc(TTY3270_OUTPUT_BUFFER_SIZE);
719 if (!tp->write) 713 if (IS_ERR(tp->write))
720 goto out_pages; 714 goto out_pages;
721 tp->read = raw3270_request_alloc(0); 715 tp->read = raw3270_request_alloc(0);
722 if (!tp->read) 716 if (IS_ERR(tp->read))
723 goto out_write; 717 goto out_write;
724 tp->kreset = raw3270_request_alloc(1); 718 tp->kreset = raw3270_request_alloc(1);
725 if (!tp->kreset) 719 if (IS_ERR(tp->kreset))
726 goto out_read; 720 goto out_read;
727 tp->kbd = kbd_alloc(); 721 tp->kbd = kbd_alloc();
728 if (!tp->kbd) 722 if (!tp->kbd)
@@ -845,7 +839,8 @@ tty3270_del_views(void)
845 int i; 839 int i;
846 840
847 for (i = 0; i < tty3270_max_index; i++) { 841 for (i = 0; i < tty3270_max_index; i++) {
848 tp = (struct tty3270 *) raw3270_find_view(&tty3270_fn, i); 842 tp = (struct tty3270 *)
843 raw3270_find_view(&tty3270_fn, i + RAW3270_FIRSTMINOR);
849 if (!IS_ERR(tp)) 844 if (!IS_ERR(tp))
850 raw3270_del_view(&tp->view); 845 raw3270_del_view(&tp->view);
851 } 846 }
@@ -871,7 +866,9 @@ tty3270_open(struct tty_struct *tty, struct file * filp)
871 if (tty->count > 1) 866 if (tty->count > 1)
872 return 0; 867 return 0;
873 /* Check if the tty3270 is already there. */ 868 /* Check if the tty3270 is already there. */
874 tp = (struct tty3270 *) raw3270_find_view(&tty3270_fn, tty->index); 869 tp = (struct tty3270 *)
870 raw3270_find_view(&tty3270_fn,
871 tty->index + RAW3270_FIRSTMINOR);
875 if (!IS_ERR(tp)) { 872 if (!IS_ERR(tp)) {
876 tty->driver_data = tp; 873 tty->driver_data = tp;
877 tty->winsize.ws_row = tp->view.rows - 2; 874 tty->winsize.ws_row = tp->view.rows - 2;
@@ -903,7 +900,8 @@ tty3270_open(struct tty_struct *tty, struct file * filp)
903 (void (*)(unsigned long)) tty3270_read_tasklet, 900 (void (*)(unsigned long)) tty3270_read_tasklet,
904 (unsigned long) tp->read); 901 (unsigned long) tp->read);
905 902
906 rc = raw3270_add_view(&tp->view, &tty3270_fn, tty->index); 903 rc = raw3270_add_view(&tp->view, &tty3270_fn,
904 tty->index + RAW3270_FIRSTMINOR);
907 if (rc) { 905 if (rc) {
908 tty3270_free_view(tp); 906 tty3270_free_view(tp);
909 return rc; 907 return rc;
@@ -911,8 +909,8 @@ tty3270_open(struct tty_struct *tty, struct file * filp)
911 909
912 rc = tty3270_alloc_screen(tp); 910 rc = tty3270_alloc_screen(tp);
913 if (rc) { 911 if (rc) {
914 raw3270_del_view(&tp->view);
915 raw3270_put_view(&tp->view); 912 raw3270_put_view(&tp->view);
913 raw3270_del_view(&tp->view);
916 return rc; 914 return rc;
917 } 915 }
918 916
@@ -1780,7 +1778,7 @@ tty3270_init(void)
1780 struct tty_driver *driver; 1778 struct tty_driver *driver;
1781 int ret; 1779 int ret;
1782 1780
1783 driver = alloc_tty_driver(256); 1781 driver = alloc_tty_driver(RAW3270_MAXDEVS);
1784 if (!driver) 1782 if (!driver)
1785 return -ENOMEM; 1783 return -ENOMEM;
1786 1784
@@ -1794,6 +1792,7 @@ tty3270_init(void)
1794 driver->driver_name = "ttyTUB"; 1792 driver->driver_name = "ttyTUB";
1795 driver->name = "ttyTUB"; 1793 driver->name = "ttyTUB";
1796 driver->major = IBM_TTY3270_MAJOR; 1794 driver->major = IBM_TTY3270_MAJOR;
1795 driver->minor_start = RAW3270_FIRSTMINOR;
1797 driver->type = TTY_DRIVER_TYPE_SYSTEM; 1796 driver->type = TTY_DRIVER_TYPE_SYSTEM;
1798 driver->subtype = SYSTEM_TYPE_TTY; 1797 driver->subtype = SYSTEM_TYPE_TTY;
1799 driver->init_termios = tty_std_termios; 1798 driver->init_termios = tty_std_termios;