diff options
| author | Anton Altaparmakov <aia21@cantab.net> | 2006-01-19 11:39:33 -0500 |
|---|---|---|
| committer | Anton Altaparmakov <aia21@cantab.net> | 2006-01-19 11:39:33 -0500 |
| commit | 944d79559d154c12becde0dab327016cf438f46c (patch) | |
| tree | 50c101806f4d3b6585222dda060559eb4f3e005a /drivers/serial/m32r_sio.c | |
| parent | d087e4bdd24ebe3ae3d0b265b6573ec901af4b4b (diff) | |
| parent | 0f36b018b2e314d45af86449f1a97facb1fbe300 (diff) | |
Merge branch 'master' of /usr/src/ntfs-2.6/
Diffstat (limited to 'drivers/serial/m32r_sio.c')
| -rw-r--r-- | drivers/serial/m32r_sio.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c index b0ecc7537ce5..b48066a64a7d 100644 --- a/drivers/serial/m32r_sio.c +++ b/drivers/serial/m32r_sio.c | |||
| @@ -331,17 +331,12 @@ static _INLINE_ void receive_chars(struct uart_sio_port *up, int *status, | |||
| 331 | { | 331 | { |
| 332 | struct tty_struct *tty = up->port.info->tty; | 332 | struct tty_struct *tty = up->port.info->tty; |
| 333 | unsigned char ch; | 333 | unsigned char ch; |
| 334 | unsigned char flag; | ||
| 334 | int max_count = 256; | 335 | int max_count = 256; |
| 335 | 336 | ||
| 336 | do { | 337 | do { |
| 337 | if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) { | ||
| 338 | tty->flip.work.func((void *)tty); | ||
| 339 | if (tty->flip.count >= TTY_FLIPBUF_SIZE) | ||
| 340 | return; // if TTY_DONT_FLIP is set | ||
| 341 | } | ||
| 342 | ch = sio_in(up, SIORXB); | 338 | ch = sio_in(up, SIORXB); |
| 343 | *tty->flip.char_buf_ptr = ch; | 339 | flag = TTY_NORMAL; |
| 344 | *tty->flip.flag_buf_ptr = TTY_NORMAL; | ||
| 345 | up->port.icount.rx++; | 340 | up->port.icount.rx++; |
| 346 | 341 | ||
| 347 | if (unlikely(*status & (UART_LSR_BI | UART_LSR_PE | | 342 | if (unlikely(*status & (UART_LSR_BI | UART_LSR_PE | |
| @@ -380,30 +375,24 @@ static _INLINE_ void receive_chars(struct uart_sio_port *up, int *status, | |||
| 380 | 375 | ||
| 381 | if (*status & UART_LSR_BI) { | 376 | if (*status & UART_LSR_BI) { |
| 382 | DEBUG_INTR("handling break...."); | 377 | DEBUG_INTR("handling break...."); |
| 383 | *tty->flip.flag_buf_ptr = TTY_BREAK; | 378 | flag = TTY_BREAK; |
| 384 | } else if (*status & UART_LSR_PE) | 379 | } else if (*status & UART_LSR_PE) |
| 385 | *tty->flip.flag_buf_ptr = TTY_PARITY; | 380 | flag = TTY_PARITY; |
| 386 | else if (*status & UART_LSR_FE) | 381 | else if (*status & UART_LSR_FE) |
| 387 | *tty->flip.flag_buf_ptr = TTY_FRAME; | 382 | flag = TTY_FRAME; |
| 388 | } | 383 | } |
| 389 | if (uart_handle_sysrq_char(&up->port, ch, regs)) | 384 | if (uart_handle_sysrq_char(&up->port, ch, regs)) |
| 390 | goto ignore_char; | 385 | goto ignore_char; |
| 391 | if ((*status & up->port.ignore_status_mask) == 0) { | 386 | if ((*status & up->port.ignore_status_mask) == 0) |
| 392 | tty->flip.flag_buf_ptr++; | 387 | tty_insert_flip_char(tty, ch, flag); |
| 393 | tty->flip.char_buf_ptr++; | 388 | |
| 394 | tty->flip.count++; | 389 | if (*status & UART_LSR_OE) { |
| 395 | } | ||
| 396 | if ((*status & UART_LSR_OE) && | ||
| 397 | tty->flip.count < TTY_FLIPBUF_SIZE) { | ||
| 398 | /* | 390 | /* |
| 399 | * Overrun is special, since it's reported | 391 | * Overrun is special, since it's reported |
| 400 | * immediately, and doesn't affect the current | 392 | * immediately, and doesn't affect the current |
| 401 | * character. | 393 | * character. |
| 402 | */ | 394 | */ |
| 403 | *tty->flip.flag_buf_ptr = TTY_OVERRUN; | 395 | tty_insert_flip_char(tty, 0, TTY_OVERRUN); |
| 404 | tty->flip.flag_buf_ptr++; | ||
| 405 | tty->flip.char_buf_ptr++; | ||
| 406 | tty->flip.count++; | ||
| 407 | } | 396 | } |
| 408 | ignore_char: | 397 | ignore_char: |
| 409 | *status = serial_in(up, UART_LSR); | 398 | *status = serial_in(up, UART_LSR); |
