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 f4809c8..461bfe0 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c @@ -62,6 +62,7 @@ #include <linux/console.h> #include <linux/module.h> #include <linux/bitops.h> +#include <linux/tty_flip.h> #include <asm/system.h> #include <asm/io.h> @@ -370,7 +371,7 @@ cy_sched_event(struct cyclades_port *info, int event) received, out buffer empty, modem change, etc. */ static irqreturn_t -cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp) +cd2401_rxerr_interrupt(int irq, void *dev_id) { struct tty_struct *tty; struct cyclades_port *info; @@ -427,8 +428,9 @@ cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp) overflowing, we still loose the next incoming character. */ - tty_insert_flip_char(tty, data, TTY_NORMAL); - } + if (tty_buffer_request_room(tty, 1) != 0){ + tty_insert_flip_char(tty, data, TTY_FRAME); + } /* These two conditions may imply */ /* a normal read should be done. */ /* else if(data & CyTIMEOUT) */ @@ -437,21 +439,21 @@ cd2401_rxerr_interrupt(int irq, void *dev_id, struct pt_regs *fp) tty_insert_flip_char(tty, 0, TTY_NORMAL); } }else{ - tty_insert_flip_char(tty, data, TTY_NORMAL); + tty_insert_flip_char(tty, data, TTY_NORMAL); } }else{ /* there was a software buffer overrun and nothing could be done about it!!! */ } } - schedule_delayed_work(&tty->flip.work, 1); + tty_schedule_flip(tty); /* end of service */ base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS; return IRQ_HANDLED; } /* cy_rxerr_interrupt */ static irqreturn_t -cd2401_modem_interrupt(int irq, void *dev_id, struct pt_regs *fp) +cd2401_modem_interrupt(int irq, void *dev_id) { struct cyclades_port *info; 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) } /* cy_modem_interrupt */ static irqreturn_t -cd2401_tx_interrupt(int irq, void *dev_id, struct pt_regs *fp) +cd2401_tx_interrupt(int irq, void *dev_id) { struct cyclades_port *info; 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) } /* cy_tx_interrupt */ static irqreturn_t -cd2401_rx_interrupt(int irq, void *dev_id, struct pt_regs *fp) +cd2401_rx_interrupt(int irq, void *dev_id) { struct tty_struct *tty; struct cyclades_port *info; @@ -635,6 +637,7 @@ cd2401_rx_interrupt(int irq, void *dev_id, struct pt_regs *fp) char data; int char_count; int save_cnt; + int len; /* determine the channel and change to that context */ channel = (u_short ) (base_addr[CyLICR] >> 2); @@ -667,14 +670,15 @@ cd2401_rx_interrupt(int irq, void *dev_id, struct pt_regs *fp) info->mon.char_max = char_count; info->mon.char_last = char_count; #endif - while(char_count--){ + len = tty_buffer_request_room(tty, char_count); + while(len--){ data = base_addr[CyRDR]; tty_insert_flip_char(tty, data, TTY_NORMAL); #ifdef CYCLOM_16Y_HACK udelay(10L); #endif } - schedule_delayed_work(&tty->flip.work, 1); + tty_schedule_flip(tty); } /* end of service */ base_addr[CyREOIR] = save_cnt ? 0 : CyNOTRANS; @@ -1422,7 +1426,6 @@ cy_tiocmget(struct tty_struct *tty, struct file *file) volatile unsigned char *base_addr = (u_char *)BASE_ADDR; unsigned long flags; unsigned char status; - unsigned int result; channel = info->line; @@ -1446,7 +1449,6 @@ cy_tiocmset(struct tty_struct *tty, struct file *file, int channel; volatile unsigned char *base_addr = (u_char *)BASE_ADDR; unsigned long flags; - unsigned int arg; channel = info->line; |