aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/sclp_tty.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/char/sclp_tty.c')
-rw-r--r--drivers/s390/char/sclp_tty.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c
index a20d7c89341d..6cbf067f1a8f 100644
--- a/drivers/s390/char/sclp_tty.c
+++ b/drivers/s390/char/sclp_tty.c
@@ -13,6 +13,7 @@
13#include <linux/kmod.h> 13#include <linux/kmod.h>
14#include <linux/tty.h> 14#include <linux/tty.h>
15#include <linux/tty_driver.h> 15#include <linux/tty_driver.h>
16#include <linux/tty_flip.h>
16#include <linux/sched.h> 17#include <linux/sched.h>
17#include <linux/wait.h> 18#include <linux/wait.h>
18#include <linux/slab.h> 19#include <linux/slab.h>
@@ -496,25 +497,19 @@ sclp_tty_input(unsigned char* buf, unsigned int count)
496 case CTRLCHAR_SYSRQ: 497 case CTRLCHAR_SYSRQ:
497 break; 498 break;
498 case CTRLCHAR_CTRL: 499 case CTRLCHAR_CTRL:
499 sclp_tty->flip.count++; 500 tty_insert_flip_char(sclp_tty, cchar, TTY_NORMAL);
500 *sclp_tty->flip.flag_buf_ptr++ = TTY_NORMAL;
501 *sclp_tty->flip.char_buf_ptr++ = cchar;
502 tty_flip_buffer_push(sclp_tty); 501 tty_flip_buffer_push(sclp_tty);
503 break; 502 break;
504 case CTRLCHAR_NONE: 503 case CTRLCHAR_NONE:
505 /* send (normal) input to line discipline */ 504 /* send (normal) input to line discipline */
506 memcpy(sclp_tty->flip.char_buf_ptr, buf, count);
507 if (count < 2 || 505 if (count < 2 ||
508 (strncmp ((const char *) buf + count - 2, "^n", 2) && 506 (strncmp((const char *) buf + count - 2, "^n", 2) &&
509 strncmp ((const char *) buf + count - 2, "\0252n", 2))) { 507 strncmp((const char *) buf + count - 2, "\252n", 2))) {
510 sclp_tty->flip.char_buf_ptr[count] = '\n'; 508 /* add the auto \n */
511 count++; 509 tty_insert_flip_string(sclp_tty, buf, count);
510 tty_insert_flip_char(sclp_tty, '\n', TTY_NORMAL);
512 } else 511 } else
513 count -= 2; 512 tty_insert_flip_string(sclp_tty, buf, count - 2);
514 memset(sclp_tty->flip.flag_buf_ptr, TTY_NORMAL, count);
515 sclp_tty->flip.char_buf_ptr += count;
516 sclp_tty->flip.flag_buf_ptr += count;
517 sclp_tty->flip.count += count;
518 tty_flip_buffer_push(sclp_tty); 513 tty_flip_buffer_push(sclp_tty);
519 break; 514 break;
520 } 515 }