aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/sunsab.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/sunsab.c')
-rw-r--r--drivers/serial/sunsab.c38
1 files changed, 9 insertions, 29 deletions
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index ba9381fd3f2d..7e773ff76c61 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -159,21 +159,14 @@ receive_chars(struct uart_sunsab_port *up,
159 saw_console_brk = 1; 159 saw_console_brk = 1;
160 160
161 for (i = 0; i < count; i++) { 161 for (i = 0; i < count; i++) {
162 unsigned char ch = buf[i]; 162 unsigned char ch = buf[i], flag;
163 163
164 if (tty == NULL) { 164 if (tty == NULL) {
165 uart_handle_sysrq_char(&up->port, ch, regs); 165 uart_handle_sysrq_char(&up->port, ch, regs);
166 continue; 166 continue;
167 } 167 }
168 168
169 if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) { 169 flag = TTY_NORMAL;
170 tty->flip.work.func((void *)tty);
171 if (tty->flip.count >= TTY_FLIPBUF_SIZE)
172 return tty; // if TTY_DONT_FLIP is set
173 }
174
175 *tty->flip.char_buf_ptr = ch;
176 *tty->flip.flag_buf_ptr = TTY_NORMAL;
177 up->port.icount.rx++; 170 up->port.icount.rx++;
178 171
179 if (unlikely(stat->sreg.isr0 & (SAB82532_ISR0_PERR | 172 if (unlikely(stat->sreg.isr0 & (SAB82532_ISR0_PERR |
@@ -209,34 +202,21 @@ receive_chars(struct uart_sunsab_port *up,
209 stat->sreg.isr1 &= ((up->port.read_status_mask >> 8) & 0xff); 202 stat->sreg.isr1 &= ((up->port.read_status_mask >> 8) & 0xff);
210 203
211 if (stat->sreg.isr1 & SAB82532_ISR1_BRK) { 204 if (stat->sreg.isr1 & SAB82532_ISR1_BRK) {
212 *tty->flip.flag_buf_ptr = TTY_BREAK; 205 flag = TTY_BREAK;
213 } else if (stat->sreg.isr0 & SAB82532_ISR0_PERR) 206 } else if (stat->sreg.isr0 & SAB82532_ISR0_PERR)
214 *tty->flip.flag_buf_ptr = TTY_PARITY; 207 flag = TTY_PARITY;
215 else if (stat->sreg.isr0 & SAB82532_ISR0_FERR) 208 else if (stat->sreg.isr0 & SAB82532_ISR0_FERR)
216 *tty->flip.flag_buf_ptr = TTY_FRAME; 209 flag = TTY_FRAME;
217 } 210 }
218 211
219 if (uart_handle_sysrq_char(&up->port, ch, regs)) 212 if (uart_handle_sysrq_char(&up->port, ch, regs))
220 continue; 213 continue;
221 214
222 if ((stat->sreg.isr0 & (up->port.ignore_status_mask & 0xff)) == 0 && 215 if ((stat->sreg.isr0 & (up->port.ignore_status_mask & 0xff)) == 0 &&
223 (stat->sreg.isr1 & ((up->port.ignore_status_mask >> 8) & 0xff)) == 0){ 216 (stat->sreg.isr1 & ((up->port.ignore_status_mask >> 8) & 0xff)) == 0)
224 tty->flip.flag_buf_ptr++; 217 tty_insert_flip_char(tty, ch, flag);
225 tty->flip.char_buf_ptr++; 218 if (stat->sreg.isr0 & SAB82532_ISR0_RFO)
226 tty->flip.count++; 219 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
227 }
228 if ((stat->sreg.isr0 & SAB82532_ISR0_RFO) &&
229 tty->flip.count < TTY_FLIPBUF_SIZE) {
230 /*
231 * Overrun is special, since it's reported
232 * immediately, and doesn't affect the current
233 * character.
234 */
235 *tty->flip.flag_buf_ptr = TTY_OVERRUN;
236 tty->flip.flag_buf_ptr++;
237 tty->flip.char_buf_ptr++;
238 tty->flip.count++;
239 }
240 } 220 }
241 221
242 if (saw_console_brk) 222 if (saw_console_brk)