X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fserial%2Fdz.c;h=97824eeeafae51bdeb93cda017b21e223b7c8c9e;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=293d17234bffd5b10ba9462b3781c2e5e607ca0f;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c index 293d17234..97824eeea 100644 --- a/drivers/serial/dz.c +++ b/drivers/serial/dz.c @@ -28,12 +28,13 @@ #include #include -#include #include #include #include -#include +#include +#include #include +#include #include #include @@ -186,7 +187,7 @@ static inline void dz_receive_chars(struct dz_port *dport) struct uart_icount *icount; int ignore = 0; unsigned short status, tmp; - unsigned char ch; + unsigned char ch, flag; /* this code is going to be a problem... the call to tty_flip_buffer is going to need @@ -201,6 +202,7 @@ static inline void dz_receive_chars(struct dz_port *dport) ch = UCHAR(status); /* grab the char */ + flag = TTY_NORMAL; #if 0 if (info->is_console) { @@ -217,8 +219,6 @@ static inline void dz_receive_chars(struct dz_port *dport) if (tty->flip.count >= TTY_FLIPBUF_SIZE) break; - *tty->flip.char_buf_ptr = ch; - *tty->flip.flag_buf_ptr = 0; icount->rx++; /* keep track of the statistics */ @@ -243,12 +243,12 @@ static inline void dz_receive_chars(struct dz_port *dport) tmp = status & dport->port.read_status_mask; if (tmp & DZ_PERR) { - *tty->flip.flag_buf_ptr = TTY_PARITY; + flag = TTY_PARITY; #ifdef DEBUG_DZ debug_console("PERR\n", 5); #endif } else if (tmp & DZ_FERR) { - *tty->flip.flag_buf_ptr = TTY_FRAME; + flag = TTY_FRAME; #ifdef DEBUG_DZ debug_console("FERR\n", 5); #endif @@ -257,17 +257,12 @@ static inline void dz_receive_chars(struct dz_port *dport) #ifdef DEBUG_DZ debug_console("OERR\n", 5); #endif - if (tty->flip.count < TTY_FLIPBUF_SIZE) { - tty->flip.count++; - tty->flip.flag_buf_ptr++; - tty->flip.char_buf_ptr++; - *tty->flip.flag_buf_ptr = TTY_OVERRUN; - } + tty_insert_flip_char(tty, ch, flag); + ch = 0; + flag = TTY_OVERRUN; } } - tty->flip.flag_buf_ptr++; - tty->flip.char_buf_ptr++; - tty->flip.count++; + tty_insert_flip_char(tty, ch, flag); ignore_char: } while (status & DZ_DVAL);