diff options
Diffstat (limited to 'drivers/char/mxser.c')
-rw-r--r-- | drivers/char/mxser.c | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 7a245068e3e5..f022f0944434 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c | |||
@@ -1995,9 +1995,6 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status) | |||
1995 | unsigned char ch, gdl; | 1995 | unsigned char ch, gdl; |
1996 | int ignored = 0; | 1996 | int ignored = 0; |
1997 | int cnt = 0; | 1997 | int cnt = 0; |
1998 | unsigned char *cp; | ||
1999 | char *fp; | ||
2000 | int count; | ||
2001 | int recv_room; | 1998 | int recv_room; |
2002 | int max = 256; | 1999 | int max = 256; |
2003 | unsigned long flags; | 2000 | unsigned long flags; |
@@ -2011,10 +2008,6 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status) | |||
2011 | //return; | 2008 | //return; |
2012 | } | 2009 | } |
2013 | 2010 | ||
2014 | cp = tty->flip.char_buf; | ||
2015 | fp = tty->flip.flag_buf; | ||
2016 | count = 0; | ||
2017 | |||
2018 | // following add by Victor Yu. 09-02-2002 | 2011 | // following add by Victor Yu. 09-02-2002 |
2019 | if (info->IsMoxaMustChipFlag != MOXA_OTHER_UART) { | 2012 | if (info->IsMoxaMustChipFlag != MOXA_OTHER_UART) { |
2020 | 2013 | ||
@@ -2041,12 +2034,10 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status) | |||
2041 | } | 2034 | } |
2042 | while (gdl--) { | 2035 | while (gdl--) { |
2043 | ch = inb(info->base + UART_RX); | 2036 | ch = inb(info->base + UART_RX); |
2044 | count++; | 2037 | tty_insert_flip_char(tty, ch, 0); |
2045 | *cp++ = ch; | ||
2046 | *fp++ = 0; | ||
2047 | cnt++; | 2038 | cnt++; |
2048 | /* | 2039 | /* |
2049 | if((count>=HI_WATER) && (info->stop_rx==0)){ | 2040 | if((cnt>=HI_WATER) && (info->stop_rx==0)){ |
2050 | mxser_stoprx(tty); | 2041 | mxser_stoprx(tty); |
2051 | info->stop_rx=1; | 2042 | info->stop_rx=1; |
2052 | break; | 2043 | break; |
@@ -2061,7 +2052,7 @@ intr_old: | |||
2061 | if (max-- < 0) | 2052 | if (max-- < 0) |
2062 | break; | 2053 | break; |
2063 | /* | 2054 | /* |
2064 | if((count>=HI_WATER) && (info->stop_rx==0)){ | 2055 | if((cnt>=HI_WATER) && (info->stop_rx==0)){ |
2065 | mxser_stoprx(tty); | 2056 | mxser_stoprx(tty); |
2066 | info->stop_rx=1; | 2057 | info->stop_rx=1; |
2067 | break; | 2058 | break; |
@@ -2078,36 +2069,33 @@ intr_old: | |||
2078 | if (++ignored > 100) | 2069 | if (++ignored > 100) |
2079 | break; | 2070 | break; |
2080 | } else { | 2071 | } else { |
2081 | count++; | 2072 | char flag = 0; |
2082 | if (*status & UART_LSR_SPECIAL) { | 2073 | if (*status & UART_LSR_SPECIAL) { |
2083 | if (*status & UART_LSR_BI) { | 2074 | if (*status & UART_LSR_BI) { |
2084 | *fp++ = TTY_BREAK; | 2075 | flag = TTY_BREAK; |
2085 | /* added by casper 1/11/2000 */ | 2076 | /* added by casper 1/11/2000 */ |
2086 | info->icount.brk++; | 2077 | info->icount.brk++; |
2087 | |||
2088 | /* */ | 2078 | /* */ |
2089 | if (info->flags & ASYNC_SAK) | 2079 | if (info->flags & ASYNC_SAK) |
2090 | do_SAK(tty); | 2080 | do_SAK(tty); |
2091 | } else if (*status & UART_LSR_PE) { | 2081 | } else if (*status & UART_LSR_PE) { |
2092 | *fp++ = TTY_PARITY; | 2082 | flag = TTY_PARITY; |
2093 | /* added by casper 1/11/2000 */ | 2083 | /* added by casper 1/11/2000 */ |
2094 | info->icount.parity++; | 2084 | info->icount.parity++; |
2095 | /* */ | 2085 | /* */ |
2096 | } else if (*status & UART_LSR_FE) { | 2086 | } else if (*status & UART_LSR_FE) { |
2097 | *fp++ = TTY_FRAME; | 2087 | flag = TTY_FRAME; |
2098 | /* added by casper 1/11/2000 */ | 2088 | /* added by casper 1/11/2000 */ |
2099 | info->icount.frame++; | 2089 | info->icount.frame++; |
2100 | /* */ | 2090 | /* */ |
2101 | } else if (*status & UART_LSR_OE) { | 2091 | } else if (*status & UART_LSR_OE) { |
2102 | *fp++ = TTY_OVERRUN; | 2092 | flag = TTY_OVERRUN; |
2103 | /* added by casper 1/11/2000 */ | 2093 | /* added by casper 1/11/2000 */ |
2104 | info->icount.overrun++; | 2094 | info->icount.overrun++; |
2105 | /* */ | 2095 | /* */ |
2106 | } else | 2096 | } |
2107 | *fp++ = 0; | 2097 | } |
2108 | } else | 2098 | tty_insert_flip_char(tty, ch, flag); |
2109 | *fp++ = 0; | ||
2110 | *cp++ = ch; | ||
2111 | cnt++; | 2099 | cnt++; |
2112 | if (cnt >= recv_room) { | 2100 | if (cnt >= recv_room) { |
2113 | if (!info->ldisc_stop_rx) { | 2101 | if (!info->ldisc_stop_rx) { |
@@ -2132,13 +2120,13 @@ intr_old: | |||
2132 | // above add by Victor Yu. 09-02-2002 | 2120 | // above add by Victor Yu. 09-02-2002 |
2133 | } while (*status & UART_LSR_DR); | 2121 | } while (*status & UART_LSR_DR); |
2134 | 2122 | ||
2135 | end_intr: // add by Victor Yu. 09-02-2002 | 2123 | end_intr: // add by Victor Yu. 09-02-2002 |
2136 | 2124 | ||
2137 | mxvar_log.rxcnt[info->port] += cnt; | 2125 | mxvar_log.rxcnt[info->port] += cnt; |
2138 | info->mon_data.rxcnt += cnt; | 2126 | info->mon_data.rxcnt += cnt; |
2139 | info->mon_data.up_rxcnt += cnt; | 2127 | info->mon_data.up_rxcnt += cnt; |
2140 | spin_unlock_irqrestore(&info->slock, flags); | 2128 | spin_unlock_irqrestore(&info->slock, flags); |
2141 | 2129 | ||
2142 | tty_flip_buffer_push(tty); | 2130 | tty_flip_buffer_push(tty); |
2143 | } | 2131 | } |
2144 | 2132 | ||