aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/sx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/sx.c')
-rw-r--r--drivers/char/sx.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index 564f31778eb3..64bf89cb574f 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -1085,6 +1085,7 @@ static inline void sx_receive_chars (struct sx_port *port)
1085 int rx_op; 1085 int rx_op;
1086 struct tty_struct *tty; 1086 struct tty_struct *tty;
1087 int copied=0; 1087 int copied=0;
1088 unsigned char *rp;
1088 1089
1089 func_enter2 (); 1090 func_enter2 ();
1090 tty = port->gs.tty; 1091 tty = port->gs.tty;
@@ -1095,8 +1096,8 @@ static inline void sx_receive_chars (struct sx_port *port)
1095 sx_dprintk (SX_DEBUG_RECEIVE, "rxop=%d, c = %d.\n", rx_op, c); 1096 sx_dprintk (SX_DEBUG_RECEIVE, "rxop=%d, c = %d.\n", rx_op, c);
1096 1097
1097 /* Don't copy more bytes than there is room for in the buffer */ 1098 /* Don't copy more bytes than there is room for in the buffer */
1098 if (tty->flip.count + c > TTY_FLIPBUF_SIZE) 1099
1099 c = TTY_FLIPBUF_SIZE - tty->flip.count; 1100 c = tty_prepare_flip_string(tty, &rp, c);
1100 1101
1101 sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); 1102 sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c);
1102 1103
@@ -1111,14 +1112,8 @@ static inline void sx_receive_chars (struct sx_port *port)
1111 sx_dprintk (SX_DEBUG_RECEIVE , "Copying over %d chars. First is %d at %lx\n", c, 1112 sx_dprintk (SX_DEBUG_RECEIVE , "Copying over %d chars. First is %d at %lx\n", c,
1112 read_sx_byte (port->board, CHAN_OFFSET(port,hi_rxbuf) + rx_op), 1113 read_sx_byte (port->board, CHAN_OFFSET(port,hi_rxbuf) + rx_op),
1113 CHAN_OFFSET(port, hi_rxbuf)); 1114 CHAN_OFFSET(port, hi_rxbuf));
1114 memcpy_fromio (tty->flip.char_buf_ptr, 1115 memcpy_fromio (rp,
1115 port->board->base + CHAN_OFFSET(port,hi_rxbuf) + rx_op, c); 1116 port->board->base + CHAN_OFFSET(port,hi_rxbuf) + rx_op, c);
1116 memset(tty->flip.flag_buf_ptr, TTY_NORMAL, c);
1117
1118 /* Update the kernel buffer end */
1119 tty->flip.count += c;
1120 tty->flip.char_buf_ptr += c;
1121 tty->flip.flag_buf_ptr += c;
1122 1117
1123 /* This one last. ( Not essential.) 1118 /* This one last. ( Not essential.)
1124 It allows the card to start putting more data into the buffer! 1119 It allows the card to start putting more data into the buffer!