diff options
Diffstat (limited to 'drivers/char/synclink_gt.c')
-rw-r--r-- | drivers/char/synclink_gt.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index 41759cd70a4f..79c81def4104 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c | |||
@@ -1749,6 +1749,9 @@ static void rx_async(struct slgt_info *info) | |||
1749 | unsigned char status; | 1749 | unsigned char status; |
1750 | struct slgt_desc *bufs = info->rbufs; | 1750 | struct slgt_desc *bufs = info->rbufs; |
1751 | int i, count; | 1751 | int i, count; |
1752 | int chars = 0; | ||
1753 | int stat; | ||
1754 | unsigned char ch; | ||
1752 | 1755 | ||
1753 | start = end = info->rbuf_current; | 1756 | start = end = info->rbuf_current; |
1754 | 1757 | ||
@@ -1760,16 +1763,15 @@ static void rx_async(struct slgt_info *info) | |||
1760 | DBGDATA(info, p, count, "rx"); | 1763 | DBGDATA(info, p, count, "rx"); |
1761 | 1764 | ||
1762 | for(i=0 ; i < count; i+=2, p+=2) { | 1765 | for(i=0 ; i < count; i+=2, p+=2) { |
1763 | if (tty) { | 1766 | if (tty && chars) { |
1764 | if (tty->flip.count >= TTY_FLIPBUF_SIZE) | 1767 | tty_flip_buffer_push(tty); |
1765 | tty_flip_buffer_push(tty); | 1768 | chars = 0; |
1766 | if (tty->flip.count >= TTY_FLIPBUF_SIZE) | ||
1767 | break; | ||
1768 | *tty->flip.char_buf_ptr = *p; | ||
1769 | *tty->flip.flag_buf_ptr = 0; | ||
1770 | } | 1769 | } |
1770 | ch = *p; | ||
1771 | icount->rx++; | 1771 | icount->rx++; |
1772 | 1772 | ||
1773 | stat = 0; | ||
1774 | |||
1773 | if ((status = *(p+1) & (BIT9 + BIT8))) { | 1775 | if ((status = *(p+1) & (BIT9 + BIT8))) { |
1774 | if (status & BIT9) | 1776 | if (status & BIT9) |
1775 | icount->parity++; | 1777 | icount->parity++; |
@@ -1778,17 +1780,14 @@ static void rx_async(struct slgt_info *info) | |||
1778 | /* discard char if tty control flags say so */ | 1780 | /* discard char if tty control flags say so */ |
1779 | if (status & info->ignore_status_mask) | 1781 | if (status & info->ignore_status_mask) |
1780 | continue; | 1782 | continue; |
1781 | if (tty) { | 1783 | if (status & BIT9) |
1782 | if (status & BIT9) | 1784 | stat = TTY_PARITY; |
1783 | *tty->flip.flag_buf_ptr = TTY_PARITY; | 1785 | else if (status & BIT8) |
1784 | else if (status & BIT8) | 1786 | stat = TTY_FRAME; |
1785 | *tty->flip.flag_buf_ptr = TTY_FRAME; | ||
1786 | } | ||
1787 | } | 1787 | } |
1788 | if (tty) { | 1788 | if (tty) { |
1789 | tty->flip.flag_buf_ptr++; | 1789 | tty_insert_flip_char(tty, ch, stat); |
1790 | tty->flip.char_buf_ptr++; | 1790 | chars++; |
1791 | tty->flip.count++; | ||
1792 | } | 1791 | } |
1793 | } | 1792 | } |
1794 | 1793 | ||
@@ -1811,7 +1810,7 @@ static void rx_async(struct slgt_info *info) | |||
1811 | break; | 1810 | break; |
1812 | } | 1811 | } |
1813 | 1812 | ||
1814 | if (tty && tty->flip.count) | 1813 | if (tty && chars) |
1815 | tty_flip_buffer_push(tty); | 1814 | tty_flip_buffer_push(tty); |
1816 | } | 1815 | } |
1817 | 1816 | ||
@@ -2029,7 +2028,7 @@ static void isr_serial(struct slgt_info *info) | |||
2029 | if (info->tty) { | 2028 | if (info->tty) { |
2030 | if (!(status & info->ignore_status_mask)) { | 2029 | if (!(status & info->ignore_status_mask)) { |
2031 | if (info->read_status_mask & MASK_BREAK) { | 2030 | if (info->read_status_mask & MASK_BREAK) { |
2032 | *info->tty->flip.flag_buf_ptr = TTY_BREAK; | 2031 | tty_insert_flip_char(info->tty, 0, TTY_BREAK); |
2033 | if (info->flags & ASYNC_SAK) | 2032 | if (info->flags & ASYNC_SAK) |
2034 | do_SAK(info->tty); | 2033 | do_SAK(info->tty); |
2035 | } | 2034 | } |