diff options
Diffstat (limited to 'drivers/char/serial167.c')
-rw-r--r-- | drivers/char/serial167.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index f4809c8183cc..461bfe0234c9 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c | |||
@@ -62,6 +62,7 @@ | |||
62 | #include <linux/console.h> | 62 | #include <linux/console.h> |
63 | #include <linux/module.h> | 63 | #include <linux/module.h> |
64 | #include <linux/bitops.h> | 64 | #include <linux/bitops.h> |
65 | #include <linux/tty_flip.h> | ||
65 | 66 | ||
66 | #include <asm/system.h> | 67 | #include <asm/system.h> |
67 | #include <asm/io.h> | 68 | #include <asm/io.h> |
@@ -370,7 +371,7 @@ cy_sched_event(struct cyclades_port *info, int event) | |||
370 | received, out buffer empty, modem change, etc. | 371 | received, out buffer empty, modem change, etc. |
371 | */ | 372 | */ |
372 | static irqreturn_t | 373 | static irqreturn_t |
373 | cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp) | 374 | cd2401_rxerr_interrupt(int irq, void *dev_id) |
374 | { | 375 | { |
375 | struct tty_struct *tty; | 376 | struct tty_struct *tty; |
376 | struct cyclades_port *info; | 377 | struct cyclades_port *info; |
@@ -427,8 +428,9 @@ cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp) | |||
427 | overflowing, we still loose | 428 | overflowing, we still loose |
428 | the next incoming character. | 429 | the next incoming character. |
429 | */ | 430 | */ |
430 | tty_insert_flip_char(tty, data, TTY_NORMAL); | 431 | if (tty_buffer_request_room(tty, 1) != 0){ |
431 | } | 432 | tty_insert_flip_char(tty, data, TTY_FRAME); |
433 | } | ||
432 | /* These two conditions may imply */ | 434 | /* These two conditions may imply */ |
433 | /* a normal read should be done. */ | 435 | /* a normal read should be done. */ |
434 | /* else if(data & CyTIMEOUT) */ | 436 | /* else if(data & CyTIMEOUT) */ |
@@ -437,21 +439,21 @@ cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp) | |||
437 | tty_insert_flip_char(tty, 0, TTY_NORMAL); | 439 | tty_insert_flip_char(tty, 0, TTY_NORMAL); |
438 | } | 440 | } |
439 | }else{ | 441 | }else{ |
440 | tty_insert_flip_char(tty, data, TTY_NORMAL); | 442 | tty_insert_flip_char(tty, data, TTY_NORMAL); |
441 | } | 443 | } |
442 | }else{ | 444 | }else{ |
443 | /* there was a software buffer overrun | 445 | /* there was a software buffer overrun |
444 | and nothing could be done about it!!! */ | 446 | and nothing could be done about it!!! */ |
445 | } | 447 | } |
446 | } | 448 | } |
447 | schedule_delayed_work(&tty->flip.work, 1); | 449 | tty_schedule_flip(tty); |
448 | /* end of service */ | 450 | /* end of service */ |
449 | base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS; | 451 | base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS; |
450 | return IRQ_HANDLED; | 452 | return IRQ_HANDLED; |
451 | } /* cy_rxerr_interrupt */ | 453 | } /* cy_rxerr_interrupt */ |
452 | 454 | ||
453 | static irqreturn_t | 455 | static irqreturn_t |
454 | cd2401_modem_interrupt(int irq, void *dev_id, struct pt_regs *fp) | 456 | cd2401_modem_interrupt(int irq, void *dev_id) |
455 | { | 457 | { |
456 | struct cyclades_port *info; | 458 | struct cyclades_port *info; |
457 | volatile unsigned char *base_addr = (unsigned char *)BASE_ADDR; | 459 | volatile unsigned char *base_addr = (unsigned char *)BASE_ADDR; |
@@ -506,7 +508,7 @@ cd2401_modem_interrupt(int irq, void *dev_id, struct pt_regs *fp) | |||
506 | } /* cy_modem_interrupt */ | 508 | } /* cy_modem_interrupt */ |
507 | 509 | ||
508 | static irqreturn_t | 510 | static irqreturn_t |
509 | cd2401_tx_interrupt(int irq, void *dev_id, struct pt_regs *fp) | 511 | cd2401_tx_interrupt(int irq, void *dev_id) |
510 | { | 512 | { |
511 | struct cyclades_port *info; | 513 | struct cyclades_port *info; |
512 | volatile unsigned char *base_addr = (unsigned char *)BASE_ADDR; | 514 | volatile unsigned char *base_addr = (unsigned char *)BASE_ADDR; |
@@ -626,7 +628,7 @@ cd2401_tx_interrupt(int irq, void *dev_id, struct pt_regs *fp) | |||
626 | } /* cy_tx_interrupt */ | 628 | } /* cy_tx_interrupt */ |
627 | 629 | ||
628 | static irqreturn_t | 630 | static irqreturn_t |
629 | cd2401_rx_interrupt(int irq, void *dev_id, struct pt_regs *fp) | 631 | cd2401_rx_interrupt(int irq, void *dev_id) |
630 | { | 632 | { |
631 | struct tty_struct *tty; | 633 | struct tty_struct *tty; |
632 | struct cyclades_port *info; | 634 | struct cyclades_port *info; |
@@ -635,6 +637,7 @@ cd2401_rx_interrupt(int irq, void *dev_id, struct pt_regs *fp) | |||
635 | char data; | 637 | char data; |
636 | int char_count; | 638 | int char_count; |
637 | int save_cnt; | 639 | int save_cnt; |
640 | int len; | ||
638 | 641 | ||
639 | /* determine the channel and change to that context */ | 642 | /* determine the channel and change to that context */ |
640 | channel = (u_short ) (base_addr[CyLICR] >> 2); | 643 | channel = (u_short ) (base_addr[CyLICR] >> 2); |
@@ -667,14 +670,15 @@ cd2401_rx_interrupt(int irq, void *dev_id, struct pt_regs *fp) | |||
667 | info->mon.char_max = char_count; | 670 | info->mon.char_max = char_count; |
668 | info->mon.char_last = char_count; | 671 | info->mon.char_last = char_count; |
669 | #endif | 672 | #endif |
670 | while(char_count--){ | 673 | len = tty_buffer_request_room(tty, char_count); |
674 | while(len--){ | ||
671 | data = base_addr[CyRDR]; | 675 | data = base_addr[CyRDR]; |
672 | tty_insert_flip_char(tty, data, TTY_NORMAL); | 676 | tty_insert_flip_char(tty, data, TTY_NORMAL); |
673 | #ifdef CYCLOM_16Y_HACK | 677 | #ifdef CYCLOM_16Y_HACK |
674 | udelay(10L); | 678 | udelay(10L); |
675 | #endif | 679 | #endif |
676 | } | 680 | } |
677 | schedule_delayed_work(&tty->flip.work, 1); | 681 | tty_schedule_flip(tty); |
678 | } | 682 | } |
679 | /* end of service */ | 683 | /* end of service */ |
680 | base_addr[CyREOIR] = save_cnt ? 0 : CyNOTRANS; | 684 | base_addr[CyREOIR] = save_cnt ? 0 : CyNOTRANS; |
@@ -1422,7 +1426,6 @@ cy_tiocmget(struct tty_struct *tty, struct file *file) | |||
1422 | volatile unsigned char *base_addr = (u_char *)BASE_ADDR; | 1426 | volatile unsigned char *base_addr = (u_char *)BASE_ADDR; |
1423 | unsigned long flags; | 1427 | unsigned long flags; |
1424 | unsigned char status; | 1428 | unsigned char status; |
1425 | unsigned int result; | ||
1426 | 1429 | ||
1427 | channel = info->line; | 1430 | channel = info->line; |
1428 | 1431 | ||
@@ -1446,7 +1449,6 @@ cy_tiocmset(struct tty_struct *tty, struct file *file, | |||
1446 | int channel; | 1449 | int channel; |
1447 | volatile unsigned char *base_addr = (u_char *)BASE_ADDR; | 1450 | volatile unsigned char *base_addr = (u_char *)BASE_ADDR; |
1448 | unsigned long flags; | 1451 | unsigned long flags; |
1449 | unsigned int arg; | ||
1450 | 1452 | ||
1451 | channel = info->line; | 1453 | channel = info->line; |
1452 | 1454 | ||