diff options
Diffstat (limited to 'drivers/s390/char/con3215.c')
-rw-r--r-- | drivers/s390/char/con3215.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 75419cf9d353..1f060914cfa4 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
17 | #include <linux/kdev_t.h> | 17 | #include <linux/kdev_t.h> |
18 | #include <linux/tty.h> | 18 | #include <linux/tty.h> |
19 | #include <linux/tty_flip.h> | ||
19 | #include <linux/vt_kern.h> | 20 | #include <linux/vt_kern.h> |
20 | #include <linux/init.h> | 21 | #include <linux/init.h> |
21 | #include <linux/console.h> | 22 | #include <linux/console.h> |
@@ -432,8 +433,6 @@ raw3215_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
432 | if (count > slen) | 433 | if (count > slen) |
433 | count = slen; | 434 | count = slen; |
434 | } else | 435 | } else |
435 | if (count >= TTY_FLIPBUF_SIZE - tty->flip.count) | ||
436 | count = TTY_FLIPBUF_SIZE - tty->flip.count - 1; | ||
437 | EBCASC(raw->inbuf, count); | 436 | EBCASC(raw->inbuf, count); |
438 | cchar = ctrlchar_handle(raw->inbuf, count, tty); | 437 | cchar = ctrlchar_handle(raw->inbuf, count, tty); |
439 | switch (cchar & CTRLCHAR_MASK) { | 438 | switch (cchar & CTRLCHAR_MASK) { |
@@ -441,28 +440,20 @@ raw3215_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
441 | break; | 440 | break; |
442 | 441 | ||
443 | case CTRLCHAR_CTRL: | 442 | case CTRLCHAR_CTRL: |
444 | tty->flip.count++; | 443 | tty_insert_flip_char(tty, cchar, TTY_NORMAL); |
445 | *tty->flip.flag_buf_ptr++ = TTY_NORMAL; | ||
446 | *tty->flip.char_buf_ptr++ = cchar; | ||
447 | tty_flip_buffer_push(raw->tty); | 444 | tty_flip_buffer_push(raw->tty); |
448 | break; | 445 | break; |
449 | 446 | ||
450 | case CTRLCHAR_NONE: | 447 | case CTRLCHAR_NONE: |
451 | memcpy(tty->flip.char_buf_ptr, | ||
452 | raw->inbuf, count); | ||
453 | if (count < 2 || | 448 | if (count < 2 || |
454 | (strncmp(raw->inbuf+count-2, "^n", 2) && | 449 | (strncmp(raw->inbuf+count-2, "\252n", 2) && |
455 | strncmp(raw->inbuf+count-2, "\252n", 2)) ) { | 450 | strncmp(raw->inbuf+count-2, "^n", 2)) ) { |
456 | /* don't add the auto \n */ | 451 | /* add the auto \n */ |
457 | tty->flip.char_buf_ptr[count] = '\n'; | 452 | raw->inbuf[count] = '\n'; |
458 | memset(tty->flip.flag_buf_ptr, | ||
459 | TTY_NORMAL, count + 1); | ||
460 | count++; | 453 | count++; |
461 | } else | 454 | } else |
462 | count-=2; | 455 | count -= 2; |
463 | tty->flip.char_buf_ptr += count; | 456 | tty_insert_flip_string(tty, raw->inbuf, count); |
464 | tty->flip.flag_buf_ptr += count; | ||
465 | tty->flip.count += count; | ||
466 | tty_flip_buffer_push(raw->tty); | 457 | tty_flip_buffer_push(raw->tty); |
467 | break; | 458 | break; |
468 | } | 459 | } |