diff options
author | Len Brown <len.brown@intel.com> | 2006-01-27 17:18:29 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-01-27 17:18:29 -0500 |
commit | 292dd876ee765c478b27c93cc51e93a558ed58bf (patch) | |
tree | 5b740e93253295baee2a9c414a6c66d03d44a9ef /drivers/s390/net/ctctty.c | |
parent | d4ec6c7cc9a15a7a529719bc3b84f46812f9842e (diff) | |
parent | 9fdb62af92c741addbea15545f214a6e89460865 (diff) | |
download | talos-op-linux-292dd876ee765c478b27c93cc51e93a558ed58bf.tar.gz talos-op-linux-292dd876ee765c478b27c93cc51e93a558ed58bf.zip |
Pull release into acpica branch
Diffstat (limited to 'drivers/s390/net/ctctty.c')
-rw-r--r-- | drivers/s390/net/ctctty.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c index 968f2c113efe..93d1725eb79b 100644 --- a/drivers/s390/net/ctctty.c +++ b/drivers/s390/net/ctctty.c @@ -25,6 +25,7 @@ #include <linux/config.h> #include <linux/module.h> #include <linux/tty.h> +#include <linux/tty_flip.h> #include <linux/serial_reg.h> #include <linux/interrupt.h> #include <linux/delay.h> @@ -101,25 +102,17 @@ static spinlock_t ctc_tty_lock; static int ctc_tty_try_read(ctc_tty_info * info, struct sk_buff *skb) { - int c; int len; struct tty_struct *tty; DBF_TEXT(trace, 5, __FUNCTION__); if ((tty = info->tty)) { if (info->mcr & UART_MCR_RTS) { - c = TTY_FLIPBUF_SIZE - tty->flip.count; len = skb->len; - if (c >= len) { - memcpy(tty->flip.char_buf_ptr, skb->data, len); - memset(tty->flip.flag_buf_ptr, 0, len); - tty->flip.count += len; - tty->flip.char_buf_ptr += len; - tty->flip.flag_buf_ptr += len; - tty_flip_buffer_push(tty); - kfree_skb(skb); - return 1; - } + tty_insert_flip_string(tty, skb->data, len); + tty_flip_buffer_push(tty); + kfree_skb(skb); + return 1; } } return 0; @@ -138,19 +131,12 @@ ctc_tty_readmodem(ctc_tty_info *info) DBF_TEXT(trace, 5, __FUNCTION__); if ((tty = info->tty)) { if (info->mcr & UART_MCR_RTS) { - int c = TTY_FLIPBUF_SIZE - tty->flip.count; struct sk_buff *skb; - if ((c > 0) && (skb = skb_dequeue(&info->rx_queue))) { + if ((skb = skb_dequeue(&info->rx_queue))) { int len = skb->len; - if (len > c) - len = c; - memcpy(tty->flip.char_buf_ptr, skb->data, len); + tty_insert_flip_string(tty, skb->data, len); skb_pull(skb, len); - memset(tty->flip.flag_buf_ptr, 0, len); - tty->flip.count += len; - tty->flip.char_buf_ptr += len; - tty->flip.flag_buf_ptr += len; tty_flip_buffer_push(tty); if (skb->len > 0) skb_queue_head(&info->rx_queue, skb); |