diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2007-05-08 03:36:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:25 -0400 |
commit | ce71b0ffd01b0917a74c03562aaa110a71a0ee29 (patch) | |
tree | aa9748936fc5a83a499e1fb6abdf952f69d69193 /drivers/char | |
parent | 2c7fea992104b5ca2b510d585a27b3ba018b795f (diff) |
Char: cyclades, fix blockmove
tty has no longer flip buffers accessible externally. Fix it by moving the
code to the tty_*flip* helpers.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/cyclades.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index c236e9f7d8e7..91609539ad8a 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c | |||
@@ -1560,7 +1560,7 @@ cyz_handle_rx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl, | |||
1560 | int char_count; | 1560 | int char_count; |
1561 | int len; | 1561 | int len; |
1562 | #ifdef BLOCKMOVE | 1562 | #ifdef BLOCKMOVE |
1563 | int small_count; | 1563 | unsigned char *buf; |
1564 | #else | 1564 | #else |
1565 | char data; | 1565 | char data; |
1566 | #endif | 1566 | #endif |
@@ -1596,25 +1596,23 @@ cyz_handle_rx(struct cyclades_port *info, struct CH_CTRL __iomem *ch_ctrl, | |||
1596 | /* we'd like to use memcpy(t, f, n) and memset(s, c, count) | 1596 | /* we'd like to use memcpy(t, f, n) and memset(s, c, count) |
1597 | for performance, but because of buffer boundaries, there | 1597 | for performance, but because of buffer boundaries, there |
1598 | may be several steps to the operation */ | 1598 | may be several steps to the operation */ |
1599 | while (0 < (small_count = min_t(unsigned int, | 1599 | while (1) { |
1600 | rx_bufsize - new_rx_get, | 1600 | len = tty_prepare_flip_string(tty, &buf, |
1601 | min_t(unsigned int, TTY_FLIPBUF_SIZE - | 1601 | char_count); |
1602 | tty->flip.count, char_count)))){ | 1602 | if (!len) |
1603 | memcpy_fromio(tty->flip.char_buf_ptr, | 1603 | break; |
1604 | (char *)(cinfo->base_addr + rx_bufaddr + | ||
1605 | new_rx_get), | ||
1606 | small_count); | ||
1607 | 1604 | ||
1608 | tty->flip.char_buf_ptr += small_count; | 1605 | len = min_t(unsigned int, min(len, char_count), |
1609 | memset(tty->flip.flag_buf_ptr, TTY_NORMAL, | 1606 | rx_bufsize - new_rx_get); |
1610 | small_count); | 1607 | |
1611 | tty->flip.flag_buf_ptr += small_count; | 1608 | memcpy_fromio(buf, cinfo->base_addr + |
1612 | new_rx_get = (new_rx_get + small_count) & | 1609 | rx_bufaddr + new_rx_get, len); |
1610 | |||
1611 | new_rx_get = (new_rx_get + len) & | ||
1613 | (rx_bufsize - 1); | 1612 | (rx_bufsize - 1); |
1614 | char_count -= small_count; | 1613 | char_count -= len; |
1615 | info->icount.rx += small_count; | 1614 | info->icount.rx += len; |
1616 | info->idle_stats.recv_bytes += small_count; | 1615 | info->idle_stats.recv_bytes += len; |
1617 | tty->flip.count += small_count; | ||
1618 | } | 1616 | } |
1619 | #else | 1617 | #else |
1620 | len = tty_buffer_request_room(tty, char_count); | 1618 | len = tty_buffer_request_room(tty, char_count); |