aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/synclink.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/synclink.c')
-rw-r--r--drivers/char/synclink.c43
1 files changed, 16 insertions, 27 deletions
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c
index 789572fc002b..9f1b466c4f84 100644
--- a/drivers/char/synclink.c
+++ b/drivers/char/synclink.c
@@ -1467,6 +1467,7 @@ static void mgsl_isr_receive_data( struct mgsl_struct *info )
1467{ 1467{
1468 int Fifocount; 1468 int Fifocount;
1469 u16 status; 1469 u16 status;
1470 int work = 0;
1470 unsigned char DataByte; 1471 unsigned char DataByte;
1471 struct tty_struct *tty = info->tty; 1472 struct tty_struct *tty = info->tty;
1472 struct mgsl_icount *icount = &info->icount; 1473 struct mgsl_icount *icount = &info->icount;
@@ -1487,6 +1488,8 @@ static void mgsl_isr_receive_data( struct mgsl_struct *info )
1487 /* flush the receive FIFO */ 1488 /* flush the receive FIFO */
1488 1489
1489 while( (Fifocount = (usc_InReg(info,RICR) >> 8)) ) { 1490 while( (Fifocount = (usc_InReg(info,RICR) >> 8)) ) {
1491 int flag;
1492
1490 /* read one byte from RxFIFO */ 1493 /* read one byte from RxFIFO */
1491 outw( (inw(info->io_base + CCAR) & 0x0780) | (RDR+LSBONLY), 1494 outw( (inw(info->io_base + CCAR) & 0x0780) | (RDR+LSBONLY),
1492 info->io_base + CCAR ); 1495 info->io_base + CCAR );
@@ -1498,13 +1501,9 @@ static void mgsl_isr_receive_data( struct mgsl_struct *info )
1498 RXSTATUS_OVERRUN + RXSTATUS_BREAK_RECEIVED) ) 1501 RXSTATUS_OVERRUN + RXSTATUS_BREAK_RECEIVED) )
1499 usc_UnlatchRxstatusBits(info,RXSTATUS_ALL); 1502 usc_UnlatchRxstatusBits(info,RXSTATUS_ALL);
1500 1503
1501 if (tty->flip.count >= TTY_FLIPBUF_SIZE)
1502 continue;
1503
1504 *tty->flip.char_buf_ptr = DataByte;
1505 icount->rx++; 1504 icount->rx++;
1506 1505
1507 *tty->flip.flag_buf_ptr = 0; 1506 flag = 0;
1508 if ( status & (RXSTATUS_FRAMING_ERROR + RXSTATUS_PARITY_ERROR + 1507 if ( status & (RXSTATUS_FRAMING_ERROR + RXSTATUS_PARITY_ERROR +
1509 RXSTATUS_OVERRUN + RXSTATUS_BREAK_RECEIVED) ) { 1508 RXSTATUS_OVERRUN + RXSTATUS_BREAK_RECEIVED) ) {
1510 printk("rxerr=%04X\n",status); 1509 printk("rxerr=%04X\n",status);
@@ -1530,41 +1529,31 @@ static void mgsl_isr_receive_data( struct mgsl_struct *info )
1530 status &= info->read_status_mask; 1529 status &= info->read_status_mask;
1531 1530
1532 if (status & RXSTATUS_BREAK_RECEIVED) { 1531 if (status & RXSTATUS_BREAK_RECEIVED) {
1533 *tty->flip.flag_buf_ptr = TTY_BREAK; 1532 flag = TTY_BREAK;
1534 if (info->flags & ASYNC_SAK) 1533 if (info->flags & ASYNC_SAK)
1535 do_SAK(tty); 1534 do_SAK(tty);
1536 } else if (status & RXSTATUS_PARITY_ERROR) 1535 } else if (status & RXSTATUS_PARITY_ERROR)
1537 *tty->flip.flag_buf_ptr = TTY_PARITY; 1536 flag = TTY_PARITY;
1538 else if (status & RXSTATUS_FRAMING_ERROR) 1537 else if (status & RXSTATUS_FRAMING_ERROR)
1539 *tty->flip.flag_buf_ptr = TTY_FRAME; 1538 flag = TTY_FRAME;
1540 if (status & RXSTATUS_OVERRUN) {
1541 /* Overrun is special, since it's
1542 * reported immediately, and doesn't
1543 * affect the current character
1544 */
1545 if (tty->flip.count < TTY_FLIPBUF_SIZE) {
1546 tty->flip.count++;
1547 tty->flip.flag_buf_ptr++;
1548 tty->flip.char_buf_ptr++;
1549 *tty->flip.flag_buf_ptr = TTY_OVERRUN;
1550 }
1551 }
1552 } /* end of if (error) */ 1539 } /* end of if (error) */
1553 1540 tty_insert_flip_char(tty, DataByte, flag);
1554 tty->flip.flag_buf_ptr++; 1541 if (status & RXSTATUS_OVERRUN) {
1555 tty->flip.char_buf_ptr++; 1542 /* Overrun is special, since it's
1556 tty->flip.count++; 1543 * reported immediately, and doesn't
1544 * affect the current character
1545 */
1546 work += tty_insert_flip_char(tty, 0, TTY_OVERRUN);
1547 }
1557 } 1548 }
1558 1549
1559 if ( debug_level >= DEBUG_LEVEL_ISR ) { 1550 if ( debug_level >= DEBUG_LEVEL_ISR ) {
1560 printk("%s(%d):mgsl_isr_receive_data flip count=%d\n",
1561 __FILE__,__LINE__,tty->flip.count);
1562 printk("%s(%d):rx=%d brk=%d parity=%d frame=%d overrun=%d\n", 1551 printk("%s(%d):rx=%d brk=%d parity=%d frame=%d overrun=%d\n",
1563 __FILE__,__LINE__,icount->rx,icount->brk, 1552 __FILE__,__LINE__,icount->rx,icount->brk,
1564 icount->parity,icount->frame,icount->overrun); 1553 icount->parity,icount->frame,icount->overrun);
1565 } 1554 }
1566 1555
1567 if ( tty->flip.count ) 1556 if(work)
1568 tty_flip_buffer_push(tty); 1557 tty_flip_buffer_push(tty);
1569} 1558}
1570 1559